This commit is contained in:
lisonge 2024-02-03 17:42:53 +08:00
parent f86d382b5f
commit be040667b2
3 changed files with 178 additions and 186 deletions

View File

@ -1,12 +1,169 @@
/**
*
*
*/
export type IArray<T> = T | T[];
export interface RawSubscription {
/**
* , id不一致则更新失败
*
* id 使, id
*
*/
id: number;
/**
*
*/
name: string;
/**
* ,
*
* version version
*/
version: number;
/**
*
*/
author?: string;
/**
* GKD , version version ,
*
* , 使
*/
updateUrl?: string;
/**
* uri , [],
*
* , uri
*/
supportUri?: string;
/**
* id version json , , , id version , updateUrl
*
*
*/
checkUpdateUrl?: string;
/**
*
*/
apps?: RawApp[];
/**
*
*/
globalGroups?: RawGlobalGroup[];
/**
*
*/
categories?: RawCategory[];
}
/**
*
*/
export interface RawApp {
/**
*
*/
id: string;
/**
* , 使
*/
name?: string;
/**
*
*/
groups: RawAppGroup[];
}
/**
*
*/
export interface RawGlobalGroup extends RawGroupProps, RawGlobalRuleProps {
rules: RawGlobalRule[];
}
/**
*
*/
export interface RawCategory {
/**
*
*
* /
*/
key: number;
/**
*
*
* , name ,
*
* : `开屏广告` `开屏广告-1` `开屏广告-2` `开屏广告-233`
*/
name: string;
/**
* null => enable
*
* true =>
*
* false =>
*/
enable?: boolean;
}
/**
*
*/
export interface RawAppRule extends RawRuleProps, RawAppRuleProps {}
/**
*
*/
export interface RawAppGroup extends RawGroupProps, RawAppRuleProps {
/**
* string => { matches: string }
*
* string[] => { matches: string }[]
*/
rules: IArray<RawAppRule | string>;
}
/**
*
*/
export interface RawGlobalRule extends RawRuleProps, RawGlobalRuleProps {}
/**
*
*/
export interface RawGlobalApp extends RawAppRuleProps {
/**
*
*/
id: string;
/**
* /
*
* @default true
*/
enable?: boolean;
}
/**
* ()()
*/
export type RawCommonProps = {
export interface RawCommonProps {
/**
* 单位: 毫秒
*
@ -146,12 +303,12 @@ export type RawCommonProps = {
* , , -- 广 gif
*/
exampleUrls?: IArray<string>;
};
}
/**
*
*/
export type RawRuleProps = RawCommonProps & {
export interface RawRuleProps extends RawCommonProps {
/**
*
*
@ -231,12 +388,12 @@ export type RawRuleProps = RawCommonProps & {
* GKD , ,
*/
excludeMatches?: IArray<string>;
};
}
/**
*
*/
export type RawGroupProps = RawCommonProps & {
export interface RawGroupProps extends RawCommonProps {
/**
*
*
@ -278,12 +435,12 @@ export type RawGroupProps = RawCommonProps & {
scopeKeys?: IArray<number>;
// rules: RawRuleProps[];
};
}
/**
* ()
*/
export type RawAppRuleProps = {
export interface RawAppRuleProps {
/**
* Id startWith activityIds ,
*
@ -297,35 +454,17 @@ export type RawAppRuleProps = {
* activityIds
*/
excludeActivityIds?: IArray<string>;
};
// <--全局规则相关--
/**
*
*/
export type RawGlobalApp = RawAppRuleProps & {
/**
*
*/
id: string;
/**
* /
*
* @default true
*/
enable?: boolean;
};
}
/**
*
*/
export type RawGlobalRuleProps = {
export interface RawGlobalRuleProps {
/**
* true =>
*
* false => apps
*
*
* @default true
*/
matchAnyApp?: boolean;
@ -334,14 +473,14 @@ export type RawGlobalRuleProps = {
* ,
*
* , GKD
*
*
* @default false
*/
matchLauncher?: boolean;
/**
* ,
*
*
* @default false
*/
matchSystemApp?: boolean;
@ -350,155 +489,9 @@ export type RawGlobalRuleProps = {
* ,
*/
apps?: RawGlobalApp[];
};
}
/**
*
*
*/
export type RawGlobalRule = RawRuleProps & RawGlobalRuleProps;
/**
*
*/
export type RawGlobalGroup = RawGroupProps &
RawGlobalRuleProps & {
rules: RawGlobalRule[];
};
// --全局规则相关-->
// <--APP规则相关--
/**
*
*/
export type RawCategory = {
/**
*
*
* /
*/
key: number;
/**
*
*
* , name ,
*
* : `开屏广告` `开屏广告-1` `开屏广告-2` `开屏广告-233`
*/
name: string;
/**
* null => enable
*
* true =>
*
* false =>
*/
enable?: boolean;
};
/**
*
*/
export type RawAppRule = RawRuleProps & RawAppRuleProps;
/**
*
*/
export type RawAppGroup = RawGroupProps &
RawAppRuleProps & {
/**
* string => { matches: string }
*
* string[] => { matches: string }[]
*/
rules: IArray<RawAppRule | string>;
};
/**
*
*/
export type RawApp = {
/**
*
*/
id: string;
/**
* , 使
*/
name?: string;
/**
*
*/
groups: RawAppGroup[];
};
// --APP规则相关-->
/**
*
*/
export type RawSubscription = {
/**
* , id不一致则更新失败\
* : `[0, Number.MAX_SAFE_INTEGER]`\
* : `new Date().getTime()`
*
* GKD默认订阅是 0, id 使, id
*
* 使, -2, -1
*/
id: number;
/**
*
*/
name: string;
/**
* ,
*
* version version
*/
version: number;
author?: string;
/**
* GKD , version version ,
*
* , 使
*/
updateUrl?: string;
/**
* uri , [],
*
* , uri
*/
supportUri?: string;
/**
* id version json , , , id version , updateUrl
*
*
*/
checkUpdateUrl?: string;
/**
*
*/
globalGroups?: RawGlobalGroup[];
/**
*
*/
categories?: RawCategory[];
/**
*
*/
apps?: RawApp[];
};
export type IArray<T> = T | T[];

View File

@ -13,4 +13,5 @@
"out": "../docs/api",
"docsRoot": "../docs",
"hideBreadcrumbs": true,
"sort": ["source-order"]
}

View File

@ -2,7 +2,8 @@ import { defineConfig } from 'vitepress';
import { mirror, transformHtml } from './plugins';
import typedocSidebar from '../api/typedoc-sidebar.json';
const logoUrl = 'https://registry.npmmirror.com/@gkd-kit/docs/0.0.1706371840771/files/.vitepress/dist/logo.svg'
const logoUrl =
'https://registry.npmmirror.com/@gkd-kit/docs/0.0.1706371840771/files/.vitepress/dist/logo.svg';
// https://vitepress.dev/reference/site-config
export default defineConfig({
@ -40,10 +41,7 @@ export default defineConfig({
text: 'API',
link: '/api/',
collapsed: true,
items: typedocSidebar.map((s) => ({
...s,
link: s.link.replace('/..\\docs\\api/', '/api/'),
})),
items: typedocSidebar,
},
],
outline: { label: '页面导航' },