@delta-comic/plugin 3.0.0-next.7 → 3.0.0-next.9
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/lib/index.d.mts +945 -748
- package/dist/lib/index.mjs +2002 -126
- package/dist/lib/index.mjs.map +1 -1
- package/dist/vite/index.d.mts +2 -3
- package/dist/vite/index.mjs +1 -1
- package/dist/vite/index.mjs.map +1 -1
- package/package.json +18 -17
- package/dist/global-BSAsAv3E.mjs +0 -1443
- package/dist/global-BSAsAv3E.mjs.map +0 -1
- package/dist/native-CHH-Olpj.mjs +0 -63
- package/dist/native-CHH-Olpj.mjs.map +0 -1
- package/dist/runtime-Dk50hXwU.mjs +0 -663
- package/dist/runtime-Dk50hXwU.mjs.map +0 -1
- package/dist/storage-DMKDlPzl.mjs +0 -351
- package/dist/storage-DMKDlPzl.mjs.map +0 -1
package/dist/lib/index.d.mts
CHANGED
|
@@ -1,116 +1,59 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DELTA_COMIC_PLUGIN_API_VERSION, FormConfigure, FormDefaultValue, FormResult, FormSingleConfigure, FormSingleResult, PluginManifest, PluginManifest as PluginManifest$1, StreamQuery, UniCommentRow, UniContentDownloadProvider, UniContentLayoutComponent, UniContentPage, UniContentPageLike, UniContentType_, UniImage, UniItem, UniItemAuthor, UniItemCardComponent, UniItemRaw, UniItemTranslator, UniResourceProcessInstance, UniResourceType, UniUserCardComponent } from "@delta-comic/model";
|
|
2
2
|
import { App, Component, MaybeRefOrGetter, Raw, Ref } from "vue";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
//#region lib/configPointer.d.ts
|
|
3
|
+
import { PluginArchiveDB } from "@delta-comic/db";
|
|
4
|
+
//#region lib/api/config.d.ts
|
|
7
5
|
type ConfigDescription = Record<string, Required<Pick<FormSingleConfigure, 'defaultValue'>> & FormSingleConfigure>;
|
|
8
6
|
type UnwrapConfigPointer<T extends ConfigPointer> = T['_type'];
|
|
9
7
|
declare class ConfigPointer<T extends ConfigDescription = ConfigDescription> {
|
|
10
|
-
pluginName: string;
|
|
11
|
-
config: T;
|
|
12
|
-
configName: string;
|
|
8
|
+
readonly pluginName: string;
|
|
9
|
+
readonly config: T;
|
|
10
|
+
readonly configName: string;
|
|
13
11
|
readonly key: symbol;
|
|
14
12
|
readonly _type: T;
|
|
15
13
|
constructor(pluginName: string, config: T, configName: string);
|
|
16
14
|
}
|
|
17
15
|
//#endregion
|
|
18
|
-
//#region lib/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
interface PluginI18nAdapter {
|
|
24
|
-
setLocaleMessage(locale: string, message: PluginLocaleMessage): void;
|
|
25
|
-
translate?(key: string, params?: Record<string, number | string>): string;
|
|
26
|
-
}
|
|
27
|
-
declare class PluginI18nRegistry {
|
|
28
|
-
private adapter?;
|
|
29
|
-
private baseMessages;
|
|
30
|
-
private readonly pluginMessages;
|
|
31
|
-
install(adapter: PluginI18nAdapter, baseMessages: PluginLocaleMessages): void;
|
|
32
|
-
register(plugin: string, messages: PluginLocaleMessages): void;
|
|
33
|
-
remove(plugin: string): void;
|
|
34
|
-
translate(key: string, params?: Record<string, number | string>): string;
|
|
35
|
-
private compose;
|
|
36
|
-
private locales;
|
|
37
|
-
private refresh;
|
|
16
|
+
//#region lib/api/env.d.ts
|
|
17
|
+
type Platform = 'tauri' | 'web';
|
|
18
|
+
interface ConfigEnv {
|
|
19
|
+
safe: boolean;
|
|
20
|
+
platform: Platform;
|
|
38
21
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
declare
|
|
42
|
-
|
|
43
|
-
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region lib/api/host.d.ts
|
|
24
|
+
declare module '@delta-comic/utils' {
|
|
25
|
+
interface SharedFunctions {
|
|
26
|
+
routeToContent(contentType: UniContentType_, id: string, ep: string, preload?: UniItem): Promise<unknown>;
|
|
27
|
+
routeToSearch(input: string, source?: [plugin: string, method: string], sort?: string): Promise<unknown>;
|
|
28
|
+
pushShareToken(token: string): Promise<unknown>;
|
|
29
|
+
}
|
|
44
30
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
tokenListen: ShareToken[];
|
|
31
|
+
declare namespace remote_d_exports {
|
|
32
|
+
export { Definition, RemoteModel, TestFunction, TestGroup };
|
|
48
33
|
}
|
|
49
|
-
|
|
50
|
-
|
|
34
|
+
type RemoteModel = TestGroup[];
|
|
35
|
+
interface TestGroup {
|
|
51
36
|
name: string;
|
|
52
|
-
|
|
53
|
-
|
|
37
|
+
test: TestFunction;
|
|
38
|
+
remotes: Definition[];
|
|
39
|
+
allowNoConnected?: boolean;
|
|
54
40
|
}
|
|
55
|
-
interface
|
|
56
|
-
title: string;
|
|
57
|
-
detail: string;
|
|
58
|
-
onPositive(): void;
|
|
59
|
-
onNegative(): void;
|
|
60
|
-
}
|
|
61
|
-
interface InitiativeItem {
|
|
62
|
-
key: string;
|
|
41
|
+
interface Definition {
|
|
63
42
|
name: string;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
filter(page: UniContentPage): boolean;
|
|
70
|
-
}
|
|
71
|
-
declare namespace content_d_exports {
|
|
72
|
-
export { Config$6 as Config };
|
|
73
|
-
}
|
|
74
|
-
type Config$6 = Record<string, {
|
|
75
|
-
itemCard?: UniItemCardComponent;
|
|
76
|
-
commentRow?: UniCommentRow;
|
|
77
|
-
layout?: UniContentLayoutComponent;
|
|
78
|
-
contentPage?: UniContentPageLike;
|
|
79
|
-
downloadProvider?: UniContentDownloadProvider;
|
|
80
|
-
itemTranslator?: UniItemTranslator;
|
|
81
|
-
}>;
|
|
82
|
-
declare namespace subscribe_d_exports {
|
|
83
|
-
export { Config$5 as Config };
|
|
84
|
-
}
|
|
85
|
-
interface Config$5 {
|
|
86
|
-
getUpdateList(olds: {
|
|
87
|
-
author: UniItemAuthor;
|
|
88
|
-
list: UniItem[];
|
|
89
|
-
}[], signal: AbortSignal): PromiseLike<{
|
|
90
|
-
isUpdated: boolean;
|
|
91
|
-
whichUpdated: UniItemAuthor[];
|
|
92
|
-
}>;
|
|
93
|
-
onAdd?(author: UniItemAuthor): any;
|
|
94
|
-
onRemove?(author: UniItemAuthor): any;
|
|
95
|
-
fetchAuthorContent: StreamQuery<UniItem, {
|
|
96
|
-
author: UniItemAuthor;
|
|
97
|
-
}>;
|
|
43
|
+
url: string;
|
|
44
|
+
/**
|
|
45
|
+
* cover root `test` method
|
|
46
|
+
*/
|
|
47
|
+
test?: TestFunction;
|
|
98
48
|
}
|
|
49
|
+
type TestFunction = (url: string, signal: AbortSignal) => Promise<void>;
|
|
99
50
|
declare namespace user_d_exports {
|
|
100
|
-
export { ActionPageItem,
|
|
51
|
+
export { ActionPageItem, Auth, CallbackResult, Favourites, InjectCode, Method, Selection, UserAction, UserActionPage, UserModel };
|
|
101
52
|
}
|
|
102
|
-
interface
|
|
53
|
+
interface UserModel {
|
|
54
|
+
auth: Auth;
|
|
103
55
|
edit?: Component;
|
|
104
56
|
card?: UniUserCardComponent;
|
|
105
|
-
authorIcon?: Record<string, Component>;
|
|
106
|
-
/**
|
|
107
|
-
* 1. download
|
|
108
|
-
* 2. upload (收藏那些云端未收藏的漫画)
|
|
109
|
-
*/
|
|
110
|
-
syncFavourite?: {
|
|
111
|
-
download: () => PromiseLike<UniItem[]>;
|
|
112
|
-
upload: (items: UniItemRaw[]) => PromiseLike<any>;
|
|
113
|
-
};
|
|
114
57
|
/**
|
|
115
58
|
* 你希望展示的(`userActions`)自己的板块的页面
|
|
116
59
|
*/
|
|
@@ -118,11 +61,44 @@ interface Config$4 {
|
|
|
118
61
|
/**
|
|
119
62
|
* 在用户界面,在历史记录那个板块的下方,你希望展示的自己的板块
|
|
120
63
|
*/
|
|
121
|
-
userActions?:
|
|
64
|
+
userActions?: UserAction[];
|
|
65
|
+
favourites: Favourites;
|
|
66
|
+
}
|
|
67
|
+
interface Auth {
|
|
68
|
+
selections: Selection[];
|
|
69
|
+
/**
|
|
70
|
+
* @returns `string` -> id; `false` -> by user; `true` -> no auth
|
|
71
|
+
*/
|
|
72
|
+
default: () => Promise<string | boolean>;
|
|
73
|
+
}
|
|
74
|
+
interface Selection {
|
|
75
|
+
name: string;
|
|
76
|
+
id: string;
|
|
77
|
+
call: (by: Method) => Promise<void>;
|
|
78
|
+
}
|
|
79
|
+
type Method = {
|
|
80
|
+
form<T extends FormConfigure>(form: T): Promise<{ [x in keyof T]: FormSingleResult<T[x]>; }>;
|
|
81
|
+
/**
|
|
82
|
+
* @param injectCode 你可以在js调用`callback(...)`来完成鉴权,传值为你给的回调
|
|
83
|
+
*/
|
|
84
|
+
website<T>(url: string, injectCode: InjectCode): Promise<CallbackResult<T>>;
|
|
85
|
+
};
|
|
86
|
+
interface InjectCode {
|
|
87
|
+
js: string;
|
|
88
|
+
css: string;
|
|
89
|
+
}
|
|
90
|
+
interface CallbackResult<T> {
|
|
91
|
+
callbackValue: T;
|
|
92
|
+
cookie: string;
|
|
93
|
+
localStorage: Record<string, string>;
|
|
94
|
+
sessionStorage: Record<string, string>;
|
|
95
|
+
href: string;
|
|
96
|
+
title: string;
|
|
122
97
|
}
|
|
123
98
|
interface UserAction {
|
|
124
99
|
call(author: UniItemAuthor): any;
|
|
125
100
|
name: string;
|
|
101
|
+
id: string;
|
|
126
102
|
icon?: Component;
|
|
127
103
|
}
|
|
128
104
|
interface UserActionPage {
|
|
@@ -144,120 +120,77 @@ type ActionPageItem = {
|
|
|
144
120
|
icon?: Component;
|
|
145
121
|
value: MaybeRefOrGetter<string | number>;
|
|
146
122
|
};
|
|
147
|
-
|
|
148
|
-
|
|
123
|
+
interface Favourites {
|
|
124
|
+
download: (signal: AbortSignal) => Promise<UniItem[]>;
|
|
125
|
+
upload: (items: UniItemRaw[], signal: AbortSignal) => Promise<void>;
|
|
149
126
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* error -> 不可用
|
|
154
|
-
* other -> 可用并比对时间
|
|
155
|
-
*/
|
|
156
|
-
test: (fork: string, signal: AbortSignal) => PromiseLike<void>;
|
|
157
|
-
}
|
|
158
|
-
declare namespace otherProgress_d_exports {
|
|
159
|
-
export { Config$2 as Config, OtherProgressRunnerOptions, runOtherProgress };
|
|
160
|
-
}
|
|
161
|
-
interface Config$2 {
|
|
162
|
-
/** Run immediately with adjacent async steps; a trailing async group does not block loading. */
|
|
163
|
-
async?: boolean;
|
|
164
|
-
call: (setDescription: (description: string) => void) => PromiseLike<any>;
|
|
165
|
-
name: string;
|
|
127
|
+
declare namespace expose_d_exports {
|
|
128
|
+
export { ExposeModel };
|
|
166
129
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
description: string;
|
|
171
|
-
name: string;
|
|
172
|
-
}) => void;
|
|
130
|
+
type ExposeModel = Record<string, any>;
|
|
131
|
+
declare namespace content_d_exports {
|
|
132
|
+
export { AutoCompleteProvider, Barcode, Category, ContentModel, HotCategory, HotLevelboard, HotPageContent, HotSearchProvider, HotTopButton, ItemProvider, Model, Promotes, Search, SearchAim, SearchMethod, Tabbar };
|
|
173
133
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
declare namespace search_d_exports {
|
|
179
|
-
export { Barcode, Category, Config$1 as Config, HotLevelboard, HotMainList, HotSearchItem, HotSearchProvider, HotSearchTarget, HotTopButton, ItemProvider, RouteToContent, SearchMethod, Tabbar };
|
|
134
|
+
interface ContentModel {
|
|
135
|
+
models?: Model[];
|
|
136
|
+
search?: Search;
|
|
137
|
+
promotes?: Promotes;
|
|
180
138
|
}
|
|
181
|
-
interface
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
mainListCard?: HotMainList[];
|
|
193
|
-
};
|
|
139
|
+
interface Model {
|
|
140
|
+
name: string;
|
|
141
|
+
ItemCard?: UniItemCardComponent;
|
|
142
|
+
CommentRow?: UniCommentRow;
|
|
143
|
+
Layout?: UniContentLayoutComponent;
|
|
144
|
+
ContentPage?: UniContentPageLike;
|
|
145
|
+
DownloadProvider?: UniContentDownloadProvider;
|
|
146
|
+
ItemTranslator?: UniItemTranslator;
|
|
147
|
+
}
|
|
148
|
+
interface Search {
|
|
149
|
+
methods: SearchMethod[];
|
|
194
150
|
barcode?: Barcode[];
|
|
195
|
-
|
|
196
|
-
hotSearch?: HotSearchProvider[];
|
|
197
|
-
fetchRandomItems?: ItemProvider;
|
|
151
|
+
getHotSearch: HotSearchProvider;
|
|
198
152
|
}
|
|
199
|
-
type
|
|
153
|
+
type HotSearchProvider = (signal: AbortSignal) => Promise<SearchAim[]>;
|
|
200
154
|
interface SearchMethod {
|
|
201
155
|
name: string;
|
|
156
|
+
id: string;
|
|
202
157
|
sorts: {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
158
|
+
options: {
|
|
159
|
+
label: string;
|
|
160
|
+
id: string;
|
|
161
|
+
}[];
|
|
162
|
+
default: string;
|
|
163
|
+
};
|
|
207
164
|
fetchSearchResult: StreamQuery<UniItem, {
|
|
208
|
-
|
|
209
|
-
sort: string;
|
|
165
|
+
aim: SearchAim;
|
|
210
166
|
}>;
|
|
211
|
-
getAutoComplete
|
|
212
|
-
text: string;
|
|
213
|
-
value: string;
|
|
214
|
-
} | Component)[]>;
|
|
215
|
-
}
|
|
216
|
-
interface HotSearchTarget {
|
|
217
|
-
/** Search method key declared by the same plugin. */
|
|
218
|
-
method: string;
|
|
219
|
-
/** Falls back to the search method's default sort when omitted. */
|
|
220
|
-
sort?: string;
|
|
221
|
-
}
|
|
222
|
-
interface HotSearchItem {
|
|
223
|
-
text: string;
|
|
224
|
-
/** Search input used after selection. Defaults to `text`. */
|
|
225
|
-
value?: string;
|
|
226
|
-
badge?: {
|
|
227
|
-
text: string;
|
|
228
|
-
tone?: 'accent' | 'warning';
|
|
229
|
-
};
|
|
230
|
-
/** Overrides the provider target for this item. */
|
|
231
|
-
target?: HotSearchTarget;
|
|
167
|
+
getAutoComplete: AutoCompleteProvider;
|
|
232
168
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
content: ItemProvider;
|
|
169
|
+
type AutoCompleteProvider = (input: string, signal: AbortSignal) => Promise<SearchAim[] | Component>;
|
|
170
|
+
interface SearchAim {
|
|
171
|
+
input: string;
|
|
172
|
+
search: {
|
|
173
|
+
method: string;
|
|
174
|
+
sort?: string;
|
|
175
|
+
};
|
|
241
176
|
}
|
|
242
|
-
interface
|
|
177
|
+
interface Barcode {
|
|
243
178
|
name: string;
|
|
244
|
-
|
|
245
|
-
|
|
179
|
+
id: string;
|
|
180
|
+
getTipText: (aim: SearchAim) => string;
|
|
181
|
+
isMatch: (aim: SearchAim) => boolean;
|
|
246
182
|
}
|
|
247
|
-
interface
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
183
|
+
interface Promotes {
|
|
184
|
+
tabbar?: Tabbar[];
|
|
185
|
+
categories?: Category[];
|
|
186
|
+
hotPageContent?: HotPageContent;
|
|
187
|
+
fetchRandomItems?: ItemProvider;
|
|
252
188
|
}
|
|
189
|
+
type ItemProvider = (signal: AbortSignal) => Promise<UniItem[]>;
|
|
253
190
|
interface Category {
|
|
254
191
|
title: string;
|
|
255
192
|
namespace: string;
|
|
256
|
-
search:
|
|
257
|
-
methodId: string;
|
|
258
|
-
input: string;
|
|
259
|
-
sort: string;
|
|
260
|
-
};
|
|
193
|
+
search: SearchAim;
|
|
261
194
|
}
|
|
262
195
|
interface Tabbar {
|
|
263
196
|
title: string;
|
|
@@ -267,124 +200,851 @@ interface Tabbar {
|
|
|
267
200
|
tabbar: Tabbar;
|
|
268
201
|
}>;
|
|
269
202
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
getContent: (searchText: string, signal: AbortSignal) => PromiseLike<Parameters<RouteToContent>>;
|
|
203
|
+
interface HotPageContent {
|
|
204
|
+
levelboard?: HotLevelboard[];
|
|
205
|
+
topButton?: HotTopButton[];
|
|
206
|
+
categories?: HotCategory[];
|
|
207
|
+
}
|
|
208
|
+
interface HotLevelboard {
|
|
277
209
|
name: string;
|
|
210
|
+
id: string;
|
|
211
|
+
content: ItemProvider;
|
|
278
212
|
}
|
|
279
|
-
|
|
280
|
-
|
|
213
|
+
interface HotCategory {
|
|
214
|
+
name: string;
|
|
215
|
+
content: ItemProvider;
|
|
281
216
|
}
|
|
282
|
-
interface
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
217
|
+
interface HotTopButton {
|
|
218
|
+
name: string;
|
|
219
|
+
icon: Component;
|
|
220
|
+
bgColor: string;
|
|
286
221
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* @param injectCode 你可以在js调用`callback(...)`来完成鉴权,传值为你给的回调
|
|
291
|
-
*/
|
|
292
|
-
website<T>(url: string, injectCode: InjectCode): Promise<CallbackResult<T>>;
|
|
293
|
-
};
|
|
294
|
-
interface InjectCode {
|
|
295
|
-
js: string;
|
|
296
|
-
css: string;
|
|
222
|
+
declare namespace social_d_exports {
|
|
223
|
+
export { InitiativeItem, Share, SharePopupConfig, ShareToken, SocialModel, Subscribe, SubscribeListProvider };
|
|
297
224
|
}
|
|
298
|
-
interface
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
225
|
+
interface SocialModel {
|
|
226
|
+
share?: Share;
|
|
227
|
+
subscribe?: Subscribe;
|
|
228
|
+
}
|
|
229
|
+
interface Share {
|
|
230
|
+
initiative?: InitiativeItem[];
|
|
231
|
+
tokenListen?: ShareToken[];
|
|
232
|
+
}
|
|
233
|
+
interface ShareToken {
|
|
234
|
+
key: string;
|
|
235
|
+
name: string;
|
|
236
|
+
isMatched(chipboard: string): boolean;
|
|
237
|
+
show(chipboard: string): Promise<SharePopupConfig>;
|
|
238
|
+
}
|
|
239
|
+
interface SharePopupConfig {
|
|
304
240
|
title: string;
|
|
241
|
+
detail: string;
|
|
242
|
+
onPositive(): void;
|
|
243
|
+
onNegative(): void;
|
|
244
|
+
}
|
|
245
|
+
interface InitiativeItem {
|
|
246
|
+
key: string;
|
|
247
|
+
name: string;
|
|
248
|
+
icon: Component | UniImage;
|
|
249
|
+
bgColor?: string;
|
|
250
|
+
call(page: UniContentPage): Promise<{
|
|
251
|
+
token?: string;
|
|
252
|
+
} | void>;
|
|
253
|
+
filter(page: UniContentPage): boolean;
|
|
254
|
+
}
|
|
255
|
+
interface Subscribe {
|
|
256
|
+
getUpdateList: SubscribeListProvider;
|
|
257
|
+
fetchAuthorContent: StreamQuery<UniItem, {
|
|
258
|
+
author: UniItemAuthor;
|
|
259
|
+
}>;
|
|
260
|
+
}
|
|
261
|
+
type SubscribeListProvider = (olds: {
|
|
262
|
+
author: UniItemAuthor;
|
|
263
|
+
list: UniItem[];
|
|
264
|
+
}[], signal: AbortSignal) => Promise<{
|
|
265
|
+
isUpdated: boolean;
|
|
266
|
+
whichUpdated: UniItemAuthor[];
|
|
267
|
+
}>;
|
|
268
|
+
declare namespace special_d_exports {
|
|
269
|
+
export { SpecialModel, Step };
|
|
270
|
+
}
|
|
271
|
+
type SpecialModel = Step[];
|
|
272
|
+
interface Step {
|
|
273
|
+
name: string;
|
|
274
|
+
call: (setDescription: (description: string) => void) => Promise<void>;
|
|
305
275
|
}
|
|
306
276
|
declare namespace resource_d_exports {
|
|
307
|
-
export {
|
|
277
|
+
export { ResourceModel };
|
|
308
278
|
}
|
|
309
|
-
|
|
279
|
+
/** Declarative resource schemes and their pathname processors. */
|
|
280
|
+
interface ResourceModel {
|
|
310
281
|
process?: Record<string, UniResourceProcessInstance>;
|
|
311
282
|
types?: UniResourceType[];
|
|
312
283
|
}
|
|
313
284
|
//#endregion
|
|
314
|
-
//#region lib/
|
|
315
|
-
interface
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
i18n?: PluginLocaleMessages;
|
|
324
|
-
otherProgress?: Config$2[];
|
|
325
|
-
search?: Config$1;
|
|
326
|
-
/**
|
|
327
|
-
* 插件的配置项需在此处注册
|
|
328
|
-
* 传入`Store.ConfigPointer`
|
|
329
|
-
*/
|
|
330
|
-
config?: ConfigPointer[];
|
|
331
|
-
subscribe?: Record<string, Config$5>;
|
|
332
|
-
share?: Config$7;
|
|
285
|
+
//#region lib/api/model/index.d.ts
|
|
286
|
+
interface PluginConfigModel {
|
|
287
|
+
remotes?: RemoteModel;
|
|
288
|
+
resource?: ResourceModel;
|
|
289
|
+
user?: UserModel;
|
|
290
|
+
content?: ContentModel;
|
|
291
|
+
social?: SocialModel;
|
|
292
|
+
expose?: ExposeModel;
|
|
293
|
+
special?: SpecialModel;
|
|
333
294
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
295
|
+
//#endregion
|
|
296
|
+
//#region lib/api/hook/content.d.ts
|
|
297
|
+
interface ContentHooks {
|
|
298
|
+
onSearchBarcodeSubmit(searchAim: SearchAim): void;
|
|
299
|
+
onHotCategoryClick(category: HotCategory): void;
|
|
300
|
+
onHotTopButtonClick(button: HotTopButton): void;
|
|
301
|
+
}
|
|
302
|
+
//#endregion
|
|
303
|
+
//#region lib/api/hook/remote.d.ts
|
|
304
|
+
interface RemoteHooks {
|
|
305
|
+
onRemoteTestDone(group: TestGroup, remote: Definition | false): void;
|
|
306
|
+
}
|
|
307
|
+
//#endregion
|
|
308
|
+
//#region lib/api/hook/social.d.ts
|
|
309
|
+
interface SocialHooks {
|
|
310
|
+
onSubscribeOne?(author: UniItemAuthor): void;
|
|
311
|
+
onUnsubscribeOne?(author: UniItemAuthor): void;
|
|
312
|
+
}
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region lib/api/hook/lifecycle.d.ts
|
|
315
|
+
type PluginLifecycleCleanup = () => Promise<void> | void;
|
|
316
|
+
interface LifecycleHooks {
|
|
339
317
|
/** Runs after app.use() registration and before app.mount() for preboot plugins. */
|
|
340
318
|
onPreboot?(context: {
|
|
341
319
|
app: App;
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
}): (() => Promise<void> | void) | Promise<(() => Promise<void> | void) | void> | void;
|
|
345
|
-
/**
|
|
346
|
-
* 返回值如果不为空,则会await后作为expose暴露
|
|
347
|
-
*/
|
|
348
|
-
onBooted?(ins: DefineResult): (PromiseLike<object> | object) | void;
|
|
320
|
+
}): PluginLifecycleCleanup | Promise<PluginLifecycleCleanup | void> | void;
|
|
321
|
+
onBooted?(): Promise<void> | void;
|
|
349
322
|
/** Runs before a normal plugin is reloaded or the runtime is disposed. */
|
|
350
323
|
onUnload?(): Promise<void> | void;
|
|
351
324
|
/** Runs once before an installed plugin and its persisted files are removed. */
|
|
352
325
|
onUninstall?(): Promise<void> | void;
|
|
353
326
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
327
|
+
//#endregion
|
|
328
|
+
//#region lib/api/hook/index.d.ts
|
|
329
|
+
type PluginConfigHooks = Partial<RemoteHooks & ContentHooks & SocialHooks & LifecycleHooks>;
|
|
330
|
+
//#endregion
|
|
331
|
+
//#region lib/api/i18n.d.ts
|
|
332
|
+
interface PluginLocaleMessage {
|
|
333
|
+
[key: string]: PluginLocaleMessage | string;
|
|
334
|
+
}
|
|
335
|
+
type PluginLocaleMessages = Record<string, PluginLocaleMessage>;
|
|
336
|
+
//#endregion
|
|
337
|
+
//#region lib/api/plugin.d.ts
|
|
338
|
+
interface DCPluginConfig {
|
|
339
|
+
/** Stable plugin id. It must equal the candidate manifest id. */
|
|
340
|
+
name: string;
|
|
341
|
+
/** At most one declarative configuration form can be contributed by a plugin. */
|
|
342
|
+
config?: ConfigPointer;
|
|
343
|
+
i18n?: PluginLocaleMessages;
|
|
344
|
+
model?: PluginConfigModel;
|
|
345
|
+
hooks?: PluginConfigHooks;
|
|
358
346
|
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
type
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
347
|
+
type PluginConfigFactory<T extends DCPluginConfig = DCPluginConfig> = (env: ConfigEnv) => T;
|
|
348
|
+
declare const defineDeltaComicPlugin: <T extends DCPluginConfig>(config: T | PluginConfigFactory<T>) => PluginConfigFactory<T>;
|
|
349
|
+
//#endregion
|
|
350
|
+
//#region lib/kernel/candidate.d.ts
|
|
351
|
+
type PluginOrigin = 'builtin' | 'installed';
|
|
352
|
+
interface PluginManagementCapabilities {
|
|
353
|
+
readonly canDisable: boolean;
|
|
354
|
+
readonly canUninstall: boolean;
|
|
355
|
+
readonly canUpdate: boolean;
|
|
356
|
+
}
|
|
357
|
+
interface LoadedPluginModule {
|
|
358
|
+
readonly factory: PluginConfigFactory;
|
|
359
|
+
dispose?(): Promise<void> | void;
|
|
360
|
+
}
|
|
361
|
+
interface PluginCandidate {
|
|
362
|
+
readonly manifest: PluginManifest$1;
|
|
363
|
+
readonly origin: PluginOrigin;
|
|
364
|
+
readonly enabled: boolean;
|
|
365
|
+
readonly management: PluginManagementCapabilities;
|
|
366
|
+
load(signal: AbortSignal): Promise<LoadedPluginModule>;
|
|
367
|
+
}
|
|
368
|
+
interface PluginCandidateProvider {
|
|
369
|
+
readonly id: string;
|
|
370
|
+
list(signal: AbortSignal): Promise<readonly PluginCandidate[]>;
|
|
371
|
+
}
|
|
372
|
+
interface InternalPluginDefinition {
|
|
373
|
+
readonly manifest: PluginManifest$1;
|
|
374
|
+
readonly factory: PluginConfigFactory;
|
|
375
|
+
readonly canDisable?: boolean;
|
|
376
|
+
readonly enabledByDefault?: boolean;
|
|
377
|
+
}
|
|
378
|
+
declare const defineInternalPlugin: <T extends InternalPluginDefinition>(definition: T) => T;
|
|
379
|
+
//#endregion
|
|
380
|
+
//#region lib/kernel/scope.d.ts
|
|
381
|
+
type PluginDisposer = () => Promise<void> | void;
|
|
382
|
+
declare class PluginScope {
|
|
383
|
+
#private;
|
|
384
|
+
readonly owner: string;
|
|
385
|
+
constructor(owner: string);
|
|
386
|
+
get signal(): AbortSignal;
|
|
387
|
+
get disposed(): boolean;
|
|
388
|
+
defer(disposer: PluginDisposer): PluginDisposer;
|
|
389
|
+
dispose(reason?: unknown): Promise<void>;
|
|
390
|
+
}
|
|
391
|
+
//#endregion
|
|
392
|
+
//#region lib/kernel/capability.d.ts
|
|
393
|
+
interface ActivationStepUpdate {
|
|
394
|
+
readonly description?: string;
|
|
395
|
+
readonly name?: string;
|
|
396
|
+
}
|
|
397
|
+
interface ActivationContext {
|
|
398
|
+
readonly owner: string;
|
|
399
|
+
readonly scope: PluginScope;
|
|
400
|
+
readonly signal: AbortSignal;
|
|
401
|
+
report(update: ActivationStepUpdate | string): void;
|
|
402
|
+
}
|
|
403
|
+
interface CapabilityModule {
|
|
404
|
+
readonly id: string;
|
|
405
|
+
activate(plugin: DCPluginConfig, context: ActivationContext): Promise<boolean>;
|
|
406
|
+
}
|
|
407
|
+
interface CapabilityDefinition<T> {
|
|
408
|
+
readonly id: string;
|
|
409
|
+
select(plugin: DCPluginConfig): T | undefined;
|
|
410
|
+
activate(model: T, context: ActivationContext): Promise<void> | void;
|
|
411
|
+
}
|
|
412
|
+
declare const defineCapability: <T>(definition: CapabilityDefinition<T>) => CapabilityModule;
|
|
413
|
+
declare class ActivationPipeline {
|
|
414
|
+
#private;
|
|
415
|
+
constructor(modules: readonly CapabilityModule[]);
|
|
416
|
+
activate(plugin: DCPluginConfig, context: ActivationContext): Promise<string[]>;
|
|
417
|
+
}
|
|
418
|
+
//#endregion
|
|
419
|
+
//#region lib/kernel/contribution.d.ts
|
|
420
|
+
interface Contribution<T> {
|
|
421
|
+
readonly owner: string;
|
|
422
|
+
readonly id: string;
|
|
423
|
+
readonly value: T;
|
|
424
|
+
}
|
|
425
|
+
interface ContributionChannel<T> {
|
|
426
|
+
readonly key: string;
|
|
427
|
+
readonly __type?: T;
|
|
428
|
+
}
|
|
429
|
+
declare const defineContributionChannel: <T>(key: string) => ContributionChannel<T>;
|
|
430
|
+
declare class ContributionRegistry<T> {
|
|
431
|
+
#private;
|
|
432
|
+
get size(): number;
|
|
433
|
+
get entries(): ReadonlyMap<string, Contribution<T>>;
|
|
434
|
+
register(owner: string, id: string, value: T): () => boolean;
|
|
435
|
+
get(owner: string, id: string): Contribution<T> | undefined;
|
|
436
|
+
byOwner(owner: string): Contribution<T>[];
|
|
437
|
+
removeOwner(owner: string): void;
|
|
438
|
+
values(): MapIterator<Contribution<T>>;
|
|
439
|
+
}
|
|
440
|
+
declare class ContributionHub {
|
|
441
|
+
private readonly registries;
|
|
442
|
+
channel<T>(channel: ContributionChannel<T>): ContributionRegistry<T>;
|
|
443
|
+
register<T>(scope: PluginScope, channel: ContributionChannel<T>, id: string, value: T): () => boolean;
|
|
444
|
+
removeOwner(owner: string): void;
|
|
445
|
+
}
|
|
446
|
+
//#endregion
|
|
447
|
+
//#region lib/kernel/dependency.d.ts
|
|
448
|
+
interface MissingPluginDependency {
|
|
449
|
+
readonly plugin: string;
|
|
450
|
+
readonly dependency: string;
|
|
451
|
+
}
|
|
452
|
+
interface PluginDependencyPlan {
|
|
453
|
+
readonly levels: PluginCandidate[][];
|
|
454
|
+
readonly missing: MissingPluginDependency[];
|
|
455
|
+
readonly cycles: string[][];
|
|
456
|
+
}
|
|
457
|
+
declare const findPluginDependencyCycles: (candidates: readonly PluginCandidate[]) => string[][];
|
|
458
|
+
declare const planPluginDependencies: (candidates: readonly PluginCandidate[]) => PluginDependencyPlan;
|
|
459
|
+
//#endregion
|
|
460
|
+
//#region lib/capabilities/services.d.ts
|
|
461
|
+
interface RegisteredPluginConfig {
|
|
462
|
+
readonly ready: Promise<void>;
|
|
463
|
+
}
|
|
464
|
+
interface PluginConfigRegistry {
|
|
465
|
+
register(pointer: ConfigPointer): RegisteredPluginConfig;
|
|
466
|
+
unregister(pointer: ConfigPointer): void;
|
|
467
|
+
}
|
|
468
|
+
interface PluginMessageRegistry {
|
|
469
|
+
register(plugin: string, messages: PluginLocaleMessages): void;
|
|
470
|
+
remove(plugin: string): void;
|
|
471
|
+
}
|
|
472
|
+
interface PluginAuthGateway {
|
|
473
|
+
authenticate(plugin: string, auth: Auth, signal: AbortSignal): Promise<void>;
|
|
474
|
+
}
|
|
475
|
+
interface PluginCapabilityServices {
|
|
476
|
+
readonly auth?: PluginAuthGateway;
|
|
477
|
+
readonly app?: App;
|
|
478
|
+
readonly config: PluginConfigRegistry;
|
|
479
|
+
readonly contributions: ContributionHub;
|
|
480
|
+
readonly i18n: PluginMessageRegistry;
|
|
481
|
+
readonly phase: 'normal' | 'preboot';
|
|
482
|
+
}
|
|
483
|
+
//#endregion
|
|
484
|
+
//#region lib/capabilities/auth.d.ts
|
|
485
|
+
declare const createAuthCapability: (services: PluginCapabilityServices) => CapabilityModule;
|
|
486
|
+
//#endregion
|
|
487
|
+
//#region lib/capabilities/channels.d.ts
|
|
488
|
+
declare const pluginModelChannels: {
|
|
489
|
+
readonly content: ContributionChannel<ContentModel>;
|
|
490
|
+
readonly expose: ContributionChannel<ExposeModel>;
|
|
491
|
+
readonly remote: ContributionChannel<RemoteModel>;
|
|
492
|
+
readonly resource: ContributionChannel<ResourceModel>;
|
|
493
|
+
readonly social: ContributionChannel<SocialModel>;
|
|
494
|
+
readonly special: ContributionChannel<SpecialModel>;
|
|
495
|
+
readonly user: ContributionChannel<UserModel>;
|
|
496
|
+
};
|
|
497
|
+
//#endregion
|
|
498
|
+
//#region lib/capabilities/config.d.ts
|
|
499
|
+
declare const createConfigCapability: (services: PluginCapabilityServices) => CapabilityModule;
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region lib/capabilities/content.d.ts
|
|
502
|
+
declare const createContentCapability: () => CapabilityModule;
|
|
503
|
+
//#endregion
|
|
504
|
+
//#region lib/capabilities/i18n.d.ts
|
|
505
|
+
declare const createI18nCapability: (services: PluginCapabilityServices) => CapabilityModule;
|
|
506
|
+
//#endregion
|
|
507
|
+
//#region lib/capabilities/lifecycle.d.ts
|
|
508
|
+
declare const createLifecycleCapability: (services: PluginCapabilityServices) => CapabilityModule;
|
|
509
|
+
//#endregion
|
|
510
|
+
//#region lib/capabilities/model.d.ts
|
|
511
|
+
declare const createModelCapability: (services: PluginCapabilityServices) => CapabilityModule;
|
|
512
|
+
//#endregion
|
|
513
|
+
//#region lib/capabilities/remote.d.ts
|
|
514
|
+
interface RemoteSelection {
|
|
515
|
+
readonly group: TestGroup;
|
|
516
|
+
readonly latencyMs?: number;
|
|
517
|
+
readonly remote: Definition | false;
|
|
518
|
+
}
|
|
519
|
+
declare const pluginRemoteSelectionChannel: ContributionChannel<RemoteSelection>;
|
|
520
|
+
declare const createRemoteCapability: (services: PluginCapabilityServices) => CapabilityModule;
|
|
521
|
+
//#endregion
|
|
522
|
+
//#region lib/capabilities/resource.d.ts
|
|
523
|
+
declare const createResourceCapability: () => CapabilityModule;
|
|
524
|
+
//#endregion
|
|
525
|
+
//#region lib/capabilities/special.d.ts
|
|
526
|
+
declare const createSpecialCapability: () => CapabilityModule;
|
|
527
|
+
//#endregion
|
|
528
|
+
//#region lib/capabilities/user.d.ts
|
|
529
|
+
declare const createUserCapability: () => CapabilityModule;
|
|
530
|
+
//#endregion
|
|
531
|
+
//#region lib/capabilities/index.d.ts
|
|
532
|
+
/** Fixed host-owned activation topology. Third-party plugins only provide data to it. */
|
|
533
|
+
declare const createDefaultCapabilities: (services: PluginCapabilityServices) => readonly CapabilityModule[];
|
|
534
|
+
//#endregion
|
|
535
|
+
//#region lib/install/catalog.d.ts
|
|
536
|
+
type PluginCatalogSource = {
|
|
537
|
+
readonly type: 'github';
|
|
538
|
+
readonly repository: string;
|
|
539
|
+
} | {
|
|
540
|
+
readonly type: 'url';
|
|
541
|
+
readonly url: string;
|
|
542
|
+
};
|
|
543
|
+
interface PluginCatalogRepository {
|
|
544
|
+
readonly defaultBranch: string;
|
|
545
|
+
readonly lastCommitAt: string;
|
|
546
|
+
readonly name: string;
|
|
547
|
+
readonly owner: string;
|
|
548
|
+
readonly readmeUrl?: string;
|
|
549
|
+
readonly url: string;
|
|
550
|
+
}
|
|
551
|
+
interface PluginCatalogRelease {
|
|
552
|
+
readonly manifestUrl: string | null;
|
|
553
|
+
readonly publishedAt: string;
|
|
554
|
+
readonly url: string;
|
|
555
|
+
readonly version: string;
|
|
556
|
+
}
|
|
557
|
+
interface PluginCatalogListing {
|
|
558
|
+
readonly authors: readonly string[];
|
|
559
|
+
readonly id: string;
|
|
560
|
+
readonly release?: PluginCatalogRelease;
|
|
561
|
+
readonly repository?: PluginCatalogRepository;
|
|
562
|
+
readonly source: PluginCatalogSource;
|
|
563
|
+
}
|
|
564
|
+
interface PluginCatalogPageReference {
|
|
565
|
+
readonly items: number;
|
|
566
|
+
readonly page: number;
|
|
567
|
+
readonly path: string;
|
|
568
|
+
}
|
|
569
|
+
interface PluginCatalogIndex {
|
|
570
|
+
readonly pageSize: number;
|
|
571
|
+
readonly pages: readonly PluginCatalogPageReference[];
|
|
572
|
+
readonly totalItems: number;
|
|
573
|
+
readonly totalPages: number;
|
|
574
|
+
}
|
|
575
|
+
interface PluginCatalogPagination {
|
|
576
|
+
readonly next: string | null;
|
|
577
|
+
readonly page: number;
|
|
578
|
+
readonly pageSize: number;
|
|
579
|
+
readonly previous: string | null;
|
|
580
|
+
readonly totalItems: number;
|
|
581
|
+
readonly totalPages: number;
|
|
582
|
+
}
|
|
583
|
+
interface PluginCatalogPage {
|
|
584
|
+
readonly items: readonly PluginCatalogListing[];
|
|
585
|
+
readonly pagination: PluginCatalogPagination;
|
|
586
|
+
}
|
|
587
|
+
interface PluginCatalogResult<T> {
|
|
588
|
+
readonly cachedAt: string;
|
|
589
|
+
readonly data: T;
|
|
590
|
+
readonly stale: boolean;
|
|
591
|
+
}
|
|
592
|
+
/** The narrow catalog port required by an install source resolver. */
|
|
593
|
+
interface PluginInstallCatalog {
|
|
594
|
+
resolveInstallInput(plugin: string, signal: AbortSignal): Promise<string>;
|
|
595
|
+
}
|
|
596
|
+
/** Host-facing catalog operations used by the marketplace feature. */
|
|
597
|
+
interface PluginCatalog extends PluginInstallCatalog {
|
|
598
|
+
loadIndex(signal?: AbortSignal): Promise<PluginCatalogResult<PluginCatalogIndex>>;
|
|
599
|
+
loadManifest(listing: PluginCatalogListing, signal?: AbortSignal): Promise<PluginManifest$1 | undefined>;
|
|
600
|
+
loadPage(path: string, signal?: AbortSignal): Promise<PluginCatalogResult<PluginCatalogPage>>;
|
|
601
|
+
}
|
|
602
|
+
declare const pluginCatalogInstallInput: (plugin: string) => string;
|
|
603
|
+
declare const pluginCatalogIdFromInstallInput: (input: unknown) => string | undefined;
|
|
604
|
+
//#endregion
|
|
605
|
+
//#region lib/adapters/configStore.d.ts
|
|
374
606
|
type ConfigSave<T extends ConfigPointer = ConfigPointer> = {
|
|
375
607
|
form: UnwrapConfigPointer<T>;
|
|
376
608
|
data: Ref<FormResult<T['config']>>;
|
|
377
609
|
name: string;
|
|
378
610
|
ready: Promise<void>;
|
|
379
611
|
};
|
|
612
|
+
type StoredConfigSave = {
|
|
613
|
+
data: Ref<Record<string, FormDefaultValue[keyof FormDefaultValue]>>;
|
|
614
|
+
form: ConfigPointer['config'];
|
|
615
|
+
name: string;
|
|
616
|
+
ready: Promise<void>;
|
|
617
|
+
};
|
|
618
|
+
type PluginConfigLoader = <T extends ConfigPointer>(pointer: T) => ConfigSave<T>;
|
|
380
619
|
declare class ConfigStore {
|
|
381
|
-
readonly
|
|
382
|
-
private readonly
|
|
620
|
+
private readonly loadConfig;
|
|
621
|
+
private readonly entries;
|
|
622
|
+
private readonly pointers;
|
|
383
623
|
private readonly isSystemDark;
|
|
624
|
+
constructor(loadConfig?: PluginConfigLoader);
|
|
625
|
+
get form(): ReadonlyMap<symbol, StoredConfigSave>;
|
|
384
626
|
get isDark(): boolean;
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
627
|
+
load<T extends ConfigPointer>(pointer: T): ConfigSave<T>;
|
|
628
|
+
has(pointer: ConfigPointer): boolean;
|
|
629
|
+
register<T extends ConfigPointer>(pointer: T): ConfigSave<T>;
|
|
630
|
+
unregister(pointer: ConfigPointer): void;
|
|
631
|
+
}
|
|
632
|
+
//#endregion
|
|
633
|
+
//#region lib/install/contracts.d.ts
|
|
634
|
+
type PluginInstallInput = File | string;
|
|
635
|
+
interface ResolvedPluginSource {
|
|
636
|
+
readonly file: File;
|
|
637
|
+
readonly installInput: string;
|
|
638
|
+
readonly resolverId: string;
|
|
639
|
+
}
|
|
640
|
+
interface PluginSourceResolver {
|
|
641
|
+
readonly id: string;
|
|
642
|
+
matches(input: PluginInstallInput): boolean;
|
|
643
|
+
resolve(input: PluginInstallInput, signal: AbortSignal): Promise<ResolvedPluginSource>;
|
|
644
|
+
}
|
|
645
|
+
interface DecodedPluginPackage {
|
|
646
|
+
readonly codecId: string;
|
|
647
|
+
readonly files: ReadonlyMap<string, Uint8Array>;
|
|
648
|
+
readonly manifest: PluginManifest$1;
|
|
649
|
+
}
|
|
650
|
+
interface PluginPackageCodec {
|
|
651
|
+
readonly id: string;
|
|
652
|
+
matches(file: File): boolean;
|
|
653
|
+
decode(file: File, signal: AbortSignal): Promise<DecodedPluginPackage>;
|
|
654
|
+
}
|
|
655
|
+
interface PluginFileReplacement {
|
|
656
|
+
commit(): Promise<void>;
|
|
657
|
+
rollback(): Promise<void>;
|
|
658
|
+
}
|
|
659
|
+
interface PluginFileStore {
|
|
660
|
+
replace(plugin: string, files: ReadonlyMap<string, Uint8Array>): Promise<PluginFileReplacement>;
|
|
661
|
+
remove(plugin: string): Promise<void>;
|
|
662
|
+
read(plugin: string, path: string): Promise<Uint8Array>;
|
|
663
|
+
createAssetUrl(plugin: string, path: string): Promise<string>;
|
|
664
|
+
createModuleUrl(plugin: string, path: string): Promise<string>;
|
|
665
|
+
release(plugin: string): void;
|
|
666
|
+
}
|
|
667
|
+
interface PluginArchiveRepository {
|
|
668
|
+
find(plugin: string): Promise<PluginArchiveDB.Archive | undefined>;
|
|
669
|
+
list(): Promise<PluginArchiveDB.Archive[]>;
|
|
670
|
+
remove(plugin: string): Promise<void>;
|
|
671
|
+
upsert(archive: PluginArchiveDB.Archive): Promise<void>;
|
|
672
|
+
}
|
|
673
|
+
interface PluginModuleReader {
|
|
674
|
+
read(plugin: string, manifest: PluginManifest$1, signal: AbortSignal): Promise<LoadedPluginModule>;
|
|
675
|
+
}
|
|
676
|
+
interface PluginInstallProgress {
|
|
677
|
+
readonly description?: string;
|
|
678
|
+
readonly phase: 'decode' | 'persist' | 'resolve';
|
|
679
|
+
readonly progress?: number;
|
|
680
|
+
}
|
|
681
|
+
type PluginInstallReporter = (progress: PluginInstallProgress) => void;
|
|
682
|
+
//#endregion
|
|
683
|
+
//#region lib/install/candidateProvider.d.ts
|
|
684
|
+
/** Normalize persisted archives into the same candidate protocol used by internal plugins. */
|
|
685
|
+
declare class InstalledPluginCandidateProvider implements PluginCandidateProvider {
|
|
686
|
+
private readonly repository;
|
|
687
|
+
private readonly reader;
|
|
688
|
+
readonly id = "installed";
|
|
689
|
+
constructor(repository: PluginArchiveRepository, reader: PluginModuleReader);
|
|
690
|
+
list(signal: AbortSignal): Promise<PluginCandidate[]>;
|
|
691
|
+
}
|
|
692
|
+
//#endregion
|
|
693
|
+
//#region lib/install/codec.d.ts
|
|
694
|
+
declare class ZipPackageCodec implements PluginPackageCodec {
|
|
695
|
+
readonly id = "zip";
|
|
696
|
+
matches(file: File): boolean;
|
|
697
|
+
decode(file: File, signal: AbortSignal): Promise<DecodedPluginPackage>;
|
|
698
|
+
}
|
|
699
|
+
declare class DevScriptCodec implements PluginPackageCodec {
|
|
700
|
+
readonly id = "dev-script";
|
|
701
|
+
matches(file: File): boolean;
|
|
702
|
+
decode(file: File, signal: AbortSignal): Promise<DecodedPluginPackage>;
|
|
703
|
+
}
|
|
704
|
+
//#endregion
|
|
705
|
+
//#region lib/install/manifest.d.ts
|
|
706
|
+
declare const safePluginPath: (value: unknown, path: string) => string;
|
|
707
|
+
declare class PluginManifestError extends Error {
|
|
708
|
+
constructor(message: string);
|
|
709
|
+
}
|
|
710
|
+
declare const parsePluginManifest: (value: unknown) => PluginManifest$1;
|
|
711
|
+
declare const isPluginManifestCompatible: (manifest: PluginManifest$1, coreVersion: string) => boolean;
|
|
712
|
+
//#endregion
|
|
713
|
+
//#region lib/install/moduleReader.d.ts
|
|
714
|
+
declare class StoredPluginModuleReader implements PluginModuleReader {
|
|
715
|
+
private readonly files;
|
|
716
|
+
constructor(files: PluginFileStore);
|
|
717
|
+
read(plugin: string, manifest: PluginManifest, signal: AbortSignal): Promise<LoadedPluginModule>;
|
|
718
|
+
}
|
|
719
|
+
//#endregion
|
|
720
|
+
//#region lib/install/repository.d.ts
|
|
721
|
+
declare class DatabasePluginArchiveRepository implements PluginArchiveRepository {
|
|
722
|
+
find(plugin: string): Promise<{
|
|
723
|
+
installerName: string;
|
|
724
|
+
loaderName: string;
|
|
725
|
+
pluginName: string;
|
|
726
|
+
meta: import("@delta-comic/model").PluginManifest;
|
|
727
|
+
enable: boolean;
|
|
728
|
+
installInput: string;
|
|
729
|
+
displayName: string;
|
|
730
|
+
} | undefined>;
|
|
731
|
+
list(): Promise<{
|
|
732
|
+
installerName: string;
|
|
733
|
+
loaderName: string;
|
|
734
|
+
pluginName: string;
|
|
735
|
+
meta: import("@delta-comic/model").PluginManifest;
|
|
736
|
+
enable: boolean;
|
|
737
|
+
installInput: string;
|
|
738
|
+
displayName: string;
|
|
739
|
+
}[]>;
|
|
740
|
+
remove(plugin: string): Promise<void>;
|
|
741
|
+
upsert(archive: PluginArchiveDB.Archive): Promise<void>;
|
|
742
|
+
}
|
|
743
|
+
//#endregion
|
|
744
|
+
//#region lib/install/service.d.ts
|
|
745
|
+
interface PluginInstallServiceOptions {
|
|
746
|
+
readonly codecs: readonly PluginPackageCodec[];
|
|
747
|
+
readonly files: PluginFileStore;
|
|
748
|
+
readonly repository: PluginArchiveRepository;
|
|
749
|
+
readonly reservedIds?: ReadonlySet<string>;
|
|
750
|
+
readonly resolvers: readonly PluginSourceResolver[];
|
|
751
|
+
}
|
|
752
|
+
declare class PluginInstallService {
|
|
753
|
+
private readonly options;
|
|
754
|
+
constructor(options: PluginInstallServiceOptions);
|
|
755
|
+
install(input: PluginInstallInput, signal?: AbortSignal, report?: PluginInstallReporter): Promise<{
|
|
756
|
+
installerName: string;
|
|
757
|
+
loaderName: string;
|
|
758
|
+
pluginName: string;
|
|
759
|
+
meta: import("@delta-comic/model").PluginManifest;
|
|
760
|
+
enable: boolean;
|
|
761
|
+
installInput: string;
|
|
762
|
+
displayName: string;
|
|
763
|
+
}>;
|
|
764
|
+
/** Remove archive metadata and files as one compensating transaction. */
|
|
765
|
+
uninstall(plugin: string): Promise<void>;
|
|
766
|
+
}
|
|
767
|
+
//#endregion
|
|
768
|
+
//#region lib/install/source.d.ts
|
|
769
|
+
declare class LocalFileSourceResolver implements PluginSourceResolver {
|
|
770
|
+
readonly id = "local-file";
|
|
771
|
+
matches(input: PluginInstallInput): input is File;
|
|
772
|
+
resolve(input: PluginInstallInput): Promise<ResolvedPluginSource>;
|
|
773
|
+
}
|
|
774
|
+
declare class HttpSourceResolver implements PluginSourceResolver {
|
|
775
|
+
readonly id = "http";
|
|
776
|
+
matches(input: PluginInstallInput): input is string;
|
|
777
|
+
resolve(input: PluginInstallInput, signal: AbortSignal): Promise<ResolvedPluginSource>;
|
|
778
|
+
}
|
|
779
|
+
interface GitHubSourceResolverOptions {
|
|
780
|
+
readonly coreVersion: string;
|
|
781
|
+
readonly token?: string;
|
|
782
|
+
}
|
|
783
|
+
declare class GitHubSourceResolver implements PluginSourceResolver {
|
|
784
|
+
private readonly options;
|
|
785
|
+
readonly id = "github";
|
|
786
|
+
constructor(options: GitHubSourceResolverOptions);
|
|
787
|
+
matches(input: PluginInstallInput): input is string;
|
|
788
|
+
resolve(input: PluginInstallInput, signal: AbortSignal): Promise<{
|
|
789
|
+
file: File;
|
|
790
|
+
installInput: string;
|
|
791
|
+
resolverId: string;
|
|
792
|
+
}>;
|
|
793
|
+
}
|
|
794
|
+
declare class MarketplaceSourceResolver implements PluginSourceResolver {
|
|
795
|
+
private readonly catalog;
|
|
796
|
+
private readonly sources;
|
|
797
|
+
readonly id = "marketplace";
|
|
798
|
+
constructor(catalog: PluginInstallCatalog, sources: readonly PluginSourceResolver[]);
|
|
799
|
+
matches(input: PluginInstallInput): input is string;
|
|
800
|
+
resolve(input: PluginInstallInput, signal: AbortSignal): Promise<{
|
|
801
|
+
installInput: string;
|
|
802
|
+
resolverId: string;
|
|
803
|
+
file: File;
|
|
804
|
+
}>;
|
|
805
|
+
}
|
|
806
|
+
//#endregion
|
|
807
|
+
//#region lib/adapters/i18n.d.ts
|
|
808
|
+
interface PluginI18nAdapter {
|
|
809
|
+
setLocaleMessage(locale: string, message: PluginLocaleMessage): void;
|
|
810
|
+
translate?(key: string, params?: Record<string, number | string>): string;
|
|
811
|
+
}
|
|
812
|
+
declare class PluginI18nRegistry {
|
|
813
|
+
private adapter?;
|
|
814
|
+
private baseMessages;
|
|
815
|
+
private readonly pluginMessages;
|
|
816
|
+
install(adapter: PluginI18nAdapter, baseMessages: PluginLocaleMessages): void;
|
|
817
|
+
register(plugin: string, messages: PluginLocaleMessages): void;
|
|
818
|
+
remove(plugin: string): void;
|
|
819
|
+
translate(key: string, params?: Record<string, number | string>): string;
|
|
820
|
+
private compose;
|
|
821
|
+
private locales;
|
|
822
|
+
private refresh;
|
|
823
|
+
}
|
|
824
|
+
declare const pluginI18n: PluginI18nRegistry;
|
|
825
|
+
declare const pluginMessageKey: (key: string) => string;
|
|
826
|
+
declare const translatePluginText: (value: string) => string;
|
|
827
|
+
//#endregion
|
|
828
|
+
//#region lib/runtime/store.d.ts
|
|
829
|
+
declare class PluginStore {
|
|
830
|
+
private readonly translateText;
|
|
831
|
+
private readonly candidateEntries;
|
|
832
|
+
private readonly loadingEntries;
|
|
833
|
+
private readonly pluginEntries;
|
|
834
|
+
private readonly readyEntries;
|
|
835
|
+
constructor(translateText?: (value: string) => string);
|
|
836
|
+
get candidates(): ReadonlyMap<string, PluginCandidate>;
|
|
837
|
+
get loading(): ReadonlyMap<string, Raw<DCPluginConfig>>;
|
|
838
|
+
get plugins(): ReadonlyMap<string, Raw<DCPluginConfig>>;
|
|
839
|
+
get ready(): ReadonlySet<string>;
|
|
840
|
+
replaceCandidates(candidates: readonly PluginCandidate[]): void;
|
|
841
|
+
markLoading(plugin: string, config: Raw<DCPluginConfig>): void;
|
|
842
|
+
markReady(plugin: string): void;
|
|
843
|
+
markUnloaded(plugin: string): void;
|
|
844
|
+
isLoaded(plugin: string): boolean;
|
|
845
|
+
displayName(plugin: string): string;
|
|
846
|
+
modelEntries<K extends keyof NonNullable<DCPluginConfig['model']>>(key: K): [string, NonNullable<PluginConfigModel[K]>][];
|
|
847
|
+
}
|
|
848
|
+
//#endregion
|
|
849
|
+
//#region lib/runtime/engine.d.ts
|
|
850
|
+
interface PluginLoadingInfo {
|
|
851
|
+
progress: {
|
|
852
|
+
errorReason?: string;
|
|
853
|
+
status: 'done' | 'error' | 'process' | 'wait';
|
|
854
|
+
stepsIndex: number;
|
|
855
|
+
};
|
|
856
|
+
steps: {
|
|
857
|
+
description: string;
|
|
858
|
+
name: string;
|
|
859
|
+
}[];
|
|
860
|
+
}
|
|
861
|
+
interface PluginRuntimeFailure {
|
|
862
|
+
readonly error: unknown;
|
|
863
|
+
readonly phase: 'normal' | 'preboot';
|
|
864
|
+
readonly plugin: string;
|
|
865
|
+
}
|
|
866
|
+
interface PluginRuntimeReport {
|
|
867
|
+
readonly activated: string[];
|
|
868
|
+
readonly failures: PluginRuntimeFailure[];
|
|
869
|
+
}
|
|
870
|
+
interface PluginRuntimeOperation {
|
|
871
|
+
readonly operation: Promise<PluginRuntimeReport>;
|
|
872
|
+
readonly progress: Ref<Record<string, PluginLoadingInfo>>;
|
|
873
|
+
}
|
|
874
|
+
interface LoadNormalOptions {
|
|
875
|
+
readonly pluginNames?: readonly string[];
|
|
876
|
+
}
|
|
877
|
+
interface PrebootRecovery {
|
|
878
|
+
failedAt: number;
|
|
879
|
+
plugins: string[];
|
|
880
|
+
reason: string;
|
|
881
|
+
}
|
|
882
|
+
interface PluginRuntimeOptions {
|
|
883
|
+
readonly capabilities: (phase: 'normal' | 'preboot', app?: App) => readonly CapabilityModule[];
|
|
884
|
+
readonly environment: () => ConfigEnv;
|
|
885
|
+
readonly provider: PluginCandidateProvider;
|
|
886
|
+
readonly remove: (plugin: string) => Promise<void>;
|
|
887
|
+
readonly store?: PluginStore;
|
|
888
|
+
}
|
|
889
|
+
declare class PluginRuntime {
|
|
890
|
+
#private;
|
|
891
|
+
readonly store: PluginStore;
|
|
892
|
+
constructor(options: PluginRuntimeOptions);
|
|
893
|
+
get activeNormalPluginNames(): string[];
|
|
894
|
+
preparePreboot(app: App): Promise<PluginRuntimeReport>;
|
|
895
|
+
loadNormal(options?: LoadNormalOptions): PluginRuntimeOperation;
|
|
896
|
+
reloadNormal(options?: LoadNormalOptions): PluginRuntimeOperation;
|
|
897
|
+
uninstall(plugin: string): Promise<void>;
|
|
898
|
+
refreshCandidates(): Promise<readonly PluginCandidate[]>;
|
|
899
|
+
readRecovery(): PrebootRecovery | null;
|
|
900
|
+
clearRecovery(): void;
|
|
901
|
+
}
|
|
902
|
+
//#endregion
|
|
903
|
+
//#region lib/runtime/providers.d.ts
|
|
904
|
+
interface InternalPluginPreferences {
|
|
905
|
+
enabled(plugin: string, fallback: boolean): Promise<boolean>;
|
|
906
|
+
setEnabled(plugin: string, enabled: boolean): Promise<void>;
|
|
907
|
+
}
|
|
908
|
+
declare class LocalInternalPluginPreferences implements InternalPluginPreferences {
|
|
909
|
+
private readonly storage;
|
|
910
|
+
private readonly prefix;
|
|
911
|
+
constructor(storage?: Storage | undefined, prefix?: string);
|
|
912
|
+
enabled(plugin: string, fallback: boolean): Promise<boolean>;
|
|
913
|
+
setEnabled(plugin: string, enabled: boolean): Promise<void>;
|
|
914
|
+
}
|
|
915
|
+
declare class InternalPluginCandidateProvider implements PluginCandidateProvider {
|
|
916
|
+
private readonly definitions;
|
|
917
|
+
private readonly preferences;
|
|
918
|
+
readonly id = "internal";
|
|
919
|
+
constructor(definitions: readonly InternalPluginDefinition[], preferences?: InternalPluginPreferences);
|
|
920
|
+
list(signal: AbortSignal): Promise<PluginCandidate[]>;
|
|
921
|
+
}
|
|
922
|
+
declare class CompositePluginCandidateProvider implements PluginCandidateProvider {
|
|
923
|
+
private readonly providers;
|
|
924
|
+
readonly id = "composite";
|
|
925
|
+
constructor(providers: readonly PluginCandidateProvider[]);
|
|
926
|
+
list(signal: AbortSignal): Promise<PluginCandidate[]>;
|
|
927
|
+
}
|
|
928
|
+
//#endregion
|
|
929
|
+
//#region lib/composition.d.ts
|
|
930
|
+
declare const pluginContributions: ContributionHub;
|
|
931
|
+
declare const pluginStore: PluginStore;
|
|
932
|
+
declare const pluginConfigStore: ConfigStore;
|
|
933
|
+
declare const useConfig: () => ConfigStore;
|
|
934
|
+
interface PluginHostServices {
|
|
935
|
+
readonly auth?: PluginAuthGateway;
|
|
936
|
+
}
|
|
937
|
+
/** Install host-only integrations without exposing UI or platform details to the runtime kernel. */
|
|
938
|
+
declare const configurePluginHost: (services: PluginHostServices) => void;
|
|
939
|
+
declare const pluginCatalog: PluginCatalog;
|
|
940
|
+
declare const pluginInstaller: PluginInstallService;
|
|
941
|
+
declare const pluginRuntime: PluginRuntime;
|
|
942
|
+
declare const installPlugin: (input: File | string) => Promise<{
|
|
943
|
+
installerName: string;
|
|
944
|
+
loaderName: string;
|
|
945
|
+
pluginName: string;
|
|
946
|
+
meta: import("@delta-comic/model").PluginManifest;
|
|
947
|
+
enable: boolean;
|
|
948
|
+
installInput: string;
|
|
949
|
+
displayName: string;
|
|
950
|
+
}>;
|
|
951
|
+
declare const updatePlugin: (archive: {
|
|
952
|
+
installInput: string;
|
|
953
|
+
}) => Promise<{
|
|
954
|
+
installerName: string;
|
|
955
|
+
loaderName: string;
|
|
956
|
+
pluginName: string;
|
|
957
|
+
meta: import("@delta-comic/model").PluginManifest;
|
|
958
|
+
enable: boolean;
|
|
959
|
+
installInput: string;
|
|
960
|
+
displayName: string;
|
|
961
|
+
}>;
|
|
962
|
+
declare const updatePluginByName: (plugin: string) => Promise<{
|
|
963
|
+
installerName: string;
|
|
964
|
+
loaderName: string;
|
|
965
|
+
pluginName: string;
|
|
966
|
+
meta: import("@delta-comic/model").PluginManifest;
|
|
967
|
+
enable: boolean;
|
|
968
|
+
installInput: string;
|
|
969
|
+
displayName: string;
|
|
970
|
+
}>;
|
|
971
|
+
declare const setPluginEnabled: (plugin: string, enabled: boolean) => Promise<void>;
|
|
972
|
+
declare const setPluginKind: (plugin: string, kind: "normal" | "preboot") => Promise<void>;
|
|
973
|
+
declare const uninstallPlugin: (plugin: string) => Promise<void>;
|
|
974
|
+
declare const resolvePluginIconUrl: (plugin: string | undefined, icon: string | undefined) => Promise<string | undefined>;
|
|
975
|
+
declare const usePluginStore: () => PluginStore;
|
|
976
|
+
//#endregion
|
|
977
|
+
//#region lib/core/config.d.ts
|
|
978
|
+
declare const cfg: ConfigPointer<{
|
|
979
|
+
recordHistory: {
|
|
980
|
+
type: "switch";
|
|
981
|
+
defaultValue: true;
|
|
982
|
+
info: string;
|
|
983
|
+
};
|
|
984
|
+
showAIProject: {
|
|
985
|
+
type: "switch";
|
|
986
|
+
defaultValue: true;
|
|
987
|
+
info: string;
|
|
988
|
+
};
|
|
989
|
+
darkMode: {
|
|
990
|
+
type: "radio";
|
|
991
|
+
defaultValue: string;
|
|
992
|
+
info: string;
|
|
993
|
+
comp: "select";
|
|
994
|
+
selects: {
|
|
995
|
+
label: string;
|
|
996
|
+
value: string;
|
|
997
|
+
}[];
|
|
998
|
+
};
|
|
999
|
+
language: {
|
|
1000
|
+
type: "radio";
|
|
1001
|
+
defaultValue: string;
|
|
1002
|
+
info: string;
|
|
1003
|
+
comp: "select";
|
|
1004
|
+
selects: {
|
|
1005
|
+
label: string;
|
|
1006
|
+
value: string;
|
|
1007
|
+
}[];
|
|
1008
|
+
};
|
|
1009
|
+
easilyTitle: {
|
|
1010
|
+
type: "switch";
|
|
1011
|
+
defaultValue: false;
|
|
1012
|
+
info: string;
|
|
1013
|
+
};
|
|
1014
|
+
githubToken: {
|
|
1015
|
+
type: "string";
|
|
1016
|
+
defaultValue: string;
|
|
1017
|
+
info: string;
|
|
1018
|
+
placeholder: string;
|
|
1019
|
+
};
|
|
1020
|
+
receivePerReleaseUpdate: {
|
|
1021
|
+
type: "switch";
|
|
1022
|
+
defaultValue: false;
|
|
1023
|
+
info: string;
|
|
1024
|
+
};
|
|
1025
|
+
cloudEnabled: {
|
|
1026
|
+
type: "switch";
|
|
1027
|
+
defaultValue: false;
|
|
1028
|
+
info: string;
|
|
1029
|
+
};
|
|
1030
|
+
cloudServerUrl: {
|
|
1031
|
+
type: "string";
|
|
1032
|
+
defaultValue: string;
|
|
1033
|
+
info: string;
|
|
1034
|
+
placeholder: string;
|
|
1035
|
+
};
|
|
1036
|
+
installOverride: {
|
|
1037
|
+
type: "pairs";
|
|
1038
|
+
defaultValue: [];
|
|
1039
|
+
info: string;
|
|
1040
|
+
required: true;
|
|
1041
|
+
};
|
|
1042
|
+
}>;
|
|
1043
|
+
declare namespace index_d_exports {
|
|
1044
|
+
export { cfg, _default as default };
|
|
1045
|
+
}
|
|
1046
|
+
declare const _default: PluginConfigFactory<{
|
|
1047
|
+
config: ConfigPointer<{
|
|
388
1048
|
recordHistory: {
|
|
389
1049
|
type: "switch";
|
|
390
1050
|
defaultValue: true;
|
|
@@ -448,480 +1108,17 @@ declare class ConfigStore {
|
|
|
448
1108
|
info: string;
|
|
449
1109
|
required: true;
|
|
450
1110
|
};
|
|
451
|
-
}>>;
|
|
452
|
-
$isExistConfig(pointer: ConfigPointer): boolean;
|
|
453
|
-
$registerConfig<T extends ConfigPointer>(pointer: T): ConfigSave<ConfigPointer<ConfigDescription>>;
|
|
454
|
-
$unregisterConfig(pointer: ConfigPointer): void;
|
|
455
|
-
}
|
|
456
|
-
declare const useConfig: () => ConfigStore;
|
|
457
|
-
//#endregion
|
|
458
|
-
//#region lib/depends.d.ts
|
|
459
|
-
interface DependDefineConstraint<_T> {}
|
|
460
|
-
type DependDefine<T> = symbol & DependDefineConstraint<T> & {
|
|
461
|
-
_ts: T;
|
|
462
|
-
};
|
|
463
|
-
declare const exposeSymbol: (name: string) => symbol;
|
|
464
|
-
declare const declareDepType: <T>(name: string) => DependDefine<T>;
|
|
465
|
-
declare class DependencyRegistry {
|
|
466
|
-
readonly exposes: Map<symbol, unknown>;
|
|
467
|
-
constructor(exposes?: Map<symbol, unknown>);
|
|
468
|
-
provide<T>(define: DependDefine<T>, value: T): T;
|
|
469
|
-
require<T>(define: DependDefine<T>): T;
|
|
470
|
-
has(define: DependDefine<unknown>): boolean;
|
|
471
|
-
delete(define: DependDefine<unknown>): boolean;
|
|
472
|
-
clear(): void;
|
|
473
|
-
}
|
|
474
|
-
type InferDependType<T extends DependDefine<any>> = T['_ts'];
|
|
475
|
-
declare const pluginExposes: Map<symbol, unknown>;
|
|
476
|
-
declare const defaultDependencyRegistry: DependencyRegistry;
|
|
477
|
-
declare const createDependencyRegistry: () => DependencyRegistry;
|
|
478
|
-
declare const provide: <T>(define: DependDefine<T>, value: T) => T;
|
|
479
|
-
declare const require: <T>(define: DependDefine<T>) => T;
|
|
480
|
-
//#endregion
|
|
481
|
-
//#region lib/global.d.ts
|
|
482
|
-
declare class _Global {
|
|
483
|
-
share: import("vue").ShallowReactive<import("vue").ShallowReactive<SourcedKeyMap<[plugin: string, key: string], InitiativeItem>>>;
|
|
484
|
-
shareToken: import("vue").ShallowReactive<import("vue").ShallowReactive<SourcedKeyMap<[plugin: string, key: string], ShareToken>>>;
|
|
485
|
-
userActions: import("vue").ShallowReactive<import("vue").ShallowReactive<SourcedKeyMap<[plugin: string, key: string], UserAction>>>;
|
|
486
|
-
subscribes: import("vue").ShallowReactive<import("vue").ShallowReactive<SourcedKeyMap<[plugin: string, key: string], Config$5>>>;
|
|
487
|
-
globalNodes: import("vue").ShallowReactive<Raw<Component>[]>;
|
|
488
|
-
private readonly globalNodeOwners;
|
|
489
|
-
private readonly registrationOwners;
|
|
490
|
-
/**
|
|
491
|
-
* Associates global registrations made by a plugin with that plugin. The runtime
|
|
492
|
-
* deliberately loads plugins serially while this ambient scope is active.
|
|
493
|
-
*/
|
|
494
|
-
withRegistrationOwner<T>(plugin: string, action: () => Promise<T>): Promise<T>;
|
|
495
|
-
private get registrationOwner();
|
|
496
|
-
addGlobalNode(component: Raw<Component>, plugin?: string | undefined): Raw<Component>;
|
|
497
|
-
/** Removes only registrations owned by the requested plugin. */
|
|
498
|
-
removeOwnedRegistrations(plugin: string): void;
|
|
499
|
-
tabbar: import("vue").ShallowReactive<Map<string, Tabbar[]>>;
|
|
500
|
-
addTabbar(plugin: string, ...tabbar: Tabbar[]): void;
|
|
501
|
-
categories: import("vue").ShallowReactive<Map<string, Category[]>>;
|
|
502
|
-
addCategories(plugin: string, ...categories: Category[]): void;
|
|
503
|
-
barcode: import("vue").ShallowReactive<Map<string, Barcode[]>>;
|
|
504
|
-
addBarcode(plugin: string, ...barcode: Barcode[]): void;
|
|
505
|
-
hotSearch: import("vue").ShallowReactive<Map<string, HotSearchProvider[]>>;
|
|
506
|
-
addHotSearch(plugin: string, ...providers: HotSearchProvider[]): void;
|
|
507
|
-
levelboard: import("vue").ShallowReactive<Map<string, HotLevelboard[]>>;
|
|
508
|
-
addLevelboard(plugin: string, ...levelboard: HotLevelboard[]): void;
|
|
509
|
-
topButton: import("vue").ShallowReactive<Map<string, HotTopButton[]>>;
|
|
510
|
-
addTopButton(plugin: string, ...topButton: HotTopButton[]): void;
|
|
511
|
-
mainLists: import("vue").ShallowReactive<Map<string, HotMainList[]>>;
|
|
512
|
-
addMainList(plugin: string, ...mainLists: HotMainList[]): void;
|
|
513
|
-
}
|
|
514
|
-
declare const Global: _Global;
|
|
515
|
-
//#endregion
|
|
516
|
-
//#region lib/manifest.d.ts
|
|
517
|
-
type PluginIconReference = {
|
|
518
|
-
type: 'local';
|
|
519
|
-
path: string;
|
|
520
|
-
fragment: string;
|
|
521
|
-
} | {
|
|
522
|
-
type: 'remote';
|
|
523
|
-
url: string;
|
|
524
|
-
};
|
|
525
|
-
/**
|
|
526
|
-
* Accepts a credential-free HTTP(S) URL or a safe path inside the plugin archive.
|
|
527
|
-
* Query strings and fragments are kept for both forms.
|
|
528
|
-
*/
|
|
529
|
-
declare const parsePluginIconReference: (value: unknown, path?: string) => PluginIconReference;
|
|
530
|
-
declare class PluginManifestError extends Error {
|
|
531
|
-
constructor(message: string);
|
|
532
|
-
}
|
|
533
|
-
/**
|
|
534
|
-
* Validates the exact manifest format emitted by the `deltaComic` Vite plugin.
|
|
535
|
-
* The returned value is safe to use as the persisted plugin metadata shape.
|
|
536
|
-
*/
|
|
537
|
-
declare const parsePluginManifest: (value: unknown) => PluginArchiveDB.Meta;
|
|
538
|
-
declare const isPluginManifestCompatible: (manifest: PluginArchiveDB.Meta, coreVersion: string) => boolean;
|
|
539
|
-
//#endregion
|
|
540
|
-
//#region lib/marketplace/types.d.ts
|
|
541
|
-
declare const AWESOME_REGISTRY_BASE_URL = "https://raw.githubusercontent.com/delta-comic/awesome-plugins/main/";
|
|
542
|
-
declare const AWESOME_REGISTRY_INDEX_PATH = "registry/index.json";
|
|
543
|
-
declare const AWESOME_REGISTRY_SCHEMA_VERSION: 1;
|
|
544
|
-
interface AwesomeRegistryPageReference {
|
|
545
|
-
page: number;
|
|
546
|
-
items: number;
|
|
547
|
-
path: string;
|
|
548
|
-
}
|
|
549
|
-
interface AwesomeRegistryIndex {
|
|
550
|
-
schemaVersion: typeof AWESOME_REGISTRY_SCHEMA_VERSION;
|
|
551
|
-
pageSize: number;
|
|
552
|
-
totalItems: number;
|
|
553
|
-
totalPages: number;
|
|
554
|
-
pages: AwesomeRegistryPageReference[];
|
|
555
|
-
}
|
|
556
|
-
interface AwesomeRegistryPagination {
|
|
557
|
-
page: number;
|
|
558
|
-
pageSize: number;
|
|
559
|
-
totalItems: number;
|
|
560
|
-
totalPages: number;
|
|
561
|
-
previous: string | null;
|
|
562
|
-
next: string | null;
|
|
563
|
-
}
|
|
564
|
-
type AwesomePluginDownload = {
|
|
565
|
-
type: 'github';
|
|
566
|
-
repository: string;
|
|
567
|
-
} | {
|
|
568
|
-
type: 'url';
|
|
569
|
-
url: string;
|
|
570
|
-
};
|
|
571
|
-
interface AwesomePluginRepository {
|
|
572
|
-
owner: string;
|
|
573
|
-
name: string;
|
|
574
|
-
url: string;
|
|
575
|
-
defaultBranch: string;
|
|
576
|
-
lastCommitAt: string;
|
|
577
|
-
readmeUrl?: string;
|
|
578
|
-
}
|
|
579
|
-
interface AwesomePluginRelease {
|
|
580
|
-
version: string;
|
|
581
|
-
url: string;
|
|
582
|
-
publishedAt: string;
|
|
583
|
-
manifestUrl: string | null;
|
|
584
|
-
}
|
|
585
|
-
interface AwesomePluginListing {
|
|
586
|
-
schemaVersion: typeof AWESOME_REGISTRY_SCHEMA_VERSION;
|
|
587
|
-
id: string;
|
|
588
|
-
authors: string[];
|
|
589
|
-
download: AwesomePluginDownload;
|
|
590
|
-
repository?: AwesomePluginRepository;
|
|
591
|
-
release?: AwesomePluginRelease;
|
|
592
|
-
}
|
|
593
|
-
interface AwesomeRegistryPage {
|
|
594
|
-
schemaVersion: typeof AWESOME_REGISTRY_SCHEMA_VERSION;
|
|
595
|
-
pagination: AwesomeRegistryPagination;
|
|
596
|
-
items: AwesomePluginListing[];
|
|
597
|
-
}
|
|
598
|
-
interface AwesomeRegistryResult<T> {
|
|
599
|
-
data: T;
|
|
600
|
-
cachedAt: string;
|
|
601
|
-
stale: boolean;
|
|
602
|
-
}
|
|
603
|
-
interface AwesomeMarketplaceEntry {
|
|
604
|
-
listing: AwesomePluginListing;
|
|
605
|
-
manifest?: PluginArchiveDB.Meta;
|
|
606
|
-
manifestError?: string;
|
|
607
|
-
}
|
|
608
|
-
interface MarketplaceStorage {
|
|
609
|
-
getItem(key: string): string | null;
|
|
610
|
-
removeItem(key: string): void;
|
|
611
|
-
setItem(key: string, value: string): void;
|
|
612
|
-
}
|
|
613
|
-
//#endregion
|
|
614
|
-
//#region lib/marketplace/cache.d.ts
|
|
615
|
-
declare class AwesomeRegistryCache {
|
|
616
|
-
private readonly storage?;
|
|
617
|
-
private readonly prefix;
|
|
618
|
-
constructor(storage?: MarketplaceStorage | undefined, prefix?: string);
|
|
619
|
-
readIndex(): {
|
|
620
|
-
cachedAt: string;
|
|
621
|
-
data: AwesomeRegistryIndex;
|
|
622
|
-
} | undefined;
|
|
623
|
-
writeIndex(data: AwesomeRegistryIndex): string;
|
|
624
|
-
readPage(path: string): {
|
|
625
|
-
cachedAt: string;
|
|
626
|
-
data: AwesomeRegistryPage;
|
|
627
|
-
} | undefined;
|
|
628
|
-
writePage(path: string, data: AwesomeRegistryPage): string;
|
|
629
|
-
private read;
|
|
630
|
-
private remove;
|
|
631
|
-
private write;
|
|
632
|
-
}
|
|
633
|
-
//#endregion
|
|
634
|
-
//#region lib/marketplace/client.d.ts
|
|
635
|
-
interface AwesomeRegistryClientOptions {
|
|
636
|
-
baseUrl?: string;
|
|
637
|
-
cache?: AwesomeRegistryCache;
|
|
638
|
-
requestJson?: (url: string) => Promise<unknown>;
|
|
639
|
-
storage?: MarketplaceStorage;
|
|
640
|
-
}
|
|
641
|
-
declare class AwesomeRegistryNetworkError extends Error {
|
|
642
|
-
readonly cause?: unknown;
|
|
643
|
-
constructor(message: string, cause?: unknown);
|
|
644
|
-
}
|
|
645
|
-
declare class AwesomeRegistryClient {
|
|
646
|
-
private readonly baseUrl;
|
|
647
|
-
private readonly cache;
|
|
648
|
-
private readonly requestJson;
|
|
649
|
-
constructor(options?: AwesomeRegistryClientOptions);
|
|
650
|
-
loadIndex(): Promise<AwesomeRegistryResult<AwesomeRegistryIndex>>;
|
|
651
|
-
loadPage(path: string): Promise<AwesomeRegistryResult<AwesomeRegistryPage>>;
|
|
652
|
-
findListing(id: string): Promise<AwesomePluginListing>;
|
|
653
|
-
loadManifest(listing: AwesomePluginListing): Promise<PluginArchiveDB.Meta | undefined>;
|
|
654
|
-
private load;
|
|
655
|
-
}
|
|
656
|
-
//#endregion
|
|
657
|
-
//#region lib/marketplace/validation.d.ts
|
|
658
|
-
declare class AwesomeRegistryValidationError extends Error {
|
|
659
|
-
constructor(message: string);
|
|
660
|
-
}
|
|
661
|
-
declare class AwesomeRegistryVersionError extends AwesomeRegistryValidationError {
|
|
662
|
-
readonly received: unknown;
|
|
663
|
-
constructor(received: unknown, path: string);
|
|
664
|
-
}
|
|
665
|
-
declare const parseAwesomeRegistryIndex: (value: unknown) => AwesomeRegistryIndex;
|
|
666
|
-
declare const parseAwesomePluginListing: (value: unknown, field?: string) => AwesomePluginListing;
|
|
667
|
-
declare const parseAwesomeRegistryPage: (value: unknown) => AwesomeRegistryPage;
|
|
668
|
-
declare const assertAwesomeRegistryPagePath: (value: string) => string;
|
|
669
|
-
//#endregion
|
|
670
|
-
//#region lib/marketplace/index.d.ts
|
|
671
|
-
declare const marketplaceDownloadToInstallInput: (download: AwesomePluginDownload) => string;
|
|
672
|
-
declare const marketplaceListingInstallId: (listing: AwesomePluginListing) => string;
|
|
673
|
-
declare const marketplaceListingSource: (listing: AwesomePluginListing) => string;
|
|
674
|
-
//#endregion
|
|
675
|
-
//#region lib/pluginIcon.d.ts
|
|
676
|
-
/** Resolves persisted plugin icon metadata into a URL that an `<img>` can consume. */
|
|
677
|
-
declare const resolvePluginIconUrl: (pluginId: string | undefined, icon: string | undefined) => Promise<string | undefined>;
|
|
678
|
-
//#endregion
|
|
679
|
-
//#region lib/driver/store.d.ts
|
|
680
|
-
declare class PluginStore {
|
|
681
|
-
readonly plugins: import("vue").ShallowReactive<Map<string, Raw<PluginConfig>>>;
|
|
682
|
-
/** Plugins whose complete boot pipeline has completed successfully. */
|
|
683
|
-
readonly ready: import("vue").ShallowReactive<Set<string>>;
|
|
684
|
-
readonly revision: import("vue").ShallowRef<number, number>;
|
|
685
|
-
private readonly pluginNames;
|
|
686
|
-
/**
|
|
687
|
-
* Returns true only when every registered booter has completed successfully.
|
|
688
|
-
*
|
|
689
|
-
* `plugins.has()` intentionally is not used here: the config is inserted before
|
|
690
|
-
* the first booter runs and can therefore describe a partially initialized plugin.
|
|
691
|
-
*/
|
|
692
|
-
$isLoaded(plugin: string): boolean;
|
|
693
|
-
/** Starts a new load generation and invalidates the previous readiness state. */
|
|
694
|
-
$markLoading(plugin: string): void;
|
|
695
|
-
/** Marks a plugin ready after all booters have completed. */
|
|
696
|
-
$markReady(plugin: string): void;
|
|
697
|
-
/** Removes all lifecycle state for a plugin. */
|
|
698
|
-
$markUnloaded(plugin: string): void;
|
|
699
|
-
$refreshI18nNames(): Promise<void>;
|
|
700
|
-
$getI18nName(key: string): string;
|
|
701
|
-
$upsertArchives(archives: PluginArchiveDB.Archive[]): Promise<void>;
|
|
702
|
-
$touch(): void;
|
|
703
|
-
}
|
|
704
|
-
declare const pluginStore: PluginStore;
|
|
705
|
-
declare const usePluginStore: () => PluginStore;
|
|
706
|
-
//#endregion
|
|
707
|
-
//#region lib/driver/loadPlan.d.ts
|
|
708
|
-
interface PluginDependencyMissing {
|
|
709
|
-
pluginName: string;
|
|
710
|
-
dependencyName: string;
|
|
711
|
-
}
|
|
712
|
-
interface PluginLoadPlan {
|
|
713
|
-
levels: PluginArchiveDB.Archive[][];
|
|
714
|
-
missing: PluginDependencyMissing[];
|
|
715
|
-
cycles: string[][];
|
|
716
|
-
}
|
|
717
|
-
declare const findCyclePaths: (plugins: PluginArchiveDB.Archive[]) => string[][];
|
|
718
|
-
declare const planPluginLoadOrder: (plugins: PluginArchiveDB.Archive[]) => PluginLoadPlan;
|
|
719
|
-
type PluginMessageTranslator = (key: string, params: Record<string, number | string>) => string;
|
|
720
|
-
declare const formatPluginLoadPlanError: (plan: Pick<PluginLoadPlan, 'missing' | 'cycles'>, translate?: PluginMessageTranslator) => string;
|
|
721
|
-
//#endregion
|
|
722
|
-
//#region lib/driver/extensionTypes.d.ts
|
|
723
|
-
interface PluginInstallerDescription {
|
|
724
|
-
title: string;
|
|
725
|
-
description: string;
|
|
726
|
-
}
|
|
727
|
-
declare abstract class PluginInstaller {
|
|
728
|
-
/**
|
|
729
|
-
* @returns string mean redirect
|
|
730
|
-
*/
|
|
731
|
-
abstract download(input: string): Promise<File | string>;
|
|
732
|
-
/**
|
|
733
|
-
* @returns string mean redirect
|
|
734
|
-
*/
|
|
735
|
-
abstract update(pluginMeta: PluginArchiveDB.Archive): Promise<File | string>;
|
|
736
|
-
/**
|
|
737
|
-
* @returns string mean redirect
|
|
738
|
-
*/
|
|
739
|
-
abstract fetchPluginMetaFile(input: string): Promise<File | string>;
|
|
740
|
-
abstract isMatched(input: string): boolean;
|
|
741
|
-
abstract name: string;
|
|
742
|
-
abstract description: PluginInstallerDescription;
|
|
743
|
-
}
|
|
744
|
-
declare abstract class PluginLoader {
|
|
745
|
-
abstract name: string;
|
|
746
|
-
abstract load(pluginMeta: PluginArchiveDB.Archive): Promise<PluginConfigFactory | undefined>;
|
|
747
|
-
abstract install(file: File, context?: PluginLoaderInstallContext): Promise<PluginArchiveDB.Meta>;
|
|
748
|
-
abstract canInstall(file: File): boolean;
|
|
749
|
-
/** need full download */
|
|
750
|
-
abstract decodeMeta(file: File): Promise<PluginArchiveDB.Meta>;
|
|
751
|
-
/** no need full download */
|
|
752
|
-
abstract decodeMetaFile(file: File): Promise<PluginArchiveDB.Meta | string>;
|
|
753
|
-
abstract isMetaFile(file: File): boolean;
|
|
754
|
-
}
|
|
755
|
-
interface PluginLoaderInstallContext {
|
|
756
|
-
report: (progress: PluginLoaderInstallProgress) => void;
|
|
757
|
-
}
|
|
758
|
-
interface PluginLoaderInstallProgress {
|
|
759
|
-
description?: string;
|
|
760
|
-
progress?: number;
|
|
761
|
-
}
|
|
762
|
-
type PluginBooterSetMeta = (meta: Partial<{
|
|
763
|
-
description: string;
|
|
764
|
-
name: string;
|
|
765
|
-
}> | string) => void;
|
|
766
|
-
declare abstract class PluginBooter {
|
|
767
|
-
abstract name: string;
|
|
768
|
-
abstract call(cfg: PluginConfig, setMeta: PluginBooterSetMeta, env: Record<any, any>): Promise<any>;
|
|
769
|
-
}
|
|
770
|
-
declare namespace loader_d_exports {
|
|
771
|
-
export { BootConfigOptions, PluginBootRollback, PluginLoadingInfo, bootConfig, bootResolvedConfig, createPluginLoadingInfo, ensurePluginLoadingInfo, loadAllPlugins, loadPlugin, loadPluginConfig, loaders, markPluginLoadError };
|
|
772
|
-
}
|
|
773
|
-
declare const loaders: import("vue").ShallowReactive<PluginLoader[]>;
|
|
774
|
-
type PluginBootRollback = (config: PluginConfig | undefined, expectedName: string | undefined) => Promise<void> | void;
|
|
775
|
-
interface BootConfigOptions {
|
|
776
|
-
expectedName?: string;
|
|
777
|
-
rollback?: PluginBootRollback;
|
|
778
|
-
}
|
|
779
|
-
declare const createPluginLoadingInfo: () => PluginLoadingInfo;
|
|
780
|
-
declare const ensurePluginLoadingInfo: (info: Ref<Record<string, PluginLoadingInfo>>, pluginName: string) => PluginLoadingInfo;
|
|
781
|
-
declare const markPluginLoadError: (info: Ref<Record<string, PluginLoadingInfo>>, pluginName: string, error: unknown) => void;
|
|
782
|
-
/** 解析 config factory 并启动插件;任何中途失败都保留原始错误并执行回滚。 */
|
|
783
|
-
declare const bootConfig: (configFactory: PluginConfigFactory, info: Ref<Record<string, PluginLoadingInfo>>, options?: BootConfigOptions) => Promise<PluginConfig>;
|
|
784
|
-
declare const bootResolvedConfig: (cfg: ReturnType<PluginConfigFactory>, info: Ref<Record<string, PluginLoadingInfo>>) => Promise<void>;
|
|
785
|
-
declare const loadPluginConfig: (meta: PluginArchiveDB.Archive) => Promise<PluginConfigFactory | undefined>;
|
|
786
|
-
declare const loadPlugin: (meta: PluginArchiveDB.Archive, info: Ref<Record<string, PluginLoadingInfo>>) => Promise<void>;
|
|
787
|
-
type PluginLoadingInfo = {
|
|
788
|
-
steps: {
|
|
789
|
-
name: string;
|
|
790
|
-
description: string;
|
|
791
|
-
}[];
|
|
792
|
-
progress: {
|
|
793
|
-
errorReason?: string;
|
|
794
|
-
stepsIndex: number;
|
|
795
|
-
status: 'wait' | 'process' | 'error' | 'done';
|
|
796
|
-
};
|
|
797
|
-
};
|
|
798
|
-
declare const loadAllPlugins: () => Promise<PluginRuntimeOperation>;
|
|
799
|
-
//#endregion
|
|
800
|
-
//#region lib/driver/runtime.d.ts
|
|
801
|
-
interface PrebootRecovery {
|
|
802
|
-
failedAt: number;
|
|
803
|
-
plugins: string[];
|
|
804
|
-
reason: string;
|
|
805
|
-
}
|
|
806
|
-
interface PluginRuntimeOperation {
|
|
807
|
-
operation: Promise<void>;
|
|
808
|
-
progress: Ref<Record<string, PluginLoadingInfo>>;
|
|
809
|
-
}
|
|
810
|
-
interface LoadNormalOptions {
|
|
811
|
-
pluginNames?: readonly string[];
|
|
812
|
-
}
|
|
813
|
-
declare class PluginRuntime {
|
|
814
|
-
private readonly active;
|
|
815
|
-
private readonly activePrebootNames;
|
|
816
|
-
private readonly prebootCleanups;
|
|
817
|
-
private readonly preparedPreboot;
|
|
818
|
-
private readonly startupPluginNames;
|
|
819
|
-
private readonly startupPrebootNames;
|
|
820
|
-
private builtInSynchronization?;
|
|
821
|
-
private enabledPrebootNames;
|
|
822
|
-
private normalOperation?;
|
|
823
|
-
private startupSnapshotReady;
|
|
824
|
-
private prebootActivated;
|
|
825
|
-
get activeNormalPluginNames(): string[];
|
|
826
|
-
loadNormal(options?: LoadNormalOptions): PluginRuntimeOperation;
|
|
827
|
-
reloadNormal(options?: LoadNormalOptions): PluginRuntimeOperation;
|
|
828
|
-
preparePreboot(app: App): Promise<{
|
|
829
|
-
reloadRequired: boolean;
|
|
830
|
-
}>;
|
|
831
|
-
activatePreboot(progress?: Ref<Record<string, PluginLoadingInfo>, Record<string, PluginLoadingInfo>>): Promise<{
|
|
832
|
-
reloadRequired: boolean;
|
|
833
1111
|
}>;
|
|
834
|
-
uninstall(pluginName: string): Promise<void>;
|
|
835
|
-
readRecovery(): PrebootRecovery | null;
|
|
836
|
-
clearRecovery(): void;
|
|
837
|
-
private trackNormalOperation;
|
|
838
|
-
private ensureBuiltInPlugins;
|
|
839
|
-
private captureStartupSnapshot;
|
|
840
|
-
private loadKind;
|
|
841
|
-
private unloadKind;
|
|
842
|
-
private unloadOne;
|
|
843
|
-
private failPreboot;
|
|
844
|
-
}
|
|
845
|
-
declare const pluginRuntime: PluginRuntime;
|
|
846
|
-
//#endregion
|
|
847
|
-
//#region lib/driver/runtimePlan.d.ts
|
|
848
|
-
type ClientPluginKind = 'normal' | 'preboot';
|
|
849
|
-
declare const pluginKind: (plugin: PluginArchiveDB.Archive) => ClientPluginKind;
|
|
850
|
-
declare const selectPluginsForPhase: (plugins: PluginArchiveDB.Archive[], kind: ClientPluginKind, startupPrebootNames?: ReadonlySet<string>, activePrebootNames?: ReadonlySet<string>) => PluginArchiveDB.Archive[];
|
|
851
|
-
declare const failedDependencies: (plugin: PluginArchiveDB.Archive, failedPluginNames: ReadonlySet<string>) => string[];
|
|
852
|
-
declare const filterPluginsBySelection: (plugins: PluginArchiveDB.Archive[], pluginNames?: ReadonlySet<string>) => {
|
|
853
|
-
displayName: string;
|
|
854
|
-
enable: boolean;
|
|
855
|
-
installInput: string;
|
|
856
|
-
installerName: string;
|
|
857
|
-
loaderName: string;
|
|
858
|
-
meta: PluginArchiveDB.Meta;
|
|
859
|
-
pluginName: string;
|
|
860
|
-
}[];
|
|
861
|
-
//#endregion
|
|
862
|
-
//#region lib/driver/builtIn.d.ts
|
|
863
|
-
declare const BUILT_IN_PLUGIN_LOADER = "builtin";
|
|
864
|
-
declare const isBuiltInPluginName: (pluginName: string) => boolean;
|
|
865
|
-
declare const isBuiltInPlugin: (plugin: Pick<PluginArchiveDB.Archive, 'loaderName'>) => boolean;
|
|
866
|
-
declare const builtInDefinitionToArchive: (definition: BuiltInPluginDefinition, enable?: boolean) => PluginArchiveDB.Archive;
|
|
867
|
-
/** Mirrors compile-time definitions into the plugin catalog while preserving their enable state. */
|
|
868
|
-
declare const synchronizeBuiltInPlugins: () => Promise<void>;
|
|
869
|
-
//#endregion
|
|
870
|
-
//#region lib/driver/extensions.d.ts
|
|
871
|
-
interface NamedExtension {
|
|
872
1112
|
name: string;
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
constructor(direction: 'ascending' | 'descending');
|
|
883
|
-
register(extension: T, options?: RuntimeExtensionOptions, owner?: string): () => void;
|
|
884
|
-
removeOwner(owner: string): void;
|
|
885
|
-
private refresh;
|
|
886
|
-
}
|
|
887
|
-
declare class PluginRuntimeExtensions {
|
|
888
|
-
readonly booters: OrderedExtensionRegistry<PluginBooter>;
|
|
889
|
-
readonly installers: OrderedExtensionRegistry<PluginInstaller>;
|
|
890
|
-
readonly loaders: OrderedExtensionRegistry<PluginLoader>;
|
|
891
|
-
private readonly owners;
|
|
892
|
-
registerBooter(booter: PluginBooter, options?: RuntimeExtensionOptions): () => void;
|
|
893
|
-
registerInstaller(installer: PluginInstaller, options?: RuntimeExtensionOptions): () => void;
|
|
894
|
-
registerLoader(loader: PluginLoader, options?: RuntimeExtensionOptions): () => void;
|
|
895
|
-
removeOwner(owner: string): void;
|
|
896
|
-
withOwner<T>(owner: string, action: () => Promise<T>): Promise<T>;
|
|
897
|
-
}
|
|
898
|
-
declare const runtimeExtensions: PluginRuntimeExtensions;
|
|
899
|
-
declare const registerBooter: (booter: PluginBooter, options?: RuntimeExtensionOptions) => () => void;
|
|
900
|
-
declare const registerInstaller: (installer: PluginInstaller, options?: RuntimeExtensionOptions) => () => void;
|
|
901
|
-
declare const registerLoader: (loader: PluginLoader, options?: RuntimeExtensionOptions) => () => void;
|
|
902
|
-
declare namespace booter_d_exports {
|
|
903
|
-
export { bootPlugin, booters };
|
|
904
|
-
}
|
|
905
|
-
declare const booters: import("vue").ShallowReactive<PluginBooter[]>;
|
|
906
|
-
declare const bootPlugin: (cfg: PluginConfig, info: Ref<Record<string, PluginLoadingInfo>>) => Promise<void>;
|
|
907
|
-
declare namespace install_d_exports {
|
|
908
|
-
export { installDepends, installFilePlugin, installPlugin, installers, uninstallPlugin, updatePlugin };
|
|
909
|
-
}
|
|
910
|
-
declare const installers: import("vue").ShallowReactive<PluginInstaller[]>;
|
|
911
|
-
declare const installDepends: (m: DownloadMessageBind, meta: PluginArchiveDB.Meta, installedPlugins?: Set<string>) => Promise<void>;
|
|
912
|
-
declare const installPlugin: (input: string, __installedPlugins?: Set<string>) => Promise<void>;
|
|
913
|
-
declare const installFilePlugin: (file: File, __installedPlugins?: Set<string>) => Promise<void>;
|
|
914
|
-
declare const updatePlugin: (pluginMeta: PluginArchiveDB.Archive, __installedPlugins?: Set<string>) => Promise<void>;
|
|
915
|
-
declare const uninstallPlugin: (pluginName: string) => Promise<void>;
|
|
916
|
-
//#endregion
|
|
917
|
-
//#region lib/index.d.ts
|
|
918
|
-
declare module '@delta-comic/utils' {
|
|
919
|
-
interface SharedFunctions {
|
|
920
|
-
routeToContent(contentType_: UniContentType_, id: string, ep: string, preload?: UniItem): Promise<any>;
|
|
921
|
-
routeToSearch(input: string, source?: [plugin: string, name: string], sort?: string): Promise<any>;
|
|
922
|
-
pushShareToken(token: string): Promise<any>;
|
|
923
|
-
}
|
|
924
|
-
}
|
|
1113
|
+
model: {
|
|
1114
|
+
social: {
|
|
1115
|
+
share: {
|
|
1116
|
+
initiative: InitiativeItem[];
|
|
1117
|
+
tokenListen: ShareToken[];
|
|
1118
|
+
};
|
|
1119
|
+
};
|
|
1120
|
+
};
|
|
1121
|
+
}>;
|
|
925
1122
|
//#endregion
|
|
926
|
-
export {
|
|
1123
|
+
export { type ActionPageItem, ActivationContext, ActivationPipeline, ActivationStepUpdate, type Auth, type AutoCompleteProvider, type Barcode, type CallbackResult, CapabilityDefinition, CapabilityModule, type Category, CompositePluginCandidateProvider, ConfigDescription, ConfigEnv, ConfigPointer, content_d_exports as Content, type ContentHooks, type ContentModel, Contribution, ContributionChannel, ContributionHub, ContributionRegistry, index_d_exports as Core, DCPluginConfig, DELTA_COMIC_PLUGIN_API_VERSION, DatabasePluginArchiveRepository, DecodedPluginPackage, type Definition, DevScriptCodec, expose_d_exports as Expose, type ExposeModel, type Favourites, GitHubSourceResolver, GitHubSourceResolverOptions, type HotCategory, type HotLevelboard, type HotPageContent, type HotSearchProvider, type HotTopButton, HttpSourceResolver, type InitiativeItem, type InjectCode, InstalledPluginCandidateProvider, InternalPluginCandidateProvider, InternalPluginDefinition, InternalPluginPreferences, type ItemProvider, type LifecycleHooks, LoadNormalOptions, LoadedPluginModule, LocalFileSourceResolver, LocalInternalPluginPreferences, MarketplaceSourceResolver, type Method, MissingPluginDependency, type Model, Platform, PluginArchiveRepository, PluginAuthGateway, PluginCandidate, PluginCandidateProvider, PluginCapabilityServices, PluginCatalog, PluginCatalogIndex, PluginCatalogListing, PluginCatalogPage, PluginCatalogPageReference, PluginCatalogPagination, PluginCatalogRelease, PluginCatalogRepository, PluginCatalogResult, PluginCatalogSource, PluginConfigFactory, type PluginConfigHooks, type PluginConfigModel, PluginConfigRegistry, PluginDependencyPlan, PluginDisposer, PluginFileReplacement, PluginFileStore, PluginHostServices, type PluginI18nAdapter, PluginInstallCatalog, PluginInstallInput, PluginInstallProgress, PluginInstallReporter, PluginInstallService, PluginInstallServiceOptions, type PluginLifecycleCleanup, PluginLoadingInfo, PluginLocaleMessage, PluginLocaleMessages, PluginManagementCapabilities, type PluginManifest, PluginManifestError, PluginMessageRegistry, PluginModuleReader, PluginOrigin, PluginPackageCodec, PluginRuntime, PluginRuntimeFailure, PluginRuntimeOperation, PluginRuntimeOptions, PluginRuntimeReport, PluginScope, PluginSourceResolver, PluginStore, PrebootRecovery, type Promotes, RegisteredPluginConfig, remote_d_exports as Remote, type RemoteHooks, type RemoteModel, RemoteSelection, ResolvedPluginSource, resource_d_exports as Resource, type ResourceModel, type Search, type SearchAim, type SearchMethod, type Selection, type Share, type SharePopupConfig, type ShareToken, social_d_exports as Social, type SocialHooks, type SocialModel, special_d_exports as Special, type SpecialModel, type Step, StoredPluginModuleReader, type Subscribe, type SubscribeListProvider, type Tabbar, type TestFunction, type TestGroup, UnwrapConfigPointer, user_d_exports as User, type UserAction, type UserActionPage, type UserModel, ZipPackageCodec, configurePluginHost, createAuthCapability, createConfigCapability, createContentCapability, createDefaultCapabilities, createI18nCapability, createLifecycleCapability, createModelCapability, createRemoteCapability, createResourceCapability, createSpecialCapability, createUserCapability, defineCapability, defineContributionChannel, defineDeltaComicPlugin, defineInternalPlugin, findPluginDependencyCycles, installPlugin, isPluginManifestCompatible, parsePluginManifest, planPluginDependencies, pluginCatalog, pluginCatalogIdFromInstallInput, pluginCatalogInstallInput, pluginConfigStore, pluginContributions, pluginI18n, pluginInstaller, pluginMessageKey, pluginModelChannels, pluginRemoteSelectionChannel, pluginRuntime, pluginStore, resolvePluginIconUrl, safePluginPath, setPluginEnabled, setPluginKind, translatePluginText, uninstallPlugin, updatePlugin, updatePluginByName, useConfig, usePluginStore };
|
|
927
1124
|
//# sourceMappingURL=index.d.mts.map
|