mirror of
https://github.com/ReVanced/revanced-website.git
synced 2026-01-19 17:23:57 +00:00
feat: cooler info chips, minor refactoring
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
import { readable } from 'svelte/store';
|
||||
import type { Repository } from '$lib/types';
|
||||
import type { Repository } from 'src/data/types';
|
||||
|
||||
export type ContribData = { repositories: Repository[] };
|
||||
|
||||
const fetchContributors = async (): Promise<ContribData> => {
|
||||
const response = await fetch('https://releases.rvcd.win/contributors');
|
||||
const data = await response.json();
|
||||
return data;
|
||||
const data = await response.json();
|
||||
return data;
|
||||
};
|
||||
|
||||
export const ContributorsStore = readable(fetchContributors());
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { readable } from 'svelte/store';
|
||||
import type { Patch } from '$lib/types';
|
||||
import type { Patch } from 'src/data/types';
|
||||
|
||||
export type PatchesData = { patches: Patch[]; packages: string[] };
|
||||
|
||||
|
||||
34
src/data/types.ts
Normal file
34
src/data/types.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
export interface Contributor {
|
||||
login: string;
|
||||
avatar_url: string;
|
||||
html_url: string;
|
||||
}
|
||||
|
||||
export interface Repository {
|
||||
name: string;
|
||||
contributors: Contributor[];
|
||||
}
|
||||
|
||||
export interface Patch {
|
||||
name: string;
|
||||
description: string;
|
||||
version: string;
|
||||
excluded: boolean;
|
||||
deprecated: boolean;
|
||||
dependencies: string[];
|
||||
options: PatchOption[];
|
||||
compatiblePackages: CompatiblePackage[];
|
||||
}
|
||||
|
||||
export interface CompatiblePackage {
|
||||
name: string;
|
||||
versions: string[];
|
||||
}
|
||||
|
||||
export interface PatchOption {
|
||||
key: string;
|
||||
title: string;
|
||||
description: string;
|
||||
required: boolean;
|
||||
choices: string[];
|
||||
}
|
||||
Reference in New Issue
Block a user