@delta-comic/plugin 0.3.5 → 1.3.0

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 (45) hide show
  1. package/LICENSE +1 -1
  2. package/dist/core-NoooY1bz.js +2 -0
  3. package/dist/core-wAb1OuYe.js +521 -0
  4. package/dist/core-wAb1OuYe.js.map +1 -0
  5. package/dist/index.css +2 -2
  6. package/dist/index.js +2178 -1070
  7. package/dist/index.js.map +1 -1
  8. package/dist/pack.tgz +0 -0
  9. package/package.json +18 -23
  10. package/dist/lib/config.d.ts +0 -71
  11. package/dist/lib/depends.d.ts +0 -7
  12. package/dist/lib/driver/core.d.ts +0 -68
  13. package/dist/lib/driver/icon.d.ts +0 -3
  14. package/dist/lib/driver/index.d.ts +0 -3
  15. package/dist/lib/driver/init/booter/0_configSetter.d.ts +0 -8
  16. package/dist/lib/driver/init/booter/10_apiTest.d.ts +0 -9
  17. package/dist/lib/driver/init/booter/20_resourceTest.d.ts +0 -8
  18. package/dist/lib/driver/init/booter/30_boot.d.ts +0 -8
  19. package/dist/lib/driver/init/booter/40_auth.d.ts +0 -8
  20. package/dist/lib/driver/init/booter/50_otherProcess.d.ts +0 -8
  21. package/dist/lib/driver/init/booter/utils.d.ts +0 -3
  22. package/dist/lib/driver/init/index.d.ts +0 -19
  23. package/dist/lib/driver/init/installer/10_normalUrl.d.ts +0 -12
  24. package/dist/lib/driver/init/installer/20_local.d.ts +0 -12
  25. package/dist/lib/driver/init/installer/30_dev.d.ts +0 -12
  26. package/dist/lib/driver/init/installer/40_github.d.ts +0 -12
  27. package/dist/lib/driver/init/installer/9999_awesome.d.ts +0 -12
  28. package/dist/lib/driver/init/loader/1_userscript.d.ts +0 -11
  29. package/dist/lib/driver/init/loader/2_zip.d.ts +0 -11
  30. package/dist/lib/driver/init/utils.d.ts +0 -28
  31. package/dist/lib/driver/store.d.ts +0 -37
  32. package/dist/lib/env/Inject.vue.d.ts +0 -18
  33. package/dist/lib/env/index.d.ts +0 -12
  34. package/dist/lib/global.d.ts +0 -26
  35. package/dist/lib/index.d.ts +0 -6
  36. package/dist/lib/plugin/api.d.ts +0 -8
  37. package/dist/lib/plugin/auth.d.ts +0 -15
  38. package/dist/lib/plugin/content.d.ts +0 -8
  39. package/dist/lib/plugin/index.d.ts +0 -81
  40. package/dist/lib/plugin/otherProgress.d.ts +0 -4
  41. package/dist/lib/plugin/resource.d.ts +0 -5
  42. package/dist/lib/plugin/search.d.ts +0 -71
  43. package/dist/lib/plugin/share.d.ts +0 -26
  44. package/dist/lib/plugin/subscribe.d.ts +0 -13
  45. package/dist/lib/plugin/user.d.ts +0 -47
@@ -1,81 +0,0 @@
1
- import { ConfigPointer } from '../config';
2
- import type * as Share from './share';
3
- export type * as Share from './share';
4
- import type * as Content from './content';
5
- export type * as Content from './content';
6
- import type * as Subscribe from './subscribe';
7
- export type * as Subscribe from './subscribe';
8
- import type * as User from './user';
9
- export type * as User from './user';
10
- import type * as Api from './api';
11
- export type * as Api from './api';
12
- import type * as OtherProgress from './otherProgress';
13
- export type * as OtherProgress from './otherProgress';
14
- import type * as Search from './search';
15
- export type * as Search from './search';
16
- import type * as Auth from './auth';
17
- export type * as Auth from './auth';
18
- import type * as Resource from './resource';
19
- export type * as Resource from './resource';
20
- export declare const pluginEmitter: import('mitt').Emitter<{
21
- definedPlugin: PluginConfig;
22
- }>;
23
- export interface PluginConfig {
24
- name: string;
25
- content?: Content.Config;
26
- resource?: Resource.Content;
27
- api?: Record<string, Api.Config>;
28
- user?: User.Config;
29
- auth?: Auth.Config;
30
- otherProgress?: OtherProgress.Config[];
31
- /**
32
- * 返回值如果不为空,则会await后作为expose暴露
33
- */
34
- onBooted?(ins: DefineResult): (PromiseLike<object> | object) | void;
35
- search?: Search.Config;
36
- /**
37
- * 插件的配置项需在此处注册
38
- * 传入`Store.ConfigPointer`
39
- */
40
- config?: ConfigPointer[];
41
- subscribe?: Record<string, Subscribe.Config>;
42
- share?: Share.Config;
43
- }
44
- export type DefineResult = {
45
- api?: Record<string, string | undefined | false>;
46
- };
47
- export declare const definePlugin: <T extends PluginConfig>(config: T | ((safe: boolean) => T)) => Promise<T>;
48
- export type PluginExpose<T extends () => Promise<PluginConfig>> = Awaited<ReturnType<NonNullable<Awaited<ReturnType<T>>['onBooted']>>>;
49
- export interface RawPluginMeta {
50
- 'name:display': string;
51
- 'name:id': string;
52
- 'version': string;
53
- 'author': string | undefined;
54
- 'description': string;
55
- 'require'?: string[] | string;
56
- }
57
- export interface PluginMeta {
58
- name: {
59
- display: string;
60
- id: string;
61
- };
62
- version: {
63
- plugin: string;
64
- supportCore: string;
65
- };
66
- author: string;
67
- description: string;
68
- require: {
69
- id: string;
70
- download?: string | undefined;
71
- }[];
72
- entry?: {
73
- jsPath: string;
74
- cssPath?: string;
75
- };
76
- beforeBoot?: {
77
- path: string;
78
- slot: string;
79
- }[];
80
- }
81
- export declare const decodePluginMeta: (v: RawPluginMeta) => PluginMeta;
@@ -1,4 +0,0 @@
1
- export interface Config {
2
- call: (setDescription: (description: string) => void) => PromiseLike<any>;
3
- name: string;
4
- }
@@ -1,5 +0,0 @@
1
- import { uni } from '@delta-comic/model';
2
- export interface Content {
3
- process?: Record<string, uni.resource.ProcessInstance>;
4
- types?: uni.resource.ResourceType[];
5
- }
@@ -1,71 +0,0 @@
1
- import { RPromiseContent, RStream, uni } from '@delta-comic/model';
2
- import { Component } from 'vue';
3
- export interface Config {
4
- /**
5
- * @description
6
- * key: id
7
- */
8
- methods?: Record<string, SearchMethod>;
9
- tabbar?: Tabbar[];
10
- categories?: Category[];
11
- hotPage?: {
12
- levelBoard?: HotLevelboard[];
13
- topButton?: HotTopButton[];
14
- mainListCard?: HotMainList[];
15
- };
16
- barcode?: Barcode[];
17
- }
18
- export interface SearchMethod {
19
- name: string;
20
- sorts: {
21
- text: string;
22
- value: string;
23
- }[];
24
- defaultSort: string;
25
- getStream(input: string, sort: string): RStream<uni.item.Item>;
26
- getAutoComplete(input: string, signal: AbortSignal): PromiseLike<({
27
- text: string;
28
- value: string;
29
- } | Component)[]>;
30
- }
31
- export interface HotLevelboard {
32
- name: string;
33
- content: () => RStream<uni.item.Item> | RPromiseContent<any, uni.item.Item[]>;
34
- }
35
- export interface HotMainList {
36
- name: string;
37
- content: () => RStream<uni.item.Item> | RPromiseContent<any, uni.item.Item[]>;
38
- onClick?(): any;
39
- }
40
- export interface HotTopButton {
41
- name: string;
42
- icon: Component;
43
- bgColor: string;
44
- onClick?(): any;
45
- }
46
- export interface Category {
47
- title: string;
48
- namespace: string;
49
- search: {
50
- methodId: string;
51
- input: string;
52
- sort: string;
53
- };
54
- }
55
- export interface Tabbar {
56
- title: string;
57
- id: string;
58
- comp: Component<{
59
- isActive: boolean;
60
- tabbar: Tabbar;
61
- }>;
62
- }
63
- export type RouteToContent = (contentType_: uni.content.ContentType_, id: string, ep: string, preload?: uni.content.PreloadValue) => PromiseLike<any>;
64
- export interface Barcode {
65
- match: (searchText: string) => boolean;
66
- /**
67
- * 选中后返回路由信息
68
- */
69
- getContent: (searchText: string, signal: AbortSignal) => PromiseLike<Parameters<RouteToContent>>;
70
- name: string;
71
- }
@@ -1,26 +0,0 @@
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
- }
@@ -1,13 +0,0 @@
1
- import { uni, RStream } 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
- getListStream(author: uni.item.Author): RStream<uni.item.Item>;
13
- }
@@ -1,47 +0,0 @@
1
- import { uni } from '@delta-comic/model';
2
- import { Component, MaybeRefOrGetter } from 'vue';
3
- export interface Config {
4
- edit?: Component;
5
- card?: uni.user.UserCardComp;
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
- };