delta-comic-core 0.1.2 → 0.2.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 +156 -180
- package/dist/bundle.js.map +1 -1
- package/dist/lib/plugin/define.d.ts +1 -1
- package/dist/lib/struct/comment.d.ts +2 -4
- package/dist/lib/struct/content.d.ts +13 -34
- package/dist/lib/struct/download.d.ts +8 -0
- package/dist/lib/struct/image.d.ts +5 -12
- package/dist/lib/struct/item.d.ts +3 -5
- package/dist/lib/struct/user.d.ts +3 -6
- package/dist/lib/utils/data.d.ts +36 -0
- package/dist/pack.tgz +0 -0
- package/package.json +1 -1
- package/dist/lib/layout/user.d.ts +0 -0
|
@@ -169,7 +169,7 @@ export interface PluginConfigImage {
|
|
|
169
169
|
* value: process function
|
|
170
170
|
* 与`Image.setProcess(name, key, value)`等价
|
|
171
171
|
*/
|
|
172
|
-
process?: Record<string, ProcessInstance
|
|
172
|
+
process?: Record<string, ProcessInstance>;
|
|
173
173
|
}
|
|
174
174
|
export type PluginConfigContent = Record<string, {
|
|
175
175
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Struct, MetaData, RStream } from '../utils/data';
|
|
1
|
+
import { SourcedKeyMap, Struct, MetaData, RStream } from '../utils/data';
|
|
2
2
|
import { Component } from 'vue';
|
|
3
3
|
import { uni } from '.';
|
|
4
4
|
import { default as dayjs } from 'dayjs';
|
|
@@ -25,9 +25,7 @@ export type CommentRow = Component<{
|
|
|
25
25
|
parentComment?: Comment;
|
|
26
26
|
}>;
|
|
27
27
|
export declare abstract class Comment extends Struct<RawComment> implements RawComment {
|
|
28
|
-
|
|
29
|
-
static setCommentRow(ct_: uni.content.ContentType_, component: CommentRow): string;
|
|
30
|
-
static getCommentRow(ct_: uni.content.ContentType_): uni.comment.CommentRow | undefined;
|
|
28
|
+
static commentRow: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, name: string], uni.comment.CommentRow>>;
|
|
31
29
|
constructor(v: RawComment);
|
|
32
30
|
abstract sender: User;
|
|
33
31
|
content: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, StyleValue } from 'vue';
|
|
2
|
-
import { RStream } from '../utils/data';
|
|
2
|
+
import { SourcedKeyMap, RStream, SourcedKeyType } from '../utils/data';
|
|
3
3
|
import { uni } from '.';
|
|
4
4
|
import { AudioSrc, MediaSrc, TextTrackInit } from 'vidstack';
|
|
5
5
|
import { PluginConfigSearchCategory, PluginConfigSearchHotPageLevelboard, PluginConfigSearchHotPageMainList, PluginConfigSearchHotPageTopButton, PluginConfigSearchTabbar } from '../plugin/define';
|
|
@@ -11,32 +11,19 @@ export type ContentPageLike = new (preload: PreloadValue, id: string, ep: string
|
|
|
11
11
|
export declare abstract class ContentPage<T extends object = any> {
|
|
12
12
|
id: string;
|
|
13
13
|
ep: string;
|
|
14
|
-
|
|
15
|
-
static setViewLayout(ct_: ContentType_, component: ViewLayoutComp): string;
|
|
16
|
-
static getViewLayout(ct_: ContentType_): uni.content.ViewLayoutComp | undefined;
|
|
14
|
+
static viewLayout: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, name: string], uni.content.ViewLayoutComp>>;
|
|
17
15
|
static tabbar: import('vue').ShallowReactive<Map<string, PluginConfigSearchTabbar[]>>;
|
|
18
|
-
static
|
|
19
|
-
static getTabbar(plugin: string): PluginConfigSearchTabbar[];
|
|
16
|
+
static addTabbar(plugin: string, ...tabbar: PluginConfigSearchTabbar[]): void;
|
|
20
17
|
static categories: import('vue').ShallowReactive<Map<string, PluginConfigSearchCategory[]>>;
|
|
21
|
-
static
|
|
22
|
-
static
|
|
23
|
-
|
|
24
|
-
static setItemCard(ct_: ContentType_, component: ItemCardComp): string;
|
|
25
|
-
static getItemCard(ct_: ContentType_): uni.content.ItemCardComp | undefined;
|
|
26
|
-
private static contentPage;
|
|
27
|
-
static setContentPage(contentType: ContentType_, page: ContentPageLike): void;
|
|
28
|
-
static getContentPage(contentType: ContentType_): uni.content.ContentPageLike;
|
|
29
|
-
static toContentType(ct: ContentType_): ContentType;
|
|
30
|
-
static toContentTypeString(ct: ContentType_): string;
|
|
18
|
+
static addCategories(plugin: string, ...categories: PluginConfigSearchCategory[]): void;
|
|
19
|
+
static itemCard: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, name: string], uni.content.ItemCardComp>>;
|
|
20
|
+
static contentPage: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, name: string], uni.content.ContentPageLike>>;
|
|
31
21
|
static levelboard: import('vue').ShallowReactive<Map<string, PluginConfigSearchHotPageLevelboard[]>>;
|
|
32
|
-
static
|
|
33
|
-
static getLevelboard(plugin: string): PluginConfigSearchHotPageLevelboard[] | undefined;
|
|
22
|
+
static addLevelboard(plugin: string, cfg: PluginConfigSearchHotPageLevelboard): string;
|
|
34
23
|
static topButton: import('vue').ShallowReactive<Map<string, PluginConfigSearchHotPageTopButton[]>>;
|
|
35
|
-
static
|
|
36
|
-
static getTopButton(plugin: string): PluginConfigSearchHotPageTopButton[] | undefined;
|
|
24
|
+
static addTopButton(plugin: string, cfg: PluginConfigSearchHotPageTopButton): string;
|
|
37
25
|
static mainLists: import('vue').ShallowReactive<Map<string, PluginConfigSearchHotPageMainList[]>>;
|
|
38
|
-
static
|
|
39
|
-
static getMainList(plugin: string): PluginConfigSearchHotPageMainList[] | undefined;
|
|
26
|
+
static addMainList(plugin: string, cfg: PluginConfigSearchHotPageMainList): string;
|
|
40
27
|
constructor(preload: PreloadValue, id: string, ep: string);
|
|
41
28
|
abstract contentType: ContentType;
|
|
42
29
|
pid: import('../utils/data').PromiseWithResolvers<string>;
|
|
@@ -49,24 +36,16 @@ export declare abstract class ContentPage<T extends object = any> {
|
|
|
49
36
|
abstract loadAll(signal?: AbortSignal): Promise<any>;
|
|
50
37
|
abstract reloadAll(signal?: AbortSignal): Promise<any>;
|
|
51
38
|
abstract plugin: string;
|
|
52
|
-
abstract loadAllOffline(): Promise<
|
|
53
|
-
abstract exportOffline(
|
|
39
|
+
abstract loadAllOffline(save: T): Promise<any>;
|
|
40
|
+
abstract exportOffline(): Promise<T>;
|
|
54
41
|
abstract ViewComp: ViewComp;
|
|
55
42
|
}
|
|
43
|
+
export type ContentType_ = SourcedKeyType<typeof ContentPage.contentPage>;
|
|
44
|
+
export type ContentType = Exclude<ContentType_, string>;
|
|
56
45
|
export type ViewComp = Component<{
|
|
57
46
|
page: ContentPage;
|
|
58
47
|
isFullScreen: boolean;
|
|
59
48
|
}>;
|
|
60
|
-
export interface ContentType {
|
|
61
|
-
plugin: string;
|
|
62
|
-
name: string;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* @example "bika:comic"
|
|
66
|
-
* "91video:video"
|
|
67
|
-
* "jm:comic"
|
|
68
|
-
*/
|
|
69
|
-
export type ContentType_ = ContentType | string;
|
|
70
49
|
export type ViewLayoutComp = Component<{
|
|
71
50
|
page: ContentPage;
|
|
72
51
|
}>;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { Struct, MetaData } from '../utils/data';
|
|
2
|
-
export
|
|
3
|
-
fullName: string;
|
|
4
|
-
plugin: string;
|
|
5
|
-
referenceName: string;
|
|
6
|
-
func: (nowPath: string, img: Image) => Promise<[path: string, exit: boolean]>;
|
|
7
|
-
}
|
|
1
|
+
import { SourcedKeyMap, Struct, MetaData } from '../utils/data';
|
|
2
|
+
export type ProcessInstance = (nowPath: string, img: Image) => Promise<[path: string, exit: boolean]>;
|
|
8
3
|
export interface ProcessStep {
|
|
9
4
|
referenceName: string;
|
|
10
5
|
ignoreExit?: boolean;
|
|
@@ -22,11 +17,9 @@ export declare class Image extends Struct<RawImage> implements RawImage {
|
|
|
22
17
|
width: number;
|
|
23
18
|
height: number;
|
|
24
19
|
} | undefined;
|
|
25
|
-
static processInstances: import('vue').ShallowReactive<
|
|
26
|
-
static
|
|
27
|
-
static
|
|
28
|
-
static activeFork: import('vue').ShallowReactive<Map<string, string>>;
|
|
29
|
-
static setFork(plugin: string, namespace: string, fork: string[]): void;
|
|
20
|
+
static processInstances: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, referenceName: string], ProcessInstance>>;
|
|
21
|
+
static fork: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, namespace: string], string[]>>;
|
|
22
|
+
static activeFork: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, namespace: string], string>>;
|
|
30
23
|
static is(value: unknown): value is Image;
|
|
31
24
|
static create(v: RawImage, aspect?: {
|
|
32
25
|
width: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Struct, MetaData } from '../utils/data';
|
|
1
|
+
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';
|
|
@@ -57,11 +57,9 @@ export type Description = string | {
|
|
|
57
57
|
content: string;
|
|
58
58
|
};
|
|
59
59
|
export declare abstract class Item extends Struct<RawItem> implements RawItem {
|
|
60
|
-
static itemTranslator: import('vue').ShallowReactive<
|
|
60
|
+
static itemTranslator: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, name: string], PluginConfigContentItemTranslator>>;
|
|
61
61
|
static create(raw: RawItem): Item;
|
|
62
|
-
static authorIcon: import('vue').ShallowReactive<
|
|
63
|
-
static getAuthorIcon(plugin: string, name: string): Component | undefined;
|
|
64
|
-
static setAuthorIcon(plugin: string, name: string, icon: Component): void;
|
|
62
|
+
static authorIcon: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, name: string], Component>>;
|
|
65
63
|
abstract like(signal?: AbortSignal): PromiseLike<boolean>;
|
|
66
64
|
abstract report(signal?: AbortSignal): PromiseLike<any>;
|
|
67
65
|
abstract sendComment(text: string, signal?: AbortSignal): PromiseLike<any>;
|
|
@@ -2,6 +2,7 @@ import { AuthorAction, PluginConfigSubscribe } from '../plugin/define';
|
|
|
2
2
|
import { uni } from '.';
|
|
3
3
|
import { Image, RawImage } from './image';
|
|
4
4
|
import { Component } from 'vue';
|
|
5
|
+
import { SourcedKeyMap } from '../utils/data';
|
|
5
6
|
export interface RawUser {
|
|
6
7
|
avatar?: RawImage;
|
|
7
8
|
name: string;
|
|
@@ -11,12 +12,8 @@ export interface RawUser {
|
|
|
11
12
|
export declare abstract class User {
|
|
12
13
|
static userBase: import('vue').ShallowReactive<Map<string, uni.user.User>>;
|
|
13
14
|
static userEditorBase: import('vue').ShallowReactive<Map<string, Component>>;
|
|
14
|
-
static subscribes: import('vue').ShallowReactive<
|
|
15
|
-
static
|
|
16
|
-
static getSubscribes(plugin: string, type: string): PluginConfigSubscribe | undefined;
|
|
17
|
-
static authorActions: import('vue').ShallowReactive<Map<string, AuthorAction>>;
|
|
18
|
-
static setAuthorActions(plugin: string, type: string, config: AuthorAction): void;
|
|
19
|
-
static getAuthorActions(plugin: string, type: string): AuthorAction | undefined;
|
|
15
|
+
static subscribes: import('vue').ShallowReactive<import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, type: string], PluginConfigSubscribe>>>;
|
|
16
|
+
static authorActions: import('vue').ShallowReactive<import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, type: string], AuthorAction>>>;
|
|
20
17
|
constructor(v: RawUser);
|
|
21
18
|
avatar?: Image;
|
|
22
19
|
name: string;
|
package/dist/lib/utils/data.d.ts
CHANGED
|
@@ -1,10 +1,46 @@
|
|
|
1
1
|
import { Raw, Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 可以结构化的数据
|
|
4
|
+
*/
|
|
2
5
|
export declare class Struct<TRaw extends object> {
|
|
3
6
|
protected $$raw: TRaw;
|
|
4
7
|
toJSON(): TRaw;
|
|
5
8
|
constructor($$raw: TRaw);
|
|
6
9
|
}
|
|
7
10
|
export type MetaData = Record<string | number, any>;
|
|
11
|
+
/**
|
|
12
|
+
* 比如有很多需要注明来自哪个插件的值都可以用
|
|
13
|
+
*/
|
|
14
|
+
export declare class SourcedValue<T extends [string, string]> {
|
|
15
|
+
separator: string;
|
|
16
|
+
toJSON(value: T | string): T;
|
|
17
|
+
parse(value: string): T;
|
|
18
|
+
toString(value: T | string): string;
|
|
19
|
+
stringify(value: T): string;
|
|
20
|
+
constructor(separator?: string);
|
|
21
|
+
}
|
|
22
|
+
export type SourcedKeyType<T extends SourcedKeyMap<any, any>> = Parameters<T['get']>[0];
|
|
23
|
+
/**
|
|
24
|
+
* 相比较于普通的Map,这个元素的key操作可以是`TKey | string`
|
|
25
|
+
* _但内部保存仍使用`SourcedValue.toString`作为key_
|
|
26
|
+
*/
|
|
27
|
+
export declare class SourcedKeyMap<TKey extends [string, string], TValue> extends SourcedValue<TKey> implements Map<string, TValue> {
|
|
28
|
+
static create<TKey extends [string, string], TValue>(separator?: string): import('vue').ShallowReactive<SourcedKeyMap<TKey, TValue>>;
|
|
29
|
+
private constructor();
|
|
30
|
+
private store;
|
|
31
|
+
get size(): number;
|
|
32
|
+
[Symbol.toStringTag]: string;
|
|
33
|
+
clear(): void;
|
|
34
|
+
delete(key: string | TKey): boolean;
|
|
35
|
+
forEach(callbackfn: (value: TValue, key: string, map: Map<string, TValue>) => void, thisArg?: any): void;
|
|
36
|
+
get(key: string | TKey): TValue | undefined;
|
|
37
|
+
has(key: string | TKey): boolean;
|
|
38
|
+
set(key: string | TKey, value: TValue): this;
|
|
39
|
+
entries(): MapIterator<[string, TValue]>;
|
|
40
|
+
keys(): MapIterator<string>;
|
|
41
|
+
values(): MapIterator<TValue>;
|
|
42
|
+
[Symbol.iterator](): MapIterator<[string, TValue]>;
|
|
43
|
+
}
|
|
8
44
|
type PromiseContentEmits<TR> = {
|
|
9
45
|
success: TR;
|
|
10
46
|
error: any;
|
package/dist/pack.tgz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
File without changes
|