@xiongtao.xt/tau-plugins 0.40.0 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
1
  import type { PluginDefinition } from "./contract";
2
2
  import type { PluginEditorExtension } from "./editor";
3
3
  import type { MarkdownCodec } from "../../markdown/src/index";
4
- import { type PortablePlatform, type ReadablePortablePluginManifest, type PortablePluginHost } from "./portable";
4
+ import { type ReadablePortablePluginManifest, type PortablePluginHost } from "./portable";
5
5
  import { type DevelopmentPluginPackage, type PluginManifest } from "./package";
6
6
  export type { PublishedPluginRender } from "./render-artifact";
7
7
  export declare function assertUniqueEditorCodecs(codecs: readonly MarkdownCodec[]): void;
8
8
  export declare const PLUGIN_RENDER_VERSION = 1;
9
9
  /** 发布站只读取静态贡献;清单保持原格式,不启动应用插件生命周期。 */
10
- export declare function readPublishedPluginManifest(value: unknown): PluginManifest | ReadablePortablePluginManifest;
10
+ export declare function readPublishedPluginManifest(value: unknown): PluginManifest | import("./portable").PortablePluginManifest;
11
11
  export declare function evaluatePublishedPluginPackage(artifact: {
12
12
  manifest: PluginManifest | ReadablePortablePluginManifest;
13
13
  code: string;
@@ -33,45 +33,12 @@ export declare function evaluatePortablePluginPackage(artifact: {
33
33
  code: string;
34
34
  css?: string;
35
35
  }, modules: Readonly<Record<string, unknown>>, host: PortablePluginHost): PluginDefinition;
36
- /** 各宿主共用支持等级投影;原始数据与节点身份不改写。 */
37
- export declare function adaptPortablePluginDefinition(definition: PluginDefinition, manifest: ReadablePortablePluginManifest, platform: PortablePlatform): {
38
- support: Readonly<{
39
- [k: string]: import("./portable").PluginElementSupport;
40
- }>;
41
- definition: {
42
- editorExtensions: {
43
- blockPanel?: readonly import("../../editor/api").IBlockPanelListItem[] | ((editor: import("slate").Editor) => readonly import("../../editor/api").IBlockPanelListItem[]);
44
- commands?: readonly import("../../editor/api").EditorCommand[];
45
- hotkeys?: readonly import("../../editor/api").EditorHotkey[];
46
- menu?: import("../../editor/api").EditorMenuContribution;
47
- behaviorsFor?: Readonly<Record<string, import("../../editor/api").ElementBehaviors>>;
48
- elements: import("../../editor/api").ElementSpec<import("../../editor/api").ParagraphElement>[];
49
- styleSources: {
50
- type: string;
51
- field: string;
52
- language: "html" | "tsx";
53
- }[] | undefined;
54
- htmlSerializers: {
55
- type: string;
56
- toHtml(element: Record<string, unknown>): string;
57
- }[] | undefined;
58
- id: string;
59
- apiVersion: typeof import("../../editor/api").EXTENSION_API_VERSION;
60
- plugins?: never;
61
- }[] | undefined;
62
- editorCodecs: MarkdownCodec[] | undefined;
63
- id: string;
64
- name: string;
65
- version: string;
66
- apiVersion: 1;
67
- whiteboardExtensions?: readonly import("../../whiteboard/src/author").WhiteboardExtension[];
68
- ai?: {
69
- readonly features: readonly import("./ai").PluginAIFeature[];
70
- };
71
- create(): import("./contract").PluginInstance;
72
- };
36
+ export declare const hasPluginContent: (definition: PluginDefinition) => boolean;
37
+ type DefinitionManifest = Pick<PluginManifest, "id" | "name" | "version" | "apiVersion"> & {
38
+ readonly formatVersion?: number;
39
+ readonly editor?: boolean;
40
+ readonly whiteboard?: boolean;
73
41
  };
74
- type DefinitionManifest = Pick<PluginManifest, "id" | "name" | "version" | "apiVersion" | "editor" | "whiteboard">;
75
42
  export declare function validatePluginDefinition(manifest: DefinitionManifest, definition: PluginDefinition | undefined): PluginDefinition;
76
43
  export declare function getPluginNodeTypes(definition: PluginDefinition): string[];
77
44
  export declare function getPluginWhiteboardTypes(definition: PluginDefinition): string[];
@@ -3,5 +3,5 @@ export type { SketchPath, Vec } from "../../whiteboard/src/author";
3
3
  export type { SchematicShape, SchematicFill, ResolvedSketch, ElementSketch, PageSketch, SketchLevel, } from "../../whiteboard/src/author";
4
4
  export type { WhiteboardAPI, WhiteboardExtension, WhiteboardElementDefinition, WhiteboardContributions, TypedBoardElement, ElementCreateSpec, WhiteboardSnapshot, BoardElement, WhiteboardToolProps, } from "../../whiteboard/src/author";
5
5
  import type { PluginStorage } from "./contract";
6
- /** 由宿主按插件和工作区绑定,交互扩展通过 requires 声明后获取。 */
6
+ /** 由宿主按插件和工作区绑定,交互扩展通过 getService 获取。 */
7
7
  export declare const IPluginStorage: import("../../shared/service-contract").ServiceIdentifier<PluginStorage>;
@@ -77,16 +77,9 @@ export interface WhiteboardAPI {
77
77
  getShortcut(commandId: string): string | null;
78
78
  /** 让指定元素闪烁提示(内核事件 element:flash 的公开触发入口) */
79
79
  flashElement(id: string): void;
80
- /**
81
- * 获取必选宿主服务:只能取扩展 requires 声明过的 id;
82
- * 取未声明的 id 或对 optional 声明的 id 调用均抛错(编程错误)。
83
- * 仅扩展作用域的 api 提供,主 api 调用即抛错。
84
- */
80
+ /** 获取宿主为当前扩展提供的服务,缺失时抛错;主 API 不提供服务访问。 */
85
81
  getService<T>(id: ServiceIdentifier<T>): T;
86
- /**
87
- * 获取可选宿主服务:只能取扩展 requires/optional 声明过的 id,
88
- * 未注册返回 undefined;取未声明的 id 抛错(编程错误)。
89
- */
82
+ /** 获取宿主为当前扩展提供的可缺省服务,缺失时返回 undefined。 */
90
83
  tryGetService<T>(id: ServiceIdentifier<T>): T | undefined;
91
84
  /** 订阅内核事件(按 WhiteboardKernelEvents 推断参数)或扩展事件(<命名空间>.<名称>) */
92
85
  on<K extends keyof WhiteboardKernelEvents>(event: K, listener: (...args: WhiteboardKernelEvents[K]) => void): void;
@@ -319,16 +312,6 @@ export interface WhiteboardExtension {
319
312
  /** 展示名(UI 显示"来自 xxx"用);内置扩展可不填 */
320
313
  readonly name?: string;
321
314
  readonly apiVersion: 1;
322
- /**
323
- * 必选宿主服务:任一服务在宿主注册表中不存在时扩展被拒(reason "missing-service")。
324
- * 声明过的 id 才能经 api.getService / api.tryGetService 获取。
325
- */
326
- readonly requires?: readonly ServiceIdentifier<unknown>[];
327
- /**
328
- * 可选宿主服务:缺失不影响装配,经 api.tryGetService 获取(返回 undefined 表示未提供)。
329
- * 对 optional 中的 id 调用 getService 会抛错。
330
- */
331
- readonly optional?: readonly ServiceIdentifier<unknown>[];
332
315
  create(api: WhiteboardAPI): WhiteboardContributions;
333
316
  }
334
317
  /** 扩展被禁用的原因:除编程错误外一律降级禁用单个扩展,不中断画布装配。 */
@@ -1,301 +0,0 @@
1
- import {
2
- assertLocalId,
3
- comparePluginVersions,
4
- validatePluginManifest
5
- } from "./chunk-FZTR4KOY.js";
6
-
7
- // packages/plugins/src/capabilities.ts
8
- var PLUGIN_CAPABILITIES = [
9
- "commands",
10
- "storage",
11
- "pages",
12
- "navigation",
13
- "settings",
14
- "dialogs",
15
- "editor",
16
- "editorCodecs",
17
- "sourceEditor",
18
- "runtimeStyles",
19
- "fetch",
20
- "sync",
21
- "upload",
22
- "media"
23
- ];
24
- function readPluginCapabilityNames(value) {
25
- if (!Array.isArray(value) || value.length > 128 || [...value].some(
26
- (item) => typeof item !== "string" || item.length > 128 || !/^[a-z][a-zA-Z0-9]*$/.test(item)
27
- ) || new Set(value).size !== value.length)
28
- throw new Error("\u80FD\u529B\u5217\u8868\u5305\u542B\u65E0\u6548\u540D\u79F0\u3001\u91CD\u590D\u9879\u6216\u8D85\u51FA\u6570\u91CF\u9650\u5236");
29
- return Object.freeze([...value]);
30
- }
31
- function isPluginCapability(value) {
32
- return typeof value === "string" && PLUGIN_CAPABILITIES.some((capability) => capability === value);
33
- }
34
- function readPluginCapabilities(value) {
35
- const names = readPluginCapabilityNames(value);
36
- if (!names.every(isPluginCapability)) throw new Error("\u80FD\u529B\u5217\u8868\u5305\u542B\u672A\u77E5\u80FD\u529B");
37
- return names;
38
- }
39
-
40
- // packages/plugins/src/portable.ts
41
- var PORTABLE_PLATFORMS = ["desktop", "android", "ios"];
42
- var PORTABLE_SHARED_MODULES = [
43
- "@tau/plugins",
44
- "@tau/plugins/whiteboard",
45
- "@tau/ui",
46
- "react",
47
- "react-dom",
48
- "react-dom/client",
49
- "react/jsx-runtime",
50
- "react/jsx-dev-runtime"
51
- ];
52
- var PLUGIN_BASE_REQUIREMENTS = [
53
- "commands",
54
- "storage",
55
- "pages",
56
- "navigation",
57
- "settings",
58
- "dialogs"
59
- ];
60
- function assertKeys(item, keys, label) {
61
- if (Object.keys(item).some((key) => !keys.includes(key))) throw new Error(`${label}\u5305\u542B\u672A\u77E5\u5B57\u6BB5`);
62
- }
63
- function buildPortablePluginManifest(value, output) {
64
- const item = record(value, "\u4F5C\u8005\u6E05\u5355");
65
- const files = record(output, "\u6784\u5EFA\u6587\u4EF6\u4FE1\u606F");
66
- assertKeys(files, ["main", "styles", "integrity", "skills", "imports"], "\u6784\u5EFA\u6587\u4EF6\u4FE1\u606F");
67
- const imports = files.imports ?? [];
68
- if (!Array.isArray(imports) || imports.some((name) => !PORTABLE_SHARED_MODULES.includes(name)))
69
- throw new Error("\u6784\u5EFA\u6A21\u5757\u4F9D\u8D56\u65E0\u6548");
70
- const whiteboard = imports.includes("@tau/plugins/whiteboard");
71
- const { imports: _imports, ...buildFiles } = files;
72
- assertKeys(
73
- item,
74
- [
75
- "id",
76
- "name",
77
- "version",
78
- "description",
79
- "categories",
80
- "keywords",
81
- "permissions",
82
- "requires",
83
- "optional",
84
- "editor",
85
- "targets"
86
- ],
87
- "\u4F5C\u8005\u6E05\u5355"
88
- );
89
- const targets = record(item.targets, "\u76EE\u6807\u5E73\u53F0");
90
- const requirements = (input, optional) => {
91
- const names = readPluginCapabilities(input ?? []);
92
- const allowed = optional ? ["runtimeStyles"] : ["sourceEditor", "runtimeStyles", "media", "fetch", "sync", "upload"];
93
- if (names.some((name) => !allowed.includes(name)))
94
- throw new Error(optional ? "\u529F\u80FD\u4E0D\u652F\u6301\u53EF\u9009\u8BBF\u95EE" : "\u4F5C\u8005\u53EA\u80FD\u58F0\u660E\u989D\u5916\u529F\u80FD\u9700\u6C42");
95
- return names;
96
- };
97
- const elements = (input) => {
98
- if (input === void 0) return void 0;
99
- const editor = record(input, "\u7F16\u8F91\u5668\u58F0\u660E");
100
- assertKeys(editor, ["elements"], "\u7F16\u8F91\u5668\u58F0\u660E");
101
- return record(editor.elements, "\u8282\u70B9\u652F\u6301\u58F0\u660E");
102
- };
103
- const commonRequired = requirements(item.requires, false);
104
- const commonOptional = requirements(item.optional, true);
105
- if (commonOptional.some((name) => commonRequired.includes(name)))
106
- throw new Error("\u5FC5\u9700\u4E0E\u53EF\u9009\u80FD\u529B\u4E0D\u80FD\u91CD\u53E0");
107
- const commonElements = elements(item.editor);
108
- const normalized = Object.fromEntries(
109
- Object.entries(targets).map(([platform, input]) => {
110
- const target = record(input, "\u5E73\u53F0\u914D\u7F6E");
111
- assertKeys(target, ["minAppVersion", "requires", "optional", "editor"], "\u5E73\u53F0\u914D\u7F6E");
112
- const extra = target.requires === void 0 ? commonRequired : requirements(target.requires, false);
113
- const optional = target.optional === void 0 ? commonOptional : requirements(target.optional, true);
114
- if (optional.some((name) => extra.includes(name))) throw new Error("\u5FC5\u9700\u4E0E\u53EF\u9009\u80FD\u529B\u4E0D\u80FD\u91CD\u53E0");
115
- if (optional.includes("runtimeStyles") && !extra.includes("sourceEditor"))
116
- throw new Error("\u53EF\u9009\u6837\u5F0F\u7F16\u8BD1\u9700\u8981 sourceEditor \u8BBF\u95EE\u5668");
117
- const support = target.editor === void 0 ? commonElements : elements(target.editor);
118
- const required = [...PLUGIN_BASE_REQUIREMENTS, ...extra];
119
- if (support) required.push("editor", "editorCodecs");
120
- return [
121
- platform,
122
- {
123
- minAppVersion: target.minAppVersion,
124
- required,
125
- optional,
126
- ...support ? { elements: support } : {}
127
- }
128
- ];
129
- })
130
- );
131
- const {
132
- requires: _requires,
133
- optional: _optional,
134
- editor: _editor,
135
- targets: _targets,
136
- ...metadata
137
- } = item;
138
- return validatePortableDistributionManifest({
139
- ...metadata,
140
- formatVersion: 3,
141
- apiVersion: 1,
142
- platform: "portable",
143
- profile: "web-v1",
144
- format: "cjs",
145
- ...buildFiles,
146
- ...whiteboard ? { whiteboard: true } : {},
147
- ...Object.values(normalized).some((target) => target.elements) ? { editor: true } : {},
148
- targets: normalized
149
- });
150
- }
151
- function record(value, label) {
152
- if (!value || typeof value !== "object" || Array.isArray(value) || Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null)
153
- throw new Error(`${label}\u5FC5\u987B\u662F\u666E\u901A\u5BF9\u8C61`);
154
- return value;
155
- }
156
- function validatePortablePluginManifest(value) {
157
- return parsePortablePluginManifest(value, readPluginCapabilities);
158
- }
159
- function readPortablePluginManifest(value) {
160
- return parsePortablePluginManifest(value, readPluginCapabilityNames);
161
- }
162
- function validatePortableDistributionManifest(value) {
163
- const manifest = validatePortablePluginManifest(value);
164
- if (/[-+]/.test(manifest.version)) throw new Error("\u6B63\u5F0F\u8DE8\u7AEF\u5305\u7248\u672C\u4E0D\u80FD\u542B\u9884\u53D1\u5E03\u6216\u6784\u5EFA\u6807\u8BC6");
165
- if ((manifest.targets.android || manifest.targets.ios) && manifest.permissions?.length)
166
- throw new Error("\u79FB\u52A8\u7AEF\u5C1A\u672A\u63A5\u5165\u4E1A\u52A1\u6570\u636E\u6388\u6743\uFF0C\u4E0D\u80FD\u53D1\u5E03\u58F0\u660E\u8FD9\u4E9B\u6743\u9650\u7684\u79FB\u52A8\u76EE\u6807");
167
- return manifest;
168
- }
169
- function parsePortablePluginManifest(value, readCapabilities) {
170
- const item = record(value, "\u8DE8\u7AEF\u6E05\u5355");
171
- const keys = /* @__PURE__ */ new Set([
172
- "formatVersion",
173
- "apiVersion",
174
- "id",
175
- "name",
176
- "description",
177
- "version",
178
- "platform",
179
- "profile",
180
- "targets",
181
- "format",
182
- "main",
183
- "styles",
184
- "editor",
185
- "whiteboard",
186
- "categories",
187
- "keywords",
188
- "permissions",
189
- "integrity",
190
- "skills"
191
- ]);
192
- if (Object.keys(item).some((key) => !keys.has(key))) throw new Error("\u8DE8\u7AEF\u6E05\u5355\u5305\u542B\u672A\u652F\u6301\u5B57\u6BB5");
193
- if (item.formatVersion !== 3 || item.platform !== "portable" || item.profile !== "web-v1")
194
- throw new Error("\u8DE8\u7AEF\u5305\u683C\u5F0F\u6216\u8FD0\u884C\u914D\u7F6E\u4E0D\u517C\u5BB9");
195
- if (item.description !== void 0 && (typeof item.description !== "string" || !item.description.trim() || item.description.length > 160))
196
- throw new Error("\u63D2\u4EF6\u7B80\u4ECB\u5FC5\u987B\u4E3A 1 \u81F3 160 \u5B57");
197
- const base = validatePluginManifest(
198
- { ...item, formatVersion: 1, platform: "desktop" },
199
- { strict: true }
200
- );
201
- const rawTargets = record(item.targets, "\u76EE\u6807\u5E73\u53F0");
202
- if (!Object.keys(rawTargets).length || Object.keys(rawTargets).some((key) => !PORTABLE_PLATFORMS.some((platform) => platform === key)))
203
- throw new Error("\u76EE\u6807\u5E73\u53F0\u4E3A\u7A7A\u6216\u5305\u542B\u672A\u77E5\u5E73\u53F0");
204
- const targets = {};
205
- for (const platform of PORTABLE_PLATFORMS) {
206
- if (!Object.hasOwn(rawTargets, platform)) continue;
207
- const target = record(rawTargets[platform], "\u5E73\u53F0\u914D\u7F6E");
208
- if (Object.keys(target).some(
209
- (key) => !["minAppVersion", "required", "optional", "elements"].includes(key)
210
- ))
211
- throw new Error("\u5E73\u53F0\u914D\u7F6E\u5305\u542B\u672A\u77E5\u5B57\u6BB5");
212
- if (typeof target.minAppVersion !== "string") throw new Error("\u5E73\u53F0\u7F3A\u5C11\u6700\u4F4E\u5BA2\u6237\u7AEF\u7248\u672C");
213
- comparePluginVersions(target.minAppVersion, target.minAppVersion);
214
- const required = readCapabilities(target.required);
215
- const optional = readCapabilities(target.optional ?? []);
216
- if (base.whiteboard && platform !== "desktop") throw new Error("\u767D\u677F\u6269\u5C55\u53EA\u652F\u6301\u684C\u9762\u76EE\u6807");
217
- if (optional.some((capability) => required.includes(capability)))
218
- throw new Error("\u5FC5\u9700\u4E0E\u53EF\u9009\u80FD\u529B\u4E0D\u80FD\u91CD\u53E0");
219
- let elements;
220
- if (target.elements !== void 0) {
221
- const entries = Object.entries(record(target.elements, "\u8282\u70B9\u652F\u6301\u58F0\u660E"));
222
- if (!base.editor || !entries.length || entries.length > 128)
223
- throw new Error("\u8282\u70B9\u652F\u6301\u58F0\u660E\u9700\u8981\u7F16\u8F91\u5668\u8D21\u732E\u4E14\u6570\u91CF\u6709\u6548");
224
- elements = /* @__PURE__ */ Object.create(null);
225
- for (const [type, support] of entries) {
226
- assertLocalId(type);
227
- if (type === "__proto__" || !["none", "render", "edit"].includes(support))
228
- throw new Error("\u8282\u70B9\u652F\u6301\u7B49\u7EA7\u65E0\u6548");
229
- if (support !== "none" && !required.some((capability) => capability === "editor"))
230
- throw new Error("\u5C55\u793A\u6216\u7F16\u8F91\u8282\u70B9\u9700\u8981\u58F0\u660E\u7F16\u8F91\u5668\u80FD\u529B");
231
- elements[type] = support;
232
- }
233
- }
234
- if (base.editor && !elements) throw new Error("\u6BCF\u4E2A\u76EE\u6807\u5E73\u53F0\u5FC5\u987B\u660E\u786E\u58F0\u660E\u8282\u70B9\u652F\u6301\u7B49\u7EA7");
235
- targets[platform] = Object.freeze({
236
- minAppVersion: target.minAppVersion,
237
- required,
238
- optional,
239
- ...elements ? { elements: Object.freeze(elements) } : {}
240
- });
241
- }
242
- const files = record(item.integrity, "\u6587\u4EF6\u6458\u8981");
243
- if (Object.keys(files).some((file) => !Object.hasOwn(base.integrity, file)))
244
- throw new Error("\u8DE8\u7AEF\u5305\u5305\u542B\u672A\u58F0\u660E\u6587\u4EF6");
245
- for (const file of Object.keys(files)) {
246
- if (file === base.main || file === base.styles) continue;
247
- if (!file.endsWith(".md") || file.split("/").includes("scripts") || file.includes("\\"))
248
- throw new Error("\u8DE8\u7AEF Skill \u4EC5\u652F\u6301\u7EAF Markdown \u6587\u6863\uFF0C\u4E0D\u652F\u6301\u811A\u672C\u6216\u9644\u4EF6");
249
- }
250
- return Object.freeze({
251
- ...base,
252
- formatVersion: 3,
253
- platform: "portable",
254
- profile: "web-v1",
255
- ...typeof item.description === "string" ? { description: item.description } : {},
256
- targets: Object.freeze(targets)
257
- });
258
- }
259
- function assertPortablePluginCompatibility(manifest, host) {
260
- if (!host.profiles.includes(manifest.profile)) throw new Error("\u5BBF\u4E3B\u672A\u63A5\u5165\u8DE8\u7AEF\u8FD0\u884C\u914D\u7F6E");
261
- const platform = host.environment.platform;
262
- if (!PORTABLE_PLATFORMS.some((value) => value === platform))
263
- throw new Error("\u5F53\u524D\u5E73\u53F0\u4E0D\u80FD\u6FC0\u6D3B\u8DE8\u7AEF\u5E94\u7528\u63D2\u4EF6");
264
- const target = manifest.targets[platform];
265
- if (!target) throw new Error("\u63D2\u4EF6\u4E0D\u652F\u6301\u5F53\u524D\u5E73\u53F0");
266
- if ((platform === "android" || platform === "ios") && manifest.permissions?.length)
267
- throw new Error("\u79FB\u52A8\u5BBF\u4E3B\u5C1A\u672A\u63A5\u5165\u4E1A\u52A1\u6570\u636E\u6388\u6743");
268
- if (comparePluginVersions(host.appVersion, target.minAppVersion) < 0)
269
- throw new Error("\u5BA2\u6237\u7AEF\u7248\u672C\u4F4E\u4E8E\u63D2\u4EF6\u8981\u6C42");
270
- const missing = target.required.filter(
271
- (capability) => !host.capabilities.some((available) => available === capability)
272
- );
273
- if (missing.length) throw new Error(`\u5BBF\u4E3B\u7F3A\u5C11\u5FC5\u9700\u80FD\u529B\uFF1A${missing.join("\u3001")}`);
274
- return target;
275
- }
276
- function getPortableElementSupport(manifest, platform, type) {
277
- const elements = manifest.targets[platform]?.elements;
278
- return elements && Object.hasOwn(elements, type) ? elements[type] : "none";
279
- }
280
- function assertPortableElementDeclarations(manifest, nodeTypes) {
281
- const actual = new Set(nodeTypes);
282
- for (const target of Object.values(manifest.targets)) {
283
- const declared = Object.keys(target.elements ?? {});
284
- if (declared.length !== actual.size || declared.some((type) => !actual.has(type)))
285
- throw new Error("\u5E73\u53F0\u8282\u70B9\u58F0\u660E\u4E0E\u63D2\u4EF6\u5B9E\u9645\u8D21\u732E\u4E0D\u4E00\u81F4");
286
- }
287
- }
288
-
289
- export {
290
- isPluginCapability,
291
- PORTABLE_PLATFORMS,
292
- PORTABLE_SHARED_MODULES,
293
- PLUGIN_BASE_REQUIREMENTS,
294
- buildPortablePluginManifest,
295
- validatePortablePluginManifest,
296
- readPortablePluginManifest,
297
- validatePortableDistributionManifest,
298
- assertPortablePluginCompatibility,
299
- getPortableElementSupport,
300
- assertPortableElementDeclarations
301
- };
@@ -1,7 +0,0 @@
1
- /** 功能名只表示是否可用;接口升级由 SDK 和最低客户端版本管理。 */
2
- export declare const PLUGIN_CAPABILITIES: readonly ["commands", "storage", "pages", "navigation", "settings", "dialogs", "editor", "editorCodecs", "sourceEditor", "runtimeStyles", "fetch", "sync", "upload", "media"];
3
- export type PluginCapability = (typeof PLUGIN_CAPABILITIES)[number];
4
- /** 保留分发清单原值,未知可选功能可读取但不能当作已实现功能。 */
5
- export declare function readPluginCapabilityNames(value: unknown): readonly string[];
6
- export declare function isPluginCapability(value: unknown): value is PluginCapability;
7
- export declare function readPluginCapabilities(value: unknown): readonly PluginCapability[];