@delta-comic/plugin 0.0.0-semantically-released

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.
@@ -0,0 +1,64 @@
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
+ constructor(pluginName: string, config: T);
8
+ readonly key: symbol;
9
+ }
10
+ export declare const appConfig: ConfigPointer<{
11
+ recordHistory: {
12
+ type: "switch";
13
+ defaultValue: true;
14
+ info: string;
15
+ };
16
+ showAIProject: {
17
+ type: "switch";
18
+ defaultValue: true;
19
+ info: string;
20
+ };
21
+ darkMode: {
22
+ type: "radio";
23
+ defaultValue: string;
24
+ info: string;
25
+ comp: "select";
26
+ selects: {
27
+ label: string;
28
+ value: string;
29
+ }[];
30
+ };
31
+ easilyTitle: {
32
+ type: "switch";
33
+ defaultValue: false;
34
+ info: string;
35
+ };
36
+ }>;
37
+ export declare const useConfig: import('pinia').StoreDefinition<"config", Pick<{
38
+ isDark: import('vue').ComputedRef<boolean>;
39
+ form: import('vue').ShallowReactive<Map<symbol, {
40
+ form: ConfigDescription;
41
+ value: Ref<any>;
42
+ }>>;
43
+ $load: <T extends ConfigPointer>(pointer: T) => Ref<FormType.Result<T["config"]>>;
44
+ $isExistConfig: (pointer: ConfigPointer) => boolean;
45
+ $resignerConfig: (pointer: ConfigPointer) => void;
46
+ }, "form">, Pick<{
47
+ isDark: import('vue').ComputedRef<boolean>;
48
+ form: import('vue').ShallowReactive<Map<symbol, {
49
+ form: ConfigDescription;
50
+ value: Ref<any>;
51
+ }>>;
52
+ $load: <T extends ConfigPointer>(pointer: T) => Ref<FormType.Result<T["config"]>>;
53
+ $isExistConfig: (pointer: ConfigPointer) => boolean;
54
+ $resignerConfig: (pointer: ConfigPointer) => void;
55
+ }, "isDark">, Pick<{
56
+ isDark: import('vue').ComputedRef<boolean>;
57
+ form: import('vue').ShallowReactive<Map<symbol, {
58
+ form: ConfigDescription;
59
+ value: Ref<any>;
60
+ }>>;
61
+ $load: <T extends ConfigPointer>(pointer: T) => Ref<FormType.Result<T["config"]>>;
62
+ $isExistConfig: (pointer: ConfigPointer) => boolean;
63
+ $resignerConfig: (pointer: ConfigPointer) => void;
64
+ }, "$load" | "$isExistConfig" | "$resignerConfig">>;
@@ -0,0 +1,2 @@
1
+ export * from './plugin';
2
+ export * from './config';
@@ -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.ItemCardComp;
4
+ commentRow?: uni.comment.CommentRow;
5
+ layout?: uni.content.ViewLayoutComp;
6
+ contentPage?: uni.content.ContentPageLike;
7
+ itemTranslator?: uni.item.ItemTranslator;
8
+ }>;
@@ -0,0 +1,78 @@
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 interface DefineConfig {
21
+ name: string;
22
+ content?: Content.Config;
23
+ resource?: Resource.Content;
24
+ api?: Record<string, Api.Config>;
25
+ user?: User.Config;
26
+ auth?: Auth.Config;
27
+ otherProgress?: OtherProgress.Config[];
28
+ /**
29
+ * 返回值如果不为空,则会await后作为expose暴露
30
+ */
31
+ onBooted?(ins: DefineResult): (PromiseLike<object> | object) | void;
32
+ search?: Search.Config;
33
+ /**
34
+ * 插件的配置项需在此处注册
35
+ * 传入`Store.ConfigPointer`
36
+ */
37
+ config?: ConfigPointer[];
38
+ subscribe?: Record<string, Subscribe.Config>;
39
+ share?: Share.Config;
40
+ }
41
+ export type DefineResult = {
42
+ api?: Record<string, string | undefined | false>;
43
+ };
44
+ export declare const definePlugin: <T extends DefineConfig>(config: T | ((safe: boolean) => T)) => Promise<T>;
45
+ export type PluginExpose<T extends ReturnType<typeof definePlugin>> = Awaited<ReturnType<NonNullable<Awaited<T>['onBooted']>>>;
46
+ export interface RawPluginMeta {
47
+ 'name:display': string;
48
+ 'name:id': string;
49
+ 'version': string;
50
+ 'author': string | undefined;
51
+ 'description': string;
52
+ 'require'?: string[] | string;
53
+ }
54
+ export interface PluginMeta {
55
+ name: {
56
+ display: string;
57
+ id: string;
58
+ };
59
+ version: {
60
+ plugin: string;
61
+ supportCore: string;
62
+ };
63
+ author: string;
64
+ description: string;
65
+ require: {
66
+ id: string;
67
+ download?: string | undefined;
68
+ }[];
69
+ entry?: {
70
+ jsPath: string;
71
+ cssPath?: string;
72
+ };
73
+ beforeBoot?: {
74
+ path: string;
75
+ slot: string;
76
+ }[];
77
+ }
78
+ export declare const decodePluginMeta: (v: RawPluginMeta) => PluginMeta;
@@ -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,71 @@
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
+ }
@@ -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 { 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
+ }
@@ -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.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
+ };
package/dist/pack.tgz ADDED
Binary file
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@delta-comic/plugin",
3
+ "version": "0.0.0-semantically-released",
4
+ "description": "空阙虱楼",
5
+ "homepage": "https://github.com/delta-comic/delta-comic-core",
6
+ "license": "AGPL-3.0-only",
7
+ "author": {
8
+ "name": "wenxig",
9
+ "email": "wenxinguo12@gmail.com"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/delta-comic/delta-comic-core.git"
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "type": "module",
19
+ "main": "./dist/index.js",
20
+ "module": "./dist/index.js",
21
+ "types": "./dist/lib/index.d.ts",
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/lib/index.d.ts",
25
+ "import": "./dist/index.js",
26
+ "require": "./dist/index.cjs"
27
+ }
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "dependencies": {
33
+ "@vueuse/core": "^14.2.1",
34
+ "mitt": "^3.0.1",
35
+ "@delta-comic/model": "0.0.0-semantically-released",
36
+ "@delta-comic/utils": "0.0.0-semantically-released",
37
+ "@delta-comic/ui": "0.0.0-semantically-released",
38
+ "@delta-comic/core": "0.0.0-semantically-released"
39
+ },
40
+ "peerDependencies": {
41
+ "pinia": "^3.0",
42
+ "vue": "^3.5",
43
+ "vue-router": "^5.0"
44
+ },
45
+ "release": {
46
+ "extends": "../../release.config.js",
47
+ "tagFormat": "plugin-${version}"
48
+ },
49
+ "dist": {
50
+ "tarball": "./dist/pack.tgz"
51
+ },
52
+ "readme": "./README.md",
53
+ "scripts": {
54
+ "build": "vite build && pnpm pack --out ./dist/pack.tgz"
55
+ }
56
+ }