@delta-comic/plugin 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/lib/config.d.ts +71 -0
  2. package/dist/lib/depends.d.ts +7 -0
  3. package/dist/lib/driver/booter.d.ts +4 -0
  4. package/dist/lib/driver/core.d.ts +67 -0
  5. package/dist/lib/driver/icon.d.ts +3 -0
  6. package/dist/lib/driver/index.d.ts +4 -0
  7. package/dist/lib/driver/init/booter/0_configSetter.d.ts +8 -0
  8. package/dist/lib/driver/init/booter/10_apiTest.d.ts +9 -0
  9. package/dist/lib/driver/init/booter/20_resourceTest.d.ts +8 -0
  10. package/dist/lib/driver/init/booter/30_boot.d.ts +8 -0
  11. package/dist/lib/driver/init/booter/40_auth.d.ts +8 -0
  12. package/dist/lib/driver/init/booter/50_otherProcess.d.ts +8 -0
  13. package/dist/lib/driver/init/booter/utils.d.ts +3 -0
  14. package/dist/lib/driver/init/installer/10_normalUrl.d.ts +12 -0
  15. package/dist/lib/driver/init/installer/20_local.d.ts +12 -0
  16. package/dist/lib/driver/init/installer/30_dev.d.ts +12 -0
  17. package/dist/lib/driver/init/installer/40_github.d.ts +12 -0
  18. package/dist/lib/driver/init/installer/9999_awesome.d.ts +12 -0
  19. package/dist/lib/driver/init/loader/1_userscript.d.ts +11 -0
  20. package/dist/lib/driver/init/loader/2_zip.d.ts +11 -0
  21. package/dist/lib/driver/init/utils.d.ts +29 -0
  22. package/dist/lib/driver/install.d.ts +14 -0
  23. package/dist/lib/driver/loader.d.ts +5 -0
  24. package/dist/lib/driver/store.d.ts +37 -0
  25. package/dist/lib/env/Inject.vue.d.ts +18 -0
  26. package/dist/lib/env/index.d.ts +12 -0
  27. package/dist/lib/global.d.ts +26 -0
  28. package/dist/lib/index.d.ts +6 -0
  29. package/dist/lib/plugin/api.d.ts +8 -0
  30. package/dist/lib/plugin/auth.d.ts +15 -0
  31. package/dist/lib/plugin/content.d.ts +8 -0
  32. package/dist/lib/plugin/index.d.ts +58 -0
  33. package/dist/lib/plugin/otherProgress.d.ts +4 -0
  34. package/dist/lib/plugin/resource.d.ts +5 -0
  35. package/dist/lib/plugin/search.d.ts +72 -0
  36. package/dist/lib/plugin/share.d.ts +26 -0
  37. package/dist/lib/plugin/subscribe.d.ts +13 -0
  38. package/dist/lib/plugin/user.d.ts +47 -0
  39. package/dist/pack.tgz +0 -0
  40. package/package.json +6 -6
@@ -0,0 +1,71 @@
1
+ import { FormType } from '@delta-comic/ui';
2
+ import { Ref } from 'vue';
3
+ export type ConfigDescription = Record<string, Required<Pick<FormType.SingleConfigure, 'defaultValue'>> & FormType.SingleConfigure>;
4
+ export declare class ConfigPointer<T extends ConfigDescription = ConfigDescription> {
5
+ pluginName: string;
6
+ config: T;
7
+ configName: string;
8
+ constructor(pluginName: string, config: T, configName: string);
9
+ readonly key: symbol;
10
+ }
11
+ export declare const appConfig: ConfigPointer<{
12
+ recordHistory: {
13
+ type: "switch";
14
+ defaultValue: true;
15
+ info: string;
16
+ };
17
+ showAIProject: {
18
+ type: "switch";
19
+ defaultValue: true;
20
+ info: string;
21
+ };
22
+ darkMode: {
23
+ type: "radio";
24
+ defaultValue: string;
25
+ info: string;
26
+ comp: "select";
27
+ selects: {
28
+ label: string;
29
+ value: string;
30
+ }[];
31
+ };
32
+ easilyTitle: {
33
+ type: "switch";
34
+ defaultValue: false;
35
+ info: string;
36
+ };
37
+ githubToken: {
38
+ type: "string";
39
+ defaultValue: string;
40
+ info: string;
41
+ placeholder: string;
42
+ };
43
+ }>;
44
+ export declare const useConfig: import('pinia').StoreDefinition<"config", Pick<{
45
+ isDark: import('vue').ComputedRef<boolean>;
46
+ form: import('vue').ShallowReactive<Map<symbol, {
47
+ form: ConfigDescription;
48
+ value: Ref<any>;
49
+ }>>;
50
+ $load: <T extends ConfigPointer>(pointer: T) => Ref<FormType.Result<T["config"]>>;
51
+ $isExistConfig: (pointer: ConfigPointer) => boolean;
52
+ $resignerConfig: (pointer: ConfigPointer) => void;
53
+ }, "form">, Pick<{
54
+ isDark: import('vue').ComputedRef<boolean>;
55
+ form: import('vue').ShallowReactive<Map<symbol, {
56
+ form: ConfigDescription;
57
+ value: Ref<any>;
58
+ }>>;
59
+ $load: <T extends ConfigPointer>(pointer: T) => Ref<FormType.Result<T["config"]>>;
60
+ $isExistConfig: (pointer: ConfigPointer) => boolean;
61
+ $resignerConfig: (pointer: ConfigPointer) => void;
62
+ }, "isDark">, Pick<{
63
+ isDark: import('vue').ComputedRef<boolean>;
64
+ form: import('vue').ShallowReactive<Map<symbol, {
65
+ form: ConfigDescription;
66
+ value: Ref<any>;
67
+ }>>;
68
+ $load: <T extends ConfigPointer>(pointer: T) => Ref<FormType.Result<T["config"]>>;
69
+ $isExistConfig: (pointer: ConfigPointer) => boolean;
70
+ $resignerConfig: (pointer: ConfigPointer) => void;
71
+ }, "$load" | "$isExistConfig" | "$resignerConfig">>;
@@ -0,0 +1,7 @@
1
+ interface DependDefineConstraint<_T> {
2
+ }
3
+ export type DependDefine<T> = symbol & DependDefineConstraint<T>;
4
+ export declare const declareDepType: <T>(name: string) => DependDefine<T>;
5
+ export declare const require: <T>(define: DependDefine<T>) => T;
6
+ export declare const pluginExposes: Map<symbol, any>;
7
+ export {};
@@ -0,0 +1,4 @@
1
+ import { PluginConfig } from '../plugin';
2
+ import { PluginBooter } from './init/utils';
3
+ export declare const booters: PluginBooter[];
4
+ export declare const bootPlugin: (cfg: PluginConfig) => Promise<void>;
@@ -0,0 +1,67 @@
1
+ import { uni } from '@delta-comic/model';
2
+ export declare const $initCore: () => Promise<{
3
+ name: string;
4
+ config: import('../config').ConfigPointer<{
5
+ recordHistory: {
6
+ type: "switch";
7
+ defaultValue: true;
8
+ info: string;
9
+ };
10
+ showAIProject: {
11
+ type: "switch";
12
+ defaultValue: true;
13
+ info: string;
14
+ };
15
+ darkMode: {
16
+ type: "radio";
17
+ defaultValue: string;
18
+ info: string;
19
+ comp: "select";
20
+ selects: {
21
+ label: string;
22
+ value: string;
23
+ }[];
24
+ };
25
+ easilyTitle: {
26
+ type: "switch";
27
+ defaultValue: false;
28
+ info: string;
29
+ };
30
+ githubToken: {
31
+ type: "string";
32
+ defaultValue: string;
33
+ info: string;
34
+ placeholder: string;
35
+ };
36
+ }>[];
37
+ share: {
38
+ initiative: {
39
+ filter: (page: uni.content.ContentPage) => boolean;
40
+ icon: import('vue').FunctionalComponent<{}, {}, any, {}>;
41
+ key: string;
42
+ name: string;
43
+ call(page: uni.content.ContentPage): Promise<void>;
44
+ }[];
45
+ tokenListen: {
46
+ key: string;
47
+ name: string;
48
+ patten(chipboard: string): boolean;
49
+ show(chipboard: string): {
50
+ title: string;
51
+ detail: string;
52
+ onNegative(): void;
53
+ onPositive(): {
54
+ fn: import('@delta-comic/core').SharedFunctions[keyof import('@delta-comic/core').SharedFunctions];
55
+ plugin: string;
56
+ result: PromiseLike<any>;
57
+ }[] & Promise<{
58
+ result: any;
59
+ fn: import('@delta-comic/core').SharedFunctions[keyof import('@delta-comic/core').SharedFunctions];
60
+ plugin: string;
61
+ }[]>;
62
+ };
63
+ }[];
64
+ };
65
+ }>;
66
+ export declare const coreName = "core";
67
+ export declare const core: import('../depends').DependDefine<any>;
@@ -0,0 +1,3 @@
1
+ import { FunctionalComponent } from 'vue';
2
+ export declare const OfflineShareRound: FunctionalComponent;
3
+ export declare const TagOutlined: FunctionalComponent;
@@ -0,0 +1,4 @@
1
+ export * from './store';
2
+ export * as Booter from './booter';
3
+ export * as Install from './install';
4
+ export * as Loader from './loader';
@@ -0,0 +1,8 @@
1
+ import { PluginConfig } from '../../../plugin';
2
+ import { PluginBooter, PluginBooterSetMeta } from '../utils';
3
+ declare class _ConfigSetter extends PluginBooter {
4
+ name: string;
5
+ call(cfg: PluginConfig, setMeta: PluginBooterSetMeta): Promise<any>;
6
+ }
7
+ declare const _default: _ConfigSetter;
8
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { PluginConfig } from '../../../plugin';
2
+ import { PluginBooter, PluginBooterSetMeta } from '../utils';
3
+ export type _TestPluginApiResult = Record<string, string | false | undefined>;
4
+ declare class _TestPluginApi extends PluginBooter {
5
+ name: string;
6
+ call(cfg: PluginConfig, setMeta: PluginBooterSetMeta, env: Record<any, any>): Promise<any>;
7
+ }
8
+ declare const _default: _TestPluginApi;
9
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import { PluginConfig } from '../../../plugin';
2
+ import { PluginBooter, PluginBooterSetMeta } from '../utils';
3
+ declare class _TestPluginResource extends PluginBooter {
4
+ name: string;
5
+ call(cfg: PluginConfig, setMeta: PluginBooterSetMeta): Promise<any>;
6
+ }
7
+ declare const _default: _TestPluginResource;
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import { PluginConfig } from '../../../plugin';
2
+ import { PluginBooter } from '../utils';
3
+ declare class _ExposeBootPlugin extends PluginBooter {
4
+ name: string;
5
+ call(cfg: PluginConfig, _: any, env: Record<any, any>): Promise<any>;
6
+ }
7
+ declare const _default: _ExposeBootPlugin;
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import { PluginConfig } from '../../../plugin';
2
+ import { PluginBooter, PluginBooterSetMeta } from '../utils';
3
+ declare class _PluginAuth extends PluginBooter {
4
+ name: string;
5
+ call(cfg: PluginConfig, setMeta: PluginBooterSetMeta): Promise<any>;
6
+ }
7
+ declare const _default: _PluginAuth;
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import { PluginConfig } from '../../../plugin';
2
+ import { PluginBooter, PluginBooterSetMeta } from '../utils';
3
+ declare class _TestPluginResource extends PluginBooter {
4
+ name: string;
5
+ call(cfg: PluginConfig, setMeta: PluginBooterSetMeta): Promise<any>;
6
+ }
7
+ declare const _default: _TestPluginResource;
8
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { PluginConfig } from '../../../plugin';
2
+ export declare const testApi: (cfg: NonNullable<PluginConfig["api"]>[string]) => Promise<[url: string, result: number | false]>;
3
+ export declare const testResourceApi: (cfg: NonNullable<NonNullable<PluginConfig["resource"]>["types"]>[number]) => Promise<[url: string, result: number | false]>;
@@ -0,0 +1,12 @@
1
+ import { PluginArchiveDB } from '@delta-comic/db';
2
+ import { PluginInstaller, PluginInstallerDescription } from '../utils';
3
+ export declare class _PluginInstallByFallbackUrl extends PluginInstaller {
4
+ description: PluginInstallerDescription;
5
+ name: string;
6
+ private installer;
7
+ download(input: string): Promise<File>;
8
+ update(pluginMeta: PluginArchiveDB.Archive): Promise<File>;
9
+ isMatched(input: string): boolean;
10
+ }
11
+ declare const _default: _PluginInstallByFallbackUrl;
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import { PluginArchiveDB } from '@delta-comic/db';
2
+ import { PluginInstaller, PluginInstallerDescription } from '../utils';
3
+ export declare class _PluginInstallByLocal extends PluginInstaller {
4
+ description: PluginInstallerDescription;
5
+ name: string;
6
+ private installer;
7
+ download(input: string): Promise<File>;
8
+ update(pluginMeta: PluginArchiveDB.Archive): Promise<File>;
9
+ isMatched(input: string): boolean;
10
+ }
11
+ declare const _default: _PluginInstallByLocal;
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import { PluginArchiveDB } from '@delta-comic/db';
2
+ import { PluginInstaller, PluginInstallerDescription } from '../utils';
3
+ export declare class _PluginInstallByDev extends PluginInstaller {
4
+ description: PluginInstallerDescription;
5
+ name: string;
6
+ private installer;
7
+ download(input: string): Promise<File>;
8
+ update(pluginMeta: PluginArchiveDB.Archive): Promise<File>;
9
+ isMatched(input: string): boolean;
10
+ }
11
+ declare const _default: _PluginInstallByDev;
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import { PluginArchiveDB } from '@delta-comic/db';
2
+ import { PluginInstaller, PluginInstallerDescription } from '../utils';
3
+ export declare class _PluginInstallByNormalUrl extends PluginInstaller {
4
+ description: PluginInstallerDescription;
5
+ name: string;
6
+ private installer;
7
+ download(input: string): Promise<File>;
8
+ update(pluginMeta: PluginArchiveDB.Archive): Promise<File>;
9
+ isMatched(input: string): boolean;
10
+ }
11
+ declare const _default: _PluginInstallByNormalUrl;
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import { PluginArchiveDB } from '@delta-comic/db';
2
+ import { PluginInstaller, PluginInstallerDescription } from '../utils';
3
+ export declare class _PluginInstallByAwesome extends PluginInstaller {
4
+ description: PluginInstallerDescription;
5
+ name: string;
6
+ private installer;
7
+ download(input: string): Promise<File | string>;
8
+ update(pluginMeta: PluginArchiveDB.Archive): Promise<File | string>;
9
+ isMatched(input: string): boolean;
10
+ }
11
+ declare const _default: _PluginInstallByAwesome;
12
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { PluginArchiveDB } from '@delta-comic/db';
2
+ import { PluginLoader } from '../utils';
3
+ declare class _PluginUserscriptLoader extends PluginLoader {
4
+ name: string;
5
+ install(file: File): Promise<PluginArchiveDB.Meta>;
6
+ canInstall(file: File): boolean;
7
+ load(pluginMeta: PluginArchiveDB.Archive): Promise<any>;
8
+ decodeMeta(file: File): Promise<PluginArchiveDB.Meta>;
9
+ }
10
+ declare const _default: _PluginUserscriptLoader;
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { PluginArchiveDB } from '@delta-comic/db';
2
+ import { PluginLoader } from '../utils';
3
+ declare class _PluginUserscriptLoader extends PluginLoader {
4
+ name: string;
5
+ install(file: File): Promise<PluginArchiveDB.Meta>;
6
+ canInstall(file: File): boolean;
7
+ load(pluginMeta: PluginArchiveDB.Archive): Promise<any>;
8
+ decodeMeta(file: File): Promise<PluginArchiveDB.Meta>;
9
+ }
10
+ declare const _default: _PluginUserscriptLoader;
11
+ export default _default;
@@ -0,0 +1,29 @@
1
+ import { PluginArchiveDB } from '@delta-comic/db';
2
+ import { PluginConfig } from '../../plugin';
3
+ export declare const getPluginFsPath: (pluginName: string) => Promise<string>;
4
+ export interface PluginInstallerDescription {
5
+ title: string;
6
+ description: string;
7
+ }
8
+ export declare abstract class PluginInstaller {
9
+ abstract download(input: string): Promise<File | string>;
10
+ abstract update(pluginMeta: PluginArchiveDB.Archive): Promise<File | string>;
11
+ abstract isMatched(input: string): boolean;
12
+ abstract name: string;
13
+ abstract description: PluginInstallerDescription;
14
+ }
15
+ export declare abstract class PluginLoader {
16
+ abstract name: string;
17
+ abstract load(pluginMeta: PluginArchiveDB.Archive): Promise<any>;
18
+ abstract install(file: File): Promise<PluginArchiveDB.Meta>;
19
+ abstract decodeMeta(file: File): Promise<PluginArchiveDB.Meta>;
20
+ abstract canInstall(file: File): boolean;
21
+ }
22
+ export type PluginBooterSetMeta = (meta: Partial<{
23
+ description: string;
24
+ name: string;
25
+ }> | string) => void;
26
+ export declare abstract class PluginBooter {
27
+ abstract name: string;
28
+ abstract call(cfg: PluginConfig, setMeta: PluginBooterSetMeta, env: Record<any, any>): Promise<any>;
29
+ }
@@ -0,0 +1,14 @@
1
+ import { PluginArchiveDB } from '@delta-comic/db';
2
+ import { DownloadMessageBind } from '@delta-comic/ui';
3
+ import { PluginInstaller } from './init/utils';
4
+ export declare const installers: PluginInstaller[];
5
+ export interface SourceOverrideConfig {
6
+ id: string;
7
+ install: string;
8
+ enabled: boolean;
9
+ }
10
+ export declare const usePluginConfig: () => import('@vueuse/core').RemovableRef<SourceOverrideConfig[]>;
11
+ export declare const installDepends: (m: DownloadMessageBind, meta: PluginArchiveDB.Meta, installedPlugins?: Set<string>) => Promise<void>;
12
+ export declare const installPlugin: (input: string, __installedPlugins?: Set<string>) => Promise<void>;
13
+ export declare const installFilePlugin: (file: File, __installedPlugins?: Set<string>) => Promise<void>;
14
+ export declare const updatePlugin: (pluginMeta: PluginArchiveDB.Archive, __installedPlugins?: Set<string>) => Promise<void>;
@@ -0,0 +1,5 @@
1
+ import { PluginArchiveDB } from '@delta-comic/db';
2
+ import { PluginLoader } from './init/utils';
3
+ export declare const loaders: PluginLoader[];
4
+ export declare const loadPlugin: (meta: PluginArchiveDB.Archive) => Promise<void>;
5
+ export declare const loadAllPlugins: () => Promise<void>;
@@ -0,0 +1,37 @@
1
+ import { Raw } from 'vue';
2
+ import { PluginConfig, Search } from '../plugin';
3
+ export interface SavePluginBlob {
4
+ key: string;
5
+ blob: Blob;
6
+ }
7
+ export interface PluginData {
8
+ key: string;
9
+ value: any;
10
+ }
11
+ export type PluginLoadingMicroSteps = {
12
+ steps: {
13
+ name: string;
14
+ description: string;
15
+ }[];
16
+ now: {
17
+ stepsIndex: number;
18
+ status: 'process' | 'error' | 'finish' | 'wait';
19
+ error?: Error;
20
+ };
21
+ };
22
+ export declare const usePluginStore: import('pinia').StoreDefinition<"plugin", Pick<{
23
+ $getPluginDisplayName: (key: string) => string;
24
+ plugins: import('vue').ShallowReactive<Map<string, Raw<PluginConfig>>>;
25
+ allSearchSource: import('vue').ComputedRef<[plugin: string, sources: [name: string, method: Search.SearchMethod][]][]>;
26
+ pluginSteps: Record<string, PluginLoadingMicroSteps>;
27
+ }, "plugins" | "pluginSteps">, Pick<{
28
+ $getPluginDisplayName: (key: string) => string;
29
+ plugins: import('vue').ShallowReactive<Map<string, Raw<PluginConfig>>>;
30
+ allSearchSource: import('vue').ComputedRef<[plugin: string, sources: [name: string, method: Search.SearchMethod][]][]>;
31
+ pluginSteps: Record<string, PluginLoadingMicroSteps>;
32
+ }, "allSearchSource">, Pick<{
33
+ $getPluginDisplayName: (key: string) => string;
34
+ plugins: import('vue').ShallowReactive<Map<string, Raw<PluginConfig>>>;
35
+ allSearchSource: import('vue').ComputedRef<[plugin: string, sources: [name: string, method: Search.SearchMethod][]][]>;
36
+ pluginSteps: Record<string, PluginLoadingMicroSteps>;
37
+ }, "$getPluginDisplayName">>;
@@ -0,0 +1,18 @@
1
+ import { ComponentProps } from 'vue-component-type-helpers';
2
+ import { GlobalInjections } from '.';
3
+ declare const _default: <T extends keyof GlobalInjections>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & {
5
+ key: T;
6
+ args: ComponentProps<GlobalInjections[T]>;
7
+ } & Partial<{}>> & import('vue').PublicProps;
8
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
9
+ attrs: any;
10
+ slots: {};
11
+ emit: {};
12
+ }>) => import('vue').VNode & {
13
+ __ctx?: Awaited<typeof __VLS_setup>;
14
+ };
15
+ export default _default;
16
+ type __VLS_PrettifyLocal<T> = {
17
+ [K in keyof T]: T[K];
18
+ } & {};
@@ -0,0 +1,12 @@
1
+ import { Component, Raw } from 'vue';
2
+ import { default as Inject } from './Inject.vue';
3
+ import { ComponentProps } from 'vue-component-type-helpers';
4
+ export { Inject };
5
+ export type GlobalInjectionsConfig<T extends keyof GlobalInjections = keyof GlobalInjections> = {
6
+ key: T;
7
+ component: Raw<GlobalInjections[T]>;
8
+ condition: (args: ComponentProps<GlobalInjections[T]>) => boolean | Promise<boolean>;
9
+ };
10
+ export interface GlobalInjections extends Record<string, Component> {
11
+ }
12
+ export declare const addInjection: <T extends keyof GlobalInjections, TCfg extends GlobalInjectionsConfig<T> = GlobalInjectionsConfig<T>>(key: TCfg["key"], value: TCfg["component"], condition?: TCfg["condition"]) => void;
@@ -0,0 +1,26 @@
1
+ import { SourcedKeyMap } from '@delta-comic/model';
2
+ import { Component, Raw } from 'vue';
3
+ import { Search, Share, Subscribe, User } from './plugin';
4
+ import { GlobalInjectionsConfig } from './env';
5
+ declare class _Global {
6
+ share: import('vue').ShallowReactive<import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, key: string], Share.InitiativeItem>>>;
7
+ shareToken: import('vue').ShallowReactive<import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, key: string], Share.ShareToken>>>;
8
+ userActions: import('vue').ShallowReactive<import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, key: string], User.UserAction>>>;
9
+ subscribes: import('vue').ShallowReactive<import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, key: string], Subscribe.Config>>>;
10
+ globalNodes: import('vue').ShallowReactive<Raw<Component>[]>;
11
+ tabbar: import('vue').ShallowReactive<Map<string, Search.Tabbar[]>>;
12
+ addTabbar(plugin: string, ...tabbar: Search.Tabbar[]): void;
13
+ categories: import('vue').ShallowReactive<Map<string, Search.Category[]>>;
14
+ addCategories(plugin: string, ...categories: Search.Category[]): void;
15
+ barcode: import('vue').ShallowReactive<Map<string, Search.Barcode[]>>;
16
+ addBarcode(plugin: string, ...barcode: Search.Barcode[]): void;
17
+ levelboard: import('vue').ShallowReactive<Map<string, Search.HotLevelboard[]>>;
18
+ addLevelboard(plugin: string, ...levelboard: Search.HotLevelboard[]): void;
19
+ topButton: import('vue').ShallowReactive<Map<string, Search.HotTopButton[]>>;
20
+ addTopButton(plugin: string, ...topButton: Search.HotTopButton[]): void;
21
+ mainLists: import('vue').ShallowReactive<Map<string, Search.HotMainList[]>>;
22
+ addMainList(plugin: string, ...mainLists: Search.HotMainList[]): void;
23
+ envExtends: import('vue').ShallowReactive<Set<GlobalInjectionsConfig>>;
24
+ }
25
+ export declare const Global: _Global;
26
+ export {};
@@ -0,0 +1,6 @@
1
+ export * from './plugin';
2
+ export * from './config';
3
+ export * from './depends';
4
+ export * from './global';
5
+ export * from './driver';
6
+ export * from './env';
@@ -0,0 +1,8 @@
1
+ export interface Config {
2
+ forks: () => PromiseLike<string[]> | string[];
3
+ /**
4
+ * error -> 不可用
5
+ * other -> 可用并比对时间
6
+ */
7
+ test: (fork: string, signal: AbortSignal) => PromiseLike<void>;
8
+ }
@@ -0,0 +1,15 @@
1
+ import { FormType } from '@delta-comic/ui';
2
+ export interface Config {
3
+ signUp: (by: Method) => PromiseLike<any>;
4
+ logIn: (by: Method) => PromiseLike<any>;
5
+ passSelect: () => PromiseLike<'signUp' | 'logIn' | false>;
6
+ }
7
+ export type Method = {
8
+ form<T extends FormType.Configure>(form: T): Promise<{
9
+ [x in keyof T]: FormType.SingleResult<T[x]>;
10
+ }>;
11
+ /**
12
+ * sandbox: "allow-forms allow-modals allow-orientation-lock allow-popups-to-escape-sandbox allow-pointer-lock"
13
+ */
14
+ website(url: string): Window;
15
+ };
@@ -0,0 +1,8 @@
1
+ import { uni } from '@delta-comic/model';
2
+ export type Config = Record<string, {
3
+ itemCard?: uni.item.ItemCardComponent;
4
+ commentRow?: uni.comment.CommentRow;
5
+ layout?: uni.content.LayoutComponent;
6
+ contentPage?: uni.content.ContentPageLike;
7
+ itemTranslator?: uni.item.ItemTranslator;
8
+ }>;
@@ -0,0 +1,58 @@
1
+ import { ConfigPointer } from '../config';
2
+ import { PluginArchiveDB } from '@delta-comic/db';
3
+ import type * as Share from './share';
4
+ export type * as Share from './share';
5
+ import type * as Content from './content';
6
+ export type * as Content from './content';
7
+ import type * as Subscribe from './subscribe';
8
+ export type * as Subscribe from './subscribe';
9
+ import type * as User from './user';
10
+ export type * as User from './user';
11
+ import type * as Api from './api';
12
+ export type * as Api from './api';
13
+ import type * as OtherProgress from './otherProgress';
14
+ export type * as OtherProgress from './otherProgress';
15
+ import type * as Search from './search';
16
+ export type * as Search from './search';
17
+ import type * as Auth from './auth';
18
+ export type * as Auth from './auth';
19
+ import type * as Resource from './resource';
20
+ export type * as Resource from './resource';
21
+ export declare const pluginEmitter: import('mitt').Emitter<{
22
+ definedPlugin: PluginConfig;
23
+ }>;
24
+ export interface PluginConfig {
25
+ name: string;
26
+ content?: Content.Config;
27
+ resource?: Resource.Content;
28
+ api?: Record<string, Api.Config>;
29
+ user?: User.Config;
30
+ auth?: Auth.Config;
31
+ otherProgress?: OtherProgress.Config[];
32
+ /**
33
+ * 返回值如果不为空,则会await后作为expose暴露
34
+ */
35
+ onBooted?(ins: DefineResult): (PromiseLike<object> | object) | void;
36
+ search?: Search.Config;
37
+ /**
38
+ * 插件的配置项需在此处注册
39
+ * 传入`Store.ConfigPointer`
40
+ */
41
+ config?: ConfigPointer[];
42
+ subscribe?: Record<string, Subscribe.Config>;
43
+ share?: Share.Config;
44
+ }
45
+ export type DefineResult = {
46
+ api?: Record<string, string | undefined | false>;
47
+ };
48
+ export declare const definePlugin: <T extends PluginConfig>(config: T | ((safe: boolean) => T)) => Promise<T>;
49
+ export type PluginExpose<T extends () => Promise<PluginConfig>> = Awaited<ReturnType<NonNullable<Awaited<ReturnType<T>>['onBooted']>>>;
50
+ export interface RawPluginMeta {
51
+ 'name:display': string;
52
+ 'name:id': string;
53
+ 'version': string;
54
+ 'author': string | undefined;
55
+ 'description': string;
56
+ 'require'?: string[] | string;
57
+ }
58
+ export declare const decodePluginMeta: (v: RawPluginMeta) => PluginArchiveDB.Meta;
@@ -0,0 +1,4 @@
1
+ export interface Config {
2
+ call: (setDescription: (description: string) => void) => PromiseLike<any>;
3
+ name: string;
4
+ }
@@ -0,0 +1,5 @@
1
+ import { uni } from '@delta-comic/model';
2
+ export interface Content {
3
+ process?: Record<string, uni.resource.ProcessInstance>;
4
+ types?: uni.resource.ResourceType[];
5
+ }
@@ -0,0 +1,72 @@
1
+ import { StreamQuery, uni } from '@delta-comic/model';
2
+ import { UseQueryReturn } from '@pinia/colada';
3
+ import { Component } from 'vue';
4
+ export interface Config {
5
+ /**
6
+ * @description
7
+ * key: id
8
+ */
9
+ methods?: Record<string, SearchMethod>;
10
+ tabbar?: Tabbar[];
11
+ categories?: Category[];
12
+ hotPage?: {
13
+ levelBoard?: HotLevelboard[];
14
+ topButton?: HotTopButton[];
15
+ mainListCard?: HotMainList[];
16
+ };
17
+ barcode?: Barcode[];
18
+ }
19
+ export interface SearchMethod {
20
+ name: string;
21
+ sorts: {
22
+ text: string;
23
+ value: string;
24
+ }[];
25
+ defaultSort: string;
26
+ fetchSearchResult: StreamQuery<[input: string, sort: string], uni.item.Item>;
27
+ getAutoComplete(input: string, signal: AbortSignal): PromiseLike<({
28
+ text: string;
29
+ value: string;
30
+ } | Component)[]>;
31
+ }
32
+ export interface HotLevelboard {
33
+ name: string;
34
+ content: () => UseQueryReturn<uni.item.Item[]>;
35
+ }
36
+ export interface HotMainList {
37
+ name: string;
38
+ content: () => UseQueryReturn<uni.item.Item[]>;
39
+ onClick?(): any;
40
+ }
41
+ export interface HotTopButton {
42
+ name: string;
43
+ icon: Component;
44
+ bgColor: string;
45
+ onClick?(): any;
46
+ }
47
+ export interface Category {
48
+ title: string;
49
+ namespace: string;
50
+ search: {
51
+ methodId: string;
52
+ input: string;
53
+ sort: string;
54
+ };
55
+ }
56
+ export interface Tabbar {
57
+ title: string;
58
+ id: string;
59
+ comp: Component<{
60
+ isActive: boolean;
61
+ tabbar: Tabbar;
62
+ }>;
63
+ }
64
+ export type RouteToContent = (contentType_: uni.content.ContentType_, id: string, ep: string, preload?: uni.item.Item) => PromiseLike<any>;
65
+ export interface Barcode {
66
+ match: (searchText: string) => boolean;
67
+ /**
68
+ * 选中后返回路由信息
69
+ */
70
+ getContent: (searchText: string, signal: AbortSignal) => PromiseLike<Parameters<RouteToContent>>;
71
+ name: string;
72
+ }
@@ -0,0 +1,26 @@
1
+ import { uni } from '@delta-comic/model';
2
+ import { Component } from 'vue';
3
+ export interface Config {
4
+ initiative: InitiativeItem[];
5
+ tokenListen: ShareToken[];
6
+ }
7
+ export interface ShareToken {
8
+ key: string;
9
+ name: string;
10
+ patten(chipboard: string): boolean;
11
+ show(chipboard: string): Promise<PopupConfig> | PopupConfig;
12
+ }
13
+ export interface PopupConfig {
14
+ title: string;
15
+ detail: string;
16
+ onPositive(): void;
17
+ onNegative(): void;
18
+ }
19
+ export interface InitiativeItem {
20
+ key: string;
21
+ name: string;
22
+ icon: Component | uni.image.Image;
23
+ bgColor?: string;
24
+ call(page: uni.content.ContentPage): Promise<any>;
25
+ filter(page: uni.content.ContentPage): boolean;
26
+ }
@@ -0,0 +1,13 @@
1
+ import { StreamQuery, uni } from '@delta-comic/model';
2
+ export interface Config {
3
+ getUpdateList(olds: {
4
+ author: uni.item.Author;
5
+ list: uni.item.Item[];
6
+ }[], signal?: AbortSignal): PromiseLike<{
7
+ isUpdated: boolean;
8
+ whichUpdated: uni.item.Author[];
9
+ }>;
10
+ onAdd?(author: uni.item.Author): any;
11
+ onRemove?(author: uni.item.Author): any;
12
+ fetchAuthorContent: StreamQuery<[author: uni.item.Author], uni.item.Item>;
13
+ }
@@ -0,0 +1,47 @@
1
+ import { uni } from '@delta-comic/model';
2
+ import { Component, MaybeRefOrGetter } from 'vue';
3
+ export interface Config {
4
+ edit?: Component;
5
+ card?: uni.user.UserCardComponent;
6
+ authorIcon?: Record<string, Component>;
7
+ /**
8
+ * 1. download
9
+ * 2. upload (收藏那些云端未收藏的漫画)
10
+ */
11
+ syncFavourite?: {
12
+ download: () => PromiseLike<uni.item.Item[]>;
13
+ upload: (items: uni.item.RawItem[]) => PromiseLike<any>;
14
+ };
15
+ /**
16
+ * 你希望展示的(`userActions`)自己的板块的页面
17
+ */
18
+ userActionPages?: UserActionPage[];
19
+ /**
20
+ * 在用户界面,在历史记录那个板块的下方,你希望展示的自己的板块
21
+ */
22
+ userActions?: Record<string, UserAction>;
23
+ }
24
+ export interface UserAction {
25
+ call(author: uni.item.Author): any;
26
+ name: string;
27
+ icon?: Component;
28
+ }
29
+ export interface UserActionPage {
30
+ title?: string;
31
+ items: ActionPageItem[];
32
+ clickPage?: Component;
33
+ clickText?: string;
34
+ }
35
+ export type ActionPageItem = {
36
+ name: string;
37
+ key: string;
38
+ type: 'button';
39
+ icon: Component;
40
+ page: Component;
41
+ } | {
42
+ name: string;
43
+ key: string;
44
+ type: 'statistic';
45
+ icon?: Component;
46
+ value: MaybeRefOrGetter<string | number>;
47
+ };
package/dist/pack.tgz CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delta-comic/plugin",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "空阙虱楼",
5
5
  "homepage": "https://github.com/delta-comic/delta-comic",
6
6
  "license": "AGPL-3.0-only",
@@ -44,11 +44,11 @@
44
44
  "userscript-meta": "^1.0.1",
45
45
  "vue": "^3.5.30",
46
46
  "vue-component-type-helpers": "^3.2.6",
47
- "@delta-comic/db": "1.3.0",
48
- "@delta-comic/ui": "1.3.0",
49
- "@delta-comic/utils": "1.3.0",
50
- "@delta-comic/model": "1.3.0",
51
- "@delta-comic/core": "1.3.0"
47
+ "@delta-comic/core": "1.3.2",
48
+ "@delta-comic/db": "1.3.2",
49
+ "@delta-comic/model": "1.3.2",
50
+ "@delta-comic/utils": "1.3.2",
51
+ "@delta-comic/ui": "1.3.2"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@tailwindcss/vite": "^4.2.1",