lucid-extension-sdk 0.0.164 → 0.0.165
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/commandtypes.d.ts +13 -0
- package/commandtypes.js +1 -0
- package/editorclient.d.ts +12 -0
- package/editorclient.js +14 -0
- package/package.json +1 -1
package/commandtypes.d.ts
CHANGED
|
@@ -75,6 +75,7 @@ export declare const enum CommandName {
|
|
|
75
75
|
HookSelection = "hs",
|
|
76
76
|
HookTextEdit = "hte",
|
|
77
77
|
ImportCards = "ic",
|
|
78
|
+
ImportPage = "imp",
|
|
78
79
|
KillExtension = "k",
|
|
79
80
|
ListBlocks = "lb",
|
|
80
81
|
ListCollectionFields = "lcf",
|
|
@@ -357,6 +358,10 @@ export declare type CommandArgs = {
|
|
|
357
358
|
query: ImportCardsQuery;
|
|
358
359
|
result: ImportCardsResult;
|
|
359
360
|
};
|
|
361
|
+
[CommandName.ImportPage]: {
|
|
362
|
+
query: ImportPageQuery;
|
|
363
|
+
result: ImportPageResult;
|
|
364
|
+
};
|
|
360
365
|
[CommandName.ListBlocks]: {
|
|
361
366
|
query: ListChildrenQuery;
|
|
362
367
|
result: ListChildrenResult;
|
|
@@ -1001,6 +1006,14 @@ export declare type HookTextEditResult = undefined;
|
|
|
1001
1006
|
export declare type ImportCardsQuery = string;
|
|
1002
1007
|
/** Resolves when the import dialog is closed */
|
|
1003
1008
|
export declare type ImportCardsResult = Promise<void>;
|
|
1009
|
+
export declare type ImportPageQuery = {
|
|
1010
|
+
/** The ID of the document or template to import */
|
|
1011
|
+
'id': string;
|
|
1012
|
+
/** Page numbers of specified document or template to import (zero-indexed) */
|
|
1013
|
+
'n': number[];
|
|
1014
|
+
};
|
|
1015
|
+
/** Resolves when the import succeeds or fails */
|
|
1016
|
+
export declare type ImportPageResult = Promise<void>;
|
|
1004
1017
|
export declare type KillExtensionQuery = void;
|
|
1005
1018
|
export declare type KillExtensionResult = undefined;
|
|
1006
1019
|
export declare type ListChildrenQuery = {
|
package/commandtypes.js
CHANGED
|
@@ -57,6 +57,7 @@ exports.commandTitles = new Map([
|
|
|
57
57
|
["hs" /* CommandName.HookSelection */, 'HookSelection'],
|
|
58
58
|
["hte" /* CommandName.HookTextEdit */, 'HookTextEdit'],
|
|
59
59
|
["ic" /* CommandName.ImportCards */, 'ImportCards'],
|
|
60
|
+
["imp" /* CommandName.ImportPage */, 'ImportPage'],
|
|
60
61
|
["k" /* CommandName.KillExtension */, 'KillExtension'],
|
|
61
62
|
["lb" /* CommandName.ListBlocks */, 'ListBlocks'],
|
|
62
63
|
["lcf" /* CommandName.ListCollectionFields */, 'ListCollectionFields'],
|
package/editorclient.d.ts
CHANGED
|
@@ -221,6 +221,18 @@ export declare class EditorClient {
|
|
|
221
221
|
* @returns a promise that resolves when the block classes can be used to create new blocks on the document
|
|
222
222
|
*/
|
|
223
223
|
loadBlockClasses(classNames: string[]): Promise<undefined>;
|
|
224
|
+
/**
|
|
225
|
+
* Import one or pages of the specified document or template into the current document
|
|
226
|
+
* as new pages.
|
|
227
|
+
* NOTE: The indices of the pages to import will change if the pages are rearranged
|
|
228
|
+
* on the source document or template.
|
|
229
|
+
*
|
|
230
|
+
* @param documentId The ID of the document or template to import
|
|
231
|
+
* @param pageNums An array of zero-indexed page indices to import from the document or template
|
|
232
|
+
* @returns a promise that resolves to void when the pages have been imported or the
|
|
233
|
+
* the import failed
|
|
234
|
+
*/
|
|
235
|
+
importPage(documentId: string, pageNums: number[]): Promise<void>;
|
|
224
236
|
/**
|
|
225
237
|
* Load the requested shape library's content, and if it was found, return a block definition ready to be
|
|
226
238
|
* created.
|
package/editorclient.js
CHANGED
|
@@ -373,6 +373,20 @@ class EditorClient {
|
|
|
373
373
|
loadBlockClasses(classNames) {
|
|
374
374
|
return this.sendCommand("lbc" /* CommandName.LoadBlockClasses */, classNames);
|
|
375
375
|
}
|
|
376
|
+
/**
|
|
377
|
+
* Import one or pages of the specified document or template into the current document
|
|
378
|
+
* as new pages.
|
|
379
|
+
* NOTE: The indices of the pages to import will change if the pages are rearranged
|
|
380
|
+
* on the source document or template.
|
|
381
|
+
*
|
|
382
|
+
* @param documentId The ID of the document or template to import
|
|
383
|
+
* @param pageNums An array of zero-indexed page indices to import from the document or template
|
|
384
|
+
* @returns a promise that resolves to void when the pages have been imported or the
|
|
385
|
+
* the import failed
|
|
386
|
+
*/
|
|
387
|
+
async importPage(documentId, pageNums) {
|
|
388
|
+
return await this.sendCommand("imp" /* CommandName.ImportPage */, { 'id': documentId, 'n': pageNums });
|
|
389
|
+
}
|
|
376
390
|
/**
|
|
377
391
|
* Load the requested shape library's content, and if it was found, return a block definition ready to be
|
|
378
392
|
* created.
|