@delta-comic/model 2.2.0 → 3.0.0-next.5
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/index.d.mts +546 -0
- package/dist/index.mjs +379 -0
- package/package.json +14 -23
- package/README.md +0 -42
- package/dist/index.js +0 -640
- package/dist/index.js.map +0 -1
- package/dist/lib/index.d.ts +0 -2
- package/dist/lib/model/comment.d.ts +0 -47
- package/dist/lib/model/content.d.ts +0 -36
- package/dist/lib/model/download.d.ts +0 -10
- package/dist/lib/model/ep.d.ts +0 -12
- package/dist/lib/model/image.d.ts +0 -19
- package/dist/lib/model/index.d.ts +0 -8
- package/dist/lib/model/item.d.ts +0 -104
- package/dist/lib/model/resource.d.ts +0 -34
- package/dist/lib/model/user.d.ts +0 -25
- package/dist/lib/struct/index.d.ts +0 -3
- package/dist/lib/struct/meta.d.ts +0 -19
- package/dist/lib/struct/store.d.ts +0 -36
- package/dist/lib/struct/struct.d.ts +0 -12
- package/dist/pack.tgz +0 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
import { Component } from "vue";
|
|
2
|
+
|
|
3
|
+
//#region lib/struct/store.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* 比如有很多需要注明来自哪个插件的值都可以用
|
|
6
|
+
*/
|
|
7
|
+
declare class SourcedValue<T extends [string, string]> {
|
|
8
|
+
separator: string;
|
|
9
|
+
toJSON(value: T | string): T;
|
|
10
|
+
parse(value: string): T;
|
|
11
|
+
toString(value: T | string): string;
|
|
12
|
+
stringify(value: T): string;
|
|
13
|
+
constructor(separator?: string);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 相比较于普通的Map,这个元素的key操作可以是`TKey | string`
|
|
17
|
+
* _但内部保存仍使用`SourcedValue.key.toString`作为key_
|
|
18
|
+
*/
|
|
19
|
+
declare class SourcedKeyMap<TKey extends [string, string], TValue> implements Map<string, TValue> {
|
|
20
|
+
getOrInsert(key: string | TKey, value: TValue): TValue;
|
|
21
|
+
getOrInsertComputed(key: string | TKey, compute: (key: string) => TValue): TValue;
|
|
22
|
+
static createReactive<TKey extends [string, string], TValue>(separator?: string): import("vue").ShallowReactive<SourcedKeyMap<TKey, TValue>>;
|
|
23
|
+
constructor(separator?: string);
|
|
24
|
+
key: SourcedValue<TKey>;
|
|
25
|
+
private store;
|
|
26
|
+
get size(): number;
|
|
27
|
+
[Symbol.toStringTag]: string;
|
|
28
|
+
clear(): void;
|
|
29
|
+
delete(key: string | TKey): boolean;
|
|
30
|
+
forEach(callbackfn: (value: TValue, key: string, map: Map<string, TValue>) => void, thisArg?: any): void;
|
|
31
|
+
get(key: string | TKey): TValue | undefined;
|
|
32
|
+
has(key: string | TKey): boolean;
|
|
33
|
+
set(key: string | TKey, value: TValue): this;
|
|
34
|
+
entries(): MapIterator<[string, TValue]>;
|
|
35
|
+
keys(): MapIterator<string>;
|
|
36
|
+
values(): MapIterator<TValue>;
|
|
37
|
+
[Symbol.iterator](): MapIterator<[string, TValue]>;
|
|
38
|
+
}
|
|
39
|
+
type SourcedKeyType<T extends SourcedKeyMap<[string, string], any> | SourcedValue<[string, string]>> = T extends SourcedKeyMap<infer K, any> ? K | string : T extends SourcedValue<infer K> ? K | string : never;
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region lib/struct/struct.d.ts
|
|
42
|
+
/**
|
|
43
|
+
* 可以结构化的数据,调用`toJSON`获取纯粹的json(没有get/set或method)
|
|
44
|
+
*/
|
|
45
|
+
declare class Struct<TRaw extends object> {
|
|
46
|
+
protected $$raw: TRaw;
|
|
47
|
+
toJSON(): TRaw;
|
|
48
|
+
/**
|
|
49
|
+
* @param $$raw 一个纯粹json对象,不可以是高级对象
|
|
50
|
+
*/
|
|
51
|
+
constructor($$raw: TRaw);
|
|
52
|
+
static toRaw<T extends object, TRaw = (T extends Struct<infer TR> ? TR : T)>(item: T): TRaw;
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region lib/struct/meta.d.ts
|
|
56
|
+
interface Metadatable {
|
|
57
|
+
$$meta?: Metadata;
|
|
58
|
+
$$plugin: string;
|
|
59
|
+
}
|
|
60
|
+
type Metadata = Record<string | number, any>;
|
|
61
|
+
type PageKey = string | number;
|
|
62
|
+
declare class StreamQuery<TResult, TData extends object = {}> {
|
|
63
|
+
query: (data: TData, page: PageKey, signal?: AbortSignal) => Promise<{
|
|
64
|
+
data: TResult[];
|
|
65
|
+
lastPage?: PageKey;
|
|
66
|
+
nextPage?: PageKey;
|
|
67
|
+
}>;
|
|
68
|
+
initPage: PageKey;
|
|
69
|
+
constructor(query: (data: TData, page: PageKey, signal?: AbortSignal) => Promise<{
|
|
70
|
+
data: TResult[];
|
|
71
|
+
lastPage?: PageKey;
|
|
72
|
+
nextPage?: PageKey;
|
|
73
|
+
}>, initPage: PageKey);
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region lib/struct/from.d.ts
|
|
77
|
+
interface Base {
|
|
78
|
+
info: string;
|
|
79
|
+
placeholder?: string;
|
|
80
|
+
/**
|
|
81
|
+
* @default true
|
|
82
|
+
*/
|
|
83
|
+
required?: boolean;
|
|
84
|
+
}
|
|
85
|
+
interface FormString extends Base {
|
|
86
|
+
type: 'string';
|
|
87
|
+
patten?: RegExp;
|
|
88
|
+
defaultValue?: FormDefaultValue['string'];
|
|
89
|
+
}
|
|
90
|
+
interface FormNumber extends Base {
|
|
91
|
+
type: 'number';
|
|
92
|
+
range?: [number, number];
|
|
93
|
+
float?: boolean;
|
|
94
|
+
defaultValue?: FormDefaultValue['number'];
|
|
95
|
+
}
|
|
96
|
+
interface FormRadio extends Base {
|
|
97
|
+
type: 'radio';
|
|
98
|
+
selects: {
|
|
99
|
+
label: string;
|
|
100
|
+
value: string;
|
|
101
|
+
}[];
|
|
102
|
+
comp: 'radio' | 'select';
|
|
103
|
+
defaultValue?: FormDefaultValue['radio'];
|
|
104
|
+
}
|
|
105
|
+
interface FormCheckbox extends Base {
|
|
106
|
+
type: 'checkbox';
|
|
107
|
+
selects: {
|
|
108
|
+
label: string;
|
|
109
|
+
value: string;
|
|
110
|
+
}[];
|
|
111
|
+
comp: 'checkbox' | 'multipleSelect';
|
|
112
|
+
defaultValue?: FormDefaultValue['checkbox'];
|
|
113
|
+
}
|
|
114
|
+
interface FormSwitch extends Base {
|
|
115
|
+
type: 'switch';
|
|
116
|
+
close?: string;
|
|
117
|
+
open?: string;
|
|
118
|
+
defaultValue?: FormDefaultValue['switch'];
|
|
119
|
+
}
|
|
120
|
+
interface FormDate extends Base {
|
|
121
|
+
type: 'date';
|
|
122
|
+
format: string;
|
|
123
|
+
time?: boolean;
|
|
124
|
+
defaultValue?: FormDefaultValue['date'];
|
|
125
|
+
}
|
|
126
|
+
interface FormDateRange extends Base {
|
|
127
|
+
type: 'dateRange';
|
|
128
|
+
format: string;
|
|
129
|
+
time?: boolean;
|
|
130
|
+
defaultValue?: FormDefaultValue['dateRange'];
|
|
131
|
+
}
|
|
132
|
+
interface FormPairs extends Base {
|
|
133
|
+
type: 'pairs';
|
|
134
|
+
defaultValue?: FormDefaultValue['pairs'];
|
|
135
|
+
noMultiple?: boolean;
|
|
136
|
+
}
|
|
137
|
+
interface FormDefaultValue {
|
|
138
|
+
string: string;
|
|
139
|
+
number: number;
|
|
140
|
+
radio: string;
|
|
141
|
+
checkbox: string[];
|
|
142
|
+
switch: boolean;
|
|
143
|
+
date: string;
|
|
144
|
+
pairs: {
|
|
145
|
+
key: string;
|
|
146
|
+
value: string;
|
|
147
|
+
}[];
|
|
148
|
+
dateRange: [Form: FormDefaultValue['date'], to: FormDefaultValue['date']];
|
|
149
|
+
}
|
|
150
|
+
type FormSingleConfigure = FormString | FormNumber | FormRadio | FormCheckbox | FormSwitch | FormDate | FormDateRange | FormPairs;
|
|
151
|
+
type FormSingleResult<T extends FormSingleConfigure> = FormDefaultValue[T['type']];
|
|
152
|
+
type FormConfigure = { [x in string]: FormSingleConfigure };
|
|
153
|
+
type FormResult<T extends FormConfigure> = { [K in keyof T]: FormSingleResult<T[K]> };
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region lib/model/download.d.ts
|
|
156
|
+
type UniDownloadChecksumAlgorithm = 'sha256' | 'md5';
|
|
157
|
+
interface UniDownloadChecksum {
|
|
158
|
+
algorithm: UniDownloadChecksumAlgorithm;
|
|
159
|
+
value: string;
|
|
160
|
+
}
|
|
161
|
+
/** A JSON-safe HTTP header value. Sensitive values should be passed by reference. */
|
|
162
|
+
type UniDownloadHttpHeaderValue = {
|
|
163
|
+
type: 'value';
|
|
164
|
+
value: string;
|
|
165
|
+
} | {
|
|
166
|
+
type: 'secretRef';
|
|
167
|
+
secretRef: string;
|
|
168
|
+
};
|
|
169
|
+
interface UniDownloadHttpMirror {
|
|
170
|
+
url: string;
|
|
171
|
+
/** Larger values are tried first. Mirrors with the same priority keep their declared order. */
|
|
172
|
+
priority?: number;
|
|
173
|
+
headers?: Record<string, UniDownloadHttpHeaderValue>;
|
|
174
|
+
}
|
|
175
|
+
interface UniDownloadHttpSource {
|
|
176
|
+
type: 'http';
|
|
177
|
+
mirrors: UniDownloadHttpMirror[];
|
|
178
|
+
etag?: string;
|
|
179
|
+
lastModified?: string;
|
|
180
|
+
expectedSize?: number;
|
|
181
|
+
/** Unix timestamp in milliseconds after which the source should be refreshed. */
|
|
182
|
+
expiresAt?: number;
|
|
183
|
+
}
|
|
184
|
+
type UniDownloadTorrentInput = {
|
|
185
|
+
type: 'magnet';
|
|
186
|
+
uri: string;
|
|
187
|
+
} | {
|
|
188
|
+
type: 'url';
|
|
189
|
+
url: string;
|
|
190
|
+
} | {
|
|
191
|
+
type: 'bytes';
|
|
192
|
+
base64: string;
|
|
193
|
+
};
|
|
194
|
+
type UniDownloadTorrentSeedPolicy = {
|
|
195
|
+
mode: 'none';
|
|
196
|
+
} | {
|
|
197
|
+
mode: 'ratio';
|
|
198
|
+
ratio: number;
|
|
199
|
+
} | {
|
|
200
|
+
mode: 'duration';
|
|
201
|
+
durationSeconds: number;
|
|
202
|
+
} | {
|
|
203
|
+
mode: 'ratioOrDuration';
|
|
204
|
+
ratio: number;
|
|
205
|
+
durationSeconds: number;
|
|
206
|
+
};
|
|
207
|
+
interface UniDownloadTorrentSource {
|
|
208
|
+
type: 'torrent';
|
|
209
|
+
input: UniDownloadTorrentInput;
|
|
210
|
+
/** Zero-based file indexes in torrent metadata. Omit to download every file. */
|
|
211
|
+
onlyFiles?: number[];
|
|
212
|
+
seedPolicy?: UniDownloadTorrentSeedPolicy;
|
|
213
|
+
}
|
|
214
|
+
type UniDownloadSource = UniDownloadHttpSource | UniDownloadTorrentSource;
|
|
215
|
+
/** A JSON-serializable file entry produced by a content plugin. */
|
|
216
|
+
interface UniDownloadAsset {
|
|
217
|
+
/** Stable within the containing plan and across retries. */
|
|
218
|
+
key: string;
|
|
219
|
+
/** Relative to the destination selected by the host application. */
|
|
220
|
+
relativePath: string;
|
|
221
|
+
size?: number;
|
|
222
|
+
checksum?: UniDownloadChecksum;
|
|
223
|
+
source: UniDownloadSource;
|
|
224
|
+
}
|
|
225
|
+
/** A JSON-serializable group of files that should be enqueued together. */
|
|
226
|
+
interface UniDownloadPlan {
|
|
227
|
+
/** Stable for the content represented by this plan. */
|
|
228
|
+
key: string;
|
|
229
|
+
title: string;
|
|
230
|
+
assets: UniDownloadAsset[];
|
|
231
|
+
}
|
|
232
|
+
type UniContentDownloadSelection = {
|
|
233
|
+
type: 'currentEpisode';
|
|
234
|
+
} | {
|
|
235
|
+
type: 'episodes';
|
|
236
|
+
episodeIds: string[];
|
|
237
|
+
} | {
|
|
238
|
+
type: 'allEpisodes';
|
|
239
|
+
};
|
|
240
|
+
interface UniDownloadResolveInput {
|
|
241
|
+
page: UniContentPage;
|
|
242
|
+
selection: UniContentDownloadSelection;
|
|
243
|
+
}
|
|
244
|
+
type UniDownloadRefreshSourceReason = 'expired' | 'unauthorized' | 'forbidden';
|
|
245
|
+
interface UniDownloadRefreshSourceInput {
|
|
246
|
+
page: UniContentPage;
|
|
247
|
+
planKey: string;
|
|
248
|
+
assetKey: string;
|
|
249
|
+
source: UniDownloadSource;
|
|
250
|
+
reason: UniDownloadRefreshSourceReason;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Resolves plugin-specific content into a portable download plan.
|
|
254
|
+
*
|
|
255
|
+
* Providers are runtime objects and are not serialized. Their returned plans and sources must be
|
|
256
|
+
* JSON-serializable so the native downloader can persist and resume them without a live WebView.
|
|
257
|
+
*/
|
|
258
|
+
interface UniContentDownloadProvider {
|
|
259
|
+
resolve(input: UniDownloadResolveInput, signal: AbortSignal): Promise<UniDownloadPlan>;
|
|
260
|
+
refreshSource?(input: UniDownloadRefreshSourceInput, signal: AbortSignal): Promise<UniDownloadSource>;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Legacy imperative download controller.
|
|
264
|
+
*
|
|
265
|
+
* @deprecated Register a {@link UniContentDownloadProvider} for the content type and let the native
|
|
266
|
+
* downloader own task state, persistence, and lifecycle controls. This class remains unchanged so
|
|
267
|
+
* existing plugins can migrate without an immediate breaking change.
|
|
268
|
+
*/
|
|
269
|
+
declare abstract class UniDownloader implements Metadatable {
|
|
270
|
+
abstract id: string;
|
|
271
|
+
abstract name: string;
|
|
272
|
+
abstract $$plugin: string;
|
|
273
|
+
abstract $$meta?: Metadata;
|
|
274
|
+
abstract begin: () => void;
|
|
275
|
+
abstract resume: () => void;
|
|
276
|
+
abstract pause: () => void;
|
|
277
|
+
}
|
|
278
|
+
/** @deprecated Use {@link UniContentDownloadProvider}. */
|
|
279
|
+
type UniLegacyDownloader = UniDownloader;
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region lib/model/ep.d.ts
|
|
282
|
+
interface UniEpRaw extends Metadatable {
|
|
283
|
+
name: string;
|
|
284
|
+
id: string;
|
|
285
|
+
}
|
|
286
|
+
declare class UniEp extends Struct<UniEpRaw> implements UniEpRaw {
|
|
287
|
+
name: string;
|
|
288
|
+
id: string;
|
|
289
|
+
$$plugin: string;
|
|
290
|
+
$$meta?: Metadata;
|
|
291
|
+
constructor(v: UniEpRaw);
|
|
292
|
+
}
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region lib/model/content.d.ts
|
|
295
|
+
type UniContentPageLike = new (preload: UniItem | undefined, id: string, ep: string) => UniContentPage;
|
|
296
|
+
type UniContentType_ = SourcedKeyType<typeof UniContentPage.contentPages>;
|
|
297
|
+
type UniContentType = Exclude<UniContentType_, string>;
|
|
298
|
+
type UniContentViewComponent = Component<{
|
|
299
|
+
page: UniContentPage;
|
|
300
|
+
union?: UniItem;
|
|
301
|
+
}>;
|
|
302
|
+
type UniContentLayoutComponent = Component<{
|
|
303
|
+
page: UniContentPage;
|
|
304
|
+
}, any, any, any, any, any, {
|
|
305
|
+
view(args: {
|
|
306
|
+
item?: UniItem;
|
|
307
|
+
}): any;
|
|
308
|
+
}>;
|
|
309
|
+
declare abstract class UniContentPage {
|
|
310
|
+
preload: UniItem | undefined;
|
|
311
|
+
id: string;
|
|
312
|
+
ep: string;
|
|
313
|
+
static layouts: import("vue").ShallowReactive<SourcedKeyMap<[plugin: string, name: string], UniContentLayoutComponent>>;
|
|
314
|
+
static contentPages: import("vue").ShallowReactive<SourcedKeyMap<[plugin: string, name: string], UniContentPageLike>>;
|
|
315
|
+
static downloadProviders: import("vue").ShallowReactive<SourcedKeyMap<[plugin: string, name: string], UniContentDownloadProvider>>;
|
|
316
|
+
constructor(preload: UniItem | undefined, id: string, ep: string);
|
|
317
|
+
abstract plugin: string;
|
|
318
|
+
abstract contentType: UniContentType;
|
|
319
|
+
abstract fetchShortId(signal?: AbortSignal): Promise<string>;
|
|
320
|
+
abstract fetchDetail(signal?: AbortSignal): Promise<UniItem>;
|
|
321
|
+
abstract fetchRecommends: StreamQuery<UniItem>;
|
|
322
|
+
abstract fetchComments: StreamQuery<UniComment>;
|
|
323
|
+
abstract fetchEps: StreamQuery<UniEp>;
|
|
324
|
+
abstract ViewComponent: UniContentViewComponent;
|
|
325
|
+
}
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region lib/model/resource.d.ts
|
|
328
|
+
type UniResourceProcessInstance = (nowPath: string, resource: UniResource) => Promise<[path: string, exit: boolean]>;
|
|
329
|
+
interface UniResourceProcessStep {
|
|
330
|
+
referenceName: string;
|
|
331
|
+
ignoreExit?: boolean;
|
|
332
|
+
}
|
|
333
|
+
type UniResourceProcessStep_ = UniResourceProcessStep | string;
|
|
334
|
+
interface UniResourceType {
|
|
335
|
+
type: string;
|
|
336
|
+
urls: string[];
|
|
337
|
+
test: (url: string, signal: AbortSignal) => PromiseLike<void>;
|
|
338
|
+
}
|
|
339
|
+
interface UniResourceRaw extends Metadatable {
|
|
340
|
+
pathname: string;
|
|
341
|
+
type: string;
|
|
342
|
+
processSteps?: UniResourceProcessStep_[];
|
|
343
|
+
}
|
|
344
|
+
declare class UniResource extends Struct<UniResourceRaw> implements UniResourceRaw {
|
|
345
|
+
static processInstances: import("vue").ShallowReactive<SourcedKeyMap<[plugin: string, referenceName: string], UniResourceProcessInstance>>;
|
|
346
|
+
static fork: import("vue").ShallowReactive<SourcedKeyMap<[plugin: string, type: string], UniResourceType>>;
|
|
347
|
+
static precedenceFork: import("vue").ShallowReactive<SourcedKeyMap<[plugin: string, type: string], string>>;
|
|
348
|
+
static is(value: unknown): value is UniResource;
|
|
349
|
+
static create(v: UniResourceRaw): UniResource;
|
|
350
|
+
protected constructor(v: UniResourceRaw);
|
|
351
|
+
type: string;
|
|
352
|
+
pathname: string;
|
|
353
|
+
processSteps: UniResourceProcessStep[];
|
|
354
|
+
$$meta?: Metadata;
|
|
355
|
+
$$plugin: string;
|
|
356
|
+
getUrl(): Promise<string>;
|
|
357
|
+
omittedForks: import("vue").ShallowReactive<Set<string>>;
|
|
358
|
+
getThisFork(): string;
|
|
359
|
+
localChangeFork(): boolean;
|
|
360
|
+
}
|
|
361
|
+
//#endregion
|
|
362
|
+
//#region lib/model/image.d.ts
|
|
363
|
+
interface UniImageRaw extends Metadatable {
|
|
364
|
+
path: string;
|
|
365
|
+
forkNamespace: string;
|
|
366
|
+
processSteps?: UniResourceProcessStep_[];
|
|
367
|
+
}
|
|
368
|
+
declare class UniImage extends UniResource {
|
|
369
|
+
static is(value: unknown): value is UniImage;
|
|
370
|
+
static create(v: UniResourceRaw | UniImageRaw, aspect?: UniImageAspect): UniImage;
|
|
371
|
+
protected constructor(v: UniResourceRaw | UniImageRaw, aspect?: UniImageAspect);
|
|
372
|
+
get aspect(): Partial<UniImageAspect> | undefined;
|
|
373
|
+
set aspect(v: Partial<UniImageAspect> | undefined);
|
|
374
|
+
}
|
|
375
|
+
interface UniImageAspect {
|
|
376
|
+
width: number;
|
|
377
|
+
height: number;
|
|
378
|
+
}
|
|
379
|
+
type UniImage_ = string | UniImage;
|
|
380
|
+
//#endregion
|
|
381
|
+
//#region lib/model/item.d.ts
|
|
382
|
+
interface UniItemCategory extends Metadatable {
|
|
383
|
+
name: string;
|
|
384
|
+
group: string;
|
|
385
|
+
search: {
|
|
386
|
+
keyword: string;
|
|
387
|
+
source: string;
|
|
388
|
+
sort: string;
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
interface UniItemAuthor extends Metadatable {
|
|
392
|
+
label: string;
|
|
393
|
+
icon: UniResourceRaw | UniImageRaw | string;
|
|
394
|
+
description: string;
|
|
395
|
+
/**
|
|
396
|
+
* 为空则不可订阅
|
|
397
|
+
* 否则传入的为`defineConfig`中定义的`subscribe.type`
|
|
398
|
+
*/
|
|
399
|
+
subscribe?: string;
|
|
400
|
+
actions?: string[];
|
|
401
|
+
}
|
|
402
|
+
interface UniItemRaw extends Metadatable {
|
|
403
|
+
cover: UniResourceRaw | UniImageRaw;
|
|
404
|
+
title: string;
|
|
405
|
+
id: string;
|
|
406
|
+
/** @alias tags */
|
|
407
|
+
categories: UniItemCategory[];
|
|
408
|
+
author: UniItemAuthor[];
|
|
409
|
+
viewNumber?: number;
|
|
410
|
+
likeNumber?: number;
|
|
411
|
+
commentNumber?: number;
|
|
412
|
+
isLiked?: boolean;
|
|
413
|
+
updateTime?: number;
|
|
414
|
+
customIsAI?: boolean;
|
|
415
|
+
contentType: UniContentType_;
|
|
416
|
+
length: string;
|
|
417
|
+
epLength: string;
|
|
418
|
+
description?: UniItemDescription;
|
|
419
|
+
thisEp: UniEpRaw;
|
|
420
|
+
commentSendable: boolean;
|
|
421
|
+
customIsSafe?: boolean;
|
|
422
|
+
}
|
|
423
|
+
type UniItemCardComponent = Component<{
|
|
424
|
+
item: UniItem;
|
|
425
|
+
freeHeight?: boolean;
|
|
426
|
+
disabled?: boolean;
|
|
427
|
+
type?: 'default' | 'big' | 'small';
|
|
428
|
+
class?: any;
|
|
429
|
+
style?: any;
|
|
430
|
+
}, any, any, any, any, {
|
|
431
|
+
click: [];
|
|
432
|
+
}, {
|
|
433
|
+
default(): void;
|
|
434
|
+
smallTopInfo(): void;
|
|
435
|
+
cover(): void;
|
|
436
|
+
}>;
|
|
437
|
+
type UniItemTranslator = (raw: UniItemRaw) => UniItem;
|
|
438
|
+
type UniItemDescription = string | {
|
|
439
|
+
type: 'html';
|
|
440
|
+
content: string;
|
|
441
|
+
} | {
|
|
442
|
+
type: 'text';
|
|
443
|
+
content: string;
|
|
444
|
+
};
|
|
445
|
+
declare abstract class UniItem extends Struct<UniItemRaw> implements UniItemRaw {
|
|
446
|
+
static itemTranslator: import("vue").ShallowReactive<SourcedKeyMap<[plugin: string, name: string], UniItemTranslator>>;
|
|
447
|
+
static create(raw: UniItemRaw): UniItem;
|
|
448
|
+
static authorIcon: import("vue").ShallowReactive<SourcedKeyMap<[plugin: string, name: string], Component>>;
|
|
449
|
+
static itemCards: import("vue").ShallowReactive<SourcedKeyMap<[plugin: string, name: string], UniItemCardComponent>>;
|
|
450
|
+
abstract like(): Promise<any>;
|
|
451
|
+
abstract report(): Promise<any>;
|
|
452
|
+
abstract sendComment(text: string): Promise<any>;
|
|
453
|
+
static is(value: unknown): value is UniItem;
|
|
454
|
+
cover: UniResourceRaw | UniImageRaw;
|
|
455
|
+
get $cover(): UniImage;
|
|
456
|
+
title: string;
|
|
457
|
+
id: string;
|
|
458
|
+
categories: UniItemCategory[];
|
|
459
|
+
author: UniItemAuthor[];
|
|
460
|
+
viewNumber?: number;
|
|
461
|
+
likeNumber?: number;
|
|
462
|
+
commentNumber?: number;
|
|
463
|
+
isLiked?: boolean;
|
|
464
|
+
description?: UniItemDescription;
|
|
465
|
+
updateTime?: number;
|
|
466
|
+
contentType: UniContentType;
|
|
467
|
+
length: string;
|
|
468
|
+
epLength: string;
|
|
469
|
+
$$plugin: string;
|
|
470
|
+
$$meta: Metadata | undefined;
|
|
471
|
+
thisEp: UniEpRaw;
|
|
472
|
+
customIsSafe?: boolean;
|
|
473
|
+
get $thisEp(): UniEp;
|
|
474
|
+
constructor(v: UniItemRaw);
|
|
475
|
+
commentSendable: boolean;
|
|
476
|
+
customIsAI?: boolean;
|
|
477
|
+
get $isAi(): boolean;
|
|
478
|
+
}
|
|
479
|
+
//#endregion
|
|
480
|
+
//#region lib/model/user.d.ts
|
|
481
|
+
interface UniUserRaw extends Metadatable {
|
|
482
|
+
avatar?: UniResourceRaw;
|
|
483
|
+
name: string;
|
|
484
|
+
id: string;
|
|
485
|
+
}
|
|
486
|
+
declare abstract class UniUser {
|
|
487
|
+
static userBase: import("vue").ShallowReactive<Map<string, UniUser>>;
|
|
488
|
+
static userEditorBase: import("vue").ShallowReactive<Map<string, Component>>;
|
|
489
|
+
static userCards: import("vue").ShallowReactive<Map<string, UniUserCardComponent>>;
|
|
490
|
+
constructor(v: UniUserRaw);
|
|
491
|
+
avatar?: UniImage;
|
|
492
|
+
name: string;
|
|
493
|
+
id: string;
|
|
494
|
+
$$plugin: string;
|
|
495
|
+
$$meta?: Metadata;
|
|
496
|
+
abstract customUser: object;
|
|
497
|
+
}
|
|
498
|
+
type UniUserCardComponent = Component<{
|
|
499
|
+
user: UniUser;
|
|
500
|
+
isSmall?: boolean;
|
|
501
|
+
}>;
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region lib/model/comment.d.ts
|
|
504
|
+
interface UniCommentRaw extends Metadatable {
|
|
505
|
+
sender: UniUser;
|
|
506
|
+
content: {
|
|
507
|
+
type: 'string' | 'html';
|
|
508
|
+
text: string;
|
|
509
|
+
};
|
|
510
|
+
time: number;
|
|
511
|
+
id: string;
|
|
512
|
+
childrenCount: number;
|
|
513
|
+
likeCount: number;
|
|
514
|
+
isLiked: boolean;
|
|
515
|
+
reported: boolean;
|
|
516
|
+
isTop: boolean;
|
|
517
|
+
}
|
|
518
|
+
type UniCommentRow = Component<{
|
|
519
|
+
comment: UniComment;
|
|
520
|
+
item: UniItem;
|
|
521
|
+
parentComment?: UniComment;
|
|
522
|
+
}>;
|
|
523
|
+
declare abstract class UniComment extends Struct<UniCommentRaw> implements UniCommentRaw {
|
|
524
|
+
static commentRow: import("vue").ShallowReactive<SourcedKeyMap<[plugin: string, name: string], UniCommentRow>>;
|
|
525
|
+
constructor(v: UniCommentRaw);
|
|
526
|
+
abstract sender: UniUser;
|
|
527
|
+
content: {
|
|
528
|
+
type: 'string' | 'html';
|
|
529
|
+
text: string;
|
|
530
|
+
};
|
|
531
|
+
time: number;
|
|
532
|
+
id: string;
|
|
533
|
+
childrenCount: number;
|
|
534
|
+
likeCount: number;
|
|
535
|
+
isTop: boolean;
|
|
536
|
+
isLiked: boolean;
|
|
537
|
+
reported: boolean;
|
|
538
|
+
$$plugin: string;
|
|
539
|
+
$$meta?: Metadata;
|
|
540
|
+
abstract like(signal?: AbortSignal): PromiseLike<boolean>;
|
|
541
|
+
abstract report(signal?: AbortSignal): PromiseLike<any>;
|
|
542
|
+
abstract sendComment(text: string, signal?: AbortSignal): PromiseLike<any>;
|
|
543
|
+
abstract fetchChildren: StreamQuery<UniComment>;
|
|
544
|
+
}
|
|
545
|
+
//#endregion
|
|
546
|
+
export { Base, FormCheckbox, FormConfigure, FormDate, FormDateRange, FormDefaultValue, FormNumber, FormPairs, FormRadio, FormResult, FormSingleConfigure, FormSingleResult, FormString, FormSwitch, Metadata, Metadatable, PageKey, SourcedKeyMap, SourcedKeyType, SourcedValue, StreamQuery, Struct, UniComment, UniCommentRaw, UniCommentRow, UniContentDownloadProvider, UniContentDownloadSelection, UniContentLayoutComponent, UniContentPage, UniContentPageLike, UniContentType, UniContentType_, UniContentViewComponent, UniDownloadAsset, UniDownloadChecksum, UniDownloadChecksumAlgorithm, UniDownloadHttpHeaderValue, UniDownloadHttpMirror, UniDownloadHttpSource, UniDownloadPlan, UniDownloadRefreshSourceInput, UniDownloadRefreshSourceReason, UniDownloadResolveInput, UniDownloadSource, UniDownloadTorrentInput, UniDownloadTorrentSeedPolicy, UniDownloadTorrentSource, UniDownloader, UniEp, UniEpRaw, UniImage, UniImageAspect, UniImageRaw, UniImage_, UniItem, UniItemAuthor, UniItemCardComponent, UniItemCategory, UniItemDescription, UniItemRaw, UniItemTranslator, UniLegacyDownloader, UniResource, UniResourceProcessInstance, UniResourceProcessStep, UniResourceProcessStep_, UniResourceRaw, UniResourceType, UniUser, UniUserCardComponent, UniUserRaw };
|