delta-comic-core 0.2.1 → 0.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.
- package/dist/bundle.cjs +3 -3
- package/dist/bundle.cjs.map +1 -1
- package/dist/bundle.js +167 -68
- package/dist/bundle.js.map +1 -1
- package/dist/bundle2.cjs +1 -1
- package/dist/bundle2.cjs.map +1 -1
- package/dist/bundle2.js +4 -4
- package/dist/bundle2.js.map +1 -1
- package/dist/lib/components/image.vue.d.ts +1101 -6
- package/dist/lib/index.d.ts +1473 -12
- package/dist/lib/plugin/define.d.ts +27 -3
- package/dist/lib/plugin/index.d.ts +25 -0
- package/dist/lib/struct/content.d.ts +16 -29
- package/dist/lib/struct/item.d.ts +18 -2
- package/dist/lib/utils/data.d.ts +1 -1
- package/dist/lib/utils/eventBus.d.ts +3 -1
- package/dist/pack.tgz +0 -0
- package/dist/vite/index.d.ts +9 -2
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ContentPageLike,
|
|
2
|
-
import { ProcessInstance } from '../struct/image';
|
|
1
|
+
import { ContentPageLike, ViewLayoutComp, ContentPage } from '../struct/content';
|
|
2
|
+
import { ProcessInstance, Image } from '../struct/image';
|
|
3
3
|
import { CommentRow } from '../struct/comment';
|
|
4
4
|
import { UserCardComp } from '../struct/user';
|
|
5
5
|
import { RStream, RPromiseContent } from '../utils/data';
|
|
6
|
-
import { Item, RawItem, Author } from '../struct/item';
|
|
6
|
+
import { Item, RawItem, Author, ItemCardComp } from '../struct/item';
|
|
7
7
|
import { Component, MaybeRefOrGetter } from 'vue';
|
|
8
8
|
import { ConfigPointer } from '../config';
|
|
9
9
|
export type PluginDefineResult = {
|
|
@@ -28,6 +28,30 @@ export interface PluginConfig {
|
|
|
28
28
|
*/
|
|
29
29
|
config?: ConfigPointer[];
|
|
30
30
|
subscribe?: Record<string, PluginConfigSubscribe>;
|
|
31
|
+
share?: PluginShare;
|
|
32
|
+
}
|
|
33
|
+
export interface PluginShare {
|
|
34
|
+
initiative: PluginShareInitiativeItem[];
|
|
35
|
+
tokenListen: PluginShareToken[];
|
|
36
|
+
}
|
|
37
|
+
export interface PluginShareToken {
|
|
38
|
+
key: string;
|
|
39
|
+
name: string;
|
|
40
|
+
patten(chipboard: string): boolean;
|
|
41
|
+
show(chipboard: string): Promise<PluginShareTokenPopup> | PluginShareTokenPopup;
|
|
42
|
+
}
|
|
43
|
+
export interface PluginShareTokenPopup {
|
|
44
|
+
title: string;
|
|
45
|
+
detail: string;
|
|
46
|
+
onPositive(): void;
|
|
47
|
+
onNegative(): void;
|
|
48
|
+
}
|
|
49
|
+
export interface PluginShareInitiativeItem {
|
|
50
|
+
key: string;
|
|
51
|
+
name: string;
|
|
52
|
+
icon: Component | Image;
|
|
53
|
+
call(page: ContentPage): Promise<any>;
|
|
54
|
+
filter(page: ContentPage): boolean;
|
|
31
55
|
}
|
|
32
56
|
export interface PluginConfigSubscribe {
|
|
33
57
|
getUpdateList(olds: {
|
|
@@ -4,3 +4,28 @@ export declare const definePlugin: (config: PluginConfig | ((safe: boolean) => P
|
|
|
4
4
|
plugin: string;
|
|
5
5
|
result: void;
|
|
6
6
|
}[] | undefined;
|
|
7
|
+
export interface RawPluginMeta {
|
|
8
|
+
'name:display': string;
|
|
9
|
+
'name:id': string;
|
|
10
|
+
version: string;
|
|
11
|
+
author: string | undefined;
|
|
12
|
+
description: string;
|
|
13
|
+
require?: string[] | string;
|
|
14
|
+
}
|
|
15
|
+
export interface PluginMeta {
|
|
16
|
+
name: {
|
|
17
|
+
display: string;
|
|
18
|
+
id: string;
|
|
19
|
+
};
|
|
20
|
+
version: {
|
|
21
|
+
plugin: string;
|
|
22
|
+
supportCore: string;
|
|
23
|
+
};
|
|
24
|
+
author: string;
|
|
25
|
+
description: string;
|
|
26
|
+
require: {
|
|
27
|
+
id: string;
|
|
28
|
+
download?: string | undefined;
|
|
29
|
+
}[];
|
|
30
|
+
}
|
|
31
|
+
export declare const decodePluginMeta: (v: RawPluginMeta) => PluginMeta;
|
|
@@ -1,22 +1,32 @@
|
|
|
1
|
-
import { Component
|
|
1
|
+
import { Component } from 'vue';
|
|
2
2
|
import { SourcedKeyMap, RStream, SourcedKeyType } from '../utils/data';
|
|
3
3
|
import { uni } from '.';
|
|
4
4
|
import { AudioSrc, MediaSrc, TextTrackInit } from 'vidstack';
|
|
5
|
-
import { PluginConfigSearchCategory, PluginConfigSearchHotPageLevelboard, PluginConfigSearchHotPageMainList, PluginConfigSearchHotPageTopButton, PluginConfigSearchTabbar } from '../plugin/define';
|
|
5
|
+
import { PluginConfigSearchCategory, PluginConfigSearchHotPageLevelboard, PluginConfigSearchHotPageMainList, PluginConfigSearchHotPageTopButton, PluginConfigSearchTabbar, PluginShareInitiativeItem, PluginShareToken } from '../plugin/define';
|
|
6
6
|
import * as item from './item';
|
|
7
7
|
import * as ep from './ep';
|
|
8
8
|
import * as comment from './comment';
|
|
9
9
|
export type PreloadValue = item.Item | undefined;
|
|
10
10
|
export type ContentPageLike = new (preload: PreloadValue, id: string, ep: string) => ContentPage;
|
|
11
|
+
export type ContentType_ = SourcedKeyType<typeof ContentPage.contentPage>;
|
|
12
|
+
export type ContentType = Exclude<ContentType_, string>;
|
|
13
|
+
export type ViewComp = Component<{
|
|
14
|
+
page: ContentPage;
|
|
15
|
+
isFullScreen: boolean;
|
|
16
|
+
}>;
|
|
17
|
+
export type ViewLayoutComp = Component<{
|
|
18
|
+
page: ContentPage;
|
|
19
|
+
}>;
|
|
11
20
|
export declare abstract class ContentPage<T extends object = any> {
|
|
12
21
|
id: string;
|
|
13
22
|
ep: string;
|
|
14
23
|
static viewLayout: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, name: string], uni.content.ViewLayoutComp>>;
|
|
24
|
+
static share: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, key: string], PluginShareInitiativeItem>>;
|
|
25
|
+
static shareToken: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, key: string], PluginShareToken>>;
|
|
15
26
|
static tabbar: import('vue').ShallowReactive<Map<string, PluginConfigSearchTabbar[]>>;
|
|
16
27
|
static addTabbar(plugin: string, ...tabbar: PluginConfigSearchTabbar[]): void;
|
|
17
28
|
static categories: import('vue').ShallowReactive<Map<string, PluginConfigSearchCategory[]>>;
|
|
18
29
|
static addCategories(plugin: string, ...categories: PluginConfigSearchCategory[]): void;
|
|
19
|
-
static itemCard: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, name: string], uni.content.ItemCardComp>>;
|
|
20
30
|
static contentPage: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, name: string], uni.content.ContentPageLike>>;
|
|
21
31
|
static levelboard: import('vue').ShallowReactive<Map<string, PluginConfigSearchHotPageLevelboard[]>>;
|
|
22
32
|
static addLevelboard(plugin: string, cfg: PluginConfigSearchHotPageLevelboard): string;
|
|
@@ -40,35 +50,12 @@ export declare abstract class ContentPage<T extends object = any> {
|
|
|
40
50
|
abstract exportOffline(): Promise<T>;
|
|
41
51
|
abstract ViewComp: ViewComp;
|
|
42
52
|
}
|
|
43
|
-
export type ContentType_ = SourcedKeyType<typeof ContentPage.contentPage>;
|
|
44
|
-
export type ContentType = Exclude<ContentType_, string>;
|
|
45
|
-
export type ViewComp = Component<{
|
|
46
|
-
page: ContentPage;
|
|
47
|
-
isFullScreen: boolean;
|
|
48
|
-
}>;
|
|
49
|
-
export type ViewLayoutComp = Component<{
|
|
50
|
-
page: ContentPage;
|
|
51
|
-
}>;
|
|
52
|
-
export type ItemCardComp = Component<{
|
|
53
|
-
item: uni.item.Item;
|
|
54
|
-
freeHeight?: boolean;
|
|
55
|
-
disabled?: boolean;
|
|
56
|
-
type?: 'default' | 'big' | 'small';
|
|
57
|
-
class?: any;
|
|
58
|
-
style?: StyleValue;
|
|
59
|
-
}, any, any, any, any, {
|
|
60
|
-
click: [];
|
|
61
|
-
}, {
|
|
62
|
-
default(): void;
|
|
63
|
-
smallTopInfo(): void;
|
|
64
|
-
cover(): void;
|
|
65
|
-
}>;
|
|
66
|
-
export type VideoConfig = {
|
|
67
|
-
textTrack?: TextTrackInit[];
|
|
68
|
-
} & (Exclude<MediaSrc, string | AudioSrc>[]);
|
|
69
53
|
export declare abstract class ContentImagePage extends ContentPage {
|
|
70
54
|
images: import('../utils/data').PromiseWithResolvers<uni.image.Image[]>;
|
|
71
55
|
}
|
|
56
|
+
export type VideoConfig = {
|
|
57
|
+
textTrack?: TextTrackInit[];
|
|
58
|
+
} & (Exclude<MediaSrc, string | AudioSrc>[]);
|
|
72
59
|
export declare abstract class ContentVideoPage extends ContentPage {
|
|
73
60
|
videos: import('../utils/data').PromiseWithResolvers<uni.content.VideoConfig>;
|
|
74
61
|
}
|
|
@@ -2,8 +2,9 @@ import { SourcedKeyMap, Struct, MetaData } from '../utils/data';
|
|
|
2
2
|
import { default as dayjs } from 'dayjs';
|
|
3
3
|
import { ContentType, ContentType_ } from './content';
|
|
4
4
|
import { Ep, RawEp } from './ep';
|
|
5
|
-
import { Component } from 'vue';
|
|
5
|
+
import { Component, StyleValue } from 'vue';
|
|
6
6
|
import { PluginConfigContentItemTranslator } from '../plugin/define';
|
|
7
|
+
import { uni } from '.';
|
|
7
8
|
import * as image from "./image";
|
|
8
9
|
export interface Category {
|
|
9
10
|
name: string;
|
|
@@ -49,6 +50,20 @@ export interface RawItem {
|
|
|
49
50
|
commentSendable: boolean;
|
|
50
51
|
customIsSafe?: boolean;
|
|
51
52
|
}
|
|
53
|
+
export type ItemCardComp = Component<{
|
|
54
|
+
item: uni.item.Item;
|
|
55
|
+
freeHeight?: boolean;
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
type?: 'default' | 'big' | 'small';
|
|
58
|
+
class?: any;
|
|
59
|
+
style?: StyleValue;
|
|
60
|
+
}, any, any, any, any, {
|
|
61
|
+
click: [];
|
|
62
|
+
}, {
|
|
63
|
+
default(): void;
|
|
64
|
+
smallTopInfo(): void;
|
|
65
|
+
cover(): void;
|
|
66
|
+
}>;
|
|
52
67
|
export type Description = string | {
|
|
53
68
|
type: 'html';
|
|
54
69
|
content: string;
|
|
@@ -58,8 +73,9 @@ export type Description = string | {
|
|
|
58
73
|
};
|
|
59
74
|
export declare abstract class Item extends Struct<RawItem> implements RawItem {
|
|
60
75
|
static itemTranslator: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, name: string], PluginConfigContentItemTranslator>>;
|
|
61
|
-
static create(raw: RawItem): Item;
|
|
76
|
+
static create(raw: RawItem): uni.item.Item;
|
|
62
77
|
static authorIcon: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, name: string], Component>>;
|
|
78
|
+
static itemCard: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, name: string], uni.item.ItemCardComp>>;
|
|
63
79
|
abstract like(signal?: AbortSignal): PromiseLike<boolean>;
|
|
64
80
|
abstract report(signal?: AbortSignal): PromiseLike<any>;
|
|
65
81
|
abstract sendComment(text: string, signal?: AbortSignal): PromiseLike<any>;
|
package/dist/lib/utils/data.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare class SourcedValue<T extends [string, string]> {
|
|
|
19
19
|
stringify(value: T): string;
|
|
20
20
|
constructor(separator?: string);
|
|
21
21
|
}
|
|
22
|
-
export type SourcedKeyType<T extends SourcedKeyMap<
|
|
22
|
+
export type SourcedKeyType<T extends SourcedKeyMap<[string, string], any> | SourcedValue<any>> = T extends SourcedKeyMap<[string, string], any> ? Parameters<T['get']>[0] : Parameters<T['toJSON']>[0];
|
|
23
23
|
/**
|
|
24
24
|
* 相比较于普通的Map,这个元素的key操作可以是`TKey | string`
|
|
25
25
|
* _但内部保存仍使用`SourcedValue.toString`作为key_
|
|
@@ -12,10 +12,12 @@ export type SharedFunctions = {
|
|
|
12
12
|
addPlugin(ins: PluginConfig): void;
|
|
13
13
|
addRecent(item: uni.item.Item): PromiseLike<any>;
|
|
14
14
|
routeToContent(contentType_: uni.content.ContentType_, id: string, ep: string, preload?: uni.content.PreloadValue): PromiseLike<any>;
|
|
15
|
-
routeToSearch(input: string, source?: string, sort?: string): PromiseLike<any>;
|
|
15
|
+
routeToSearch(input: string, source?: [plugin: string, name: string], sort?: string): PromiseLike<any>;
|
|
16
16
|
addAuthorSubscribe(author: uni.item.Author, plugin: string): PromiseLike<void>;
|
|
17
17
|
removeAuthorSubscribe(author: uni.item.Author, plugin: string): PromiseLike<void>;
|
|
18
18
|
getIsAuthorSubscribe(author: uni.item.Author, plugin: string): PromiseLike<boolean>;
|
|
19
|
+
triggerSharePopup(page: uni.content.ContentPage): PromiseLike<void>;
|
|
20
|
+
triggerShoreToken(token: string): PromiseLike<void>;
|
|
19
21
|
};
|
|
20
22
|
export declare class SharedFunction {
|
|
21
23
|
private static sharedFunctions;
|
package/dist/pack.tgz
CHANGED
|
Binary file
|
package/dist/vite/index.d.ts
CHANGED
|
@@ -4,7 +4,14 @@ export declare const createMonkeyConfig: (config: {
|
|
|
4
4
|
version: string;
|
|
5
5
|
author?: string;
|
|
6
6
|
description: string;
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/** 通过语义化版本号描述core支持版本,通过`semver.satisfies`判定 */
|
|
8
|
+
supportCoreVersion: string;
|
|
9
|
+
/** @default ['core'] */
|
|
10
|
+
require?: ({
|
|
11
|
+
id: string;
|
|
12
|
+
download?: string;
|
|
13
|
+
} | string)[];
|
|
14
|
+
/** @default 'src/main.ts' */
|
|
15
|
+
entry?: string;
|
|
9
16
|
}, command: "build" | "serve") => any;
|
|
10
17
|
export declare const createExternalConfig: (command: "build" | "serve") => any;
|