@kitionstage/sdk 0.0.0-stage → 0.5.2-stage.2
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/README.md +73 -2
- package/dist/LICENSE +177 -0
- package/dist/THIRD_PARTY_NOTICES +28 -0
- package/dist/lib/assets/kitEngine.worker-3iMvwtlI.js +12732 -0
- package/dist/lib/assets/loro_wasm_bg-Gulzks_0.wasm +0 -0
- package/dist/lib/chunks/batch-BWpAyHvP.js +789 -0
- package/dist/lib/chunks/canonical-BIWfVCL-.js +87 -0
- package/dist/lib/chunks/envelope-D6MGY-ZN.js +61 -0
- package/dist/lib/chunks/replica-D8w3I4sn.js +2472 -0
- package/dist/lib/chunks/runtime-BVJHE1Pg.js +997 -0
- package/dist/lib/chunks/session-BqXC9a1-.js +281 -0
- package/dist/lib/chunks/toolIds-BCeSGHpV.js +821 -0
- package/dist/lib/chunks/workspaceTree-Destqupf.js +23 -0
- package/dist/lib/convergence/index.js +1035 -0
- package/dist/lib/convergence/node.js +8 -0
- package/dist/lib/embed-server/callbacks.js +37 -0
- package/dist/lib/embed-server/cli.js +19 -0
- package/dist/lib/embed-server/index.js +272 -0
- package/dist/lib/extensions/index.js +439 -0
- package/dist/lib/extensions/panel.html +208 -0
- package/dist/lib/extensions/runtime.js +198 -0
- package/dist/lib/extensions/sandbox.html +35 -0
- package/dist/lib/kdm/index.js +437 -0
- package/dist/lib/kit-dev-host/checkUiIds.mjs +44 -0
- package/dist/lib/kit-dev-host/index.js +308 -0
- package/dist/lib/kit-dev-host/lineRow.mjs +47 -0
- package/dist/lib/kit-dev-host/modeSmoke.mjs +178 -0
- package/dist/lib/kit-editor/index.js +6481 -0
- package/dist/lib/kit-editor/styles.css +807 -0
- package/dist/lib/kit-editor/workspaceTree.js +1 -0
- package/dist/lib/kit-engine/index.js +7 -0
- package/dist/lib/kit-host/index.js +530 -0
- package/dist/lib/kit-ui-protocol/index.js +336 -0
- package/dist/lib/node-only/embed-server-callbacks.js +2 -0
- package/dist/lib/node-only/embed-server.js +2 -0
- package/dist/lib/sync/index.js +1008 -0
- package/dist/lib/sync/openToken.js +201 -0
- package/dist/lib/sync/replicaVersions.js +51 -0
- package/dist/standalone/chunks/batch-CAGYk6m4.js +789 -0
- package/dist/standalone/chunks/client-B9xkOcvf.js +772 -0
- package/dist/standalone/chunks/collab-CTQZ9h7J.js +1022 -0
- package/dist/standalone/chunks/comment-Ds9t8xSE.js +94 -0
- package/dist/standalone/chunks/comments-uVDS8Wxp.js +41 -0
- package/dist/standalone/chunks/document-B5MMuYyN.js +324 -0
- package/dist/standalone/chunks/envelope-GX4Cynkx.js +7612 -0
- package/dist/standalone/chunks/index-BEgEEnhU.js +287 -0
- package/dist/standalone/chunks/index-EEl8hGbP.js +1967 -0
- package/dist/standalone/chunks/kits-Cp51mDlw.js +9 -0
- package/dist/standalone/chunks/replica-Di2iCPiD.js +3281 -0
- package/dist/standalone/chunks/replicaVersions-C3rJxnk9.js +50 -0
- package/dist/standalone/chunks/touched-T9jKJjxn.js +78 -0
- package/dist/standalone/index.js +12 -0
- package/dist/standalone/script/index.js +339 -0
- package/dist/standalone/script/kits/board.js +5 -0
- package/dist/standalone/script/kits/cad.js +5 -0
- package/dist/standalone/script/kits/design.js +5 -0
- package/dist/standalone/script/kits/doc.js +5 -0
- package/dist/standalone/script/kits/film.js +5 -0
- package/dist/standalone/script/kits/html.js +5 -0
- package/dist/standalone/script/kits/index.js +38 -0
- package/dist/standalone/script/kits/layout.js +5 -0
- package/dist/standalone/script/kits/motion.js +5 -0
- package/dist/standalone/script/kits/note.js +5 -0
- package/dist/standalone/script/kits/pdf.js +5 -0
- package/dist/standalone/script/kits/photo.js +5 -0
- package/dist/standalone/script/kits/scene.js +5 -0
- package/dist/standalone/script/kits/sheet.js +5 -0
- package/dist/standalone/script/kits/slide.js +5 -0
- package/dist/standalone/script/kits/table.js +5 -0
- package/dist/standalone/script/kits/vector.js +5 -0
- package/dist/standalone/script/node.js +401 -0
- package/dist/standalone/script/proxy.js +254 -0
- package/dist/types/convergence/src/adapter.d.ts +131 -0
- package/dist/types/convergence/src/engine.d.ts +66 -0
- package/dist/types/convergence/src/index.d.ts +21 -0
- package/dist/types/convergence/src/net.d.ts +52 -0
- package/dist/types/convergence/src/node.d.ts +6 -0
- package/dist/types/convergence/src/report.d.ts +56 -0
- package/dist/types/convergence/src/rng.d.ts +12 -0
- package/dist/types/convergence/src/scenarios.d.ts +15 -0
- package/dist/types/convergence/src/state.d.ts +67 -0
- package/dist/types/embed/src/agent.d.ts +88 -0
- package/dist/types/embed/src/blobs.d.ts +2 -0
- package/dist/types/embed/src/collab.d.ts +250 -0
- package/dist/types/embed/src/comments.d.ts +30 -0
- package/dist/types/embed/src/errors.d.ts +24 -0
- package/dist/types/embed/src/handlers.d.ts +92 -0
- package/dist/types/embed/src/index.d.ts +20 -0
- package/dist/types/embed/src/mount.d.ts +39 -0
- package/dist/types/embed/src/replicaStore.d.ts +3 -0
- package/dist/types/embed/src/rooms.d.ts +40 -0
- package/dist/types/embed/src/schemas.d.ts +7 -0
- package/dist/types/embed/src/syncClients.d.ts +28 -0
- package/dist/types/embed/src/theme.d.ts +7 -0
- package/dist/types/embed/src/types.d.ts +596 -0
- package/dist/types/embed/src/ui.d.ts +33 -0
- package/dist/types/embed/src/version.d.ts +2 -0
- package/dist/types/embed-server/src/callbacks.d.ts +30 -0
- package/dist/types/embed-server/src/cli.d.ts +1 -0
- package/dist/types/embed-server/src/index.d.ts +19 -0
- package/dist/types/embed-server/src/page.d.ts +15 -0
- package/dist/types/embed-server/src/server.d.ts +39 -0
- package/dist/types/embed-server/src/session.d.ts +22 -0
- package/dist/types/extensions/src/gate.d.ts +17 -0
- package/dist/types/extensions/src/generated/runtime.d.ts +8 -0
- package/dist/types/extensions/src/host.d.ts +135 -0
- package/dist/types/extensions/src/index.d.ts +13 -0
- package/dist/types/extensions/src/manifest.d.ts +82 -0
- package/dist/types/extensions/src/protocol.d.ts +159 -0
- package/dist/types/extensions/src/rpc.d.ts +52 -0
- package/dist/types/extensions/src/runtime/document.d.ts +40 -0
- package/dist/types/extensions/src/runtime/index.d.ts +10 -0
- package/dist/types/extensions/src/runtime/panel.d.ts +19 -0
- package/dist/types/extensions/src/runtime/runtime.d.ts +54 -0
- package/dist/types/extensions/src/runtime/worker.d.ts +1 -0
- package/dist/types/extensions/src/sandbox.d.ts +41 -0
- package/dist/types/kdm/src/args.d.ts +12 -0
- package/dist/types/kdm/src/batch.d.ts +118 -0
- package/dist/types/kdm/src/canonical.d.ts +25 -0
- package/dist/types/kdm/src/comment.d.ts +114 -0
- package/dist/types/kdm/src/diff.d.ts +125 -0
- package/dist/types/kdm/src/envelope.d.ts +27 -0
- package/dist/types/kdm/src/errors.d.ts +28 -0
- package/dist/types/kdm/src/footprint.d.ts +21 -0
- package/dist/types/kdm/src/ids.d.ts +57 -0
- package/dist/types/kdm/src/index.d.ts +18 -0
- package/dist/types/kdm/src/marks.d.ts +32 -0
- package/dist/types/kdm/src/op.d.ts +124 -0
- package/dist/types/kdm/src/origin.d.ts +41 -0
- package/dist/types/kdm/src/overlay.d.ts +92 -0
- package/dist/types/kdm/src/projection.d.ts +29 -0
- package/dist/types/kdm/src/read.d.ts +90 -0
- package/dist/types/kdm/src/replica.d.ts +403 -0
- package/dist/types/kdm/src/schema.d.ts +185 -0
- package/dist/types/kdm/src/testing.d.ts +28 -0
- package/dist/types/kdm/src/toolIds.d.ts +61 -0
- package/dist/types/kdm/src/touched.d.ts +24 -0
- package/dist/types/kdm/src/tx.d.ts +215 -0
- package/dist/types/kdm/src/value.d.ts +23 -0
- package/dist/types/kit-dev-host/src/checkNoPaths.d.ts +19 -0
- package/dist/types/kit-dev-host/src/checkUiIds.d.mts +2 -0
- package/dist/types/kit-dev-host/src/index.d.ts +179 -0
- package/dist/types/kit-dev-host/src/lineRow.d.mts +14 -0
- package/dist/types/kit-dev-host/src/memoryFiles.d.ts +15 -0
- package/dist/types/kit-dev-host/src/modeSmoke.d.mts +8 -0
- package/dist/types/kit-editor/src/CommandDialog.d.ts +22 -0
- package/dist/types/kit-editor/src/CommentsPanel.d.ts +45 -0
- package/dist/types/kit-editor/src/CustomizeDialog.d.ts +32 -0
- package/dist/types/kit-editor/src/HostButtons.d.ts +11 -0
- package/dist/types/kit-editor/src/RenderFailure.d.ts +7 -0
- package/dist/types/kit-editor/src/TextSink.d.ts +6 -0
- package/dist/types/kit-editor/src/brand.d.ts +2 -0
- package/dist/types/kit-editor/src/catalogMenus.d.ts +27 -0
- package/dist/types/kit-editor/src/chart.d.ts +138 -0
- package/dist/types/kit-editor/src/conflicts.d.ts +12 -0
- package/dist/types/kit-editor/src/drawing.d.ts +83 -0
- package/dist/types/kit-editor/src/editor.d.ts +544 -0
- package/dist/types/kit-editor/src/engine/KitCanvas.d.ts +70 -0
- package/dist/types/kit-editor/src/engine/backdrop.d.ts +32 -0
- package/dist/types/kit-editor/src/engine/createKitFile.d.ts +12 -0
- package/dist/types/kit-editor/src/engine/decorations.d.ts +14 -0
- package/dist/types/kit-editor/src/engine/engineOverlays.d.ts +197 -0
- package/dist/types/kit-editor/src/engine/engineTools.d.ts +116 -0
- package/dist/types/kit-editor/src/engine/kitDraft.d.ts +70 -0
- package/dist/types/kit-editor/src/engine/kitEngine.d.ts +390 -0
- package/dist/types/kit-editor/src/engine/kitEngine.worker.d.ts +30 -0
- package/dist/types/kit-editor/src/engine/kitHost.d.ts +41 -0
- package/dist/types/kit-editor/src/engine/kitModel.d.ts +32 -0
- package/dist/types/kit-editor/src/engine/kitModelRunner.d.ts +99 -0
- package/dist/types/kit-editor/src/engine/kitModule.d.ts +185 -0
- package/dist/types/kit-editor/src/engine/kitShortcuts.d.ts +32 -0
- package/dist/types/kit-editor/src/engine/kitTools.d.ts +79 -0
- package/dist/types/kit-editor/src/engine/lazyFonts.d.ts +34 -0
- package/dist/types/kit-editor/src/engine/lentFiles.d.ts +29 -0
- package/dist/types/kit-editor/src/engine/rasterViewport.d.ts +178 -0
- package/dist/types/kit-editor/src/engine/readOnly.d.ts +78 -0
- package/dist/types/kit-editor/src/engine/refusal.d.ts +39 -0
- package/dist/types/kit-editor/src/engine/replica.d.ts +23 -0
- package/dist/types/kit-editor/src/engine/useKitDocument.d.ts +154 -0
- package/dist/types/kit-editor/src/engine/workerRelay.d.ts +62 -0
- package/dist/types/kit-editor/src/files.d.ts +74 -0
- package/dist/types/kit-editor/src/frame/EditorFrame.d.ts +74 -0
- package/dist/types/kit-editor/src/frame/FocusBar.d.ts +10 -0
- package/dist/types/kit-editor/src/frame/MenuNodes.d.ts +20 -0
- package/dist/types/kit-editor/src/frame/MenuRibbon.d.ts +8 -0
- package/dist/types/kit-editor/src/frame/ModeButton.d.ts +7 -0
- package/dist/types/kit-editor/src/frame/menus.d.ts +64 -0
- package/dist/types/kit-editor/src/frame/modes.d.ts +51 -0
- package/dist/types/kit-editor/src/frame/useFrameLayout.d.ts +34 -0
- package/dist/types/kit-editor/src/host.d.ts +127 -0
- package/dist/types/kit-editor/src/index.d.ts +85 -0
- package/dist/types/kit-editor/src/ink.d.ts +26 -0
- package/dist/types/kit-editor/src/lease.d.ts +53 -0
- package/dist/types/kit-editor/src/oneInFlight.d.ts +7 -0
- package/dist/types/kit-editor/src/phrases.d.ts +25 -0
- package/dist/types/kit-editor/src/presence.d.ts +79 -0
- package/dist/types/kit-editor/src/strings.d.ts +6 -0
- package/dist/types/kit-editor/src/toolIcons.d.ts +32 -0
- package/dist/types/kit-editor/src/uiCatalog.d.ts +59 -0
- package/dist/types/kit-editor/src/uiConfig.d.ts +53 -0
- package/dist/types/kit-editor/src/uiContext.d.ts +65 -0
- package/dist/types/kit-editor/src/uiStore.d.ts +20 -0
- package/dist/types/kit-editor/src/useCommentAnchors.d.ts +29 -0
- package/dist/types/kit-editor/src/useKitSession.d.ts +115 -0
- package/dist/types/kit-editor/src/workspaceTree.d.ts +5 -0
- package/dist/types/kit-engine/src/contract.d.ts +154 -0
- package/dist/types/kit-engine/src/index.d.ts +2 -0
- package/dist/types/kit-engine/src/session.d.ts +133 -0
- package/dist/types/kit-host/src/files.d.ts +163 -0
- package/dist/types/kit-host/src/index.d.ts +315 -0
- package/dist/types/kit-ui-protocol/src/index.d.ts +1145 -0
- package/dist/types/loro-crdt.d.ts +9 -0
- package/dist/types/script/kits/board.d.ts +534 -0
- package/dist/types/script/kits/cad.d.ts +2937 -0
- package/dist/types/script/kits/design.d.ts +3213 -0
- package/dist/types/script/kits/doc.d.ts +2575 -0
- package/dist/types/script/kits/film.d.ts +4067 -0
- package/dist/types/script/kits/html.d.ts +38 -0
- package/dist/types/script/kits/index.d.ts +20 -0
- package/dist/types/script/kits/layout.d.ts +3483 -0
- package/dist/types/script/kits/motion.d.ts +4826 -0
- package/dist/types/script/kits/note.d.ts +631 -0
- package/dist/types/script/kits/pdf.d.ts +829 -0
- package/dist/types/script/kits/photo.d.ts +7574 -0
- package/dist/types/script/kits/scene.d.ts +2962 -0
- package/dist/types/script/kits/sheet.d.ts +2419 -0
- package/dist/types/script/kits/slide.d.ts +1894 -0
- package/dist/types/script/kits/table.d.ts +654 -0
- package/dist/types/script/kits/vector.d.ts +5167 -0
- package/dist/types/script/src/agentRelay.d.ts +48 -0
- package/dist/types/script/src/capabilities.d.ts +21 -0
- package/dist/types/script/src/document.d.ts +87 -0
- package/dist/types/script/src/drafts.d.ts +141 -0
- package/dist/types/script/src/exchange.d.ts +30 -0
- package/dist/types/script/src/headless.d.ts +190 -0
- package/dist/types/script/src/index.d.ts +15 -0
- package/dist/types/script/src/kitModel.d.ts +17 -0
- package/dist/types/script/src/kits.d.ts +8 -0
- package/dist/types/script/src/node.d.ts +42 -0
- package/dist/types/script/src/port.d.ts +89 -0
- package/dist/types/script/src/proxy.d.ts +132 -0
- package/dist/types/script/src/room.d.ts +162 -0
- package/dist/types/script/src/sources.d.ts +73 -0
- package/dist/types/sync/src/backoff.d.ts +9 -0
- package/dist/types/sync/src/blobSection.d.ts +23 -0
- package/dist/types/sync/src/capabilities.d.ts +20 -0
- package/dist/types/sync/src/client.d.ts +253 -0
- package/dist/types/sync/src/framing.d.ts +35 -0
- package/dist/types/sync/src/hash.d.ts +2 -0
- package/dist/types/sync/src/index.d.ts +19 -0
- package/dist/types/sync/src/leases.d.ts +82 -0
- package/dist/types/sync/src/openToken.d.ts +104 -0
- package/dist/types/sync/src/protocol.d.ts +484 -0
- package/dist/types/sync/src/relay.d.ts +52 -0
- package/dist/types/sync/src/replicaVersions.d.ts +17 -0
- package/dist/types/sync/src/saveMachine.d.ts +83 -0
- package/dist/types/sync/src/saveRun.d.ts +52 -0
- package/dist/types/sync/src/transport.d.ts +19 -0
- package/package.json +229 -4
|
@@ -0,0 +1,3213 @@
|
|
|
1
|
+
import type { CommandMap, ModelDocument, ModelList, ModelMap, ModelObject, ModelText, ModelTree, RequestContext } from '../src/index.js';
|
|
2
|
+
import { type KitDescriptor } from '../src/kits.js';
|
|
3
|
+
type Json = null | boolean | number | string | Json[] | {
|
|
4
|
+
[key: string]: Json;
|
|
5
|
+
};
|
|
6
|
+
type BlobRef = {
|
|
7
|
+
hash: string;
|
|
8
|
+
mime: string;
|
|
9
|
+
size: number;
|
|
10
|
+
};
|
|
11
|
+
/** kit.design: registered with @kition/sdk/script when this module loads. */
|
|
12
|
+
export declare const designKit: KitDescriptor;
|
|
13
|
+
/** The fields a new `Design` takes (`list.add(fields)`). */
|
|
14
|
+
export type DesignFields = {};
|
|
15
|
+
/** A `Design` of kit.design. */
|
|
16
|
+
export interface Design extends ModelObject {
|
|
17
|
+
readonly settings: ModelMap<Json>;
|
|
18
|
+
readonly nodes: ModelTree<Node, NodeFields>;
|
|
19
|
+
readonly styles: ModelList<Style, StyleFields>;
|
|
20
|
+
readonly collections: ModelList<Collection, CollectionFields>;
|
|
21
|
+
readonly variables: ModelList<Variable, VariableFields>;
|
|
22
|
+
readonly images: ModelList<Image, ImageFields>;
|
|
23
|
+
readonly comments: ModelList<CommentThread, CommentThreadFields>;
|
|
24
|
+
readonly libraries: ModelList<Library, LibraryFields>;
|
|
25
|
+
readonly libraryStore: ModelTree<Node, NodeFields>;
|
|
26
|
+
readonly libraryCopies: ModelList<LibraryCopy, LibraryCopyFields>;
|
|
27
|
+
}
|
|
28
|
+
/** The fields a new `Node` takes (`list.add(fields)`). */
|
|
29
|
+
export type NodeFields = {
|
|
30
|
+
name?: string | null;
|
|
31
|
+
visible?: boolean | null;
|
|
32
|
+
locked?: boolean | null;
|
|
33
|
+
opacity?: number | null;
|
|
34
|
+
kind: Json;
|
|
35
|
+
frame?: Json | null;
|
|
36
|
+
fills?: Json | null;
|
|
37
|
+
strokes?: Json | null;
|
|
38
|
+
stroke?: Json | null;
|
|
39
|
+
effects?: Json | null;
|
|
40
|
+
corners?: Json | null;
|
|
41
|
+
layout?: Json | null;
|
|
42
|
+
childLayout?: Json | null;
|
|
43
|
+
constraints?: Json | null;
|
|
44
|
+
prototype?: Json | null;
|
|
45
|
+
bindings?: Json | null;
|
|
46
|
+
instance?: Json | null;
|
|
47
|
+
mirrors?: number | null;
|
|
48
|
+
dev?: Json | null;
|
|
49
|
+
props?: Json | null;
|
|
50
|
+
};
|
|
51
|
+
/** A `Node` of kit.design. */
|
|
52
|
+
export interface Node extends ModelObject {
|
|
53
|
+
/** Read-only: the kit keeps it as it is. */
|
|
54
|
+
readonly key: number | null;
|
|
55
|
+
name: string | null;
|
|
56
|
+
visible: boolean | null;
|
|
57
|
+
locked: boolean | null;
|
|
58
|
+
opacity: number | null;
|
|
59
|
+
kind: Json;
|
|
60
|
+
frame: Json | null;
|
|
61
|
+
fills: Json | null;
|
|
62
|
+
strokes: Json | null;
|
|
63
|
+
stroke: Json | null;
|
|
64
|
+
effects: Json | null;
|
|
65
|
+
corners: Json | null;
|
|
66
|
+
layout: Json | null;
|
|
67
|
+
childLayout: Json | null;
|
|
68
|
+
constraints: Json | null;
|
|
69
|
+
prototype: Json | null;
|
|
70
|
+
bindings: Json | null;
|
|
71
|
+
instance: Json | null;
|
|
72
|
+
mirrors: number | null;
|
|
73
|
+
dev: Json | null;
|
|
74
|
+
props: Json | null;
|
|
75
|
+
}
|
|
76
|
+
/** The fields a new `Style` takes (`list.add(fields)`). */
|
|
77
|
+
export type StyleFields = {
|
|
78
|
+
name?: string | null;
|
|
79
|
+
value: Json;
|
|
80
|
+
props?: Json | null;
|
|
81
|
+
};
|
|
82
|
+
/** A `Style` of kit.design. */
|
|
83
|
+
export interface Style extends ModelObject {
|
|
84
|
+
/** Read-only: the kit keeps it as it is. */
|
|
85
|
+
readonly key: string;
|
|
86
|
+
name: string | null;
|
|
87
|
+
value: Json;
|
|
88
|
+
props: Json | null;
|
|
89
|
+
}
|
|
90
|
+
/** The fields a new `Collection` takes (`list.add(fields)`). */
|
|
91
|
+
export type CollectionFields = {
|
|
92
|
+
name?: string | null;
|
|
93
|
+
props?: Json | null;
|
|
94
|
+
};
|
|
95
|
+
/** A `Collection` of kit.design. */
|
|
96
|
+
export interface Collection extends ModelObject {
|
|
97
|
+
/** Read-only: the kit keeps it as it is. */
|
|
98
|
+
readonly key: string;
|
|
99
|
+
name: string | null;
|
|
100
|
+
readonly modes: ModelList<Mode, ModeFields>;
|
|
101
|
+
props: Json | null;
|
|
102
|
+
}
|
|
103
|
+
/** The fields a new `Mode` takes (`list.add(fields)`). */
|
|
104
|
+
export type ModeFields = {
|
|
105
|
+
name?: string | null;
|
|
106
|
+
};
|
|
107
|
+
/** A `Mode` of kit.design. */
|
|
108
|
+
export interface Mode extends ModelObject {
|
|
109
|
+
/** Read-only: the kit keeps it as it is. */
|
|
110
|
+
readonly key: string;
|
|
111
|
+
name: string | null;
|
|
112
|
+
}
|
|
113
|
+
/** The fields a new `Variable` takes (`list.add(fields)`). */
|
|
114
|
+
export type VariableFields = {
|
|
115
|
+
name?: string | null;
|
|
116
|
+
collection?: string | null;
|
|
117
|
+
type?: string | null;
|
|
118
|
+
props?: Json | null;
|
|
119
|
+
};
|
|
120
|
+
/** A `Variable` of kit.design. */
|
|
121
|
+
export interface Variable extends ModelObject {
|
|
122
|
+
/** Read-only: the kit keeps it as it is. */
|
|
123
|
+
readonly key: string;
|
|
124
|
+
name: string | null;
|
|
125
|
+
collection: string | null;
|
|
126
|
+
readonly values: ModelMap<Json>;
|
|
127
|
+
props: Json | null;
|
|
128
|
+
}
|
|
129
|
+
/** The fields a new `Library` takes (`list.add(fields)`). */
|
|
130
|
+
export type LibraryFields = {
|
|
131
|
+
name?: string | null;
|
|
132
|
+
path?: string | null;
|
|
133
|
+
version?: number | null;
|
|
134
|
+
};
|
|
135
|
+
/** A `Library` of kit.design. */
|
|
136
|
+
export interface Library extends ModelObject {
|
|
137
|
+
/** Read-only: the kit keeps it as it is. */
|
|
138
|
+
readonly key: string;
|
|
139
|
+
name: string | null;
|
|
140
|
+
path: string | null;
|
|
141
|
+
version: number | null;
|
|
142
|
+
}
|
|
143
|
+
/** The fields a new `LibraryCopy` takes (`list.add(fields)`). */
|
|
144
|
+
export type LibraryCopyFields = {
|
|
145
|
+
kind: string;
|
|
146
|
+
local: string;
|
|
147
|
+
record: Json;
|
|
148
|
+
};
|
|
149
|
+
/** A `LibraryCopy` of kit.design. Read-only: the kit keeps it as it is (rule OM8); scripts read it and run commands. */
|
|
150
|
+
export interface LibraryCopy extends ModelObject {
|
|
151
|
+
kind: string;
|
|
152
|
+
local: string;
|
|
153
|
+
record: Json;
|
|
154
|
+
}
|
|
155
|
+
/** The fields a new `Image` takes (`list.add(fields)`). */
|
|
156
|
+
export type ImageFields = {
|
|
157
|
+
blob?: BlobRef | null;
|
|
158
|
+
size?: Json | null;
|
|
159
|
+
};
|
|
160
|
+
/** A `Image` of kit.design. */
|
|
161
|
+
export interface Image extends ModelObject {
|
|
162
|
+
/** Read-only: the kit keeps it as it is. */
|
|
163
|
+
readonly key: string;
|
|
164
|
+
blob: BlobRef | null;
|
|
165
|
+
size: Json | null;
|
|
166
|
+
}
|
|
167
|
+
/** The fields a new `CommentThread` takes (`list.add(fields)`). */
|
|
168
|
+
export type CommentThreadFields = {
|
|
169
|
+
anchor: Json;
|
|
170
|
+
resolved?: boolean | null;
|
|
171
|
+
};
|
|
172
|
+
/** A `CommentThread` of kit.design. */
|
|
173
|
+
export interface CommentThread extends ModelObject {
|
|
174
|
+
/** Read-only: the kit keeps it as it is. */
|
|
175
|
+
readonly key: number;
|
|
176
|
+
anchor: Json;
|
|
177
|
+
resolved: boolean | null;
|
|
178
|
+
readonly comments: ModelList<Comment, CommentFields>;
|
|
179
|
+
}
|
|
180
|
+
/** The fields a new `Comment` takes (`list.add(fields)`). */
|
|
181
|
+
export type CommentFields = {
|
|
182
|
+
author: string;
|
|
183
|
+
name?: string | null;
|
|
184
|
+
created: string;
|
|
185
|
+
edited?: number | null;
|
|
186
|
+
reactions?: Json | null;
|
|
187
|
+
};
|
|
188
|
+
/** A `Comment` of kit.design. */
|
|
189
|
+
export interface Comment extends ModelObject {
|
|
190
|
+
author: string;
|
|
191
|
+
name: string | null;
|
|
192
|
+
get body(): ModelText;
|
|
193
|
+
set body(value: string);
|
|
194
|
+
created: string;
|
|
195
|
+
edited: number | null;
|
|
196
|
+
reactions: Json | null;
|
|
197
|
+
/** Read-only: the kit keeps it as it is. */
|
|
198
|
+
readonly key: number | null;
|
|
199
|
+
}
|
|
200
|
+
/** Every command of kit.design, by id, with its parameters. */
|
|
201
|
+
export interface DesignCommands extends CommandMap {
|
|
202
|
+
/** Import from file. Imports a file (SVG, image, .fig, .sketch or REST JSON) into the design at x, y; SVG becomes an editable frame of shapes and text. Params: {path?, data? (base64, instead of path), name? (with data: the file's name), x?, y?, center? (SVG: centre it on x, y), variables? (REST: the local variables JSON as an object, JSON text or a path)} SVG becomes an editable frame (shapes, text, gradients, masks, effects; with `warnings` for what it left out), images become image layers, .kdesign, REST API file JSON, .fig and .sketch pages are appended with their variables and flows (REST, .fig and .sketch: with `warnings`; those return `summary` {name, pages, layers, images} of the file read). Reads the mode, part. Changes the document. */
|
|
203
|
+
"file.import": {
|
|
204
|
+
center?: boolean;
|
|
205
|
+
data?: string; /** with data: the file's name */
|
|
206
|
+
name?: string;
|
|
207
|
+
path?: Json;
|
|
208
|
+
variables?: Json;
|
|
209
|
+
x?: number;
|
|
210
|
+
y?: number;
|
|
211
|
+
};
|
|
212
|
+
/** Place image. Places an image from a path or base64 data as a new image layer at x, y. Params: {data? (base64 of the image), name? (the image's name), x?, y?, width?, height?, mode? (as image.place)}. Reads the part. Changes the document. */
|
|
213
|
+
"file.placeImage": {
|
|
214
|
+
data?: string;
|
|
215
|
+
height?: number;
|
|
216
|
+
mode?: "fill" | "fit" | "crop" | "tile"; /** the image's name */
|
|
217
|
+
name?: string;
|
|
218
|
+
width?: number;
|
|
219
|
+
x?: number;
|
|
220
|
+
y?: number;
|
|
221
|
+
};
|
|
222
|
+
/** Save to version history. Snapshots the document into the file's version history with an optional name and description; answers the version. Params: {name?, description?} snapshot the document into the file's version history (on a branch tab: the branch's own history; kept when the file is saved); returns the version. Reads the part. Changes the document. */
|
|
223
|
+
"file.saveVersion": {
|
|
224
|
+
description?: string;
|
|
225
|
+
name?: string;
|
|
226
|
+
};
|
|
227
|
+
/** Show version history. Opens the version history panel and answers the versions, as version.list does. Params: {} opens the panel; returns the versions like `version.list`. */
|
|
228
|
+
"file.versionHistory": Record<string, never>;
|
|
229
|
+
/** Create branch. Creates a branch: a separate copy of the file to work on, opened in a new tab; answers its id, name and tab index. Params: {name?} a copy of the file to work on separately, opened in a new tab; it remembers the file as it is now (its base); in a live session it stays yours ? {id, name, index (its tab)}. Changes the document. */
|
|
230
|
+
"branch.create": {
|
|
231
|
+
name?: string;
|
|
232
|
+
};
|
|
233
|
+
/** Export. Exports layers (default the selection, else the page) as PNG, JPEG, SVG, PDF, WebP, Android Vector Drawable or the whole .fig, at a scale with print options; answers the data. Params: {ids? (default selection, else the page), format? (png|jpg|svg|pdf|webp|xml (an Android Vector Drawable, with `warnings` for what it changed or left out), or fig: the whole file as .fig, experimental, with `warnings` for what was left out; other apps may not open every file), scale? (default 1) | size? (2x|512w|512h or {by: scale|width|height, value}: a scale, or a width or height in pixels), path? (else returns base64 `data`), bleed? (PDF: points, or with a unit: "3mm", "0.125in", "9pt"), cropMarks?, bleedMarks?, cmyk? (PDF print options), svgIdAttribute? (SVG ids, XML android:name), vdCompat? (XML: bestEffort (default: approximate with a warning)|exact (leave out what can't be exact, with a warning)|ignore (no warnings))}. Acts on `ids`. Reads the mode, part, selection. */
|
|
234
|
+
"file.export": {
|
|
235
|
+
bleed?: Json;
|
|
236
|
+
bleedMarks?: boolean;
|
|
237
|
+
cmyk?: boolean;
|
|
238
|
+
cropMarks?: boolean;
|
|
239
|
+
format?: "png" | "jpg" | "svg" | "pdf" | "webp" | "xml" | "fig"; /** default selection, else the page */
|
|
240
|
+
ids?: Array<Json>;
|
|
241
|
+
scale?: number; /** 2x|512w|512h or {by: scale|width|height, value}: a scale, or a width or height in pixels; one of several alternative parameters */
|
|
242
|
+
size?: number;
|
|
243
|
+
svgIdAttribute?: boolean;
|
|
244
|
+
vdCompat?: boolean;
|
|
245
|
+
};
|
|
246
|
+
/** Export frames to PDF. Exports every top-level frame of a page, in reading order, as one PDF with optional bleed, marks and CMYK. Params: {path?, page? (page id, default the current page), bleed? (PDF: points, or with a unit: "3mm", "0.125in", "9pt"), cropMarks?, bleedMarks?, cmyk? (PDF print options)} every top-level frame in reading order, one PDF page each; returns base64 `data` without a path. Reads the part. */
|
|
247
|
+
"file.exportFramesPdf": {
|
|
248
|
+
bleed?: Json;
|
|
249
|
+
bleedMarks?: boolean;
|
|
250
|
+
cmyk?: boolean;
|
|
251
|
+
cropMarks?: boolean; /** page id, default the current page */
|
|
252
|
+
page?: number;
|
|
253
|
+
};
|
|
254
|
+
/** Export selection as SVG. Exports the selected or given layers as SVG markup or to a file. Params: {ids?, path?}. Acts on `ids`. Reads the mode, part, selection. */
|
|
255
|
+
"file.exportSvg": {
|
|
256
|
+
ids?: Array<Json>;
|
|
257
|
+
};
|
|
258
|
+
/** Rename. Renames the document file. Params: {name}. Changes the document. */
|
|
259
|
+
"file.rename": {
|
|
260
|
+
name?: string;
|
|
261
|
+
};
|
|
262
|
+
/** Color profile. Sets the file's colour profile (sRGB or Display P3), converting colour values or reinterpreting them; without a profile answers the current one. Params: {profile?: srgb|displayP3, convert? (default true: convert colour values so colours keep their appearance; false: keep the values and reinterpret them)} without `profile`, returns the current one (and the app opens the dialog). Returns {profile, changed}. Changes the document. */
|
|
263
|
+
"file.colorProfile": {
|
|
264
|
+
convert?: boolean;
|
|
265
|
+
profile?: "srgb" | "displayP3";
|
|
266
|
+
};
|
|
267
|
+
/** Undo. Undoes the last step in a scope (the person's or the agent's; default the caller's), leaving the other scope's later steps in place. Params: {scope?: "person"|"agent"} (default: the scope of who runs it). Changes the document. */
|
|
268
|
+
"edit.undo": {
|
|
269
|
+
scope?: "person" | "agent";
|
|
270
|
+
};
|
|
271
|
+
/** Redo. Redoes the last undone step in a scope (the person's or the agent's; default the caller's). Params: {scope?: "person"|"agent"} (default: the scope of who runs it). Changes the document. */
|
|
272
|
+
"edit.redo": {
|
|
273
|
+
scope?: "person" | "agent";
|
|
274
|
+
};
|
|
275
|
+
/** Cut. Removes the selected or given layers and puts them on the clipboard. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
276
|
+
"edit.cut": {
|
|
277
|
+
id?: Json;
|
|
278
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
279
|
+
index?: number;
|
|
280
|
+
};
|
|
281
|
+
/** Copy. Copies the selected or given layers to the clipboard without changing the design. Params: {ids?}. Acts on `ids`. Reads the mode, selection. */
|
|
282
|
+
"edit.copy": {
|
|
283
|
+
id?: Json;
|
|
284
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
285
|
+
index?: number;
|
|
286
|
+
};
|
|
287
|
+
/** Paste. Pastes the clipboard into a parent (default the current page or frame) at x, y; a copied main component pastes as an instance. Params: {parent?, x?, y? (page coordinates of the pasted top-left)} a copied main component pastes as an instance of it within its file (cut ones, and pastes into other files, keep the component). Reads the mode, part, selection. Changes the document. */
|
|
288
|
+
"edit.paste": {
|
|
289
|
+
parent?: Json;
|
|
290
|
+
x?: number; /** page coordinates of the pasted top-left */
|
|
291
|
+
y?: number;
|
|
292
|
+
};
|
|
293
|
+
/** Paste over selection. Pastes the clipboard on top of the selection, at the same position. Params: {}. Reads the mode, part, selection. Changes the document. */
|
|
294
|
+
"edit.pasteOver": {
|
|
295
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
296
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
297
|
+
index?: number;
|
|
298
|
+
};
|
|
299
|
+
/** Paste to replace. Replaces the selected or given layers with the clipboard's content, in their places. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
300
|
+
"edit.pasteReplace": {
|
|
301
|
+
id?: Json;
|
|
302
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
303
|
+
index?: number;
|
|
304
|
+
};
|
|
305
|
+
/** Duplicate. Duplicates the selected or given layers, offset by dx, dy (or repeating the last duplicate's offset); answers the copies. Params: {ids?, dx?, dy? (page offset; default: the offset of the last duplicate when ids are its copies, still selected; else top-level frames to the right with a 100 gap, everything else in place)} a main component's copy is an instance of it (a variant stays a new variant in its set). Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
306
|
+
"edit.duplicate": {
|
|
307
|
+
dx?: number; /** page offset; default: the offset of the last duplicate when ids are its copies, still selected; else top-level frames to the right with a 100 gap, everything else in place */
|
|
308
|
+
dy?: number; /** read by the command beside its listed parameters */
|
|
309
|
+
id?: Json;
|
|
310
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
311
|
+
index?: number; /** read by the command beside its listed parameters */
|
|
312
|
+
style?: string; /** read by the command beside its listed parameters */
|
|
313
|
+
variable?: string;
|
|
314
|
+
};
|
|
315
|
+
/** Delete. Deletes the selected or given layers. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
316
|
+
"edit.delete": {
|
|
317
|
+
id?: Json;
|
|
318
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
319
|
+
index?: number;
|
|
320
|
+
};
|
|
321
|
+
/** Find and replace. Finds text in text layers (or layer names) and replaces it, selecting the matches by default; answers the count. Params: {find, replace? (text layers), layerNames? (bool), select? (default true)}. Reads the part. Changes the document. */
|
|
322
|
+
"edit.findReplace": {
|
|
323
|
+
find?: string; /** read by the command beside its listed parameters */
|
|
324
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
325
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
326
|
+
index?: number;
|
|
327
|
+
layerNames?: boolean;
|
|
328
|
+
replace?: string;
|
|
329
|
+
select?: boolean;
|
|
330
|
+
};
|
|
331
|
+
/** Copy properties. Copies a layer's fills, strokes, effects and text style so edit.pasteProperties can apply them. Params: {id?}. Acts on `id`. Reads the mode, selection. */
|
|
332
|
+
"edit.copyProperties": {
|
|
333
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
334
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
335
|
+
index?: number;
|
|
336
|
+
};
|
|
337
|
+
/** Paste properties. Applies the copied properties (fills, strokes, effects, text style) to the selected or given layers. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
338
|
+
"edit.pasteProperties": {
|
|
339
|
+
id?: Json;
|
|
340
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
341
|
+
index?: number;
|
|
342
|
+
};
|
|
343
|
+
/** Pick color. Picks the colour under the eyedropper and optionally applies it to the selection. Params: {apply?}. Reads the mode. */
|
|
344
|
+
"edit.pickColor": {
|
|
345
|
+
apply?: boolean; /** read by the command beside its listed parameters */
|
|
346
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
347
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
348
|
+
index?: number;
|
|
349
|
+
};
|
|
350
|
+
/** Set default properties. Makes a layer's properties the defaults for new layers of its kind. Params: {id?}. Acts on `id`. Reads the mode, selection. */
|
|
351
|
+
"edit.setDefaultProperties": {
|
|
352
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
353
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
354
|
+
index?: number;
|
|
355
|
+
};
|
|
356
|
+
/** Select all. Selects every layer on the current page (or in the current frame). Params: {}. Reads the part, selection. */
|
|
357
|
+
"select.all": Record<string, never>;
|
|
358
|
+
/** Select matching layers. Selects the layers that match the selected one in kind and properties. Params: {}. Reads the part, selection. */
|
|
359
|
+
"select.matching": Record<string, never>;
|
|
360
|
+
/** Select none. Clears the selection, deselecting every layer. Params: {}. */
|
|
361
|
+
"select.none": Record<string, never>;
|
|
362
|
+
/** Select inverse. Selects the layers that aren't selected and deselects the others. Params: {}. Reads the part, selection. */
|
|
363
|
+
"select.inverse": Record<string, never>;
|
|
364
|
+
/** Fill. Selects every layer with the same fill as the selected layer. Params: {}. Reads the part, selection. */
|
|
365
|
+
"select.sameFill": Record<string, never>;
|
|
366
|
+
/** Stroke. Selects every layer with the same stroke as the selected layer. Params: {}. Reads the part, selection. */
|
|
367
|
+
"select.sameStroke": Record<string, never>;
|
|
368
|
+
/** Effect. Selects every layer with the same effects as the selected layer. Params: {}. Reads the part, selection. */
|
|
369
|
+
"select.sameEffect": Record<string, never>;
|
|
370
|
+
/** Text properties. Selects every text layer with the same text properties as the selected one. Params: {}. Reads the part, selection. */
|
|
371
|
+
"select.sameText": Record<string, never>;
|
|
372
|
+
/** Font. Selects every text layer using the same font as the selected one. Params: {}. Reads the part, selection. */
|
|
373
|
+
"select.sameFont": Record<string, never>;
|
|
374
|
+
/** Instance. Selects every instance of the same component as the selected instance. Params: {}. Reads the part, selection. */
|
|
375
|
+
"select.sameInstance": Record<string, never>;
|
|
376
|
+
/** Properties. Selects every layer with the same properties as the selected layer. Params: {}. Reads the part, selection. */
|
|
377
|
+
"select.sameProperties": Record<string, never>;
|
|
378
|
+
/** Pixel grid. Shows, hides or toggles the pixel grid; view state only. Params: {on?}. Reads the mode. */
|
|
379
|
+
"view.pixelGrid": {
|
|
380
|
+
on?: boolean;
|
|
381
|
+
};
|
|
382
|
+
/** Layout grids. Shows, hides or toggles frames' layout grids; view state only. Params: {on?}. Reads the mode. */
|
|
383
|
+
"view.layoutGrids": {
|
|
384
|
+
on?: boolean;
|
|
385
|
+
};
|
|
386
|
+
/** Rulers. Shows, hides or toggles the rulers; view state only. Params: {on?}. Reads the mode. */
|
|
387
|
+
"view.rulers": {
|
|
388
|
+
on?: boolean;
|
|
389
|
+
};
|
|
390
|
+
/** Slices. Shows, hides or toggles slices; view state only. Params: {on?}. Reads the mode. */
|
|
391
|
+
"view.slices": {
|
|
392
|
+
on?: boolean;
|
|
393
|
+
};
|
|
394
|
+
/** Comments. Shows, hides or toggles comment pins; view state only. Params: {on?}. Reads the mode. */
|
|
395
|
+
"view.comments": {
|
|
396
|
+
on?: boolean;
|
|
397
|
+
};
|
|
398
|
+
/** Show outlines. Turns outline mode on, off or toggles it; view state only. Params: {on?}. Reads the mode. */
|
|
399
|
+
"view.outlines": {
|
|
400
|
+
on?: boolean;
|
|
401
|
+
};
|
|
402
|
+
/** Show outlines for selection. Turns outline mode for the selected layers only on, off or toggles it. Params: {on?} outline mode for the selected layers only. Reads the mode. */
|
|
403
|
+
"view.outlinesSelection": {
|
|
404
|
+
on?: boolean;
|
|
405
|
+
};
|
|
406
|
+
/** Include hidden layers. Sets whether outline mode also outlines hidden layers. Params: {on?} outline mode (and outlines for the selection) outlines hidden layers too; they can be clicked there. Reads the mode. */
|
|
407
|
+
"view.outlinesHiddenLayers": {
|
|
408
|
+
on?: boolean;
|
|
409
|
+
};
|
|
410
|
+
/** Include object bounds. Sets whether outline mode also draws each layer's bounding box. Params: {on?} outline mode also draws each layer's box (groups, text, vectors); a click on a box's edge picks its layer. Reads the mode. */
|
|
411
|
+
"view.outlinesObjectBounds": {
|
|
412
|
+
on?: boolean;
|
|
413
|
+
};
|
|
414
|
+
/** Pixel preview. Turns pixel preview on, off or toggles it, at 1? or 2? rendered pixels. Params: {on?, scale? (1|2: rendered pixels per page pixel; turns it on)}. Reads the mode. */
|
|
415
|
+
"view.pixelPreview": {
|
|
416
|
+
on?: boolean; /** 1|2: rendered pixels per page pixel; turns it on */
|
|
417
|
+
scale?: number;
|
|
418
|
+
};
|
|
419
|
+
/** Mask outlines. Shows, hides or toggles mask outlines; view state only. Params: {on?}. Reads the mode. */
|
|
420
|
+
"view.maskOutlines": {
|
|
421
|
+
on?: boolean;
|
|
422
|
+
};
|
|
423
|
+
/** Frame outlines. Shows, hides or toggles frame outlines; view state only. Params: {on?}. Reads the mode. */
|
|
424
|
+
"view.frameOutlines": {
|
|
425
|
+
on?: boolean;
|
|
426
|
+
};
|
|
427
|
+
/** Soft-proof sRGB. Turns sRGB soft-proofing of a Display P3 file on, off or toggles it. Params: {on?} mark the colours of a Display P3 file that sRGB screens and files can't show. Reads the mode. */
|
|
428
|
+
"view.proofSrgb": {
|
|
429
|
+
on?: boolean;
|
|
430
|
+
};
|
|
431
|
+
/** Zoom to previous frame. Zooms the view to the previous top-level frame. Params: {}. Reads the mode, part, selection. */
|
|
432
|
+
"view.prevFrame": Record<string, never>;
|
|
433
|
+
/** Zoom to next frame. Zooms the view to the next top-level frame. Params: {}. Reads the mode, part, selection. */
|
|
434
|
+
"view.nextFrame": Record<string, never>;
|
|
435
|
+
/** Previous page. Switches to the previous page of the file. Params: {}. Reads the part. */
|
|
436
|
+
"view.prevPage": Record<string, never>;
|
|
437
|
+
/** Next page. Switches to the next page of the file. Params: {}. Reads the part. */
|
|
438
|
+
"view.nextPage": Record<string, never>;
|
|
439
|
+
/** Frame selection. Wraps the selected or given layers in a new frame, optionally named. Params: {ids?, name?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
440
|
+
"object.frameSelection": {
|
|
441
|
+
ids?: Array<Json>;
|
|
442
|
+
name?: string;
|
|
443
|
+
};
|
|
444
|
+
/** Group selection. Groups the selected or given layers, optionally naming the group. Params: {ids?, name?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
445
|
+
"object.group": {
|
|
446
|
+
ids?: Array<Json>;
|
|
447
|
+
name?: string;
|
|
448
|
+
};
|
|
449
|
+
/** Ungroup selection. Ungroups the selected or given groups, keeping their children in place. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
450
|
+
"object.ungroup": {
|
|
451
|
+
id?: Json;
|
|
452
|
+
ids?: Array<Json>;
|
|
453
|
+
};
|
|
454
|
+
/** Remove frame. Removes the selected frames, keeping their children in place. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
455
|
+
"object.removeFrame": {
|
|
456
|
+
ids?: Array<Json>;
|
|
457
|
+
};
|
|
458
|
+
/** Resize to fit. Resizes frames, sections and components to fit their contents without moving the contents. Params: {ids?} (frames, sections and components shrink or grow to their contents; the contents stay put). Acts on `ids`. Reads the selection. Changes the document. */
|
|
459
|
+
"object.resizeToFit": {
|
|
460
|
+
id?: Json;
|
|
461
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
462
|
+
maxLines?: number; /** read by the command beside its listed parameters */
|
|
463
|
+
minSize?: number; /** read by the command beside its listed parameters */
|
|
464
|
+
orphans?: boolean;
|
|
465
|
+
};
|
|
466
|
+
/** Add auto layout. Adds auto layout (horizontal, vertical or grid) to the selected or given frames, or wraps other layers in an auto-layout frame. Params: {ids?, direction?: "horizontal|vertical|grid"}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
467
|
+
"layout.add": {
|
|
468
|
+
direction?: "horizontal" | "vertical" | "grid";
|
|
469
|
+
ids?: Array<Json>;
|
|
470
|
+
};
|
|
471
|
+
/** Remove auto layout. Removes auto layout from the selected or given frames, keeping their children where they are. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
472
|
+
"layout.remove": {
|
|
473
|
+
ids?: Array<Json>;
|
|
474
|
+
};
|
|
475
|
+
/** Suggest auto layout. Adds the auto layout that best fits the current arrangement of the selected layers. Params: {ids?, direction?: "horizontal|vertical|grid" (default: what fits the arrangement)}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
476
|
+
"layout.suggest": {
|
|
477
|
+
direction?: "horizontal" | "vertical" | "grid";
|
|
478
|
+
ids?: Array<Json>;
|
|
479
|
+
};
|
|
480
|
+
/** Create component. Makes the selected frame or group a component, or wraps several layers in one. Params: {ids?} (one frame/group becomes a component; several layers are wrapped in one). Acts on `ids`. Reads the selection. Changes the document. */
|
|
481
|
+
"component.create": {
|
|
482
|
+
ids?: Array<Json>;
|
|
483
|
+
};
|
|
484
|
+
/** Create multiple components. Makes each selected layer its own component. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
485
|
+
"component.createMultiple": {
|
|
486
|
+
ids?: Array<Json>;
|
|
487
|
+
};
|
|
488
|
+
/** Combine as variants. Combines main components into a component set of variants. Params: {ids? (main components; none already a variant, a library copy or inside an instance)} (wraps them in a new component set; names without `=` become "Property 1=Default", "Property 1=VariantN"). Acts on `ids`. Reads the selection. Changes the document. */
|
|
489
|
+
"component.combineVariants": {
|
|
490
|
+
ids?: Array<Json>;
|
|
491
|
+
};
|
|
492
|
+
/** Reset all changes. Resets every override of the selected instances back to their main component. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
493
|
+
"component.resetInstance": {
|
|
494
|
+
ids?: Array<Json>;
|
|
495
|
+
};
|
|
496
|
+
/** Detach instance. Detaches the selected instances from their main component, turning them into frames. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
497
|
+
"component.detach": {
|
|
498
|
+
ids?: Array<Json>;
|
|
499
|
+
};
|
|
500
|
+
/** Go to main component. Selects and shows the main component of an instance. Params: {id?}. Acts on `id`. Reads the mode, part, selection. */
|
|
501
|
+
"component.goToMain": {
|
|
502
|
+
id?: Json;
|
|
503
|
+
};
|
|
504
|
+
/** Push changes to main component. Pushes an instance's overrides into its main component, updating every instance. Params: {id?}. Acts on `id`. Reads the selection. Changes the document. */
|
|
505
|
+
"component.pushChanges": {
|
|
506
|
+
id?: Json;
|
|
507
|
+
};
|
|
508
|
+
/** Restore main component. Restores a deleted main component from one of its instances, in that instance's place. Params: {id?} (an instance whose main was deleted becomes the main again, in its place). Acts on `id`. Reads the selection. Changes the document. */
|
|
509
|
+
"component.restoreMain": {
|
|
510
|
+
id?: Json;
|
|
511
|
+
};
|
|
512
|
+
/** Use as mask. Uses the bottom selected layer as a mask for the layers above it in a group. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
513
|
+
"object.mask": {
|
|
514
|
+
id?: Json;
|
|
515
|
+
ids?: Array<Json>;
|
|
516
|
+
};
|
|
517
|
+
/** Release mask. Releases a mask so the layers above it are no longer clipped. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
518
|
+
"object.releaseMask": {
|
|
519
|
+
id?: Json;
|
|
520
|
+
ids?: Array<Json>;
|
|
521
|
+
};
|
|
522
|
+
/** Set as thumbnail. Sets a frame as the file's thumbnail. Params: {id?}. Acts on `id`. Reads the selection. Changes the document. */
|
|
523
|
+
"object.setThumbnail": {
|
|
524
|
+
id?: Json;
|
|
525
|
+
};
|
|
526
|
+
/** Bring to front. Brings the selected or given layers to the front of their parent. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
527
|
+
"arrange.front": {
|
|
528
|
+
ids?: Array<Json>;
|
|
529
|
+
};
|
|
530
|
+
/** Bring forward. Brings the selected or given layers one step forward. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
531
|
+
"arrange.forward": {
|
|
532
|
+
ids?: Array<Json>;
|
|
533
|
+
};
|
|
534
|
+
/** Send backward. Sends the selected or given layers one step backward. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
535
|
+
"arrange.backward": {
|
|
536
|
+
ids?: Array<Json>;
|
|
537
|
+
};
|
|
538
|
+
/** Send to back. Sends the selected or given layers to the back of their parent. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
539
|
+
"arrange.back": {
|
|
540
|
+
ids?: Array<Json>;
|
|
541
|
+
};
|
|
542
|
+
/** Flip horizontal. Flips the selected or given layers (or selected vector points) horizontally. Params: {ids?} (in vector edit mode without ids: the selected points). Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
543
|
+
"object.flipH": {
|
|
544
|
+
ids?: Array<Json>;
|
|
545
|
+
};
|
|
546
|
+
/** Flip vertical. Flips the selected or given layers (or selected vector points) vertically. Params: {ids?} (in vector edit mode without ids: the selected points). Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
547
|
+
"object.flipV": {
|
|
548
|
+
ids?: Array<Json>;
|
|
549
|
+
};
|
|
550
|
+
/** Rotate 180?. Rotates the selected or given layers (or selected vector points) by 180 degrees. Params: {ids?} (in vector edit mode without ids: the selected points). Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
551
|
+
"object.rotate180": {
|
|
552
|
+
ids?: Array<Json>;
|
|
553
|
+
};
|
|
554
|
+
/** Rotate 90? left. Rotates the selected or given layers (or selected vector points) 90 degrees counter-clockwise. Params: {ids?} (in vector edit mode without ids: the selected points). Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
555
|
+
"object.rotateLeft": {
|
|
556
|
+
ids?: Array<Json>;
|
|
557
|
+
};
|
|
558
|
+
/** Rotate 90? right. Rotates the selected or given layers (or selected vector points) 90 degrees clockwise. Params: {ids?} (in vector edit mode without ids: the selected points). Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
559
|
+
"object.rotateRight": {
|
|
560
|
+
ids?: Array<Json>;
|
|
561
|
+
};
|
|
562
|
+
/** Flatten. Flattens the selected or given layers into a single vector layer. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
563
|
+
"vector.flatten": {
|
|
564
|
+
ids?: Array<Json>;
|
|
565
|
+
};
|
|
566
|
+
/** Outline stroke. Converts the strokes of the selected or given layers into filled outlines. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
567
|
+
"vector.outlineStroke": {
|
|
568
|
+
ids?: Array<Json>;
|
|
569
|
+
};
|
|
570
|
+
/** Union. Sets union as the boolean operation of the selected operands or group, or wraps layers in a union boolean group. Params: {ids?} ? layers inside boolean groups: sets their own operation (how each combines with the operands below it); one boolean group: sets its operation (every operand follows it); otherwise wraps the layers in a new boolean group. Acts on `ids`. Reads the selection. Changes the document. */
|
|
571
|
+
"bool.union": {
|
|
572
|
+
ids?: Array<Json>;
|
|
573
|
+
};
|
|
574
|
+
/** Subtract. Sets subtract as the boolean operation of the selected operands or group, or wraps layers in a subtract boolean group. Params: {ids?} ? layers inside boolean groups: sets their own operation (how each combines with the operands below it); one boolean group: sets its operation (every operand follows it); otherwise wraps the layers in a new boolean group. Acts on `ids`. Reads the selection. Changes the document. */
|
|
575
|
+
"bool.subtract": {
|
|
576
|
+
ids?: Array<Json>;
|
|
577
|
+
};
|
|
578
|
+
/** Intersect. Sets intersect as the boolean operation of the selected operands or group, or wraps layers in an intersect boolean group. Params: {ids?} ? layers inside boolean groups: sets their own operation (how each combines with the operands below it); one boolean group: sets its operation (every operand follows it); otherwise wraps the layers in a new boolean group. Acts on `ids`. Reads the selection. Changes the document. */
|
|
579
|
+
"bool.intersect": {
|
|
580
|
+
ids?: Array<Json>;
|
|
581
|
+
};
|
|
582
|
+
/** Exclude. Sets exclude as the boolean operation of the selected operands or group, or wraps layers in an exclude boolean group. Params: {ids?} ? layers inside boolean groups: sets their own operation (how each combines with the operands below it); one boolean group: sets its operation (every operand follows it); otherwise wraps the layers in a new boolean group. Acts on `ids`. Reads the selection. Changes the document. */
|
|
583
|
+
"bool.exclude": {
|
|
584
|
+
ids?: Array<Json>;
|
|
585
|
+
};
|
|
586
|
+
/** Flatten. Flattens boolean groups into plain vector layers of their result. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
587
|
+
"bool.flatten": {
|
|
588
|
+
ids?: Array<Json>;
|
|
589
|
+
};
|
|
590
|
+
/** Rasterize selection. Replaces the selected or given layers with an image of them at a scale (default 2). Params: {ids?, scale? (default 2)}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
591
|
+
"object.rasterize": {
|
|
592
|
+
id?: Json;
|
|
593
|
+
ids?: Array<Json>; /** default 2 */
|
|
594
|
+
scale?: number;
|
|
595
|
+
};
|
|
596
|
+
/** Show/Hide selection. Shows, hides or toggles the visibility of the selected or given layers. Params: {ids?, visible?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
597
|
+
"object.toggleVisible": {
|
|
598
|
+
ids?: Array<Json>;
|
|
599
|
+
visible?: boolean;
|
|
600
|
+
};
|
|
601
|
+
/** Lock/Unlock selection. Locks, unlocks or toggles the lock of the selected or given layers. Params: {ids?, locked?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
602
|
+
"object.toggleLock": {
|
|
603
|
+
ids?: Array<Json>;
|
|
604
|
+
locked?: boolean;
|
|
605
|
+
};
|
|
606
|
+
/** Hide other layers. Hides every layer on the page except the selected ones. Params: {}. Reads the part, selection. Changes the document. */
|
|
607
|
+
"object.hideOthers": Record<string, never>;
|
|
608
|
+
/** Collapse layers. Collapses every row in the layers panel; the design is unchanged. Params: {}. */
|
|
609
|
+
"layers.collapseAll": Record<string, never>;
|
|
610
|
+
/** Remove fill. Removes every fill from the selected or given layers. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
611
|
+
"object.removeFill": {
|
|
612
|
+
ids?: Array<Json>;
|
|
613
|
+
};
|
|
614
|
+
/** Remove stroke. Removes every stroke from the selected or given layers. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
615
|
+
"object.removeStroke": {
|
|
616
|
+
ids?: Array<Json>;
|
|
617
|
+
};
|
|
618
|
+
/** Swap fill and stroke. Swaps the fills and strokes of the selected or given layers. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
619
|
+
"object.swapFillStroke": {
|
|
620
|
+
ids?: Array<Json>;
|
|
621
|
+
};
|
|
622
|
+
/** Rename. Renames the selected or given layers (without a name, starts inline renaming in the layers panel). Params: {ids?, name?} (without a name: rename the layer inline in the layers panel). Acts on `ids`. Reads the selection. Changes the document. */
|
|
623
|
+
"object.rename": {
|
|
624
|
+
ids?: Array<Json>;
|
|
625
|
+
name?: string;
|
|
626
|
+
};
|
|
627
|
+
/** Batch rename. Renames several layers at once by find and replace (optionally regex) or a pattern with numbering codes. Params: {ids?, find? (match; empty: none), regex? (find is a regular expression), replace? (for each match), name? (pattern for the whole name), start? (where $n starts and $N stops; default 1)} codes in replace and name: $& current name (or the match), $` and $' text before and after the match, $1...$9 groups, $n up, $N down, $nnn padded; layers are numbered in stacking order, bottom first. Acts on `ids`. Reads the selection. Changes the document. */
|
|
628
|
+
"object.batchRename": {
|
|
629
|
+
find?: string;
|
|
630
|
+
ids?: Array<Json>; /** pattern for the whole name */
|
|
631
|
+
name?: string;
|
|
632
|
+
regex?: boolean;
|
|
633
|
+
replace?: string; /** where $n starts and $N stops; default 1 */
|
|
634
|
+
start?: number;
|
|
635
|
+
};
|
|
636
|
+
/** Move to page. Moves the selected or given layers to another page. Params: {ids?, page}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
637
|
+
"object.moveToPage": {
|
|
638
|
+
ids?: Array<Json>;
|
|
639
|
+
page?: number;
|
|
640
|
+
};
|
|
641
|
+
/** Select children. Selects the children of the selected layers. Params: {}. Reads the selection. */
|
|
642
|
+
"select.children": {
|
|
643
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
644
|
+
ids?: Array<Json>;
|
|
645
|
+
};
|
|
646
|
+
/** Select parent. Selects the parent of the selected layers. Params: {}. Reads the selection. */
|
|
647
|
+
"select.parent": {
|
|
648
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
649
|
+
ids?: Array<Json>;
|
|
650
|
+
};
|
|
651
|
+
/** Select next sibling. Selects the next sibling of the selected layer. Params: {}. Reads the part, selection. */
|
|
652
|
+
"select.next": {
|
|
653
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
654
|
+
ids?: Array<Json>;
|
|
655
|
+
};
|
|
656
|
+
/** Select previous sibling. Selects the previous sibling of the selected layer. Params: {}. Reads the part, selection. */
|
|
657
|
+
"select.previous": {
|
|
658
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
659
|
+
ids?: Array<Json>;
|
|
660
|
+
};
|
|
661
|
+
/** Bold. Toggles bold on the selected or given text layers (or the selected text range). Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
662
|
+
"text.bold": {
|
|
663
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
664
|
+
text?: string;
|
|
665
|
+
};
|
|
666
|
+
/** Italic. Toggles italic on the selected or given text layers (or the selected text range). Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
667
|
+
"text.italic": {
|
|
668
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
669
|
+
text?: string;
|
|
670
|
+
};
|
|
671
|
+
/** Underline. Toggles underline on the selected or given text layers (or the selected text range). Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
672
|
+
"text.underline": {
|
|
673
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
674
|
+
text?: string;
|
|
675
|
+
};
|
|
676
|
+
/** Strikethrough. Toggles strikethrough on the selected or given text layers (or the selected text range). Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
677
|
+
"text.strikethrough": {
|
|
678
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
679
|
+
text?: string;
|
|
680
|
+
};
|
|
681
|
+
/** Create link. Makes the selected or given text (or text range) a hyperlink to url. Params: {url, ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
682
|
+
"text.link": {
|
|
683
|
+
ids?: Array<Json>;
|
|
684
|
+
url?: string;
|
|
685
|
+
};
|
|
686
|
+
/** Bulleted list. Turns the selected or given text's paragraphs into a bulleted list (or back to plain text). Params: {ids?} while editing: the selected paragraphs. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
687
|
+
"text.bulletList": {
|
|
688
|
+
ids?: Array<Json>;
|
|
689
|
+
};
|
|
690
|
+
/** Numbered list. Turns the selected or given text's paragraphs into a numbered list (or back to plain text). Params: {ids?} while editing: the selected paragraphs. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
691
|
+
"text.numberList": {
|
|
692
|
+
ids?: Array<Json>;
|
|
693
|
+
};
|
|
694
|
+
/** Text align left. Aligns the text of the selected or given text layers to the left. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
695
|
+
"text.alignLeft": {
|
|
696
|
+
id?: Json;
|
|
697
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
698
|
+
text?: string;
|
|
699
|
+
};
|
|
700
|
+
/** Text align center. Centres the text of the selected or given text layers. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
701
|
+
"text.alignCenter": {
|
|
702
|
+
id?: Json;
|
|
703
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
704
|
+
text?: string;
|
|
705
|
+
};
|
|
706
|
+
/** Text align right. Aligns the text of the selected or given text layers to the right. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
707
|
+
"text.alignRight": {
|
|
708
|
+
id?: Json;
|
|
709
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
710
|
+
text?: string;
|
|
711
|
+
};
|
|
712
|
+
/** Text align justified. Justifies the text of the selected or given text layers. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
713
|
+
"text.alignJustify": {
|
|
714
|
+
id?: Json;
|
|
715
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
716
|
+
text?: string;
|
|
717
|
+
};
|
|
718
|
+
/** Increase font size. Increases the font size of the selected or given text layers by one step. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
719
|
+
"text.sizeUp": {
|
|
720
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
721
|
+
text?: string;
|
|
722
|
+
};
|
|
723
|
+
/** Decrease font size. Decreases the font size of the selected or given text layers by one step. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
724
|
+
"text.sizeDown": {
|
|
725
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
726
|
+
text?: string;
|
|
727
|
+
};
|
|
728
|
+
/** Increase font weight. Moves the selected or given text to the next heavier font weight available. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
729
|
+
"text.weightUp": {
|
|
730
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
731
|
+
text?: string;
|
|
732
|
+
};
|
|
733
|
+
/** Decrease font weight. Moves the selected or given text to the next lighter font weight available. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
734
|
+
"text.weightDown": {
|
|
735
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
736
|
+
text?: string;
|
|
737
|
+
};
|
|
738
|
+
/** Increase line height. Increases the line height of the selected or given text layers by one step. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
739
|
+
"text.lineHeightUp": {
|
|
740
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
741
|
+
text?: string;
|
|
742
|
+
};
|
|
743
|
+
/** Decrease line height. Decreases the line height of the selected or given text layers by one step. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
744
|
+
"text.lineHeightDown": {
|
|
745
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
746
|
+
text?: string;
|
|
747
|
+
};
|
|
748
|
+
/** Increase letter spacing. Increases the letter spacing of the selected or given text layers by one step. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
749
|
+
"text.trackingUp": {
|
|
750
|
+
fromGesture?: boolean; /** read by the command beside its listed parameters */
|
|
751
|
+
id?: Json;
|
|
752
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
753
|
+
text?: string;
|
|
754
|
+
};
|
|
755
|
+
/** Decrease letter spacing. Decreases the letter spacing of the selected or given text layers by one step. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
756
|
+
"text.trackingDown": {
|
|
757
|
+
fromGesture?: boolean; /** read by the command beside its listed parameters */
|
|
758
|
+
id?: Json;
|
|
759
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
760
|
+
text?: string;
|
|
761
|
+
};
|
|
762
|
+
/** Original case. Sets the selected or given text back to its original case (no case transform). Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
763
|
+
"text.caseOriginal": {
|
|
764
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
765
|
+
text?: string;
|
|
766
|
+
};
|
|
767
|
+
/** Uppercase. Displays the selected or given text in uppercase. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
768
|
+
"text.caseUpper": {
|
|
769
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
770
|
+
text?: string;
|
|
771
|
+
};
|
|
772
|
+
/** Lowercase. Displays the selected or given text in lowercase. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
773
|
+
"text.caseLower": {
|
|
774
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
775
|
+
text?: string;
|
|
776
|
+
};
|
|
777
|
+
/** Title case. Displays the selected or given text in title case. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
778
|
+
"text.caseTitle": {
|
|
779
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
780
|
+
text?: string;
|
|
781
|
+
};
|
|
782
|
+
/** Missing fonts. Answers the font families the document uses that aren't installed, with the layers that use them. Params: {} fonts the open document names that aren't installed (text layers, styled ranges, text styles, font family variables); the app shows them ? {families: [{family, layers}]}. Reads the mode, part, selection. */
|
|
783
|
+
"text.missingFonts": {
|
|
784
|
+
text?: string;
|
|
785
|
+
};
|
|
786
|
+
/** Align left. Aligns the selected or given layers to their left edge (or a single layer to its parent). Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
787
|
+
"align.left": {
|
|
788
|
+
id?: Json;
|
|
789
|
+
ids?: Array<Json>;
|
|
790
|
+
};
|
|
791
|
+
/** Align horizontal centers. Aligns the selected or given layers on their horizontal centres. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
792
|
+
"align.hcenter": {
|
|
793
|
+
id?: Json;
|
|
794
|
+
ids?: Array<Json>;
|
|
795
|
+
};
|
|
796
|
+
/** Align right. Aligns the selected or given layers to their right edge. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
797
|
+
"align.right": {
|
|
798
|
+
id?: Json;
|
|
799
|
+
ids?: Array<Json>;
|
|
800
|
+
};
|
|
801
|
+
/** Align top. Aligns the selected or given layers to their top edge. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
802
|
+
"align.top": {
|
|
803
|
+
id?: Json;
|
|
804
|
+
ids?: Array<Json>;
|
|
805
|
+
};
|
|
806
|
+
/** Align vertical centers. Aligns the selected or given layers on their vertical centres. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
807
|
+
"align.vcenter": {
|
|
808
|
+
id?: Json;
|
|
809
|
+
ids?: Array<Json>;
|
|
810
|
+
};
|
|
811
|
+
/** Align bottom. Aligns the selected or given layers to their bottom edge. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
812
|
+
"align.bottom": {
|
|
813
|
+
id?: Json;
|
|
814
|
+
ids?: Array<Json>;
|
|
815
|
+
};
|
|
816
|
+
/** Distribute horizontal spacing. Spaces the selected or given layers evenly horizontally, or by a fixed spacing. Params: {ids?, spacing?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
817
|
+
"distribute.horizontal": {
|
|
818
|
+
fromGesture?: boolean; /** read by the command beside its listed parameters */
|
|
819
|
+
id?: Json;
|
|
820
|
+
ids?: Array<Json>;
|
|
821
|
+
spacing?: number;
|
|
822
|
+
};
|
|
823
|
+
/** Distribute vertical spacing. Spaces the selected or given layers evenly vertically, or by a fixed spacing. Params: {ids?, spacing?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
824
|
+
"distribute.vertical": {
|
|
825
|
+
fromGesture?: boolean; /** read by the command beside its listed parameters */
|
|
826
|
+
id?: Json;
|
|
827
|
+
ids?: Array<Json>;
|
|
828
|
+
spacing?: number;
|
|
829
|
+
};
|
|
830
|
+
/** Tidy up. Tidies the selected layers into an evenly spaced grid, or by a fixed spacing. Params: {ids?, spacing?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
831
|
+
"arrange.tidy": {
|
|
832
|
+
id?: Json;
|
|
833
|
+
ids?: Array<Json>;
|
|
834
|
+
spacing?: number;
|
|
835
|
+
};
|
|
836
|
+
/** Pack horizontal. Packs the selected layers side by side horizontally with no gaps. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
837
|
+
"arrange.packH": {
|
|
838
|
+
ids?: Array<Json>;
|
|
839
|
+
};
|
|
840
|
+
/** Pack vertical. Packs the selected layers one above another vertically with no gaps. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
841
|
+
"arrange.packV": {
|
|
842
|
+
ids?: Array<Json>;
|
|
843
|
+
};
|
|
844
|
+
/** Round to pixels. Rounds the position and size of the selected or given layers to whole pixels. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
845
|
+
"arrange.roundToPixels": {
|
|
846
|
+
ids?: Array<Json>;
|
|
847
|
+
};
|
|
848
|
+
/** Join selection. Joins the selected vector layers' open paths (or the selected points in vector edit mode). Params: {ids?} (in vector edit mode: joins the selected points). Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
849
|
+
"vector.join": {
|
|
850
|
+
code?: string; /** read by the command beside its listed parameters */
|
|
851
|
+
id?: Json;
|
|
852
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
853
|
+
link?: string;
|
|
854
|
+
};
|
|
855
|
+
/** Smooth join selection. Joins the selected open paths or points with a smooth curve. Params: {ids?} (in vector edit mode: joins the selected points smoothly). Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
856
|
+
"vector.smoothJoin": {
|
|
857
|
+
code?: string; /** read by the command beside its listed parameters */
|
|
858
|
+
id?: Json;
|
|
859
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
860
|
+
link?: string;
|
|
861
|
+
};
|
|
862
|
+
/** Delete and heal selection. Deletes the selected vector points and heals the path across the gap. Params: {vertices?} (default the selected points of every edited layer). Reads the mode. Changes the document. */
|
|
863
|
+
"vector.deleteHeal": {
|
|
864
|
+
vertices?: Array<number>;
|
|
865
|
+
};
|
|
866
|
+
/** Simplify vector. Reduces the points of the selected or given vector layers within a tolerance. Params: {ids?, tolerance?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
867
|
+
"vector.simplify": {
|
|
868
|
+
id?: Json;
|
|
869
|
+
ids?: Array<Json>;
|
|
870
|
+
tolerance?: number;
|
|
871
|
+
};
|
|
872
|
+
/** Reverse path direction. Reverses the path direction of the selected or given vector layers. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
873
|
+
"vector.reverse": {
|
|
874
|
+
ids?: Array<Json>;
|
|
875
|
+
};
|
|
876
|
+
/** Offset path. Offsets the paths of the selected or given vector layers outward (or inward for negative offset). Params: {ids?, offset}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
877
|
+
"vector.offset": {
|
|
878
|
+
ids?: Array<Json>;
|
|
879
|
+
offset?: number;
|
|
880
|
+
};
|
|
881
|
+
/** Snap to geometry. Turns snapping to geometry on, off or toggles it. Params: {on?}. Reads the mode. */
|
|
882
|
+
"view.snapGeometry": {
|
|
883
|
+
on?: boolean;
|
|
884
|
+
};
|
|
885
|
+
/** Snap to objects. Turns snapping to objects on, off or toggles it. Params: {on?}. Reads the mode. */
|
|
886
|
+
"view.snapObjects": {
|
|
887
|
+
on?: boolean;
|
|
888
|
+
};
|
|
889
|
+
/** Snap to pixel grid. Turns snapping to the pixel grid on, off or toggles it. Params: {on?}. Reads the mode. */
|
|
890
|
+
"view.snapPixel": {
|
|
891
|
+
on?: boolean;
|
|
892
|
+
};
|
|
893
|
+
/** Keep tool selected after use. Sets whether a drawing tool stays selected after use. Params: {on?}. Reads the mode. */
|
|
894
|
+
"pref.keepTool": {
|
|
895
|
+
on?: boolean;
|
|
896
|
+
};
|
|
897
|
+
/** Highlight layers on hover. Sets whether layers highlight on hover. Params: {on?}. Reads the mode. */
|
|
898
|
+
"pref.highlightHover": {
|
|
899
|
+
on?: boolean;
|
|
900
|
+
};
|
|
901
|
+
/** Rename duplicated layers. Sets whether duplicated layers get numbered names. Params: {on?}. Reads the mode. */
|
|
902
|
+
"pref.renameDuplicates": {
|
|
903
|
+
on?: boolean;
|
|
904
|
+
};
|
|
905
|
+
/** Show dimensions on objects. Sets whether the canvas shows dimensions on selected objects. Params: {on?}. Reads the mode. */
|
|
906
|
+
"pref.showDimensions": {
|
|
907
|
+
on?: boolean;
|
|
908
|
+
};
|
|
909
|
+
/** Use number keys for opacity. Sets whether number keys set the selection's opacity. Params: {on?}. Reads the mode. */
|
|
910
|
+
"pref.numberKeysOpacity": {
|
|
911
|
+
on?: boolean;
|
|
912
|
+
};
|
|
913
|
+
/** Nudge amount. Sets the small and big nudge amounts used by transform.nudge. Params: {small?, big?}. Reads the mode. */
|
|
914
|
+
"pref.nudge": {
|
|
915
|
+
big?: number;
|
|
916
|
+
small?: number;
|
|
917
|
+
};
|
|
918
|
+
/** Hide when publishing. Keeps components (or sets) out of the library this file publishes, or toggles that. Params: {ids? (components, sets or layers in them; default the selection), on? (default: toggle, hiding unless all are hidden)} keeps them out of the library this file publishes, the way a name starting with `.` or `_` does: hiding puts a `.` before the name, showing takes the leading `.` and `_` away ? {ids, hidden}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
919
|
+
"component.hideWhenPublishing": {
|
|
920
|
+
ids?: Array<Json>;
|
|
921
|
+
on?: boolean;
|
|
922
|
+
};
|
|
923
|
+
/** Move. Chooses the Move tool in the editor; the design is unchanged. Params: {}. Reads the mode. */
|
|
924
|
+
"tool.move": Record<string, never>;
|
|
925
|
+
/** Scale. Chooses the Scale tool in the editor; the design is unchanged. Params: {}. Reads the mode. */
|
|
926
|
+
"tool.scale": Record<string, never>;
|
|
927
|
+
/** Hand. Chooses the Hand tool in the editor; the design is unchanged. Params: {}. Reads the mode. */
|
|
928
|
+
"tool.hand": Record<string, never>;
|
|
929
|
+
/** Frame. Chooses the Frame tool in the editor; use frame.create to make a frame directly. Params: {}. Reads the mode. */
|
|
930
|
+
"tool.frame": Record<string, never>;
|
|
931
|
+
/** Section. Chooses the Section tool in the editor; use node.create to make a section directly. Params: {}. Reads the mode. */
|
|
932
|
+
"tool.section": Record<string, never>;
|
|
933
|
+
/** Slice. Chooses the Slice tool in the editor; use node.create to make a slice directly. Params: {}. Reads the mode. */
|
|
934
|
+
"tool.slice": Record<string, never>;
|
|
935
|
+
/** Rectangle. Chooses the Rectangle tool in the editor; use shape.rectangle to draw one directly. Params: {}. Reads the mode. */
|
|
936
|
+
"tool.rectangle": Record<string, never>;
|
|
937
|
+
/** Line. Chooses the Line tool in the editor; use shape.line to draw one directly. Params: {}. Reads the mode. */
|
|
938
|
+
"tool.line": Record<string, never>;
|
|
939
|
+
/** Arrow. Chooses the Arrow tool in the editor; use shape.arrow to draw one directly. Params: {}. Reads the mode. */
|
|
940
|
+
"tool.arrow": Record<string, never>;
|
|
941
|
+
/** Ellipse. Chooses the Ellipse tool in the editor; use shape.ellipse to draw one directly. Params: {}. Reads the mode. */
|
|
942
|
+
"tool.ellipse": Record<string, never>;
|
|
943
|
+
/** Polygon. Chooses the Polygon tool in the editor; use shape.polygon to draw one directly. Params: {}. Reads the mode. */
|
|
944
|
+
"tool.polygon": Record<string, never>;
|
|
945
|
+
/** Star. Chooses the Star tool in the editor; use shape.star to draw one directly. Params: {}. Reads the mode. */
|
|
946
|
+
"tool.star": Record<string, never>;
|
|
947
|
+
/** Pen. Chooses the Pen tool in the editor; use vector.create to make a path directly. Params: {}. Reads the mode. */
|
|
948
|
+
"tool.pen": Record<string, never>;
|
|
949
|
+
/** Pencil. Chooses the Pencil tool in the editor; use vector.create to make a path directly. Params: {}. Reads the mode. */
|
|
950
|
+
"tool.pencil": Record<string, never>;
|
|
951
|
+
/** Text. Chooses the Text tool in the editor; use text.create to add text directly. Params: {}. Reads the mode. */
|
|
952
|
+
"tool.text": {
|
|
953
|
+
text?: string;
|
|
954
|
+
};
|
|
955
|
+
/** Comment. Chooses the Comment tool in the editor; use comment.add to add a comment directly. Params: {}. Reads the mode. */
|
|
956
|
+
"tool.comment": Record<string, never>;
|
|
957
|
+
/** Shape builder. Chooses the Shape builder tool in the editor; the design is unchanged. Params: {}. Reads the mode. */
|
|
958
|
+
"tool.shapeBuilder": Record<string, never>;
|
|
959
|
+
/** Create layer. Creates a layer of a type (rectangle, ellipse, polygon, star, line, arrow, vector, text, frame, section, component, slice) at x, y in a parent with properties; answers its id. Params: {type: rectangle|ellipse|polygon|star|line|arrow|vector|text|frame|section|component|slice, x?, y? (relative to the parent frame; groups don't count), width?, height?, parent? (id; default: the page), index?, name?, text? (for text), characters? (the same as text), path? (SVG path data for vector), points?: [[x, y]] (vector: instead of path), closed?: bool (vector points: a closed shape), props?: {node.set keys}, select? (default true)}. Reads the mode, part. Changes the document. */
|
|
960
|
+
"node.create": {
|
|
961
|
+
characters?: string; /** vector points: a closed shape */
|
|
962
|
+
closed?: boolean;
|
|
963
|
+
height?: number; /** a position counted from 0 (the first is 0) */
|
|
964
|
+
index?: number;
|
|
965
|
+
name?: string; /** an id (a number, or its digits as text) */
|
|
966
|
+
parent?: Json; /** SVG path data for vector */
|
|
967
|
+
path?: string; /** vector: instead of path */
|
|
968
|
+
points?: Array<Array<number>>;
|
|
969
|
+
props?: {
|
|
970
|
+
[key: string]: Json;
|
|
971
|
+
};
|
|
972
|
+
select?: boolean; /** for text */
|
|
973
|
+
text?: string;
|
|
974
|
+
type?: "rectangle" | "ellipse" | "polygon" | "star" | "line" | "arrow" | "vector" | "text" | "frame" | "section" | "component" | "slice";
|
|
975
|
+
width?: number;
|
|
976
|
+
x?: number; /** relative to the parent frame; groups don't count */
|
|
977
|
+
y?: number;
|
|
978
|
+
};
|
|
979
|
+
/** Create frame. Creates a frame from a device preset or a size, in a parent, with a name and properties; answers its id. Params: {preset? (name from FRAME_PRESETS), x?, y?, width?, height?, parent?, name?, props?} (a preset without x/y lands to the right of the page's frames). Reads the mode, part. Changes the document. */
|
|
980
|
+
"frame.create": {
|
|
981
|
+
height?: number;
|
|
982
|
+
name?: string; /** an id (a number, or its digits as text) */
|
|
983
|
+
parent?: Json; /** name from FRAME_PRESETS */
|
|
984
|
+
preset?: string;
|
|
985
|
+
props?: {
|
|
986
|
+
[key: string]: Json;
|
|
987
|
+
};
|
|
988
|
+
width?: number;
|
|
989
|
+
x?: number;
|
|
990
|
+
y?: number;
|
|
991
|
+
};
|
|
992
|
+
/** Rectangle. Draws a rectangle at x, y with width and height in a parent, with optional properties; answers its id. Params: {x, y, width, height, parent?, props?}. Reads the part. Changes the document. */
|
|
993
|
+
"shape.rectangle": {
|
|
994
|
+
height?: number; /** an id (a number, or its digits as text) */
|
|
995
|
+
parent?: Json;
|
|
996
|
+
props?: {
|
|
997
|
+
[key: string]: Json;
|
|
998
|
+
};
|
|
999
|
+
width?: number;
|
|
1000
|
+
x?: number;
|
|
1001
|
+
y?: number;
|
|
1002
|
+
};
|
|
1003
|
+
/** Ellipse. Draws an ellipse in the box x, y, width, height in a parent, with optional properties; answers its id. Params: {x, y, width, height, parent?, props?}. Reads the part. Changes the document. */
|
|
1004
|
+
"shape.ellipse": {
|
|
1005
|
+
height?: number; /** an id (a number, or its digits as text) */
|
|
1006
|
+
parent?: Json;
|
|
1007
|
+
props?: {
|
|
1008
|
+
[key: string]: Json;
|
|
1009
|
+
};
|
|
1010
|
+
width?: number;
|
|
1011
|
+
x?: number;
|
|
1012
|
+
y?: number;
|
|
1013
|
+
};
|
|
1014
|
+
/** Polygon. Draws a polygon in a box with a point count in a parent; answers its id. Params: {x, y, width, height, parent?, props? {pointCount}}. Reads the part. Changes the document. */
|
|
1015
|
+
"shape.polygon": {
|
|
1016
|
+
height?: number; /** an id (a number, or its digits as text) */
|
|
1017
|
+
parent?: Json;
|
|
1018
|
+
width?: number;
|
|
1019
|
+
x?: number;
|
|
1020
|
+
y?: number;
|
|
1021
|
+
};
|
|
1022
|
+
/** Star. Draws a star in a box with a point count and inner radius in a parent; answers its id. Params: {x, y, width, height, parent?, props? {pointCount, innerRadius}}. Reads the part. Changes the document. */
|
|
1023
|
+
"shape.star": {
|
|
1024
|
+
height?: number; /** an id (a number, or its digits as text) */
|
|
1025
|
+
parent?: Json;
|
|
1026
|
+
width?: number;
|
|
1027
|
+
x?: number;
|
|
1028
|
+
y?: number;
|
|
1029
|
+
};
|
|
1030
|
+
/** Line. Draws a line of a length from x, y (optionally rotated) in a parent; answers its id. Params: {x, y, width (length), parent?, props? {rotation}}. Reads the part. Changes the document. */
|
|
1031
|
+
"shape.line": {
|
|
1032
|
+
parent?: Json; /** length */
|
|
1033
|
+
width?: number;
|
|
1034
|
+
x?: number;
|
|
1035
|
+
y?: number;
|
|
1036
|
+
};
|
|
1037
|
+
/** Arrow. Draws an arrow of a length from x, y in a parent, with optional properties; answers its id. Params: {x, y, width (length), parent?, props?}. Reads the part. Changes the document. */
|
|
1038
|
+
"shape.arrow": {
|
|
1039
|
+
parent?: Json;
|
|
1040
|
+
props?: {
|
|
1041
|
+
[key: string]: Json;
|
|
1042
|
+
}; /** length */
|
|
1043
|
+
width?: number;
|
|
1044
|
+
x?: number;
|
|
1045
|
+
y?: number;
|
|
1046
|
+
};
|
|
1047
|
+
/** Text. Creates a text layer at x, y in a parent with optional fixed width and text properties (font, size and more); answers its id. Params: {text, x, y, parent?, width? (fixed width wraps), props? (fontSize, fontFamily, ...)}. Reads the mode, part. Changes the document. */
|
|
1048
|
+
"text.create": {
|
|
1049
|
+
parent?: Json;
|
|
1050
|
+
props?: {
|
|
1051
|
+
[key: string]: Json;
|
|
1052
|
+
};
|
|
1053
|
+
text?: string; /** fixed width wraps */
|
|
1054
|
+
width?: number;
|
|
1055
|
+
x?: number;
|
|
1056
|
+
y?: number;
|
|
1057
|
+
};
|
|
1058
|
+
/** Vector. Creates a vector layer from SVG path data or points, open or closed, scaled to a box, in a parent; answers its id. Params: {path (SVG path data) | points [[x,y],..], closed?, x?, y?, width?, height? (scale the path; one keeps its proportion), parent?, props?}. Reads the part. Changes the document. */
|
|
1059
|
+
"vector.create": {
|
|
1060
|
+
closed?: boolean; /** scale the path; one keeps its proportion */
|
|
1061
|
+
height?: number; /** an id (a number, or its digits as text) */
|
|
1062
|
+
parent?: Json;
|
|
1063
|
+
path?: string;
|
|
1064
|
+
props?: {
|
|
1065
|
+
[key: string]: Json;
|
|
1066
|
+
};
|
|
1067
|
+
width?: number;
|
|
1068
|
+
x?: number;
|
|
1069
|
+
y?: number;
|
|
1070
|
+
};
|
|
1071
|
+
/** Place image. Places an image from base64 or a path as a new image layer, or adds it as a fill on an existing layer. Params: {data? (base64 of the image), name? (the image's name), x?, y?, width?, height?, parent?, target? (an existing layer: the image is added on top of its fills instead of making a layer), index? (with `target`: fill `index` becomes the image in place, keeping its opacity, blend and visibility and, when it is an image already, its scale mode, tile scale, rotation and adjustments), mode? (fill|fit|crop|tile)} ? {id, image, width, height, imageProfile (its embedded colour profile; null: taken as sRGB)}. Reads the part. Changes the document. */
|
|
1072
|
+
"image.place": {
|
|
1073
|
+
data?: string;
|
|
1074
|
+
height?: number; /** a position counted from 0 (the first is 0); with `target`: fill `index` becomes the image in place, keeping its opacity, blend and visibility and, when it is an image already, its scale mode, tile scale, rotation and adjustments */
|
|
1075
|
+
index?: number;
|
|
1076
|
+
mode?: "fill" | "fit" | "crop" | "tile"; /** the image's name */
|
|
1077
|
+
name?: string; /** an id (a number, or its digits as text) */
|
|
1078
|
+
parent?: Json; /** an id (a number, or its digits as text) */
|
|
1079
|
+
target?: Json;
|
|
1080
|
+
width?: number;
|
|
1081
|
+
x?: number;
|
|
1082
|
+
y?: number;
|
|
1083
|
+
};
|
|
1084
|
+
/** Swap orientation. Swaps the width and height of the selected or given frames (portrait and landscape). Params: {ids?} (portrait ? landscape: width and height trade places). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1085
|
+
"frame.swapOrientation": {
|
|
1086
|
+
anchor?: string; /** read by the command beside its listed parameters */
|
|
1087
|
+
height?: number; /** read by the command beside its listed parameters */
|
|
1088
|
+
id?: Json;
|
|
1089
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
1090
|
+
width?: number;
|
|
1091
|
+
};
|
|
1092
|
+
/** List frame presets. Answers the device and paper frame presets with their sizes, for frame.create. Params: {}. */
|
|
1093
|
+
"frame.presets": Record<string, never>;
|
|
1094
|
+
/** Paste design layers. Pastes layers copied from another design app (clipboard HTML or design data) into a parent at x, y. Params: {html? (the clipboard's HTML), data? (instead of html: base64 of the clipboard's design data, at most 256 MB), parent?, x?, y?} layers copied from another design app (a .fig canvas in the clipboard's HTML), read like a .fig file (best effort, with `warnings`), pasted as edit.paste pastes. Reads the mode, part, selection. Changes the document. */
|
|
1095
|
+
"edit.pasteDesignLayers": {
|
|
1096
|
+
data?: string;
|
|
1097
|
+
html?: string; /** an id (a number, or its digits as text) */
|
|
1098
|
+
parent?: Json;
|
|
1099
|
+
x?: number;
|
|
1100
|
+
y?: number;
|
|
1101
|
+
};
|
|
1102
|
+
/** Select. Replaces the selection with the layers ids. Params: {ids: [..]} (replace the selection). Reads the part, selection. */
|
|
1103
|
+
"select.set": {
|
|
1104
|
+
ids?: Array<Json>;
|
|
1105
|
+
};
|
|
1106
|
+
/** Add to selection. Adds the layers ids to the selection. Params: {ids}. Acts on `ids`. Reads the selection. */
|
|
1107
|
+
"select.add": {
|
|
1108
|
+
ids?: Array<Json>;
|
|
1109
|
+
};
|
|
1110
|
+
/** Remove from selection. Removes the layers ids from the selection. Params: {ids}. Acts on `ids`. Reads the selection. */
|
|
1111
|
+
"select.remove": {
|
|
1112
|
+
ids?: Array<Json>;
|
|
1113
|
+
};
|
|
1114
|
+
/** Layers at a point. Answers every layer under a page point, front-most first, with its id, name, type and depth. Params: {x, y (page coordinates)} ? {layers: [{id, name, type, depth}]} (every layer under the point, front-most first; what the context menu's Select layer lists). Reads the mode, part, selection. */
|
|
1115
|
+
"select.layersAt": {
|
|
1116
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
1117
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
1118
|
+
item?: string; /** read by the command beside its listed parameters */
|
|
1119
|
+
value?: string;
|
|
1120
|
+
x?: number; /** page coordinates */
|
|
1121
|
+
y?: number;
|
|
1122
|
+
};
|
|
1123
|
+
/** Select area. Selects the layers inside a marquee rectangle (adding or including nested layers as asked); answers the selection. Params: {x, y, width, height (page units; a marquee from x, y), add? (toggle like a Shift marquee), deep? (nested layers, like Cmd/Ctrl)} ? {selection}; with no box: draw one from the keyboard in the app (arrows move it, Cmd/Ctrl+arrows or Shift+arrows size it, Enter selects, Escape cancels). Reads the selection. */
|
|
1124
|
+
"select.area": {
|
|
1125
|
+
add?: boolean;
|
|
1126
|
+
deep?: boolean; /** page units; a marquee from x, y */
|
|
1127
|
+
height?: number;
|
|
1128
|
+
width?: number;
|
|
1129
|
+
x?: number;
|
|
1130
|
+
y?: number;
|
|
1131
|
+
};
|
|
1132
|
+
/** Select layers by name. Selects the layers whose names match a query on the current page or every page. Params: {query, page? (default current; "all" for every page)}. Reads the part. */
|
|
1133
|
+
"select.byName": {
|
|
1134
|
+
page?: number;
|
|
1135
|
+
query?: string;
|
|
1136
|
+
};
|
|
1137
|
+
/** Nudge. Nudges the selection by dx, dy times the nudge amount (auto-layout children move one place in the flow instead). Params: {dx, dy, big? (use the big nudge amount)} (auto layout children move one place instead: along the flow, between wrapped rows, to the next grid cell, or into the neighbouring nested auto layout frame). Reads the mode, selection. Changes the document. */
|
|
1138
|
+
"transform.nudge": {
|
|
1139
|
+
big?: boolean;
|
|
1140
|
+
dx?: number;
|
|
1141
|
+
dy?: number;
|
|
1142
|
+
};
|
|
1143
|
+
/** Resize by nudge. Grows or shrinks the selection by dw, dh times the nudge amount, top-left fixed. Params: {dw, dh, big?} (grow or shrink the selection by the nudge amount, top-left fixed). Reads the mode, selection. Changes the document. */
|
|
1144
|
+
"transform.nudgeSize": {
|
|
1145
|
+
big?: boolean;
|
|
1146
|
+
dh?: number;
|
|
1147
|
+
dw?: number;
|
|
1148
|
+
};
|
|
1149
|
+
/** Opacity from number keys. Sets the selection's opacity from typed digits, as the number keys do (1 is 10%, 0 is 100%, two digits a percentage). Params: {digits ("1"..."9": 10%...90%, "0": 100%; two digits: that percentage, "45" is 45%), ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1150
|
+
"object.opacityKeys": {
|
|
1151
|
+
digits?: string; /** read by the command beside its listed parameters */
|
|
1152
|
+
id?: Json;
|
|
1153
|
+
ids?: Array<Json>;
|
|
1154
|
+
};
|
|
1155
|
+
/** Set properties. Sets properties of a layer: name, visibility, lock, opacity, blend, position, size, rotation, fills, strokes, effects, corner radius, constraints, auto layout and text fields. Params: name, visible, locked, opacity (0-1), blend, x, y (relative to the parent frame; groups don't count), width, height, rotation (degrees), fills (paints or colours; gradients as {type: linearGradient|radialGradient|angularGradient|diamondGradient, stops: ["#hex", ...], from?, to?} too), fill (colour, or "none"/null: no fill), strokes, stroke (colour, or "none"/null: no stroke), strokeWeight, strokeAlign (inside|center|outside), strokeSides [t,r,b,l], strokeTopWeight / strokeRightWeight / strokeBottomWeight / strokeLeftWeight (one side; turns on individual strokes), strokeCap / startCap / endCap, strokeJoin, miterAngle (degrees: sharper joins bevel; or miterLimit as a ratio), dashes [..], widthProfile (preset uniform|wedge|taper|eye|rounded|pinch, [[t, scale], ...] or null), brush (preset id, {preset, spacing, sizeJitter, rotationJitter, scatter, seed} or null), cornerRadius (n or [tl,tr,br,bl]), cornerSmoothing (0-1), effects, clip, isMask, layout (null|horizontal|vertical|grid|{...}), gap, crossGap, padding (n or [t,r,b,l]), paddingTop/Right/Bottom/Left, mainAlign (min|center|max, or the auto gaps spaceBetween|spaceAround|spaceEvenly), crossAlign (min|center|max|baseline: first text baselines, horizontal layouts), contentAlign (wrapped lines: auto = packed where crossAlign says | spaceBetween), wrap (rows of a horizontal layout, columns of a vertical one), strokesIncluded (the frame's inside stroke takes up space), reverseZ (canvas stacking: true = first on top), columnGap / rowGap (aliases of gap / crossGap), gridColumns, gridRows, columnTracks / rowTracks ([120 | "1fr" | "auto" | {sizing, value}]), gridColumn / gridRow (0-based cell anchor, null = auto), gridColumnSpan, gridRowSpan, gridAlignH / gridAlignV (a grid child's alignment in its cell: min|center|max, auto/null = the frame's), sizingH / sizingV (fixed|hug|fill), absolute (ignore auto layout; follows constraints), minWidth, maxWidth, minHeight, maxHeight (null removes), constraints {horizontal, vertical}, grids, exports, characters, fontFamily, fontStyle, fontSize, lineHeight (auto|px|"150%"), letterSpacing (px|"2%"), textAlign (left|center|right|justified), textAlignVertical, textAutoResize (widthAndHeight|height|none|truncate), textDecoration, textDecorationStyle (solid|dotted|wavy), textDecorationThickness / textDecorationOffset (auto|px|"10%" of the font size; the offset runs from the baseline down to an underline's top edge), textDecorationSkipInk (underlines break around descenders), textDecorationColor (colour, or auto/null: the text's), textCase (original|upper|lower|title|smallCaps), paragraphSpacing, paragraphIndent, listStyle (none|bulleted|numbered; with start/end: the paragraphs those chars touch), indentation (list nesting level 0-8, same range rule), listSpacing (px between list items, in place of paragraphSpacing), hangingPunctuation, hangingList (markers outside the box), leadingTrim (vertical trim: none|capHeight), maxLines, features ({tag: bool}, e.g. {"liga": false, "tnum": true}), fontVariations / variationSettings ({axis: number}, e.g. {"wght": 550, "wdth": 85}; null = none), path (a vector's SVG path data: replaces its geometry, keeping the layer, its paints, styles and bindings; width/height in the same call scale it as node.create does; its own box goes at the layer's x/y, or with x/y given, at x + its left edge and y + its top as node.create places it), pointCount, innerRadius, arcStart, arcSweep, arcInner, booleanOperation (a boolean group's operation, or an operand's own; null: the group's), operandOperation (a layer in a boolean group: how it combines with the operands below it; null: the group's), constrainProportions, description, interactions, overflow, pluginData {k: v}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1156
|
+
"node.set": {
|
|
1157
|
+
id?: number; /** The layers to change (default the selection). */
|
|
1158
|
+
ids?: Array<number>; /** The properties to set: name, visible, locked, opacity (0-1), blend, x, y (relative to the parent frame; groups don't count), width, height, rotation (degrees), fills (paints or colours; gradients as {type: linearGradient|radialGradient|angularGradient|diamondGradient, stops: ["#hex", ...], from?, to?} too), fill (colour, or "none"/null: no fill), strokes, stroke (colour, or "none"/null: no stroke), strokeWeight, strokeAlign (inside|center|outside), strokeSides [t,r,b,l], strokeTopWeight / strokeRightWeight / strokeBottomWeight / strokeLeftWeight (one side; turns on individual strokes), strokeCap / startCap / endCap, strokeJoin, miterAngle (degrees: sharper joins bevel; or miterLimit as a ratio), dashes [..], widthProfile (preset uniform|wedge|taper|eye|rounded|pinch, [[t, scale], ...] or null), brush (preset id, {preset, spacing, sizeJitter, rotationJitter, scatter, seed} or null), cornerRadius (n or [tl,tr,br,bl]), cornerSmoothing (0-1), effects, clip, isMask, layout (null|horizontal|vertical|grid|{...}), gap, crossGap, padding (n or [t,r,b,l]), paddingTop/Right/Bottom/Left, mainAlign (min|center|max, or the auto gaps spaceBetween|spaceAround|spaceEvenly), crossAlign (min|center|max|baseline: first text baselines, horizontal layouts), contentAlign (wrapped lines: auto = packed where crossAlign says | spaceBetween), wrap (rows of a horizontal layout, columns of a vertical one), strokesIncluded (the frame's inside stroke takes up space), reverseZ (canvas stacking: true = first on top), columnGap / rowGap (aliases of gap / crossGap), gridColumns, gridRows, columnTracks / rowTracks ([120 | "1fr" | "auto" | {sizing, value}]), gridColumn / gridRow (0-based cell anchor, null = auto), gridColumnSpan, gridRowSpan, gridAlignH / gridAlignV (a grid child's alignment in its cell: min|center|max, auto/null = the frame's), sizingH / sizingV (fixed|hug|fill), absolute (ignore auto layout; follows constraints), minWidth, maxWidth, minHeight, maxHeight (null removes), constraints {horizontal, vertical}, grids, exports, characters, fontFamily, fontStyle, fontSize, lineHeight (auto|px|"150%"), letterSpacing (px|"2%"), textAlign (left|center|right|justified), textAlignVertical, textAutoResize (widthAndHeight|height|none|truncate), textDecoration, textDecorationStyle (solid|dotted|wavy), textDecorationThickness / textDecorationOffset (auto|px|"10%" of the font size; the offset runs from the baseline down to an underline's top edge), textDecorationSkipInk (underlines break around descenders), textDecorationColor (colour, or auto/null: the text's), textCase (original|upper|lower|title|smallCaps), paragraphSpacing, paragraphIndent, listStyle (none|bulleted|numbered; with start/end: the paragraphs those chars touch), indentation (list nesting level 0-8, same range rule), listSpacing (px between list items, in place of paragraphSpacing), hangingPunctuation, hangingList (markers outside the box), leadingTrim (vertical trim: none|capHeight), maxLines, features ({tag: bool}, e.g. {"liga": false, "tnum": true}), fontVariations / variationSettings ({axis: number}, e.g. {"wght": 550, "wdth": 85}; null = none), path (a vector's SVG path data: replaces its geometry, keeping the layer, its paints, styles and bindings; width/height in the same call scale it as node.create does; its own box goes at the layer's x/y, or with x/y given, at x + its left edge and y + its top as node.create places it), pointCount, innerRadius, arcStart, arcSweep, arcInner, booleanOperation (a boolean group's operation, or an operand's own; null: the group's), operandOperation (a layer in a boolean group: how it combines with the operands below it; null: the group's), constrainProportions, description, interactions, overflow, pluginData {k: v} */
|
|
1159
|
+
props: {
|
|
1160
|
+
[key: string]: Json;
|
|
1161
|
+
};
|
|
1162
|
+
};
|
|
1163
|
+
/** Get layer. Answers one layer's properties by id: its type, geometry, paints, effects, layout and children. Params: {id}. Acts on `id`. */
|
|
1164
|
+
"node.get": {
|
|
1165
|
+
id?: Json;
|
|
1166
|
+
};
|
|
1167
|
+
/** Move layer into. Moves layers into another parent at an index among its children. Params: {ids?, parent, index? (final position among parent's children, bottom first; default top)}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1168
|
+
"node.reparent": {
|
|
1169
|
+
id?: Json;
|
|
1170
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0); final position among parent's children, bottom first; default top */
|
|
1171
|
+
index?: number; /** an id (a number, or its digits as text) */
|
|
1172
|
+
parent?: Json;
|
|
1173
|
+
};
|
|
1174
|
+
/** Reorder layer. Moves a layer to an index among its siblings. Params: {id, index}. Acts on `id`. Changes the document. */
|
|
1175
|
+
"node.reorder": {
|
|
1176
|
+
id?: Json; /** a position counted from 0 (the first is 0) */
|
|
1177
|
+
index?: number;
|
|
1178
|
+
};
|
|
1179
|
+
/** Add fill. Adds a fill paint (default light grey, white for frames) on top of the selected or given layers' fills. Params: {ids?, paint? (default #D9D9D9 or white for frames)}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1180
|
+
"fill.add": {
|
|
1181
|
+
ids?: Array<Json>;
|
|
1182
|
+
paint?: Json;
|
|
1183
|
+
};
|
|
1184
|
+
/** Add stroke. Adds a stroke paint (default black) to the selected or given layers. Params: {ids?, paint? (default black)}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1185
|
+
"stroke.add": {
|
|
1186
|
+
ids?: Array<Json>;
|
|
1187
|
+
paint?: Json;
|
|
1188
|
+
};
|
|
1189
|
+
/** Remove fill. Removes the fill at index from the selected or given layers. Params: {ids?, index}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1190
|
+
"fill.remove": {
|
|
1191
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0) */
|
|
1192
|
+
index?: number;
|
|
1193
|
+
};
|
|
1194
|
+
/** Remove stroke. Removes the stroke at index from the selected or given layers. Params: {ids?, index}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1195
|
+
"stroke.remove": {
|
|
1196
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0) */
|
|
1197
|
+
index?: number;
|
|
1198
|
+
};
|
|
1199
|
+
/** Set fill. Sets the fill at index (default the top one) of the selected or given layers to a paint or colour, with opacity, visibility and blend. Params: {ids?, index?, paint | color, opacity?, visible?, blend?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1200
|
+
"fill.set": {
|
|
1201
|
+
blend?: string; /** one of several alternative parameters */
|
|
1202
|
+
color?: string;
|
|
1203
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0) */
|
|
1204
|
+
index?: number;
|
|
1205
|
+
opacity?: number; /** one of several alternative parameters */
|
|
1206
|
+
paint?: Json;
|
|
1207
|
+
visible?: boolean;
|
|
1208
|
+
};
|
|
1209
|
+
/** Set stroke. Sets the stroke at index of the selected or given layers to a paint or colour, with opacity, visibility and blend. Params: {ids?, index?, paint | color, opacity?, visible?, blend?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1210
|
+
"stroke.set": {
|
|
1211
|
+
blend?: string; /** one of several alternative parameters */
|
|
1212
|
+
color?: string;
|
|
1213
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0) */
|
|
1214
|
+
index?: number;
|
|
1215
|
+
opacity?: number; /** one of several alternative parameters */
|
|
1216
|
+
paint?: Json;
|
|
1217
|
+
visible?: boolean;
|
|
1218
|
+
};
|
|
1219
|
+
/** Copy fill. Copies one fill of a layer (default the top one) so fill.paste can apply it. Params: {id?, index? (default the top fill)}. Acts on `id`. Reads the mode, selection. */
|
|
1220
|
+
"fill.copy": {
|
|
1221
|
+
id?: Json; /** a position counted from 0 (the first is 0); default the top fill */
|
|
1222
|
+
index?: number;
|
|
1223
|
+
};
|
|
1224
|
+
/** Paste fill. Pastes the copied fill onto the selected or given layers, replacing the fill at index or adding one. Params: {ids?, index? (replace the fill there; without: add one)}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
1225
|
+
"fill.paste": {
|
|
1226
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0); replace the fill there; without: add one */
|
|
1227
|
+
index?: number;
|
|
1228
|
+
};
|
|
1229
|
+
/** Copy stroke. Copies one stroke of a layer with its weight, alignment, caps, joins and dashes so stroke.paste can apply it. Params: {id?, index? (default the top stroke)} its paint and the stroke's weight, alignment, sides, caps, joins and dashes. Acts on `id`. Reads the mode, selection. */
|
|
1230
|
+
"stroke.copy": {
|
|
1231
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
1232
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0); default the top stroke */
|
|
1233
|
+
index?: number;
|
|
1234
|
+
};
|
|
1235
|
+
/** Paste stroke. Pastes the copied stroke with its settings onto the selected or given layers, replacing or adding one. Params: {ids?, index? (replace the stroke there; without: add one)} the copied stroke's settings come with its paint. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
1236
|
+
"stroke.paste": {
|
|
1237
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0); replace the stroke there; without: add one */
|
|
1238
|
+
index?: number;
|
|
1239
|
+
};
|
|
1240
|
+
/** Pattern fill. Fills the selected or given layers with a pattern of a source layer, with tiling, scale, spacing and alignment. Params: {source (layer id), ids?, index? (default the top fill), tile? (grid|horizontalHex|verticalHex), scale? (1 = the source's size), spacing? [x, y], align? (start|center|end), opacity?} the source layer tiled; it updates as the source changes. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1241
|
+
"fill.pattern": {
|
|
1242
|
+
align?: "start" | "center" | "end";
|
|
1243
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0); default the top fill */
|
|
1244
|
+
index?: number;
|
|
1245
|
+
opacity?: number; /** 1 = the source's size */
|
|
1246
|
+
scale?: number; /** an id (a number, or its digits as text) */
|
|
1247
|
+
source?: Json;
|
|
1248
|
+
tile?: "grid" | "horizontalHex" | "verticalHex";
|
|
1249
|
+
};
|
|
1250
|
+
/** Width profile. Sets a variable width profile (a preset or points of scale along the path) on the selected strokes. Params: {ids?, preset?: "uniform|wedge|taper|eye|rounded|pinch", points?: [[t (0-1 along each subpath), scale (? stroke weight)]] (instead of preset)} ? none = uniform. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1251
|
+
"stroke.widthProfile": {
|
|
1252
|
+
ids?: Array<Json>; /** [[t (0-1 along each subpath), scale (? stroke weight)]] (instead of preset); 0-1 along each subpath; ? stroke weight; instead of preset */
|
|
1253
|
+
points?: Array<Array<Json>>;
|
|
1254
|
+
preset?: "uniform" | "wedge" | "taper" | "eye" | "rounded" | "pinch";
|
|
1255
|
+
};
|
|
1256
|
+
/** Brush. Applies a stretched or scattered brush preset to the selected strokes, with spacing and jitter, or clears it. Params: {ids?, preset (taper|ink|ribbon|bristle: stretched along the path; dots|stars|confetti|leaves: scattered along it | null: plain), spacing? (? weight), sizeJitter? (0-1), rotationJitter? (0-1), scatter? (0-4 ? weight), seed?} layers without a stroke get a black one. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1257
|
+
"stroke.brush": {
|
|
1258
|
+
fromGesture?: boolean; /** read by the command beside its listed parameters */
|
|
1259
|
+
id?: Json;
|
|
1260
|
+
ids?: Array<Json>; /** taper|ink|ribbon|bristle: stretched along the path; dots|stars|confetti|leaves: scattered along it | null: plain */
|
|
1261
|
+
preset?: string;
|
|
1262
|
+
rotationJitter?: number;
|
|
1263
|
+
scatter?: number;
|
|
1264
|
+
seed?: number;
|
|
1265
|
+
sizeJitter?: number; /** ? weight */
|
|
1266
|
+
spacing?: number;
|
|
1267
|
+
};
|
|
1268
|
+
/** Add effect. Adds an effect (drop shadow, inner shadow, layer or background blur, noise, texture, glass) to the selected or given layers. Params: {ids?, type? (dropShadow|innerShadow|layerBlur|backgroundBlur|noise|texture|glass), effect? {..}}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1269
|
+
"effect.add": {
|
|
1270
|
+
effect?: {
|
|
1271
|
+
[key: string]: Json;
|
|
1272
|
+
};
|
|
1273
|
+
ids?: Array<Json>;
|
|
1274
|
+
type?: "dropShadow" | "innerShadow" | "layerBlur" | "backgroundBlur" | "noise" | "texture" | "glass";
|
|
1275
|
+
};
|
|
1276
|
+
/** Remove effect. Removes the effect at index from the selected or given layers. Params: {ids?, index}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1277
|
+
"effect.remove": {
|
|
1278
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0) */
|
|
1279
|
+
index?: number;
|
|
1280
|
+
};
|
|
1281
|
+
/** Set effect. Changes the effect at index on the selected or given layers. Params: {ids?, index, effect {..}}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1282
|
+
"effect.set": {
|
|
1283
|
+
effect?: {
|
|
1284
|
+
[key: string]: Json;
|
|
1285
|
+
};
|
|
1286
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0) */
|
|
1287
|
+
index?: number;
|
|
1288
|
+
};
|
|
1289
|
+
/** Copy effect. Copies one effect of a layer (default the top one) so effect.paste can apply it. Params: {id?, index? (default the top effect)}. Acts on `id`. Reads the mode, selection. */
|
|
1290
|
+
"effect.copy": {
|
|
1291
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
1292
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0); default the top effect */
|
|
1293
|
+
index?: number;
|
|
1294
|
+
};
|
|
1295
|
+
/** Paste effect. Pastes the copied effect onto the selected or given layers, replacing the effect at index or adding one. Params: {ids?, index? (replace the effect there; without: add one)}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
1296
|
+
"effect.paste": {
|
|
1297
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0); replace the effect there; without: add one */
|
|
1298
|
+
index?: number;
|
|
1299
|
+
};
|
|
1300
|
+
/** Add layout grid. Adds a layout grid (grid, columns or rows) to the selected or given frames. Params: {ids?, grid? {kind: grid|columns|rows, ..}}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1301
|
+
"grid.add": {
|
|
1302
|
+
ids?: Array<Json>;
|
|
1303
|
+
};
|
|
1304
|
+
/** Remove layout grid. Removes the layout grid at index from the selected or given frames. Params: {ids?, index}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1305
|
+
"grid.remove": {
|
|
1306
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0) */
|
|
1307
|
+
index?: number;
|
|
1308
|
+
};
|
|
1309
|
+
/** Add export setting. Adds an export setting (size, suffix, format, PDF bleed) to the selected or given layers, used by file.exportLayers. Params: {ids?, setting? {size: 2x|512w|512h|{by: scale|width|height, value}, suffix?, format?: png|jpg|svg|pdf|webp|xml (Android Vector Drawable), bleed? (PDF: points, or with a unit: "3mm", "0.125in", "9pt"), cropMarks?, bleedMarks?, cmyk? (PDF print options), vdCompat? (XML: bestEffort|exact|ignore)}} (without a setting: 1x, then one scale step up with an "@2x"-style suffix). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1310
|
+
"export.add": {
|
|
1311
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
1312
|
+
setting?: {
|
|
1313
|
+
[key: string]: Json;
|
|
1314
|
+
};
|
|
1315
|
+
};
|
|
1316
|
+
/** Edit export setting. Edits the export setting at index on the selected or given layers: size, suffix, format and PDF options. Params: {ids?, index, size? (2x|512w|512h|{by, value}), suffix?, format? (png|jpg|svg|pdf|webp|xml: Android Vector Drawable), bleed? (PDF: points, or with a unit: "3mm", "0.125in", "9pt"), cropMarks?, bleedMarks?, cmyk? (PDF print options), vdCompat? (XML: bestEffort|exact|ignore)}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1317
|
+
"export.update": {
|
|
1318
|
+
bleed?: Json;
|
|
1319
|
+
bleedMarks?: boolean;
|
|
1320
|
+
cmyk?: boolean;
|
|
1321
|
+
cropMarks?: boolean;
|
|
1322
|
+
format?: "png" | "jpg" | "svg" | "pdf" | "webp" | "xml";
|
|
1323
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0) */
|
|
1324
|
+
index?: number; /** 2x|512w|512h|{by, value} */
|
|
1325
|
+
size?: number;
|
|
1326
|
+
suffix?: string;
|
|
1327
|
+
vdCompat?: boolean;
|
|
1328
|
+
};
|
|
1329
|
+
/** Remove export setting. Removes the export setting at index from the selected or given layers. Params: {ids?, index}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1330
|
+
"export.remove": {
|
|
1331
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0) */
|
|
1332
|
+
index?: number;
|
|
1333
|
+
};
|
|
1334
|
+
/** Run several commands. Runs a list of commands as one undo step (later steps can refer to earlier results with as); use it for multi-step edits. Params: {label?, commands: [{command, params, as?}]} (one undo step). Reads the selection. Changes the document. */
|
|
1335
|
+
"command.batch": {
|
|
1336
|
+
commands?: Array<{
|
|
1337
|
+
as?: Json;
|
|
1338
|
+
command?: Json;
|
|
1339
|
+
params?: Json;
|
|
1340
|
+
}>; /** read by the command beside its listed parameters */
|
|
1341
|
+
fuel?: number;
|
|
1342
|
+
label?: string; /** read by the command beside its listed parameters */
|
|
1343
|
+
plugin?: string; /** read by the command beside its listed parameters */
|
|
1344
|
+
x?: number; /** read by the command beside its listed parameters */
|
|
1345
|
+
y?: number;
|
|
1346
|
+
};
|
|
1347
|
+
/** Repeat last command. Repeats the last command on the current selection. Params: {}. Reads the mode, selection. Changes the document. */
|
|
1348
|
+
"edit.repeat": Record<string, never>;
|
|
1349
|
+
/** Move fill. Moves a fill from one index to another in the fill list of the selected or given layers (bottom first). Params: {ids?, from, to} (indices in the fill list, bottom first). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1350
|
+
"fill.move": {
|
|
1351
|
+
from?: number;
|
|
1352
|
+
ids?: Array<Json>;
|
|
1353
|
+
to?: number;
|
|
1354
|
+
};
|
|
1355
|
+
/** Move stroke. Moves a stroke from one index to another in the stroke list of the selected or given layers. Params: {ids?, from, to} (indices in the stroke list, bottom first). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1356
|
+
"stroke.move": {
|
|
1357
|
+
from?: number;
|
|
1358
|
+
ids?: Array<Json>;
|
|
1359
|
+
to?: number;
|
|
1360
|
+
};
|
|
1361
|
+
/** Move effect. Moves an effect from one index to another in the effect list of the selected or given layers. Params: {ids?, from, to} (indices in the effect list, bottom first). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1362
|
+
"effect.move": {
|
|
1363
|
+
from?: number;
|
|
1364
|
+
ids?: Array<Json>;
|
|
1365
|
+
to?: number;
|
|
1366
|
+
};
|
|
1367
|
+
/** Move layout grid. Moves a layout grid from one index to another in the selected or given frames. Params: {ids?, from, to} (indices in the layout grid list, bottom first). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1368
|
+
"grid.move": {
|
|
1369
|
+
from?: number;
|
|
1370
|
+
ids?: Array<Json>;
|
|
1371
|
+
to?: number;
|
|
1372
|
+
};
|
|
1373
|
+
/** Selection colors. Answers the colours used by the selection (descendants and text ranges included) with the paint slots that use each. Params: {ids?} ? {colors: [{paint, targets}]}; includes descendants and text ranges. Acts on `ids`. Reads the mode, part, selection. */
|
|
1374
|
+
"selection.colors": {
|
|
1375
|
+
id?: Json;
|
|
1376
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
1377
|
+
text?: string;
|
|
1378
|
+
};
|
|
1379
|
+
/** Change selection color. Replaces the paint in given fill or stroke slots (from selection.colors) with a new paint. Params: {targets: [{id, fills, index, range: [start,end] | null}], paint}. Changes the document. */
|
|
1380
|
+
"selection.setPaint": {
|
|
1381
|
+
paint?: Json; /** [{id, fills, index, range: [start,end] | null}] */
|
|
1382
|
+
targets?: Array<{
|
|
1383
|
+
fills?: Json;
|
|
1384
|
+
id?: Json;
|
|
1385
|
+
index?: number;
|
|
1386
|
+
range?: Json;
|
|
1387
|
+
}>;
|
|
1388
|
+
};
|
|
1389
|
+
/** Apply selection color style. Applies a colour style to the given fill or stroke slots (from selection.colors). Params: {targets, style}; applies the color style to matching fill/stroke lists (text ranges keep typography). Changes the document. */
|
|
1390
|
+
"selection.applyColorStyle": {
|
|
1391
|
+
style?: string;
|
|
1392
|
+
targets?: Array<{
|
|
1393
|
+
[key: string]: Json;
|
|
1394
|
+
}>;
|
|
1395
|
+
};
|
|
1396
|
+
/** Apply selection color variable. Binds a colour variable to the given solid fill or stroke slots (from selection.colors). Params: {targets, variable (id or name)}; binds the color variable to matching solid fill/stroke slots, replacing a color style there (text ranges with fills of their own take its value in the layer's modes). Changes the document. */
|
|
1397
|
+
"selection.bindColorVariable": {
|
|
1398
|
+
targets?: Array<{
|
|
1399
|
+
[key: string]: Json;
|
|
1400
|
+
}>; /** an id (a number, or its digits as text) */
|
|
1401
|
+
variable?: Json;
|
|
1402
|
+
};
|
|
1403
|
+
/** Detach selection color. Unlinks the colour style or variable of the given paint slots, keeping their colour values. Params: {targets}; unlinks the color style or variable of matching fill/stroke lists, keeping their values. Changes the document. */
|
|
1404
|
+
"selection.detachColor": {
|
|
1405
|
+
targets?: Array<{
|
|
1406
|
+
[key: string]: Json;
|
|
1407
|
+
}>;
|
|
1408
|
+
};
|
|
1409
|
+
/** Select layers with color. Selects the layers that own the given paint slots; answers their ids. Params: {targets} ? {ids}; selects the layers owning these paint slots. Reads the part. */
|
|
1410
|
+
"selection.selectColor": {
|
|
1411
|
+
targets?: Array<{
|
|
1412
|
+
[key: string]: Json;
|
|
1413
|
+
}>;
|
|
1414
|
+
};
|
|
1415
|
+
/** Spacing. Sets the horizontal and/or vertical spacing between the selected or given layers. Params: {ids?, horizontal?, vertical?, fromGesture?} (page units; fromGesture uses the interaction snapshot). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1416
|
+
"arrange.spacing": {
|
|
1417
|
+
fromGesture?: boolean;
|
|
1418
|
+
horizontal?: number; /** read by the command beside its listed parameters */
|
|
1419
|
+
id?: Json;
|
|
1420
|
+
ids?: Array<Json>;
|
|
1421
|
+
vertical?: number;
|
|
1422
|
+
};
|
|
1423
|
+
/** Reorder selection. Moves one selected layer into another's visual slot (or swaps them) without changing the hierarchy. Params: {ids?, source, target, swap?, fromGesture?} (insert at target's visual slot; no hierarchy changes). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1424
|
+
"arrange.reorder": {
|
|
1425
|
+
fromGesture?: boolean;
|
|
1426
|
+
ids?: Array<Json>; /** an id (a number, or its digits as text) */
|
|
1427
|
+
source?: Json;
|
|
1428
|
+
swap?: boolean; /** an id (a number, or its digits as text) */
|
|
1429
|
+
target?: Json;
|
|
1430
|
+
};
|
|
1431
|
+
/** Move. Moves the selected or given layers by dx, dy page units. Params: {ids?, dx, dy} (page units). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1432
|
+
"transform.move": {
|
|
1433
|
+
dx?: number;
|
|
1434
|
+
dy?: number; /** read by the command beside its listed parameters */
|
|
1435
|
+
id?: Json;
|
|
1436
|
+
ids?: Array<Json>;
|
|
1437
|
+
};
|
|
1438
|
+
/** Move to. Moves the selected or given layers so their top-left is at page coordinates x, y. Params: {ids?, x, y} (page coordinates of the selection's top-left). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1439
|
+
"transform.moveTo": {
|
|
1440
|
+
ids?: Array<Json>;
|
|
1441
|
+
x?: number;
|
|
1442
|
+
y?: number;
|
|
1443
|
+
};
|
|
1444
|
+
/** Rotate. Rotates the selected or given layers by degrees about a pivot (default the rotation origin or centre). Params: {ids?, degrees, cx?, cy? (pivot, page coords; default the selection's rotation origin, else its centre)}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
1445
|
+
"transform.rotate": {
|
|
1446
|
+
cx?: number; /** pivot, page coords; default the selection's rotation origin, else its centre */
|
|
1447
|
+
cy?: number;
|
|
1448
|
+
degrees?: number;
|
|
1449
|
+
ids?: Array<Json>;
|
|
1450
|
+
};
|
|
1451
|
+
/** Move rotation origin. Shows, hides or toggles the draggable rotation origin of the selection; not saved. Params: {on? (default: toggles)} ? shows the selection's rotation origin to drag (Escape hides it); not saved. Reads the mode. */
|
|
1452
|
+
"transform.rotationOrigin": {
|
|
1453
|
+
fuel?: number;
|
|
1454
|
+
on?: boolean; /** read by the command beside its listed parameters */
|
|
1455
|
+
plugin?: string; /** read by the command beside its listed parameters */
|
|
1456
|
+
x?: number; /** read by the command beside its listed parameters */
|
|
1457
|
+
y?: number;
|
|
1458
|
+
};
|
|
1459
|
+
/** Set rotation origin. Sets the point the selection rotates about (or resets it to the centre) while the selection lasts. Params: {x, y (page coords) | reset: true} ? the point the selection turns about (default its centre); kept while the selection lasts, not saved. Reads the mode. */
|
|
1460
|
+
"transform.setRotationOrigin": {
|
|
1461
|
+
fuel?: number; /** read by the command beside its listed parameters */
|
|
1462
|
+
plugin?: string; /** one of several alternative parameters */
|
|
1463
|
+
reset?: boolean;
|
|
1464
|
+
x?: number;
|
|
1465
|
+
y?: number;
|
|
1466
|
+
};
|
|
1467
|
+
/** Scale. Scales the selected or given layers by a factor about a pivot, scaling strokes, effects and text too (as the Scale tool does). Params: {ids?, factor, cx?, cy? (pivot; default top-left)} ? scales size, strokes, effects, text (the K tool). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1468
|
+
"transform.scale": {
|
|
1469
|
+
cx?: number; /** pivot; default top-left */
|
|
1470
|
+
cy?: number;
|
|
1471
|
+
factor?: number;
|
|
1472
|
+
ids?: Array<Json>;
|
|
1473
|
+
};
|
|
1474
|
+
/** Resize. Resizes the selected or given layers to a width and/or height, keeping an anchor point fixed. Params: {ids?, width?, height?, anchor? (tl|t|tr|l|c|r|bl|b|br)}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1475
|
+
"transform.resize": {
|
|
1476
|
+
anchor?: "tl" | "t" | "tr" | "l" | "c" | "r" | "bl" | "b" | "br";
|
|
1477
|
+
height?: number; /** read by the command beside its listed parameters */
|
|
1478
|
+
id?: Json;
|
|
1479
|
+
ids?: Array<Json>;
|
|
1480
|
+
width?: number;
|
|
1481
|
+
};
|
|
1482
|
+
/** Convert to group. Converts the selected or given frames into groups in place, dropping frame-only properties like auto layout and fills. Params: {ids?} (frames become groups in place, their layers staying where they are; what only a frame has goes: auto layout, fills, strokes, corner radius, clipping, layout grids, guides and scrolling. Groups are left alone; instances, main components, layers inside instances and empty frames are refused). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1483
|
+
"object.convertToGroup": {
|
|
1484
|
+
ids?: Array<Json>;
|
|
1485
|
+
};
|
|
1486
|
+
/** Convert to frame. Converts the selected or given groups or sections into frames of the same box in place. Params: {ids?} (groups become frames of the same box in place, their layers staying where they are: no fill, not clipping; sections become frames that keep their fill and don't clip. Frames are left alone; instances, main components, layers inside instances and sections holding sections are refused). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1487
|
+
"object.convertToFrame": {
|
|
1488
|
+
ids?: Array<Json>;
|
|
1489
|
+
};
|
|
1490
|
+
/** Convert to section. Converts the selected or given top-level frames into sections in place, keeping their fill and layers. Params: {ids?} (frames on the page or in a section become sections in place, keeping their fill and layers; what only a frame has goes: auto layout, clipping, layout grids, guides and scrolling. Sections are left alone; nested frames, instances and main components are refused). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1491
|
+
"object.convertToSection": {
|
|
1492
|
+
ids?: Array<Json>;
|
|
1493
|
+
};
|
|
1494
|
+
/** Wrap in new section. Wraps the selected or given top-level layers in a new section with some room around them. Params: {ids?, name?} (layers on the page or in a section; the section wraps them with some room). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1495
|
+
"object.wrapInSection": {
|
|
1496
|
+
ids?: Array<Json>;
|
|
1497
|
+
name?: string;
|
|
1498
|
+
};
|
|
1499
|
+
/** Set fill rule. Sets the fill rule (non-zero or even-odd) of a vector layer or one of its filled regions. Params: {ids? | id?, region? (a filled area of a vector; every area when left out), rule: nonZero|evenOdd}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1500
|
+
"vector.fillRule": {
|
|
1501
|
+
id?: Json; /** one of several alternative parameters */
|
|
1502
|
+
ids?: Array<Json>;
|
|
1503
|
+
region?: number;
|
|
1504
|
+
rule?: "nonZero" | "evenOdd";
|
|
1505
|
+
};
|
|
1506
|
+
/** Reverse loop. Reverses the direction of one loop of a vector's filled region, which changes how the area fills. Params: {ids? | id?, region, loop} (a loop of a filled area; its direction flips, which changes how the area fills). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1507
|
+
"vector.reverseLoop": {
|
|
1508
|
+
id?: Json; /** one of several alternative parameters */
|
|
1509
|
+
ids?: Array<Json>;
|
|
1510
|
+
loop?: number;
|
|
1511
|
+
region?: number;
|
|
1512
|
+
};
|
|
1513
|
+
/** Hide/Show section contents. Hides or shows the contents of the selected or given sections (a hidden section shows only its name and outline). Params: {ids?, hidden? (default: hide unless all are hidden)} (a hidden section shows only its name and outline; its layers aren't drawn or hit). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1514
|
+
"section.toggleContents": {
|
|
1515
|
+
hidden?: boolean;
|
|
1516
|
+
ids?: Array<Json>;
|
|
1517
|
+
};
|
|
1518
|
+
/** Resolve change. Marks changed ready-for-dev frames and sections as resolved, back to Ready for dev, with a reason. Params: {ids?, reason?} (ready-for-dev frames and sections that changed since they were marked go back to Ready for dev; the reason is kept). Acts on `ids`. Reads the selection. Changes the document. */
|
|
1519
|
+
"dev.resolveChange": {
|
|
1520
|
+
id?: Json;
|
|
1521
|
+
ids?: Array<Json>;
|
|
1522
|
+
reason?: string;
|
|
1523
|
+
};
|
|
1524
|
+
/** Compare changes. Answers what changed in a ready-for-dev frame or section since it was marked (or since a saved version). Params: {id? (default the first selected layer), version? (a version id from version.list: compare with that saved version instead; any top-level frame or section), show? (open the compare view in the app)} ? {id, name, changed, snapshot, added, removed, modified, truncated, version: {id, name, time} | null, changes: [{id, name, type, change: added|removed|changed, depth, layers, properties?: [{section, property, before, after, text}]}]} what changed in a ready-for-dev frame or section since it was marked, or since the version (`snapshot` is false when that isn't known: a file from before snapshots were kept). Acts on `id`. Reads the selection. */
|
|
1525
|
+
"dev.compare": {
|
|
1526
|
+
id?: Json;
|
|
1527
|
+
show?: boolean;
|
|
1528
|
+
version?: string;
|
|
1529
|
+
};
|
|
1530
|
+
/** Focus view. Shows only one top-level frame or section on the canvas (or the next or previous ready-for-dev one); answers which. Params: {id? (a top-level frame or section; default the selection), direction?: next|previous (the next ready-for-dev one, across pages)} ? {id, name, page, index, count} show only that layer on the canvas (Escape or `dev.unfocus` ends it). Acts on `id`. Reads the mode, part, selection. */
|
|
1531
|
+
"dev.focus": {
|
|
1532
|
+
direction?: "next" | "previous"; /** an id (a number, or its digits as text) */
|
|
1533
|
+
id?: Json;
|
|
1534
|
+
};
|
|
1535
|
+
/** Exit focus view. Leaves focus view so the whole page shows again. Params: {} ? {focused: false}. */
|
|
1536
|
+
"dev.unfocus": {
|
|
1537
|
+
direction?: string; /** read by the command beside its listed parameters */
|
|
1538
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
1539
|
+
ids?: Array<Json>;
|
|
1540
|
+
};
|
|
1541
|
+
/** Set grid track size. Sets the sizing (fixed, hug or fill) of one column or row track of a grid auto layout. Params: {ids?, axis: columns|rows, index (0-based), sizing: fixed|hug|fill, value? (fixed: px, default the track's current size; fill: fr, default 1)}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1542
|
+
"layout.setTrack": {
|
|
1543
|
+
axis?: "columns" | "rows";
|
|
1544
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0); 0-based */
|
|
1545
|
+
index?: number;
|
|
1546
|
+
sizing?: "fixed" | "hug" | "fill";
|
|
1547
|
+
value?: number;
|
|
1548
|
+
};
|
|
1549
|
+
/** Export layers. Exports the selected layers (or every layer with export settings) by their export settings, or their assets, as files or a zip. Params: {ids? (default the selection, else every layer on the page with export settings), assets? (true: the Inspect tab's assets in and under them instead: layers with export settings, icons as SVG, images as PNG), dir? (folder to write into; else each file comes back as base64 `data`), zip? (no dir: the files come back together as one base64 zip `data` instead), bleed? (PDF: points, or with a unit: "3mm", "0.125in", "9pt"), cropMarks?, bleedMarks?, cmyk? (PDF print options): for every PDF instead of each setting's own, vdCompat? (bestEffort|exact|ignore: for every XML instead of each setting's own)} every layer once per export setting, named `<layer><suffix>.<format>` ("@2x" when a scaled export has no suffix; repeats get " 2"; slashes in a layer name make folders). Returns {files: [{name, id, bytes, path | data, warnings (XML only)}], skipped (layers without settings), data? (zip)}. Acts on `ids`. Reads the part, selection. */
|
|
1550
|
+
"file.exportLayers": {
|
|
1551
|
+
assets?: boolean;
|
|
1552
|
+
bleed?: Json;
|
|
1553
|
+
bleedMarks?: boolean;
|
|
1554
|
+
cmyk?: boolean;
|
|
1555
|
+
cropMarks?: boolean; /** default the selection, else every layer on the page with export settings */
|
|
1556
|
+
ids?: Array<Json>;
|
|
1557
|
+
vdCompat?: boolean;
|
|
1558
|
+
zip?: boolean;
|
|
1559
|
+
};
|
|
1560
|
+
/** List versions. Answers the file's version history, oldest first, with names, descriptions and times. Params: {} the version history, oldest first: [{id, index, name, description, time (Unix seconds), auto?, previewing?}]. */
|
|
1561
|
+
"version.list": Record<string, never>;
|
|
1562
|
+
/** Restore version. Replaces the design with a saved version in one undo step, keeping the current state in the history first. Params: {id | index} replace the design with the version (one undo step; the file name and the comments stay; the design as it was is kept in the history first, unless a version of it was just saved or restored). Changes the document. */
|
|
1563
|
+
"version.restore": {
|
|
1564
|
+
id?: string; /** a position counted from 0 (the first is 0); one of several alternative parameters */
|
|
1565
|
+
index?: number;
|
|
1566
|
+
};
|
|
1567
|
+
/** Rename version. Renames a version (an autosave with a title becomes a named version). Params: {id | index, name, description?} a titled autosave becomes a named version. Changes the document. */
|
|
1568
|
+
"version.rename": {
|
|
1569
|
+
description?: string; /** an id; one of several alternative parameters */
|
|
1570
|
+
id?: string; /** a position counted from 0 (the first is 0); one of several alternative parameters */
|
|
1571
|
+
index?: number;
|
|
1572
|
+
name?: string;
|
|
1573
|
+
};
|
|
1574
|
+
/** Delete version. Deletes a version from the file's history. Params: {id | index}. Changes the document. */
|
|
1575
|
+
"version.delete": {
|
|
1576
|
+
id?: string; /** a position counted from 0 (the first is 0); one of several alternative parameters */
|
|
1577
|
+
index?: number;
|
|
1578
|
+
};
|
|
1579
|
+
/** View version. Shows a saved version on the canvas read-only in place of the document; version.exitPreview goes back. Params: {id | index} show the version on the canvas in place of the document (read-only; `version.restore` keeps it, `version.exitPreview` goes back). */
|
|
1580
|
+
"version.preview": {
|
|
1581
|
+
id?: string; /** a position counted from 0 (the first is 0); one of several alternative parameters */
|
|
1582
|
+
index?: number;
|
|
1583
|
+
};
|
|
1584
|
+
/** Autosave version. Saves an automatic checkpoint when there are changes since the last version. Params: {} save an automatic checkpoint when the document has unsaved changes since the last version (with `pref.autoSave` on: changes made since it was opened); the app does this every 30 minutes; keeps the newest 20 autosaves ? {saved, version?}. Reads the mode, part. Changes the document. */
|
|
1585
|
+
"version.autosave": Record<string, never>;
|
|
1586
|
+
/** Back to current version. Ends a version preview and shows the current document again. Params: {} end a version preview. */
|
|
1587
|
+
"version.exitPreview": Record<string, never>;
|
|
1588
|
+
/** Add page. Adds a page (a name starting with a hyphen adds a divider). Params: {name?} (a name starting with a hyphen adds a divider). Reads the part. Changes the document. */
|
|
1589
|
+
"page.add": {
|
|
1590
|
+
name?: string;
|
|
1591
|
+
};
|
|
1592
|
+
/** Go to page. Switches to a page by id or index. Params: {id | index}. Acts on `id`. */
|
|
1593
|
+
"page.select": {
|
|
1594
|
+
id?: Json; /** a position counted from 0 (the first is 0); one of several alternative parameters */
|
|
1595
|
+
index?: number;
|
|
1596
|
+
};
|
|
1597
|
+
/** Rename page. Renames a page (default the current one). Params: {id?, name} (an empty page named with a leading hyphen becomes a divider). Acts on `id`. Reads the part. Changes the document. */
|
|
1598
|
+
"page.rename": {
|
|
1599
|
+
id?: Json;
|
|
1600
|
+
name?: string;
|
|
1601
|
+
};
|
|
1602
|
+
/** Delete page. Deletes a page (default the current one) with its layers. Params: {id?}. Acts on `id`. Reads the part. Changes the document. */
|
|
1603
|
+
"page.delete": {
|
|
1604
|
+
id?: Json;
|
|
1605
|
+
};
|
|
1606
|
+
/** Duplicate page. Duplicates a page (default the current one) with its layers. Params: {id?}. Acts on `id`. Reads the part. Changes the document. */
|
|
1607
|
+
"page.duplicate": {
|
|
1608
|
+
id?: Json;
|
|
1609
|
+
};
|
|
1610
|
+
/** Move page. Moves a page to an index in the page list. Params: {id?, index}. Acts on `id`. Reads the part. Changes the document. */
|
|
1611
|
+
"page.move": {
|
|
1612
|
+
fuel?: number; /** an id */
|
|
1613
|
+
id?: Json; /** a position counted from 0 (the first is 0) */
|
|
1614
|
+
index?: number; /** read by the command beside its listed parameters */
|
|
1615
|
+
plugin?: string; /** read by the command beside its listed parameters */
|
|
1616
|
+
x?: number; /** read by the command beside its listed parameters */
|
|
1617
|
+
y?: number;
|
|
1618
|
+
};
|
|
1619
|
+
/** Page background. Sets a page's canvas background colour. Params: {id?, color}. Acts on `id`. Reads the part. Changes the document. */
|
|
1620
|
+
"page.setBackground": {
|
|
1621
|
+
color?: string; /** an id */
|
|
1622
|
+
id?: Json;
|
|
1623
|
+
};
|
|
1624
|
+
/** List pages. Answers the file's pages with their ids, names and which is current. Params: {}. Reads the part. */
|
|
1625
|
+
"page.list": Record<string, never>;
|
|
1626
|
+
/** Add guide. Adds a vertical or horizontal ruler guide at an offset on a frame or the page; answers its index. Params: {vertical (bool), offset, frame? | page?} ? {index}. Reads the part. Changes the document. */
|
|
1627
|
+
"guide.add": {
|
|
1628
|
+
frame?: number;
|
|
1629
|
+
offset?: number; /** one of several alternative parameters */
|
|
1630
|
+
page?: number;
|
|
1631
|
+
vertical?: boolean;
|
|
1632
|
+
};
|
|
1633
|
+
/** Move guide. Moves a ruler guide to a new offset. Params: {index, offset, frame? | page?}. Reads the part. Changes the document. */
|
|
1634
|
+
"guide.move": {
|
|
1635
|
+
frame?: number; /** read by the command beside its listed parameters */
|
|
1636
|
+
id?: Json; /** a position counted from 0 (the first is 0) */
|
|
1637
|
+
index?: number;
|
|
1638
|
+
offset?: number; /** one of several alternative parameters */
|
|
1639
|
+
page?: number;
|
|
1640
|
+
};
|
|
1641
|
+
/** Remove guide. Removes a ruler guide (default the selected one). Params: {index?, frame? | page?} (no index: the selected guide). Reads the mode, part. Changes the document. */
|
|
1642
|
+
"guide.remove": {
|
|
1643
|
+
frame?: number; /** a position counted from 0 (the first is 0) */
|
|
1644
|
+
index?: number; /** one of several alternative parameters */
|
|
1645
|
+
page?: number;
|
|
1646
|
+
};
|
|
1647
|
+
/** Select guide. Selects a ruler guide so it can be deleted or nudged, deselecting layers. Params: {index?, frame? | page?} a ruler guide to delete or nudge (deselects layers; no index: none). Reads the part. */
|
|
1648
|
+
"guide.select": {
|
|
1649
|
+
frame?: number; /** a position counted from 0 (the first is 0) */
|
|
1650
|
+
index?: number; /** one of several alternative parameters */
|
|
1651
|
+
page?: number;
|
|
1652
|
+
};
|
|
1653
|
+
/** Remove all guides. Removes all ruler guides from a frame or the page. Params: {frame? | page?}. Reads the part. Changes the document. */
|
|
1654
|
+
"guide.clear": {
|
|
1655
|
+
frame?: number; /** read by the command beside its listed parameters */
|
|
1656
|
+
id?: Json; /** one of several alternative parameters */
|
|
1657
|
+
page?: number;
|
|
1658
|
+
};
|
|
1659
|
+
/** Dev Mode. Switches the editor into or out of Dev Mode; the design is unchanged. Params: {}. */
|
|
1660
|
+
"view.devMode": Record<string, never>;
|
|
1661
|
+
/** Choose tool. Chooses an editor tool by name; the design is unchanged. Prefer the shape and node commands to create layers directly. Params: {tool: move|scale|hand|frame|section|slice|rectangle|line|arrow|ellipse|polygon|star|pen|pencil|text|comment|shapeBuilder | on boards: sticky|shape|connector|marker|highlighter|eraser|stamp}. Reads the mode. */
|
|
1662
|
+
"tool.set": {
|
|
1663
|
+
tool?: string;
|
|
1664
|
+
};
|
|
1665
|
+
/** Place with the tool. Places what a click with a shape or frame tool makes at x, y (default the middle of the view), selected. Params: {tool? (a shape or frame tool; default the current one), x?, y? (its centre, page coords; default the middle of the view)} ? what a click with the tool makes, selected (Enter with the tool chosen). Reads the mode, part. Changes the document. */
|
|
1666
|
+
"tool.place": {
|
|
1667
|
+
tool?: string;
|
|
1668
|
+
x?: number; /** its centre, page coords; default the middle of the view */
|
|
1669
|
+
y?: number;
|
|
1670
|
+
};
|
|
1671
|
+
/** Pencil brush. Sets (or answers) the brush new Pencil strokes get: a preset with spacing and jitter. Params: {preset? (taper|ink|ribbon|bristle|dots|stars|confetti|leaves | null: plain), spacing?, sizeJitter?, rotationJitter?, scatter?, seed?} (the brush new Pencil strokes get; omit `preset` to read it). */
|
|
1672
|
+
"tool.pencilBrush": {
|
|
1673
|
+
preset?: string;
|
|
1674
|
+
rotationJitter?: number;
|
|
1675
|
+
scatter?: number;
|
|
1676
|
+
seed?: number;
|
|
1677
|
+
sizeJitter?: number;
|
|
1678
|
+
spacing?: number;
|
|
1679
|
+
};
|
|
1680
|
+
/** Scale anchor. Sets (or answers) the point that stays put when the Scale tool scales. Params: {anchor?: tl|t|tr|l|c|r|bl|b|br} (the point of the selection that stays put when the Scale tool scales; omit to read it). */
|
|
1681
|
+
"tool.scaleAnchor": {
|
|
1682
|
+
anchor?: "tl" | "t" | "tr" | "l" | "c" | "r" | "bl" | "b" | "br";
|
|
1683
|
+
};
|
|
1684
|
+
/** Text on a path. Chooses the text-on-path tool: a click on a path puts new text on it. Params: {} a click on a shape's or vector's path puts new text on it. Reads the mode. */
|
|
1685
|
+
"tool.textOnPath": Record<string, never>;
|
|
1686
|
+
/** Text on path. Puts a text layer on a vector or shape path, starting at a fraction along it, optionally flipped. Params: {text? (text layer), path? (vector or shape layer; default: the selected text and other layer), start? (0..1 along the path), flip?} the text follows the path and takes its effects and its fills when one shows, and the path layer is removed ? {id}. Acts on `id`. Reads the selection. Changes the document. */
|
|
1687
|
+
"text.onPath": {
|
|
1688
|
+
flip?: boolean; /** read by the command beside its listed parameters */
|
|
1689
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
1690
|
+
ids?: Array<Json>; /** vector or shape layer; default: the selected text and other layer */
|
|
1691
|
+
path?: string; /** 0..1 along the path */
|
|
1692
|
+
start?: number; /** text layer */
|
|
1693
|
+
text?: string;
|
|
1694
|
+
};
|
|
1695
|
+
/** Text path options. Sets where text on a path starts and whether it is flipped. Params: {start? (0..1 along the path), flip?, ids?} for text on a path. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
1696
|
+
"text.pathOptions": {
|
|
1697
|
+
flip?: boolean; /** read by the command beside its listed parameters */
|
|
1698
|
+
id?: Json;
|
|
1699
|
+
ids?: Array<Json>; /** 0..1 along the path */
|
|
1700
|
+
start?: number; /** read by the command beside its listed parameters */
|
|
1701
|
+
text?: string;
|
|
1702
|
+
};
|
|
1703
|
+
/** Remove text from path. Takes text off its path, back to a line of auto-width text. Params: {ids?} text on a path back to a line of auto-width text. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
1704
|
+
"text.removeFromPath": {
|
|
1705
|
+
ids?: Array<Json>;
|
|
1706
|
+
};
|
|
1707
|
+
/** Small caps. Displays the selected or given text in small caps. Params: {ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
1708
|
+
"text.caseSmallCaps": {
|
|
1709
|
+
id?: Json;
|
|
1710
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
1711
|
+
text?: string;
|
|
1712
|
+
};
|
|
1713
|
+
/** Letter case. Sets the letter case display (original, upper, lower, title, small caps) of the selected or given text. Params: {case: original|upper|lower|title|smallCaps, ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
1714
|
+
"text.case": {
|
|
1715
|
+
case?: "original" | "upper" | "lower" | "title" | "smallCaps";
|
|
1716
|
+
ids?: Array<Json>;
|
|
1717
|
+
};
|
|
1718
|
+
/** Decoration. Sets the text decoration (none, underline, strikethrough) of the selected or given text. Params: {decoration: none|underline|strikethrough, ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
1719
|
+
"text.decoration": {
|
|
1720
|
+
decoration?: "none" | "underline" | "strikethrough";
|
|
1721
|
+
ids?: Array<Json>;
|
|
1722
|
+
};
|
|
1723
|
+
/** List style. Sets the list style (none, bulleted, numbered) of the selected or given text's paragraphs. Params: {style: none|bulleted|numbered, ids?} while editing: the selected paragraphs. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
1724
|
+
"text.listStyle": {
|
|
1725
|
+
ids?: Array<Json>;
|
|
1726
|
+
style?: "none" | "bulleted" | "numbered";
|
|
1727
|
+
};
|
|
1728
|
+
/** Paragraph indent. Sets the paragraph indent in pixels of the selected or given text. Params: {indent (px), ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
1729
|
+
"text.paragraphIndent": {
|
|
1730
|
+
id?: Json;
|
|
1731
|
+
ids?: Array<Json>;
|
|
1732
|
+
indent?: number; /** read by the command beside its listed parameters */
|
|
1733
|
+
text?: string;
|
|
1734
|
+
};
|
|
1735
|
+
/** Paragraph spacing. Sets the spacing between paragraphs in pixels of the selected or given text. Params: {spacing (px), ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
1736
|
+
"text.paragraphSpacing": {
|
|
1737
|
+
fromGesture?: boolean; /** read by the command beside its listed parameters */
|
|
1738
|
+
id?: Json;
|
|
1739
|
+
ids?: Array<Json>; /** px */
|
|
1740
|
+
spacing?: number; /** read by the command beside its listed parameters */
|
|
1741
|
+
text?: string;
|
|
1742
|
+
};
|
|
1743
|
+
/** Max lines. Limits the selected or given text to a number of lines, truncating the rest (0 for no limit). Params: {lines (0 = no limit; truncates: auto-height text hugs up to that many lines, other text becomes a truncating box), ids?}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
1744
|
+
"text.maxLines": {
|
|
1745
|
+
id?: Json;
|
|
1746
|
+
ids?: Array<Json>;
|
|
1747
|
+
lines?: number; /** read by the command beside its listed parameters */
|
|
1748
|
+
text?: string;
|
|
1749
|
+
};
|
|
1750
|
+
/** OpenType features. Turns OpenType features on or off (or back to the font default) on the selected or given text. Params: {features: {tag: bool | null (font default)}, replace? (clear others first), id?/ids?}. Reads the mode, selection. Changes the document. */
|
|
1751
|
+
"text.setFeatures": {
|
|
1752
|
+
features?: {
|
|
1753
|
+
tag?: Json;
|
|
1754
|
+
};
|
|
1755
|
+
replace?: boolean;
|
|
1756
|
+
};
|
|
1757
|
+
/** Variable font axes. Sets variable-font axis values (or back to the style default) on the selected or given text. Params: {variations: {axis: number | null (style default)}, replace? (clear others first), id?/ids?}; while editing: the selected range. Reads the mode, selection. Changes the document. */
|
|
1758
|
+
"text.setVariations": {
|
|
1759
|
+
replace?: boolean; /** {axis: number | null (style default)}; style default */
|
|
1760
|
+
variations?: {
|
|
1761
|
+
axis?: Json;
|
|
1762
|
+
};
|
|
1763
|
+
};
|
|
1764
|
+
/** Preview text change. Previews what a text style or font command would do on the canvas without an undo step; text.endPreview restores. Params: {command: style.apply|library.applyStyle|text.setVariations|text.style, params} shows what the command would do on the canvas without an undo step (a hovered font family or style, text style or named instance, a dragged axis slider), in place of an earlier preview; text.endPreview or any other command ends it, so running the command for real commits it as one undo step. Reads the mode, part, selection. */
|
|
1765
|
+
"text.preview": {
|
|
1766
|
+
command?: "style.apply" | "library.applyStyle" | "text.setVariations" | "text.style";
|
|
1767
|
+
params?: {
|
|
1768
|
+
[key: string]: Json;
|
|
1769
|
+
};
|
|
1770
|
+
};
|
|
1771
|
+
/** End text preview. Ends a text preview, putting the document back as it was. Params: {} puts the document back as it was before text.preview ? {ended}. Reads the mode. */
|
|
1772
|
+
"text.endPreview": {
|
|
1773
|
+
text?: string;
|
|
1774
|
+
};
|
|
1775
|
+
/** Set text. Replaces the characters of a text layer (default the selected one). Params: {id?, characters}. Acts on `id`. Reads the mode, selection. Changes the document. */
|
|
1776
|
+
"text.set": {
|
|
1777
|
+
characters?: string; /** an id */
|
|
1778
|
+
id?: Json;
|
|
1779
|
+
};
|
|
1780
|
+
/** Style text range. Styles a character range of a text layer: font family, style, weight, size, line height, letter spacing, decoration, case, link and fills. Params: {id?, start?, end?, fontFamily?, fontStyle?, fontWeight?, fontSize?, lineHeight?, letterSpacing?, textDecoration?, textCase?, hyperlink?, textFills?}. Acts on `id`. Reads the mode, selection. Changes the document. */
|
|
1781
|
+
"text.style": {
|
|
1782
|
+
end?: number;
|
|
1783
|
+
fontFamily?: string;
|
|
1784
|
+
fontSize?: number;
|
|
1785
|
+
fontStyle?: string;
|
|
1786
|
+
fontWeight?: number;
|
|
1787
|
+
hyperlink?: Json; /** an id */
|
|
1788
|
+
id?: Json;
|
|
1789
|
+
letterSpacing?: Json;
|
|
1790
|
+
lineHeight?: Json;
|
|
1791
|
+
start?: number;
|
|
1792
|
+
textCase?: "original" | "upper" | "lower" | "title" | "smallCaps";
|
|
1793
|
+
textDecoration?: "none" | "underline" | "strikethrough";
|
|
1794
|
+
textFills?: Array<{
|
|
1795
|
+
[key: string]: Json;
|
|
1796
|
+
}>;
|
|
1797
|
+
};
|
|
1798
|
+
/** Edit text. Starts editing a text layer with the caret at a character index (default all selected). Params: {id, caret? (char index; default select all)}. Acts on `id`. Reads the mode, part, selection. */
|
|
1799
|
+
"text.edit.begin": {
|
|
1800
|
+
caret?: number; /** an id */
|
|
1801
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
1802
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
1803
|
+
index?: number; /** read by the command beside its listed parameters */
|
|
1804
|
+
text?: string;
|
|
1805
|
+
};
|
|
1806
|
+
/** Type text. Types text at the caret of the text being edited, replacing the selected range. Params: {text}. Reads the mode. Changes the document. */
|
|
1807
|
+
"text.edit.insert": {
|
|
1808
|
+
text?: string;
|
|
1809
|
+
};
|
|
1810
|
+
/** Text key. Presses an editing key (backspace, arrows, home, end, enter, tab and more) in the text being edited. Params: {key: Backspace|Delete|Left|Right|Up|Down|Home|End|Enter|Tab|Escape|SelectAll, shift?, alt?, cmd?} in a list, Tab nests the item and Shift+Tab, Enter on an empty item or Backspace at its start move it out. Reads the mode. Changes the document. */
|
|
1811
|
+
"text.edit.key": {
|
|
1812
|
+
alt?: boolean;
|
|
1813
|
+
cmd?: boolean;
|
|
1814
|
+
key?: "Backspace" | "Delete" | "Left" | "Right" | "Up" | "Down" | "Home" | "End" | "Enter" | "Tab" | "Escape" | "SelectAll";
|
|
1815
|
+
shift?: boolean;
|
|
1816
|
+
};
|
|
1817
|
+
/** Indent list. Nests the selected list items one level deeper while editing text. Params: {} while editing: the selected list items a level deeper. Reads the mode. Changes the document. */
|
|
1818
|
+
"text.listIndent": Record<string, never>;
|
|
1819
|
+
/** Outdent list. Moves the selected list items one level out while editing text. Params: {} while editing: the selected list items a level out. Reads the mode. Changes the document. */
|
|
1820
|
+
"text.listOutdent": Record<string, never>;
|
|
1821
|
+
/** Set caret. Moves the caret of the text being edited to a character index, optionally extending the selection. Params: {index, extend?}. Reads the mode. */
|
|
1822
|
+
"text.edit.caret": {
|
|
1823
|
+
extend?: boolean; /** a position counted from 0 (the first is 0) */
|
|
1824
|
+
index?: number;
|
|
1825
|
+
};
|
|
1826
|
+
/** Select word. Selects the word at a character index in the text being edited. Params: {index}. Reads the mode. */
|
|
1827
|
+
"text.edit.selectWord": {
|
|
1828
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
1829
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0) */
|
|
1830
|
+
index?: number; /** read by the command beside its listed parameters */
|
|
1831
|
+
text?: string;
|
|
1832
|
+
};
|
|
1833
|
+
/** Select line. Selects the line at a character index in the text being edited. Params: {index}. Reads the mode. */
|
|
1834
|
+
"text.edit.selectLine": {
|
|
1835
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
1836
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0) */
|
|
1837
|
+
index?: number; /** read by the command beside its listed parameters */
|
|
1838
|
+
text?: string;
|
|
1839
|
+
};
|
|
1840
|
+
/** Compose text (IME). Shows IME composition text at the caret (empty cancels); text.edit.insert commits it. Params: {text (empty = cancel), cursor? (chars into text)}; shown at the caret, committed by text.edit.insert. Reads the mode, part, selection. */
|
|
1841
|
+
"text.edit.preedit": {
|
|
1842
|
+
cursor?: number; /** empty = cancel */
|
|
1843
|
+
text?: string;
|
|
1844
|
+
};
|
|
1845
|
+
/** Text selection. Answers the caret and selected range of the text being edited. Params: {}. Reads the mode. */
|
|
1846
|
+
"text.edit.selection": Record<string, never>;
|
|
1847
|
+
/** Stop editing text. Stops editing text and commits what was typed, leaving the text layer selected. Params: {}. Reads the mode. */
|
|
1848
|
+
"text.edit.end": {
|
|
1849
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
1850
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
1851
|
+
index?: number; /** read by the command beside its listed parameters */
|
|
1852
|
+
text?: string;
|
|
1853
|
+
};
|
|
1854
|
+
/** List fonts. Answers the available font families, or one family's styles with their OpenType features and variation axes. Params: {family? (list its styles), style?, features? (the face's OpenType features), axes? (the face's variation axes and named instances)}. */
|
|
1855
|
+
"text.fonts": {
|
|
1856
|
+
axes?: boolean; /** list its styles */
|
|
1857
|
+
family?: string;
|
|
1858
|
+
features?: boolean;
|
|
1859
|
+
style?: string;
|
|
1860
|
+
};
|
|
1861
|
+
/** Fit text to fonts. Measures auto-sizing text boxes again in their current fonts (for example after a missing font arrived); answers the layers refitted. Params: {ids? (these layers and the text in them; default: the whole document)} auto-sizing text measures its box again, e.g. a box measured in a fallback font while its family was missing ? {refitted: [ids whose size changed]}. Acts on `ids`. Changes the document. */
|
|
1862
|
+
"text.refit": {
|
|
1863
|
+
id?: Json; /** these layers and the text in them; default: the whole document */
|
|
1864
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
1865
|
+
text?: string;
|
|
1866
|
+
};
|
|
1867
|
+
/** Document colours. Answers the solid colours used on a page, most used first. Params: {page?, limit? (default 21)} ? solid colours used on the page, most used first. Reads the part. */
|
|
1868
|
+
"paint.documentColors": {
|
|
1869
|
+
id?: Json;
|
|
1870
|
+
limit?: number;
|
|
1871
|
+
page?: number;
|
|
1872
|
+
};
|
|
1873
|
+
/** Create style. Creates a paint, text, effect or grid style from a layer (default the first selected) or a value; answers its id. Params: {type: paint|text|effect|grid, name, from? (node id; default first selected), description?, value? (paints/effects/grids/text style JSON)}. Reads the mode, selection. Changes the document. */
|
|
1874
|
+
"style.create": {
|
|
1875
|
+
description?: string; /** an id (a number, or its digits as text) */
|
|
1876
|
+
from?: Json;
|
|
1877
|
+
name?: string;
|
|
1878
|
+
type?: "paint" | "text" | "effect" | "grid";
|
|
1879
|
+
value?: Json;
|
|
1880
|
+
};
|
|
1881
|
+
/** Apply style. Applies a style by id or name to the selected or given layers (fill or stroke for paint styles, a range for text styles). Params: {ids?, style (id or name), target? (fill|stroke; paint styles), start?, end? (text styles: these chars; while editing text, the selected chars)}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1882
|
+
"style.apply": {
|
|
1883
|
+
end?: number;
|
|
1884
|
+
ids?: Array<Json>;
|
|
1885
|
+
start?: number; /** id or name */
|
|
1886
|
+
style?: string;
|
|
1887
|
+
target?: "fill" | "stroke";
|
|
1888
|
+
};
|
|
1889
|
+
/** Detach style. Detaches a style from the selected or given layers' fills, strokes, effects, grids or text, keeping their values. Params: {ids?, which: fill|stroke|effect|grid|text, start?, end? (text: these chars; while editing text, the selected chars)}. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
1890
|
+
"style.detach": {
|
|
1891
|
+
end?: number;
|
|
1892
|
+
ids?: Array<Json>;
|
|
1893
|
+
start?: number;
|
|
1894
|
+
which?: "fill" | "stroke" | "effect" | "grid" | "text";
|
|
1895
|
+
};
|
|
1896
|
+
/** Edit style. Edits a style's name, description or value, or redefines it from a layer. Params: {style, name?, description?, value?, from? (node id: redefine from it)}. Changes the document. */
|
|
1897
|
+
"style.update": {
|
|
1898
|
+
description?: string; /** an id (a number, or its digits as text) */
|
|
1899
|
+
from?: Json;
|
|
1900
|
+
name?: string;
|
|
1901
|
+
style?: string;
|
|
1902
|
+
value?: Json;
|
|
1903
|
+
};
|
|
1904
|
+
/** Bind variable in style. Binds a variable to a field of a style's value (or unbinds it). Params: {style, field, variable? (id or name; none: unbind)} bind a variable to a field of the style's value: a paint style's `fills/<i>/color` (or `fill`: its first paint) and `fills/<i>/stops/<j>/color`, an effect style's `effects/<i>/<color|radius|spread|offsetX|offsetY|startRadius>`, a grid style's `layoutGrids/<i>/<size|count|gutter|offset>`, a text style's `fontSize|lineHeight|letterSpacing` (numbers, px) and `fontFamily|fontStyle` (strings). Every layer using the style shows the field resolved in its own modes; the style keeps it resolved in the default modes. Changes the document. */
|
|
1905
|
+
"style.bind": {
|
|
1906
|
+
field?: string;
|
|
1907
|
+
style?: string; /** an id (a number, or its digits as text) */
|
|
1908
|
+
variable?: Json;
|
|
1909
|
+
};
|
|
1910
|
+
/** Duplicate style. Duplicates a style right below it; answers the new id. Params: {style} ? {id} (right below it, named "<name> copy"). Changes the document. */
|
|
1911
|
+
"style.duplicate": {
|
|
1912
|
+
style?: string;
|
|
1913
|
+
};
|
|
1914
|
+
/** Move styles. Moves styles before another style or into a folder. Params: {styles: [string] (style ids), before? (style id; default: the end), folder? ("Brand/Blog"; "" = no folder: the styles are renamed into it)}. Changes the document. */
|
|
1915
|
+
"style.move": {
|
|
1916
|
+
before?: Json;
|
|
1917
|
+
folder?: string; /** read by the command beside its listed parameters */
|
|
1918
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
1919
|
+
ids?: Array<Json>; /** style ids */
|
|
1920
|
+
styles?: Array<string>;
|
|
1921
|
+
};
|
|
1922
|
+
/** Rename style folder. Renames a style folder, renaming the styles in it. Params: {folder ("Brand/Blog"), name ("Brand/News")} (renames the styles in it). Changes the document. */
|
|
1923
|
+
"style.renameFolder": {
|
|
1924
|
+
folder?: string; /** read by the command beside its listed parameters */
|
|
1925
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
1926
|
+
ids?: Array<Json>; /** "Brand/News" */
|
|
1927
|
+
name?: string;
|
|
1928
|
+
};
|
|
1929
|
+
/** Delete style. Deletes a style; layers using it keep their values. Params: {style}. Changes the document. */
|
|
1930
|
+
"style.delete": {
|
|
1931
|
+
style?: string;
|
|
1932
|
+
};
|
|
1933
|
+
/** List styles. Answers the file's styles, optionally of one type, with their ids, names and values. Params: {type?}. */
|
|
1934
|
+
"style.list": {
|
|
1935
|
+
type?: "paint" | "text" | "effect" | "grid";
|
|
1936
|
+
};
|
|
1937
|
+
/** Create variable collection. Creates a variable collection with mode names; answers its id. Params: {name, modes? [names]}. Changes the document. */
|
|
1938
|
+
"variable.createCollection": {
|
|
1939
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
1940
|
+
modes?: Array<Json>;
|
|
1941
|
+
name?: string; /** read by the command beside its listed parameters */
|
|
1942
|
+
server?: string;
|
|
1943
|
+
};
|
|
1944
|
+
/** Add mode. Adds a mode to a variable collection, optionally duplicating another mode's values. Params: {collection, name, from? (mode id or name to duplicate; default: the default mode)}. Changes the document. */
|
|
1945
|
+
"variable.addMode": {
|
|
1946
|
+
collection?: Json; /** an id (a number, or its digits as text) */
|
|
1947
|
+
from?: Json;
|
|
1948
|
+
name?: string;
|
|
1949
|
+
};
|
|
1950
|
+
/** Create variable. Creates a colour, number, string or boolean variable in a collection with values per mode; answers its id. Params: {collection, name, type: color|number|string|boolean, value? (the default mode's value), values?: {modeName: value} (instead of value: one per mode), description?}. Changes the document. */
|
|
1951
|
+
"variable.create": {
|
|
1952
|
+
collection?: Json;
|
|
1953
|
+
description?: string;
|
|
1954
|
+
name?: string;
|
|
1955
|
+
type?: "color" | "number" | "string" | "boolean";
|
|
1956
|
+
value?: Json; /** instead of value: one per mode */
|
|
1957
|
+
values?: {
|
|
1958
|
+
modeName?: Json;
|
|
1959
|
+
};
|
|
1960
|
+
};
|
|
1961
|
+
/** Set variable value. Sets a variable's value (or an alias to another variable) in a mode. Params: {variable, mode? (name or id; default first), value: json (a value of the variable's type, or {alias: variable} of the same type, no loops)}. Changes the document. */
|
|
1962
|
+
"variable.set": {
|
|
1963
|
+
mode?: Json; /** a value of the variable's type, or {alias: variable} of the same type, no loops */
|
|
1964
|
+
value?: Json; /** an id (a number, or its digits as text) */
|
|
1965
|
+
variable?: Json;
|
|
1966
|
+
};
|
|
1967
|
+
/** Delete variable. Deletes a variable; bound layers keep their values. Params: {variable} (bound layers keep their values; variables aliasing it take its values). Changes the document. */
|
|
1968
|
+
"variable.delete": {
|
|
1969
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
1970
|
+
ids?: Array<Json>; /** an id (a number, or its digits as text) */
|
|
1971
|
+
variable?: Json;
|
|
1972
|
+
};
|
|
1973
|
+
/** Bind variable. Binds a variable to a field of the selected or given layers (a paint colour, effect value, layout size, text property) or unbinds it. Params: {ids?, field (fill|stroke (first paint)|fills/<i>/color|strokes/<i>/color|fills/<i>/stops/<j>/color (gradient stops)|effects/<i>/<offsetX|offsetY|radius|startRadius|spread|color>|layoutGrids/<i>/<size|count|gutter|offset>|componentProperties/<name> (instances: boolean/text properties; variant properties take string variables naming a value)|width|height|opacity (percent)|cornerRadius|gap|paddingHorizontal|characters|visible|fontSize...; list indices bottom first), variable (null unbinds)}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1974
|
+
"variable.bind": {
|
|
1975
|
+
field?: string;
|
|
1976
|
+
ids?: Array<Json>; /** an id (a number, or its digits as text) */
|
|
1977
|
+
variable?: Json;
|
|
1978
|
+
};
|
|
1979
|
+
/** Set variable mode. Sets which mode of a collection frames or the page use (null for the inherited mode). Params: {ids? (frames/page), collection, mode (id or name; null: Auto, inherited from the parent)}. Acts on `ids`. Reads the part, selection. Changes the document. */
|
|
1980
|
+
"variable.setMode": {
|
|
1981
|
+
collection?: Json; /** read by the command beside its listed parameters */
|
|
1982
|
+
id?: Json; /** frames/page */
|
|
1983
|
+
ids?: Array<Json>;
|
|
1984
|
+
mode?: Json;
|
|
1985
|
+
};
|
|
1986
|
+
/** List variables. Answers the file's variable collections, modes and variables with their values. Params: {}. */
|
|
1987
|
+
"variable.list": Record<string, never>;
|
|
1988
|
+
/** Adjust image. Adjusts the image paints of the selected or given layers with a preset or filters (exposure, contrast, saturation, temperature and more). Params: {ids?, target? (fill|stroke, default fill), index? (default every image paint), preset? (vivid|muted|warm|cool|blackAndWhite|fade|reset, or the name of a preset saved in the file), filters? ({exposure, contrast, saturation, temperature, tint, highlights, shadows}: each -1..1, applied over the preset)} sets the adjustments of the layers' image paints; returns {changed}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1989
|
+
"image.adjust": {
|
|
1990
|
+
filters?: {
|
|
1991
|
+
[key: string]: Json;
|
|
1992
|
+
};
|
|
1993
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0); default every image paint */
|
|
1994
|
+
index?: number; /** vivid|muted|warm|cool|blackAndWhite|fade|reset, or the name of a preset saved in the file */
|
|
1995
|
+
preset?: string;
|
|
1996
|
+
target?: "fill" | "stroke";
|
|
1997
|
+
};
|
|
1998
|
+
/** Save image preset. Saves an image adjustment preset in the file from filters or the first selected image paint's adjustments. Params: {name, filters? (default the adjustments of the first image paint of `ids`/the selection), ids?, target?, index?} saved in the file; a preset with the same name is replaced. Acts on `ids`. Reads the selection. Changes the document. */
|
|
1999
|
+
"image.savePreset": {
|
|
2000
|
+
filters?: {
|
|
2001
|
+
[key: string]: Json;
|
|
2002
|
+
};
|
|
2003
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0) */
|
|
2004
|
+
index?: number;
|
|
2005
|
+
name?: string;
|
|
2006
|
+
target?: "fill" | "stroke";
|
|
2007
|
+
};
|
|
2008
|
+
/** Delete image preset. Deletes a saved image adjustment preset from the file. Params: {name}. Changes the document. */
|
|
2009
|
+
"image.deletePreset": {
|
|
2010
|
+
name?: string;
|
|
2011
|
+
};
|
|
2012
|
+
/** Image presets. Answers the built-in and saved image adjustment presets with their filters. Params: {} ? {builtIn: [{id, label, filters}], saved: [{name, filters}]}. */
|
|
2013
|
+
"image.presets": {
|
|
2014
|
+
id?: Json;
|
|
2015
|
+
};
|
|
2016
|
+
/** Edit variable. Edits a variable's name, description, scopes and whether it is hidden from publishing. Params: {variable, name?, description?, scopes? ([scope ids]; null or ["ALL_SCOPES"] = every supported property, [] = hidden from pickers), hiddenFromPublishing? (left out when the file is published as a library), codeSyntax?: {WEB?, iOS?, ANDROID?: name code uses ("" clears)}}. Changes the document. */
|
|
2017
|
+
"variable.update": {
|
|
2018
|
+
codeSyntax?: {
|
|
2019
|
+
ANDROID?: Json;
|
|
2020
|
+
WEB?: Json;
|
|
2021
|
+
iOS?: Json;
|
|
2022
|
+
};
|
|
2023
|
+
description?: string;
|
|
2024
|
+
hiddenFromPublishing?: boolean; /** read by the command beside its listed parameters */
|
|
2025
|
+
library?: string;
|
|
2026
|
+
name?: string;
|
|
2027
|
+
scopes?: Json; /** an id (a number, or its digits as text) */
|
|
2028
|
+
variable?: Json;
|
|
2029
|
+
};
|
|
2030
|
+
/** Duplicate variable. Duplicates a variable; answers the new id. Params: {variable} ? {id}. Changes the document. */
|
|
2031
|
+
"variable.duplicate": {
|
|
2032
|
+
id?: Json; /** an id (a number, or its digits as text) */
|
|
2033
|
+
variable?: Json;
|
|
2034
|
+
};
|
|
2035
|
+
/** Rename mode. Renames a mode of a variable collection. Params: {collection, mode, name}. Changes the document. */
|
|
2036
|
+
"variable.renameMode": {
|
|
2037
|
+
collection?: Json; /** an id (a number, or its digits as text) */
|
|
2038
|
+
mode?: Json;
|
|
2039
|
+
name?: string;
|
|
2040
|
+
};
|
|
2041
|
+
/** Delete mode. Deletes a mode from a variable collection (a collection keeps at least one). Params: {collection, mode} (a collection keeps at least one mode). Changes the document. */
|
|
2042
|
+
"variable.removeMode": {
|
|
2043
|
+
collection?: Json; /** an id (a number, or its digits as text) */
|
|
2044
|
+
mode?: Json;
|
|
2045
|
+
};
|
|
2046
|
+
/** Move mode. Moves a mode to an index in its collection (index 0 is the default mode). Params: {collection, mode, to (index; 0 = the default mode, layers on Auto follow it)}. Changes the document. */
|
|
2047
|
+
"variable.moveMode": {
|
|
2048
|
+
collection?: Json; /** an id (a number, or its digits as text) */
|
|
2049
|
+
mode?: Json;
|
|
2050
|
+
to?: number;
|
|
2051
|
+
};
|
|
2052
|
+
/** Rename collection. Renames a variable collection. Params: {collection, name}. Changes the document. */
|
|
2053
|
+
"variable.renameCollection": {
|
|
2054
|
+
collection?: Json;
|
|
2055
|
+
name?: string;
|
|
2056
|
+
};
|
|
2057
|
+
/** Delete collection. Deletes a variable collection with its variables; bound layers keep their values. Params: {collection} (with its variables; bound layers keep their values). Changes the document. */
|
|
2058
|
+
"variable.deleteCollection": {
|
|
2059
|
+
collection?: Json;
|
|
2060
|
+
};
|
|
2061
|
+
/** Reset variable override. Resets an extended collection's overridden variable so it follows the inherited value again. Params: {variable (a variable of an extended collection inherited from the collection it extends), mode? (id or name; every overridden mode when omitted)} the value follows the inherited one again. Changes the document. */
|
|
2062
|
+
"variable.resetOverride": {
|
|
2063
|
+
mode?: Json; /** an id (a number, or its digits as text) */
|
|
2064
|
+
variable?: Json;
|
|
2065
|
+
};
|
|
2066
|
+
/** Export variables. Exports variable collections as the local variables JSON (for variable.import) or as CSS custom properties. Params: {collections?: [string] (ids or names; default every collection of this file, not library copies), format? (json (default): the local variables JSON that variable.import reads | css: custom properties, the default mode on :root and each other mode on [data-<collection>="<mode>"]; numbers in px unless layers or scopes use them as opacity or font weight | tailwind: a Tailwind CSS v4 stylesheet, the default mode as an @theme block named the way inspect.code's tailwind utilities read them: --color-*, --radius-*, --text-*, --spacing-*, --font-*, unique per file) | dart: a Dart file for Flutter, a class of constants per collection and mode (Color, double, String, bool), aliases resolved), path? (write it there)} ? {text}, or {path} when written. Reads the mode, selection. */
|
|
2067
|
+
"variable.export": {
|
|
2068
|
+
collections?: Array<string>; /** a Dart file for Flutter; one of several alternative parameters */
|
|
2069
|
+
dart?: Json;
|
|
2070
|
+
format?: "json" | "css";
|
|
2071
|
+
};
|
|
2072
|
+
/** Import variables. Imports variable collections and variables from local variables JSON (an object, text or a path). Params: {variables (the local variables JSON, as variable.export writes it: an object, JSON text or a path; `variableCollections` and `variables` under `meta` or at the top level)} collections join this file's collection of the same name (values by mode name; new modes and variables are added, a variable of another type is skipped), others are added ? {collections (added), variables (added), updated, warnings (also when it holds no variables, or fewer than its collections list)}. Changes the document. */
|
|
2073
|
+
"variable.import": {
|
|
2074
|
+
variables?: Json;
|
|
2075
|
+
};
|
|
2076
|
+
/** Add variant. Adds a variant to a component set by duplicating one, named by a property value. Params: {id? (component set, variant, or a main component not in a set yet: it becomes a set of itself and the new variant), property?, value?} (duplicates the variant; `property`=`value` names the new one). Acts on `id`. Reads the selection. Changes the document. */
|
|
2077
|
+
"component.addVariant": {
|
|
2078
|
+
id?: Json;
|
|
2079
|
+
property?: string;
|
|
2080
|
+
value?: string;
|
|
2081
|
+
};
|
|
2082
|
+
/** Create instance. Creates an instance of a component (or a set's default variant) at x, y in a parent; answers its id. Params: {component (component or set: its default variant), x?, y?, parent?}. Reads the part. Changes the document. */
|
|
2083
|
+
"instance.create": {
|
|
2084
|
+
component?: Json; /** an id (a number, or its digits as text) */
|
|
2085
|
+
parent?: Json;
|
|
2086
|
+
x?: number;
|
|
2087
|
+
y?: number;
|
|
2088
|
+
};
|
|
2089
|
+
/** Place instance. Places an instance of a component centred at a page point, inside the frame under it. Params: {component, x, y (page point: the instance is centred there, inside the frame under it; auto layout frames insert by position)}. Reads the part. Changes the document. */
|
|
2090
|
+
"instance.place": {
|
|
2091
|
+
component?: Json; /** read by the command beside its listed parameters */
|
|
2092
|
+
fuel?: number; /** read by the command beside its listed parameters */
|
|
2093
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2094
|
+
plugin?: string;
|
|
2095
|
+
x?: number; /** page point: the instance is centred there, inside the frame under it; auto layout frames insert by position */
|
|
2096
|
+
y?: number;
|
|
2097
|
+
};
|
|
2098
|
+
/** Expose nested instance. Exposes a nested instance's properties on its main component's instances (or stops). Params: {id? (an instance inside a main component), exposed? (default true)} ? its properties then show on the main's instances. Acts on `id`. Reads the selection. Changes the document. */
|
|
2099
|
+
"component.exposeInstance": {
|
|
2100
|
+
exposed?: boolean; /** an id; an instance inside a main component */
|
|
2101
|
+
id?: Json;
|
|
2102
|
+
};
|
|
2103
|
+
/** Exposed nested instances. Answers the nested instances whose properties an instance exposes. Params: {id? (instance)} ? the nested instance copies whose properties it exposes. Acts on `id`. Reads the selection. */
|
|
2104
|
+
"instance.exposed": {
|
|
2105
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2106
|
+
ids?: Array<Json>;
|
|
2107
|
+
};
|
|
2108
|
+
/** Make slot. Makes a frame inside a main component a slot that instances can fill with any content. Params: {id? (a frame inside a main component), name? (the slot property's name; the frame's by default), preferred?: [string] (component or set ids)} (its instances take any content there). Acts on `id`. Reads the selection. Changes the document. */
|
|
2109
|
+
"component.makeSlot": {
|
|
2110
|
+
id?: Json; /** the slot property's name; the frame's by default */
|
|
2111
|
+
name?: string; /** component or set ids */
|
|
2112
|
+
preferred?: Array<string>;
|
|
2113
|
+
};
|
|
2114
|
+
/** Remove slot. Turns a slot frame back into an ordinary frame; instances lose their own content in it. Params: {id? (a slot frame of a main component)} (instances lose their own content in it). Acts on `id`. Reads the selection. Changes the document. */
|
|
2115
|
+
"component.removeSlot": {
|
|
2116
|
+
id?: Json;
|
|
2117
|
+
};
|
|
2118
|
+
/** Insert into slot. Inserts an instance of a component into a slot of an instance, optionally clearing the slot first. Params: {id? (a slot inside an instance, or the instance with `slot`), slot? (slot property name), component, index? (child index; on top when omitted), replace? (clear the slot first)}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2119
|
+
"instance.slotInsert": {
|
|
2120
|
+
component?: Json; /** an id; a slot inside an instance, or the instance with `slot` */
|
|
2121
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2122
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0); child index; on top when omitted */
|
|
2123
|
+
index?: number;
|
|
2124
|
+
replace?: boolean;
|
|
2125
|
+
slot?: string;
|
|
2126
|
+
};
|
|
2127
|
+
/** Reset slot. Resets an instance's slot back to its main component's default content. Params: {id? (a slot inside an instance, or the instance with `slot`), slot?} (back to the main's default content). Acts on `id`. Reads the selection. Changes the document. */
|
|
2128
|
+
"instance.resetSlot": {
|
|
2129
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2130
|
+
ids?: Array<Json>;
|
|
2131
|
+
slot?: string;
|
|
2132
|
+
};
|
|
2133
|
+
/** Reset override. Resets one group of overrides (fills, text, size and more) or all overrides of an instance. Params: {id?, group? (fills|strokes|effects|opacity|visible|name|corners|characters|textStyle|padding|gap|alignment|grids|exports|interactions|size|position|modes|component|props|slot; all when omitted)}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2134
|
+
"component.resetOverride": {
|
|
2135
|
+
group?: string; /** an id */
|
|
2136
|
+
id?: Json;
|
|
2137
|
+
};
|
|
2138
|
+
/** Swap instance. Swaps the selected or given instances to another component. Params: {ids?, component}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
2139
|
+
"instance.swap": {
|
|
2140
|
+
component?: Json; /** read by the command beside its listed parameters */
|
|
2141
|
+
id?: Json;
|
|
2142
|
+
ids?: Array<Json>;
|
|
2143
|
+
};
|
|
2144
|
+
/** Swap instance at point. Swaps the instance at a page point to another component, as dropping from the Assets panel with Alt does. Params: {component (component or set: its default variant), x, y (page point)} swaps the instance there (preferring one showing the same component set; Alt-drop from the Assets panel); only text layers keep their overrides (by matching names). Reads the part. Changes the document. */
|
|
2145
|
+
"instance.swapAt": {
|
|
2146
|
+
component?: Json;
|
|
2147
|
+
x?: number; /** page point */
|
|
2148
|
+
y?: number;
|
|
2149
|
+
};
|
|
2150
|
+
/** Set instance properties. Sets component property values on the selected or given instances (variant properties switch variants). Params: {ids?, properties: {name: value}} (variant properties switch variants). Acts on `ids`. Reads the selection. Changes the document. */
|
|
2151
|
+
"instance.setProperties": {
|
|
2152
|
+
ids?: Array<Json>;
|
|
2153
|
+
properties?: {
|
|
2154
|
+
name?: Json;
|
|
2155
|
+
};
|
|
2156
|
+
};
|
|
2157
|
+
/** Add component property. Adds a boolean, text, instance-swap, variant or slot property to a component or set, optionally binding a layer. Params: {id? (component, set, or a layer inside a component: it gets bound), name, type: boolean|text|instanceSwap|variant|slot, default? (boolean: the bound layer's visibility in the main; without it, the layer's current visibility), layer? (node bound to it; a frame for slots), preferred? (instance swap and slot properties: component or set ids offered first)}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2158
|
+
"component.addProperty": {
|
|
2159
|
+
default?: Json; /** an id; component, set, or a layer inside a component: it gets bound */
|
|
2160
|
+
id?: Json; /** node bound to it; a frame for slots */
|
|
2161
|
+
layer?: number;
|
|
2162
|
+
name?: string;
|
|
2163
|
+
preferred?: Array<string>;
|
|
2164
|
+
type?: "boolean" | "text" | "instanceSwap" | "variant" | "slot";
|
|
2165
|
+
};
|
|
2166
|
+
/** Edit component property. Edits a component property: its name, default value, variant values or preferred components. Params: {id? (component or set), name, newName?, default? (variant properties: that variant takes the top-left place; boolean: the main's bound layers show or hide to match), value? (with newValue: the variant value to rename), newValue? (its new name), index? (variant properties: move to this place; the variants' names follow), preferred? (instance swap and slot properties: component or set ids offered first)}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2167
|
+
"component.editProperty": {
|
|
2168
|
+
default?: Json; /** an id; component or set */
|
|
2169
|
+
id?: Json; /** a position counted from 0 (the first is 0); variant properties: move to this place; the variants' names follow */
|
|
2170
|
+
index?: number;
|
|
2171
|
+
name?: string;
|
|
2172
|
+
newName?: string;
|
|
2173
|
+
newValue?: string;
|
|
2174
|
+
preferred?: Array<string>;
|
|
2175
|
+
value?: string;
|
|
2176
|
+
};
|
|
2177
|
+
/** Delete component property. Deletes a component property from a component or set. Params: {id? (component or set), name}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2178
|
+
"component.deleteProperty": {
|
|
2179
|
+
id?: Json;
|
|
2180
|
+
name?: string;
|
|
2181
|
+
};
|
|
2182
|
+
/** Bind layer to property. Binds a layer's visibility, text, swapped component or slot to a component property (or unbinds it). Params: {layer?, property (null/"" unbinds), field?: visible|characters|mainComponent|slot}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2183
|
+
"component.bindProperty": {
|
|
2184
|
+
field?: "visible" | "characters" | "mainComponent" | "slot"; /** read by the command beside its listed parameters */
|
|
2185
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2186
|
+
ids?: Array<Json>;
|
|
2187
|
+
layer?: number;
|
|
2188
|
+
property?: Json;
|
|
2189
|
+
};
|
|
2190
|
+
/** Component properties. Answers the properties of a component, set or instance with their types and values. Params: {id? (component, set or instance)}. Acts on `id`. Reads the selection. */
|
|
2191
|
+
"component.properties": {
|
|
2192
|
+
id?: Json;
|
|
2193
|
+
};
|
|
2194
|
+
/** List components. Answers the file's components with their type, page, instance count, Assets panel folder and library. Params: {} ? [{id, name, type, page, instances, folder (the Assets panel's folders: page, frames, slash names), label, library?}]. */
|
|
2195
|
+
"component.list": Record<string, never>;
|
|
2196
|
+
/** Publish library. Publishes the file's components, sets, styles and variable collections as a library (all or exactly the given ones). Params: {description?, include? [component/set ids, style ids, variable collection ids or names: exactly these], exclude? [same]} publishes this file's components, component sets, styles and variable collections (by default all but names starting with . or _, or what the last publish offered; variables hidden from publishing stay out unless something published uses them) as a new library version; save the file so other files see it. Changes the document. */
|
|
2197
|
+
"library.publish": {
|
|
2198
|
+
description?: string; /** read by the command beside its listed parameters */
|
|
2199
|
+
include?: Array<Json>;
|
|
2200
|
+
};
|
|
2201
|
+
/** List libraries. Answers the enabled libraries with versions and updates, and this file's published library, optionally with their assets. Params: {assets? (also list each library's components, styles, variable collections and variables, and what this file can publish)} ? enabled libraries (version, updates, errors) and this file's published library. Reads the mode. */
|
|
2202
|
+
"library.list": {
|
|
2203
|
+
assets?: boolean;
|
|
2204
|
+
};
|
|
2205
|
+
/** Add library. Enables a library from a published .kdesign file or a share link so its components, styles and variables can be used. Params: {path (.kdesign file published as a library, or a share link of a file on a server: a view link is enough; where the app lends library files, a workspace path relative to this file's folder, or from the workspace root with a leading /)}. Changes the document. */
|
|
2206
|
+
"library.add": {
|
|
2207
|
+
path?: Json;
|
|
2208
|
+
};
|
|
2209
|
+
/** Swap library. Re-points every instance, style and variable copied from one library to the same-named ones in another. Params: {from (an enabled library: id, name or path), to (another enabled library)} re-points every component instance, style and variable copied from `from` to the published one of the same name in `to` (instances keep their overrides) ? {components, styles, variables, unmatched: [names still from `from`], removed (nothing of `from` is used any more: it was removed)}. Changes the document. */
|
|
2210
|
+
"library.swap": {
|
|
2211
|
+
from?: Json; /** an id (a number, or its digits as text) */
|
|
2212
|
+
to?: Json;
|
|
2213
|
+
};
|
|
2214
|
+
/** Remove library. Disables a library; copies still in use stay. Params: {id (library id, name or path)} (copies still in use stay; unused ones are dropped). Changes the document. */
|
|
2215
|
+
"library.remove": {
|
|
2216
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2217
|
+
library?: string;
|
|
2218
|
+
};
|
|
2219
|
+
/** Library updates. Answers the library components, styles and variables that have newer published versions. Params: {} ? the components, styles, variable collections and variables with a newer published version, and variables new to a library collection this file extends (listed without an `id`: no copy yet). */
|
|
2220
|
+
"library.updates": Record<string, never>;
|
|
2221
|
+
/** Accept library updates. Pulls in updated library components, styles and variables; instances keep their overrides. Params: {ids?: [string] (library ids; all when omitted)} pulls updated components, styles, variable collections and variables in (instances keep their overrides; bound layers follow). Changes the document. */
|
|
2222
|
+
"library.acceptUpdates": {
|
|
2223
|
+
collection?: string; /** library ids; all when omitted */
|
|
2224
|
+
ids?: Array<string>; /** read by the command beside its listed parameters */
|
|
2225
|
+
library?: string; /** read by the command beside its listed parameters */
|
|
2226
|
+
name?: string;
|
|
2227
|
+
};
|
|
2228
|
+
/** Place library component. Places an instance of a published library component at a page point (default the view's centre). Params: {library (id, name or path), component (id or name of a published component, set or variant), x?, y? (page point; default the view's centre)}. Reads the mode, part. Changes the document. */
|
|
2229
|
+
"library.place": {
|
|
2230
|
+
component?: Json; /** an id (a number, or its digits as text) */
|
|
2231
|
+
library?: Json;
|
|
2232
|
+
x?: number; /** page point; default the view's centre */
|
|
2233
|
+
y?: number;
|
|
2234
|
+
};
|
|
2235
|
+
/** Swap instance to library component. Copies a library component in and swaps the instance at a page point to it. Params: {library, component (id or name of a published component, set or variant), x, y (page point)} copies the component in and swaps the instance there to it (as instance.swapAt). Reads the part. Changes the document. */
|
|
2236
|
+
"library.swapAt": {
|
|
2237
|
+
component?: Json; /** an id (a number, or its digits as text) */
|
|
2238
|
+
library?: Json;
|
|
2239
|
+
x?: number; /** page point */
|
|
2240
|
+
y?: number;
|
|
2241
|
+
};
|
|
2242
|
+
/** Import library component. Copies a library component into the file as a read-only main to instantiate with instance.create. Params: {library, component} ? {component (local, read-only main to instantiate with instance.create)}. Changes the document. */
|
|
2243
|
+
"library.import": {
|
|
2244
|
+
component?: Json; /** an id (a number, or its digits as text) */
|
|
2245
|
+
library?: Json;
|
|
2246
|
+
};
|
|
2247
|
+
/** Apply library style. Copies a published library style in (linked, read-only) and applies it to the selected or given layers. Params: {library, style (id or name of a published style), ids?, target? (fill|stroke)} copies the style in (linked, read-only) and applies it. Acts on `ids`. Reads the selection. Changes the document. */
|
|
2248
|
+
"library.applyStyle": {
|
|
2249
|
+
ids?: Array<Json>; /** an id (a number, or its digits as text) */
|
|
2250
|
+
library?: Json; /** id or name of a published style */
|
|
2251
|
+
style?: string;
|
|
2252
|
+
target?: "fill" | "stroke";
|
|
2253
|
+
};
|
|
2254
|
+
/** Import library variable. Copies a published library variable in as a linked read-only copy for binding or aliasing. Params: {library, variable (id or name of a published variable)} ? {variable (local, read-only linked copy to use with variable.bind, or as an alias in variable.set)}. Changes the document. */
|
|
2255
|
+
"library.importVariable": {
|
|
2256
|
+
library?: Json; /** an id (a number, or its digits as text) */
|
|
2257
|
+
variable?: Json;
|
|
2258
|
+
};
|
|
2259
|
+
/** Bind library variable. Copies a published library variable in and binds it to a field of the selected or given layers. Params: {library, variable (id or name of a published variable), field (as variable.bind), ids?} copies the variable in (linked, read-only) and binds it. Acts on `ids`. Reads the selection. Changes the document. */
|
|
2260
|
+
"library.bindVariable": {
|
|
2261
|
+
field?: string;
|
|
2262
|
+
ids?: Array<Json>; /** an id (a number, or its digits as text) */
|
|
2263
|
+
library?: Json; /** an id (a number, or its digits as text) */
|
|
2264
|
+
variable?: Json;
|
|
2265
|
+
};
|
|
2266
|
+
/** Alias library variable. Copies a library variable in and makes a local variable an alias of it in a mode. Params: {library, alias (id or name of a published variable of the same type), variable (a local variable), mode? (default first)} copies the library variable in (linked, read-only) and makes the local variable's value an alias of it. Changes the document. */
|
|
2267
|
+
"library.aliasVariable": {
|
|
2268
|
+
alias?: Json; /** an id (a number, or its digits as text) */
|
|
2269
|
+
library?: Json; /** an id (a number, or its digits as text) */
|
|
2270
|
+
mode?: Json; /** an id (a number, or its digits as text) */
|
|
2271
|
+
variable?: Json;
|
|
2272
|
+
};
|
|
2273
|
+
/** Set library variable mode. Copies a library collection in and sets one of its modes on frames or the page. Params: {library, collection (id or name of a published collection), mode (id or name), ids? (frames; the page when omitted)} copies the collection in (linked, read-only) and sets its mode on the frames. Reads the part, selection. Changes the document. */
|
|
2274
|
+
"library.setVariableMode": {
|
|
2275
|
+
collection?: Json; /** frames; the page when omitted */
|
|
2276
|
+
ids?: Array<Json>; /** an id (a number, or its digits as text) */
|
|
2277
|
+
library?: Json; /** an id (a number, or its digits as text) */
|
|
2278
|
+
mode?: Json;
|
|
2279
|
+
};
|
|
2280
|
+
/** Extend library collection. Creates a local collection that extends a library collection, following its variables with local overrides. Params: {library, collection (id or name of a published collection), name? (default "<name> (extended)")} ? {id}: a collection of this file with the library collection's modes and variables (they follow its updates); override their values per mode with variable.set (variable.resetOverride goes back to the inherited value) and add variables of its own. Changes the document. */
|
|
2281
|
+
"library.extendCollection": {
|
|
2282
|
+
collection?: Json; /** an id (a number, or its digits as text) */
|
|
2283
|
+
library?: Json; /** default "<name> (extended)" */
|
|
2284
|
+
name?: string;
|
|
2285
|
+
};
|
|
2286
|
+
/** Add interaction. Adds a prototype interaction to a layer: a trigger (click, hover, drag, key, delay and more), actions and a transition. Params: {id?, trigger? {type: onClick|onHover|onPress|onDrag|mouseEnter|mouseLeave|mouseDown|mouseUp|afterDelay {ms}|keyPress {key (a key or a combination: Shift+K, Ctrl+Alt+Delete; or a controller button: Gamepad A|B|X|Y|LB|RB|LT|RT|View|Menu|LS|RS|Up|Down|Left|Right|Home)}}, action?: {type: navigate {preserveScroll?}|back|scrollTo {offset? [x, y] (where the layer ends up from the top-left)}|openOverlay {position?, anchor? screen|triggerInside|triggerOutside (default screen; the trigger ones measure the position preset on the layer that opens the overlay: outside puts top presets above it and bottom presets below it, edges lined up), offset? [x, y] (position manual: the overlay's top-left from the top-left of the layer that opens it; without it, right below that layer), close_on_outside? (default true), background?}|swapOverlay|closeOverlay|openUrl {url}|changeTo|setVariable {variable, value | expression (text, e.g. "count + 1")}|setVariableMode {collection, mode}|conditional {blocks [{condition? | expression? (text, e.g. "count >= 3"), actions}]}, dest?}, actions? [..], transition? {type: instant|dissolve|smartAnimate|moveIn|moveOut|push|slideIn|slideOut, direction?: left|right|top|bottom}, durationMs?, easing? linear|easeIn|easeOut|easeInOut|easeInBack|easeOutBack|easeInOutBack|gentle|quick|bouncy|slow|{customBezier {x1, y1, x2, y2}}|{customSpring {mass, stiffness, damping}}}, delayMs? (mouse enter, leave, down and up: how long after the gesture the actions run, up to 600000), dest? (a frame id: with id alone, a click that navigates there)} ? or {id, dest} for a click-navigate. Returns {index}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2287
|
+
"proto.interaction.add": {
|
|
2288
|
+
action?: {
|
|
2289
|
+
[key: string]: Json;
|
|
2290
|
+
}; /** Several actions, in order (instead of action). */
|
|
2291
|
+
actions?: Array<{
|
|
2292
|
+
[key: string]: Json;
|
|
2293
|
+
}>; /** Mouse enter, leave, down and up: how long after the gesture the actions run, up to 600000. */
|
|
2294
|
+
delayMs?: number; /** A frame id: with id alone, a click that navigates there. */
|
|
2295
|
+
dest?: number;
|
|
2296
|
+
durationMs?: number; /** A named easing, or {customBezier {x1, y1, x2, y2}} or {customSpring {mass, stiffness, damping}}. */
|
|
2297
|
+
easing?: Json; /** The layer the interaction is on (default the selection). */
|
|
2298
|
+
id?: number; /** {type: instant|dissolve|smartAnimate|moveIn|moveOut|push|slideIn|slideOut, direction?: left|right|top|bottom}. */
|
|
2299
|
+
transition?: {
|
|
2300
|
+
[key: string]: Json;
|
|
2301
|
+
}; /** What starts it: {type: onClick|onHover|onPress|onDrag|mouseEnter|mouseLeave|mouseDown|mouseUp|afterDelay {ms}|keyPress {key}} (default onClick). */
|
|
2302
|
+
trigger?: {
|
|
2303
|
+
[key: string]: Json;
|
|
2304
|
+
};
|
|
2305
|
+
};
|
|
2306
|
+
/** Remove all interactions. Removes every prototype interaction from the selected or given layers. Params: {ids?}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
2307
|
+
"proto.interaction.clear": {
|
|
2308
|
+
id?: Json;
|
|
2309
|
+
ids?: Array<Json>;
|
|
2310
|
+
};
|
|
2311
|
+
/** Remove interaction. Removes the prototype interaction at index from a layer. Params: {id?, index}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2312
|
+
"proto.interaction.remove": {
|
|
2313
|
+
id?: Json; /** a position counted from 0 (the first is 0) */
|
|
2314
|
+
index?: number;
|
|
2315
|
+
};
|
|
2316
|
+
/** Edit interaction. Replaces or patches the prototype interaction at index: trigger, actions, transition, duration, easing and delay. Params: {id?, index, interaction {..}} replaces it; or patch fields: {id?, index, trigger?, action? (first action), actions?, transition?, durationMs?, easing?, delayMs?}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2317
|
+
"proto.interaction.set": {
|
|
2318
|
+
action?: {
|
|
2319
|
+
[key: string]: Json;
|
|
2320
|
+
}; /** read by the command beside its listed parameters */
|
|
2321
|
+
actions?: Array<Json>; /** read by the command beside its listed parameters */
|
|
2322
|
+
delayMs?: number; /** read by the command beside its listed parameters */
|
|
2323
|
+
durationMs?: number; /** read by the command beside its listed parameters */
|
|
2324
|
+
easing?: Json; /** an id */
|
|
2325
|
+
id?: Json; /** a position counted from 0 (the first is 0) */
|
|
2326
|
+
index?: number; /** read by the command beside its listed parameters */
|
|
2327
|
+
interaction?: {
|
|
2328
|
+
[key: string]: Json;
|
|
2329
|
+
}; /** read by the command beside its listed parameters */
|
|
2330
|
+
transition?: {
|
|
2331
|
+
[key: string]: Json;
|
|
2332
|
+
}; /** read by the command beside its listed parameters */
|
|
2333
|
+
trigger?: {
|
|
2334
|
+
[key: string]: Json;
|
|
2335
|
+
};
|
|
2336
|
+
};
|
|
2337
|
+
/** Add flow starting point. Adds a prototype flow starting at a top-level frame (default the selection). Params: {start? (top-level frame id; default selection), name?}. Reads the part, selection. Changes the document. */
|
|
2338
|
+
"proto.flow.add": {
|
|
2339
|
+
name?: string; /** top-level frame id; default selection */
|
|
2340
|
+
start?: number;
|
|
2341
|
+
};
|
|
2342
|
+
/** Rename flow. Renames a prototype flow and sets its description. Params: {start, name?, description?}. Reads the part. Changes the document. */
|
|
2343
|
+
"proto.flow.rename": {
|
|
2344
|
+
description?: string; /** read by the command beside its listed parameters */
|
|
2345
|
+
id?: Json;
|
|
2346
|
+
name?: string;
|
|
2347
|
+
start?: number;
|
|
2348
|
+
};
|
|
2349
|
+
/** Remove flow. Removes a prototype flow starting point. Params: {start}. Reads the part. Changes the document. */
|
|
2350
|
+
"proto.flow.remove": {
|
|
2351
|
+
start?: number;
|
|
2352
|
+
};
|
|
2353
|
+
/** Prototype settings. Sets the prototype's device, background, rotation, device colour and custom size. Params: {device? (a device name, "Custom size" or "None"), background?, rotation?: portrait|landscape (or 0 or 90; phones and tablets turn), color? (one of the device's colours by name), width?, height? (the custom size's screen, 1?10000 points; picks "Custom size"), responsive?: bool (frames resize to the screen and their constraints and auto layout respond)}. Reads the part. Changes the document. */
|
|
2354
|
+
"proto.settings": {
|
|
2355
|
+
background?: string; /** one of the device's colours by name */
|
|
2356
|
+
color?: string;
|
|
2357
|
+
device?: string; /** the custom size's screen, 1?10000 points; picks "Custom size" */
|
|
2358
|
+
height?: number; /** frames resize to the screen and their constraints and auto layout respond */
|
|
2359
|
+
responsive?: boolean;
|
|
2360
|
+
rotation?: Json;
|
|
2361
|
+
width?: number;
|
|
2362
|
+
};
|
|
2363
|
+
/** Present. Opens the prototype presenter from a frame (default the selected frame or first flow). Params: {start? (frame id; default: the selected frame, else the first flow, else the first frame)}. Reads the part. */
|
|
2364
|
+
"proto.present": {
|
|
2365
|
+
id?: Json; /** frame id; default: the selected frame, else the first flow, else the first frame */
|
|
2366
|
+
start?: number;
|
|
2367
|
+
};
|
|
2368
|
+
/** Open prototype preview. Opens a floating live prototype preview over the canvas from a frame. Params: {start? (frame id; default as proto.present)} a floating preview pane over the canvas that follows edits live. Reads the part. */
|
|
2369
|
+
"proto.preview": {
|
|
2370
|
+
id?: Json; /** frame id; default as proto.present */
|
|
2371
|
+
start?: number;
|
|
2372
|
+
};
|
|
2373
|
+
/** Close prototype preview. Closes the floating prototype preview. Params: {}. */
|
|
2374
|
+
"proto.closePreview": {
|
|
2375
|
+
force?: boolean; /** read by the command beside its listed parameters */
|
|
2376
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2377
|
+
index?: number;
|
|
2378
|
+
};
|
|
2379
|
+
/** Presentation options. Sets how the presenter sizes the prototype and whether it shows the device frame, hotspot hints and inspect. Params: {scale? fit|fitWidth|fill|actual, deviceFrame? bool, hotspotHints? bool, inspect? bool} how the presenter sizes the prototype (Fit scales down to fit, Fit width fills the width, Fill covers the window, Actual shows it at 100%), whether it draws the device, whether a click where nothing reacts flashes the hotspots (on by default) and whether the Inspect panel shows the properties of the layer under the pointer; kept for later presentations. */
|
|
2380
|
+
"proto.presentOptions": {
|
|
2381
|
+
deviceFrame?: boolean; /** read by the command beside its listed parameters */
|
|
2382
|
+
hotspotHints?: boolean; /** read by the command beside its listed parameters */
|
|
2383
|
+
inspect?: boolean; /** read by the command beside its listed parameters */
|
|
2384
|
+
scale?: string;
|
|
2385
|
+
};
|
|
2386
|
+
/** Notice before leaving for a link. Sets whether a presented prototype warns before opening a website link. Params: {show? (default true; false skips it)} whether a presented prototype's Open link to a website first says that it leaves the prototype, with Open link and Cancel; kept with the preferences ? {shown}. Reads the mode. */
|
|
2387
|
+
"proto.linkNotice": {
|
|
2388
|
+
show?: boolean;
|
|
2389
|
+
};
|
|
2390
|
+
/** Add prototype action. Adds an action to a prototype interaction, at a path inside conditionals. Params: {id?, index (interaction), path? (where it goes: [n] appends to an interaction with n actions, [i, b, j] inside block b of the conditional i; default: after the last action), action {type: ..., as proto.interaction.add; setVariable takes `expression` text, conditional blocks take `expression` or `condition`}} ? {path}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2391
|
+
"proto.action.add": {
|
|
2392
|
+
action?: {
|
|
2393
|
+
[key: string]: Json;
|
|
2394
|
+
}; /** an id */
|
|
2395
|
+
id?: Json; /** a position counted from 0 (the first is 0); interaction */
|
|
2396
|
+
index?: number; /** where it goes: [n] appends to an interaction with n actions, [i, b, j] inside block b of the conditional i; default: after the last action */
|
|
2397
|
+
path?: Array<number>;
|
|
2398
|
+
};
|
|
2399
|
+
/** Edit prototype action. Replaces the prototype action at a path in an interaction. Params: {id?, index, path [action, block, action, ...], action {...}} replaces the action there. Acts on `id`. Reads the selection. Changes the document. */
|
|
2400
|
+
"proto.action.set": {
|
|
2401
|
+
action?: {
|
|
2402
|
+
[key: string]: Json;
|
|
2403
|
+
}; /** an id */
|
|
2404
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2405
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0) */
|
|
2406
|
+
index?: number; /** read by the command beside its listed parameters */
|
|
2407
|
+
path?: Array<Json>;
|
|
2408
|
+
};
|
|
2409
|
+
/** Remove prototype action. Removes the prototype action at a path (an interaction keeps at least one). Params: {id?, index, path} (an interaction keeps at least one action: remove the interaction instead). Acts on `id`. Reads the selection. Changes the document. */
|
|
2410
|
+
"proto.action.remove": {
|
|
2411
|
+
id?: Json; /** a position counted from 0 (the first is 0) */
|
|
2412
|
+
index?: number;
|
|
2413
|
+
path?: Array<number>;
|
|
2414
|
+
};
|
|
2415
|
+
/** Reorder prototype action. Moves a prototype action to another index in the same list. Params: {id?, index, path, to (its new index in the same list)} ? {path}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2416
|
+
"proto.action.move": {
|
|
2417
|
+
id?: Json; /** a position counted from 0 (the first is 0) */
|
|
2418
|
+
index?: number;
|
|
2419
|
+
path?: Array<number>;
|
|
2420
|
+
to?: number;
|
|
2421
|
+
};
|
|
2422
|
+
/** Add else if / else. Adds an else-if (with a condition) or else block to a conditional prototype action. Params: {id?, index, path (a conditional action), else?: bool (add the else block; default: an else if before it), expression? (text, e.g. "count >= 3") | condition? (expression JSON); default condition: the first variable equal to its value} ? {block}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2423
|
+
"proto.conditional.addBlock": {
|
|
2424
|
+
condition?: Json; /** add the else block; default: an else if before it */
|
|
2425
|
+
else?: boolean;
|
|
2426
|
+
expression?: string; /** an id */
|
|
2427
|
+
id?: Json; /** a position counted from 0 (the first is 0) */
|
|
2428
|
+
index?: number; /** a conditional action */
|
|
2429
|
+
path?: Array<number>;
|
|
2430
|
+
};
|
|
2431
|
+
/** Edit condition. Edits the condition of a block of a conditional prototype action. Params: {id?, index, path (a conditional action), block, expression (text) | condition (expression JSON)} the condition must give true or false. Acts on `id`. Reads the selection. Changes the document. */
|
|
2432
|
+
"proto.conditional.setCondition": {
|
|
2433
|
+
block?: number; /** expression JSON; one of several alternative parameters */
|
|
2434
|
+
condition?: Json;
|
|
2435
|
+
expression?: string; /** an id */
|
|
2436
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2437
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0) */
|
|
2438
|
+
index?: number; /** a conditional action */
|
|
2439
|
+
path?: Array<number>; /** read by the command beside its listed parameters */
|
|
2440
|
+
text?: string;
|
|
2441
|
+
};
|
|
2442
|
+
/** Remove if / else if / else. Removes a block of a conditional prototype action. Params: {id?, index, path (a conditional action), block} removing the if when only an else (or nothing) is left removes the whole conditional action ? {removedAction}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2443
|
+
"proto.conditional.removeBlock": {
|
|
2444
|
+
block?: number; /** an id */
|
|
2445
|
+
id?: Json; /** a position counted from 0 (the first is 0) */
|
|
2446
|
+
index?: number; /** a conditional action */
|
|
2447
|
+
path?: Array<number>;
|
|
2448
|
+
};
|
|
2449
|
+
/** Evaluate prototype expression. Evaluates a prototype expression (variables, modes, arithmetic) on a layer and answers its value. Params: {expression (text, e.g. "count + 1", "accent[Dark]", "mode(Theme) == 'Dark'") | expr (expression JSON), id? (the layer it runs on: variables resolve in its modes; default: the document's default modes)} ? {value, type, text} without changing anything. Acts on `id`. */
|
|
2450
|
+
"proto.evaluate": {
|
|
2451
|
+
expr?: Json;
|
|
2452
|
+
expression?: string; /** an id; the layer it runs on: variables resolve in its modes; default: the document's default modes */
|
|
2453
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2454
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
2455
|
+
text?: string;
|
|
2456
|
+
};
|
|
2457
|
+
/** Add comment. Adds a comment thread at a page point, optionally pinned to a layer; answers its id. Params: {x, y, text, page?, author?, anchor? (node id to pin to; true = innermost frame under the point)}. Reads the mode, part. Changes the document. */
|
|
2458
|
+
"comment.add": {
|
|
2459
|
+
anchor?: Json;
|
|
2460
|
+
author?: string;
|
|
2461
|
+
page?: number;
|
|
2462
|
+
text?: string;
|
|
2463
|
+
x?: number;
|
|
2464
|
+
y?: number;
|
|
2465
|
+
};
|
|
2466
|
+
/** Reply to comment. Replies to a comment thread. Params: {id, text, author?}. Acts on `id`. Reads the mode. Changes the document. */
|
|
2467
|
+
"comment.reply": {
|
|
2468
|
+
author?: string; /** an id */
|
|
2469
|
+
id?: Json;
|
|
2470
|
+
text?: string;
|
|
2471
|
+
};
|
|
2472
|
+
/** Edit comment. Edits the first message or a reply of a comment thread. Params: {id, text, reply? (index; omit for the first message), author?}. Acts on `id`. Changes the document. */
|
|
2473
|
+
"comment.edit": {
|
|
2474
|
+
author?: string; /** an id */
|
|
2475
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2476
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
2477
|
+
index?: number; /** read by the command beside its listed parameters */
|
|
2478
|
+
link?: string;
|
|
2479
|
+
reply?: number;
|
|
2480
|
+
text?: string;
|
|
2481
|
+
};
|
|
2482
|
+
/** React to comment. Adds, removes or toggles an emoji reaction on a comment or reply. Params: {id, emoji, reply? (index; omit for the first message), on? (default: toggle), author?}. Acts on `id`. Reads the mode. Changes the document. */
|
|
2483
|
+
"comment.react": {
|
|
2484
|
+
author?: string;
|
|
2485
|
+
emoji?: string; /** an id */
|
|
2486
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2487
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
2488
|
+
index?: number; /** read by the command beside its listed parameters */
|
|
2489
|
+
link?: string;
|
|
2490
|
+
on?: boolean;
|
|
2491
|
+
reply?: number;
|
|
2492
|
+
};
|
|
2493
|
+
/** Resolve comment. Resolves (or reopens) a comment thread. Params: {id, resolved? (default true)}. Acts on `id`. Changes the document. */
|
|
2494
|
+
"comment.resolve": {
|
|
2495
|
+
id?: Json;
|
|
2496
|
+
resolved?: boolean;
|
|
2497
|
+
};
|
|
2498
|
+
/** Move comment. Moves a comment pin to a page point, pinned to a layer or the page. Params: {id, x, y, anchor? (default true: pin to the innermost frame under the point; false: to the page; or a node id)}. Acts on `id`. Changes the document. */
|
|
2499
|
+
"comment.move": {
|
|
2500
|
+
anchor?: Json; /** an id */
|
|
2501
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2502
|
+
link?: string;
|
|
2503
|
+
x?: number;
|
|
2504
|
+
y?: number;
|
|
2505
|
+
};
|
|
2506
|
+
/** Delete comment. Deletes a comment thread or one reply. Params: {id, reply? (index: delete one reply; omit to delete the thread), author?}. Acts on `id`. Changes the document. */
|
|
2507
|
+
"comment.delete": {
|
|
2508
|
+
author?: string; /** an id */
|
|
2509
|
+
id?: Json;
|
|
2510
|
+
reply?: number;
|
|
2511
|
+
};
|
|
2512
|
+
/** Mark comment as read. Marks a comment thread (or every thread) read or unread. Params: {id? | link? (omit: every thread), read? (default true; false marks it unread), author?}. Acts on `id`. Reads the mode. */
|
|
2513
|
+
"comment.markRead": {
|
|
2514
|
+
author?: string; /** an id; omit: every thread; one of several alternative parameters */
|
|
2515
|
+
id?: Json;
|
|
2516
|
+
link?: string;
|
|
2517
|
+
read?: boolean;
|
|
2518
|
+
};
|
|
2519
|
+
/** Open comment. Opens a comment thread and zooms or centres the view on it. Params: {id | link, view? (fit: zoom to the thread's frame, default; center: centre the pin; keep), author?}. Acts on `id`. Reads the mode, part. */
|
|
2520
|
+
"comment.open": {
|
|
2521
|
+
author?: string; /** an id; one of several alternative parameters */
|
|
2522
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2523
|
+
ids?: Array<Json>; /** one of several alternative parameters */
|
|
2524
|
+
link?: Json; /** read by the command beside its listed parameters */
|
|
2525
|
+
maxLines?: number; /** read by the command beside its listed parameters */
|
|
2526
|
+
minSize?: number; /** read by the command beside its listed parameters */
|
|
2527
|
+
orphans?: boolean;
|
|
2528
|
+
view?: "fit" | "center" | "keep";
|
|
2529
|
+
};
|
|
2530
|
+
/** Next comment. Opens the next or previous comment thread in the filtered list. Params: {id? (the thread to step from; omitted: the first or last), dir? (1 next, -1 previous; default 1), page?, filter?, sort?, query? (the list, as comment.list), author?}. Acts on `id`. Reads the mode, part. */
|
|
2531
|
+
"comment.next": {
|
|
2532
|
+
author?: string;
|
|
2533
|
+
dir?: 1 | -1;
|
|
2534
|
+
filter?: "all" | "open" | "resolved" | "mine" | "unread"; /** an id; the thread to step from; omitted: the first or last */
|
|
2535
|
+
id?: Json;
|
|
2536
|
+
page?: number;
|
|
2537
|
+
query?: string;
|
|
2538
|
+
sort?: "date" | "page";
|
|
2539
|
+
};
|
|
2540
|
+
/** Zoom to comments. Zooms the view to fit comment threads on the current page. Params: {ids (comment ids on the current page)}. Reads the mode, part. */
|
|
2541
|
+
"comment.zoom": {
|
|
2542
|
+
id?: Json; /** comment ids on the current page */
|
|
2543
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
2544
|
+
maxLines?: number; /** read by the command beside its listed parameters */
|
|
2545
|
+
minSize?: number; /** read by the command beside its listed parameters */
|
|
2546
|
+
orphans?: boolean;
|
|
2547
|
+
};
|
|
2548
|
+
/** Copy link to comment. Answers a link to a comment thread. Params: {id}. Acts on `id`. */
|
|
2549
|
+
"comment.link": {
|
|
2550
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2551
|
+
link?: string;
|
|
2552
|
+
};
|
|
2553
|
+
/** People in comments. Answers the people taking part in the file's comments. Params: {}. Reads the mode. */
|
|
2554
|
+
"comment.people": Record<string, never>;
|
|
2555
|
+
/** List comments. Answers comment threads on a page or every page, filtered, sorted and searched. Params: {page? (default: current; "all" for every page), filter? (all|open|resolved|mine|unread; default all), sort? (date|page; default date), query? (search text), frame? (a top-level frame id), resolved? (false hides resolved ones), author? (whose threads and read state)}. Reads the mode, part. */
|
|
2556
|
+
"comment.list": {
|
|
2557
|
+
author?: string;
|
|
2558
|
+
filter?: "all" | "open" | "resolved" | "mine" | "unread"; /** a top-level frame id */
|
|
2559
|
+
frame?: number; /** default: current; "all" for every page */
|
|
2560
|
+
page?: number;
|
|
2561
|
+
query?: string;
|
|
2562
|
+
resolved?: boolean;
|
|
2563
|
+
sort?: "date" | "page";
|
|
2564
|
+
};
|
|
2565
|
+
/** Edit vector. Enters vector edit mode on layers (default the selection), converting shapes to vectors. Params: {id? | ids?} (default the selection; several layers are edited at once, the first active; converts shapes to vectors). Acts on `ids`. Reads the selection. Changes the document. */
|
|
2566
|
+
"vector.edit.begin": {
|
|
2567
|
+
id?: Json; /** one of several alternative parameters */
|
|
2568
|
+
ids?: Array<Json>;
|
|
2569
|
+
};
|
|
2570
|
+
/** Done editing. Leaves vector edit mode. Params: {}. Reads the mode. Changes the document. */
|
|
2571
|
+
"vector.edit.end": Record<string, never>;
|
|
2572
|
+
/** Vector edit state. Answers the vector edit overlay and the edited layer's vector network: points, segments, handles and regions. Params: {} ? page-space overlay plus the local network. Reads the mode. */
|
|
2573
|
+
"vector.edit.state": Record<string, never>;
|
|
2574
|
+
/** Vector edit tool. Chooses the tool used in vector edit mode (move, pen, bend, paint, lasso, cut, eraser, width). Params: {tool: move|pen|bend|paint|lasso|cut|eraser|width}. Reads the mode. */
|
|
2575
|
+
"vector.edit.tool": {
|
|
2576
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2577
|
+
ids?: Array<Json>;
|
|
2578
|
+
tool?: "move" | "pen" | "bend" | "paint" | "lasso" | "cut" | "eraser" | "width";
|
|
2579
|
+
};
|
|
2580
|
+
/** Select points. Selects points, segments, handles or regions in vector edit mode. Params: {vertices?: [i, ...], segments?: [i, ...], handles?: [[segment, start], ...], regions?: [i, ...] (filled regions, with their points), id? (an edited layer, made active), add?}. Acts on `id`. Reads the mode. */
|
|
2581
|
+
"vector.edit.select": {
|
|
2582
|
+
add?: boolean;
|
|
2583
|
+
handles?: Array<Array<number>>; /** an id; an edited layer, made active */
|
|
2584
|
+
id?: Json; /** [i]; filled regions, with their points */
|
|
2585
|
+
regions?: Array<number>; /** [i] */
|
|
2586
|
+
segments?: Array<number>; /** [i] */
|
|
2587
|
+
vertices?: Array<number>;
|
|
2588
|
+
};
|
|
2589
|
+
/** Select all points. Selects every point of the edited vector layers. Params: {} (in every edited layer). Reads the mode. */
|
|
2590
|
+
"vector.edit.selectAll": {
|
|
2591
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2592
|
+
ids?: Array<Json>;
|
|
2593
|
+
};
|
|
2594
|
+
/** Move points. Moves points of the edited vectors by dx, dy local units (default the selected points). Params: {vertices?, dx, dy} (local units; default the selected points of every edited layer). Reads the mode. Changes the document. */
|
|
2595
|
+
"vector.edit.moveVertices": {
|
|
2596
|
+
dx?: number;
|
|
2597
|
+
dy?: number;
|
|
2598
|
+
vertices?: Array<number>;
|
|
2599
|
+
};
|
|
2600
|
+
/** Nudge points. Nudges the selected points by dx, dy page units. Params: {dx, dy} (page units; the selected points of every edited layer). Reads the mode. Changes the document. */
|
|
2601
|
+
"vector.edit.nudge": {
|
|
2602
|
+
dx?: number;
|
|
2603
|
+
dy?: number;
|
|
2604
|
+
};
|
|
2605
|
+
/** Point position. Moves the selected points so their top-left is at x, y in the parent's coordinates. Params: {x?, y?} (the selected points' top-left, in the parent's coordinates). Reads the mode. Changes the document. */
|
|
2606
|
+
"vector.edit.position": {
|
|
2607
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2608
|
+
ids?: Array<Json>;
|
|
2609
|
+
x?: number;
|
|
2610
|
+
y?: number;
|
|
2611
|
+
};
|
|
2612
|
+
/** Set handle. Places one handle of a segment at local x, y, optionally breaking its mirroring. Params: {segment, start (bool), x, y (local), independent?}. Reads the mode. Changes the document. */
|
|
2613
|
+
"vector.edit.setHandle": {
|
|
2614
|
+
independent?: boolean;
|
|
2615
|
+
segment?: number; /** bool */
|
|
2616
|
+
start?: number;
|
|
2617
|
+
x?: number; /** local */
|
|
2618
|
+
y?: number;
|
|
2619
|
+
};
|
|
2620
|
+
/** Move handles. Moves the selected (or given) handles by dx, dy page units. Params: {dx, dy (page units), handles?: [[segment, start], ...] (default the selected handles), independent?}. Reads the mode. Changes the document. */
|
|
2621
|
+
"vector.edit.moveHandles": {
|
|
2622
|
+
dx?: number; /** page units */
|
|
2623
|
+
dy?: number; /** default the selected handles */
|
|
2624
|
+
handles?: Array<Array<number>>;
|
|
2625
|
+
independent?: boolean;
|
|
2626
|
+
};
|
|
2627
|
+
/** Handle mirroring. Sets handle mirroring (none, angle, angle and length) of points. Params: {mode: none|angle|angleAndLength, vertices?}. Reads the mode. Changes the document. */
|
|
2628
|
+
"vector.edit.mirroring": {
|
|
2629
|
+
mode?: "none" | "angle" | "angleAndLength";
|
|
2630
|
+
vertices?: Array<number>;
|
|
2631
|
+
};
|
|
2632
|
+
/** Smooth or sharpen points. Makes points smooth (or sharp corners). Params: {vertices?, smooth? (default true)}. Reads the mode. Changes the document. */
|
|
2633
|
+
"vector.edit.smooth": {
|
|
2634
|
+
smooth?: boolean;
|
|
2635
|
+
vertices?: Array<number>;
|
|
2636
|
+
};
|
|
2637
|
+
/** Bend segment. Bends a segment so its curve passes through a page point at parameter t. Params: {segment, t (0..1), x, y (page point the curve passes through)}. Reads the mode. Changes the document. */
|
|
2638
|
+
"vector.edit.bend": {
|
|
2639
|
+
segment?: number;
|
|
2640
|
+
t?: number;
|
|
2641
|
+
x?: number; /** page point the curve passes through */
|
|
2642
|
+
y?: number;
|
|
2643
|
+
};
|
|
2644
|
+
/** Add point. Adds a point on a segment at parameter t. Params: {segment, t (0..1)}. Reads the mode. Changes the document. */
|
|
2645
|
+
"vector.edit.addVertex": {
|
|
2646
|
+
segment?: number;
|
|
2647
|
+
t?: number;
|
|
2648
|
+
};
|
|
2649
|
+
/** Delete points. Deletes points and segments (default the selection) of the edited vectors. Params: {vertices?, segments?} (default the selection in every edited layer). Reads the mode. Changes the document. */
|
|
2650
|
+
"vector.edit.delete": {
|
|
2651
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2652
|
+
ids?: Array<Json>;
|
|
2653
|
+
segments?: Array<number>;
|
|
2654
|
+
vertices?: Array<number>;
|
|
2655
|
+
};
|
|
2656
|
+
/** Point corner radius. Sets the corner radius of points. Params: {radius, vertices?}. Reads the mode. Changes the document. */
|
|
2657
|
+
"vector.edit.cornerRadius": {
|
|
2658
|
+
radius?: number;
|
|
2659
|
+
vertices?: Array<number>;
|
|
2660
|
+
};
|
|
2661
|
+
/** Point stroke cap. Sets the stroke cap (round, square, arrows and more) where the stroke ends at points. Params: {cap: none|round|square|lineArrow|triangleArrow|reversedTriangle|circleFilled|diamondFilled|null (the layer's), vertices?} ? where the stroke ends at these points. Reads the mode. Changes the document. */
|
|
2662
|
+
"vector.edit.strokeCap": {
|
|
2663
|
+
cap?: Json; /** read by the command beside its listed parameters */
|
|
2664
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2665
|
+
ids?: Array<Json>;
|
|
2666
|
+
vertices?: Array<number>;
|
|
2667
|
+
};
|
|
2668
|
+
/** Point stroke join. Sets how the stroke turns (miter, bevel, round) at points. Params: {join: miter|bevel|round|null (the layer's), vertices?} ? how the stroke turns at these points. Reads the mode. Changes the document. */
|
|
2669
|
+
"vector.edit.strokeJoin": {
|
|
2670
|
+
code?: string; /** read by the command beside its listed parameters */
|
|
2671
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2672
|
+
ids?: Array<Json>;
|
|
2673
|
+
join?: Json; /** read by the command beside its listed parameters */
|
|
2674
|
+
link?: string;
|
|
2675
|
+
vertices?: Array<number>;
|
|
2676
|
+
};
|
|
2677
|
+
/** Paint bucket. Fills or unfills the closed areas under page points, as the paint bucket does. Params: {x, y} | {points: [[x, y], ...]} (page points: fills or unfills the closed area under the first, and does the same to the areas under the rest, like a drag). Reads the mode. Changes the document. */
|
|
2678
|
+
"vector.edit.paint": {
|
|
2679
|
+
points?: Array<Array<number>>; /** in one of several forms of the parameters */
|
|
2680
|
+
x?: number; /** in one of several forms of the parameters */
|
|
2681
|
+
y?: number;
|
|
2682
|
+
};
|
|
2683
|
+
/** Cut path. Cuts paths at a segment point or vertex, or along a line between two page points. Params: {segment, t?} | {vertex} | {from: [x, y], to: [x, y]} (page: cuts every path the line crosses; parts that come apart move to layers of their own). Reads the mode. Changes the document. */
|
|
2684
|
+
"vector.edit.cut": {
|
|
2685
|
+
from?: Array<number>;
|
|
2686
|
+
segment?: number;
|
|
2687
|
+
t?: number; /** in one of several forms of the parameters */
|
|
2688
|
+
to?: Array<number>; /** in one of several forms of the parameters */
|
|
2689
|
+
vertex?: Json;
|
|
2690
|
+
};
|
|
2691
|
+
/** Erase. Erases the parts of paths a brush of radius passes over along page points. Params: {points: [[x, y], ...] (page), radius? (page units, default 8)} ? removes the parts of paths the brush passes over. Reads the mode. Changes the document. */
|
|
2692
|
+
"vector.edit.erase": {
|
|
2693
|
+
points?: Array<Array<number>>; /** page units, default 8 */
|
|
2694
|
+
radius?: number;
|
|
2695
|
+
};
|
|
2696
|
+
/** Connect points. Connects two points with a straight segment. Params: {a, b} (adds a straight segment). Reads the mode. Changes the document. */
|
|
2697
|
+
"vector.edit.connect": {
|
|
2698
|
+
a?: number;
|
|
2699
|
+
b?: number;
|
|
2700
|
+
};
|
|
2701
|
+
/** Lasso select. Selects the points inside a lasso of page points. Params: {points: [[x, y], ...] (page), add?}. Reads the mode. */
|
|
2702
|
+
"vector.edit.lasso": {
|
|
2703
|
+
add?: boolean; /** page */
|
|
2704
|
+
points?: Array<Array<number>>;
|
|
2705
|
+
};
|
|
2706
|
+
/** Pen point. Adds a pen point at a page point (with a handle drag), continuing from the pen's open end. Params: {x, y (page), dx?, dy? (handle drag)} ? continues from the pen's open end; clicking a point connects to it. Reads the mode. Changes the document. */
|
|
2707
|
+
"vector.edit.pen": {
|
|
2708
|
+
dx?: number; /** handle drag */
|
|
2709
|
+
dy?: number;
|
|
2710
|
+
x?: number; /** page */
|
|
2711
|
+
y?: number;
|
|
2712
|
+
};
|
|
2713
|
+
/** End pen path. Ends the current pen path. Params: {}. Reads the mode. */
|
|
2714
|
+
"vector.edit.penEnd": Record<string, never>;
|
|
2715
|
+
/** Selected points' bounds. Answers the bounds of the selected points in the parent's coordinates and on the page. Params: {} ? {x, y (top-left in the parent's coordinates), width, height (in the vector's axes), corners (page), points}. Reads the mode. */
|
|
2716
|
+
"vector.edit.bounds": {
|
|
2717
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2718
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
2719
|
+
index?: number;
|
|
2720
|
+
};
|
|
2721
|
+
/** Resize points. Scales the selected points' box to a width and height, about its centre or top-left. Params: {width?, height?, center? (about the centre; default keeps the top-left)} ? scales the selected points' box in the vector's axes. Acts on `id`. Reads the mode. Changes the document. */
|
|
2722
|
+
"vector.edit.resize": {
|
|
2723
|
+
center?: boolean;
|
|
2724
|
+
height?: number; /** read by the command beside its listed parameters */
|
|
2725
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2726
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
2727
|
+
index?: number;
|
|
2728
|
+
width?: number;
|
|
2729
|
+
};
|
|
2730
|
+
/** Rotate points. Rotates the selected points by an angle about a page pivot (default their box centre). Params: {angle (degrees, counter-clockwise), cx?, cy? (page pivot; default the box centre)}. Reads the mode. Changes the document. */
|
|
2731
|
+
"vector.edit.rotate": {
|
|
2732
|
+
angle?: number;
|
|
2733
|
+
cx?: number; /** page pivot; default the box centre */
|
|
2734
|
+
cy?: number;
|
|
2735
|
+
};
|
|
2736
|
+
/** Transform points. Transforms points (default the selected ones) by a page-space affine matrix. Params: {matrix: [a, b, c, d, e, f] (page space), vertices? (default the selected points)}. Acts on `id`. Reads the mode. Changes the document. */
|
|
2737
|
+
"vector.edit.transform": {
|
|
2738
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2739
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
2740
|
+
index?: number; /** [a, b, c, d, e, f]; page space */
|
|
2741
|
+
matrix?: Array<number>;
|
|
2742
|
+
vertices?: Array<number>;
|
|
2743
|
+
};
|
|
2744
|
+
/** Width point. Adds, moves, resizes or removes a variable-width point on the edited path's stroke. Params: {action?: add|set|remove, index?, t? (0-1 along the path), width? (px), scale? (? stroke weight, instead of width), side?: left|right (only that side of the path changes)} ? add needs t (width defaults to the current one); set moves or resizes point `index`; with `side` only that side of the path changes (looking along it): `width` is then the distance from the centre line to that edge and `scale` that side's scale (? stroke weight, as if both sides were that wide). Reads the mode. Changes the document. */
|
|
2745
|
+
"vector.edit.widthPoint": {
|
|
2746
|
+
action?: "add" | "set" | "remove"; /** a position counted from 0 (the first is 0) */
|
|
2747
|
+
index?: number; /** ? stroke weight, instead of width */
|
|
2748
|
+
scale?: number; /** only that side of the path changes */
|
|
2749
|
+
side?: "left" | "right";
|
|
2750
|
+
t?: number;
|
|
2751
|
+
width?: number;
|
|
2752
|
+
};
|
|
2753
|
+
/** Shape builder regions. Answers the regions the shape builder sees among the selected or given layers, with their paths, sources and covering paints. Params: {ids?} ? {sources (bottom to top), regions: [{index, path (SVG, page), sources (top-most first), parts: [{id, stroke}] (the fills and outlined strokes covering it, top-most first), bounds [x, y, w, h], point [x, y] inside}]} ? visible strokes take part as their outlined areas, so stroked lines and open paths split regions. Acts on `ids`. Reads the selection. */
|
|
2754
|
+
"shapeBuilder.regions": {
|
|
2755
|
+
ids?: Array<Json>;
|
|
2756
|
+
};
|
|
2757
|
+
/** Merge regions. Merges shape builder regions (by index or page points) into one new shape styled like the top-most paint over them. Params: {ids?, regions?: [i, ...], points?: [[x, y], ...] (page)} ? {id, changed, removed, outlines, regions} ? one new shape from the regions, styled like the top-most fill or stroke over the first; the shapes lose those areas (strokes of the shapes involved become outlined vectors: `outlines`). Acts on `ids`. Reads the selection. Changes the document. */
|
|
2758
|
+
"shapeBuilder.merge": {
|
|
2759
|
+
ids?: Array<Json>; /** page */
|
|
2760
|
+
points?: Array<Array<number>>; /** [i] */
|
|
2761
|
+
regions?: Array<number>;
|
|
2762
|
+
};
|
|
2763
|
+
/** Remove regions. Removes shape builder regions (by index or page points) from the shapes and strokes covering them. Params: {ids?, regions?: [i, ...], points?: [[x, y], ...] (page)} ? {changed, removed, outlines, regions} ? the shapes (and strokes) covering the regions lose them. Acts on `ids`. Reads the selection. Changes the document. */
|
|
2764
|
+
"shapeBuilder.remove": {
|
|
2765
|
+
ids?: Array<Json>; /** page */
|
|
2766
|
+
points?: Array<Array<number>>; /** [i] */
|
|
2767
|
+
regions?: Array<number>;
|
|
2768
|
+
};
|
|
2769
|
+
/** Shape builder mode. Sets what a shape builder click does: merge or remove. Params: {mode: merge|remove} (what a click does; Alt does the other). */
|
|
2770
|
+
"shapeBuilder.mode": {
|
|
2771
|
+
mode?: "merge" | "remove";
|
|
2772
|
+
};
|
|
2773
|
+
/** Code for layer. Answers code for a layer in CSS, HTML, React, Vue, Tailwind, SwiftUI, Compose and more, with unit options. Params: {id?, language?: css|html|react|leptos|vue|tailwind|swiftui|compose|arkui (default css; html, react, leptos and vue are the whole layer tree; components take their properties as parameters, instances pass their values; a component connected to code (codeConnect.set) gives its import and snippet instead; tailwind is React with Tailwind CSS v4 utilities for pages: fluid auto layout boxes, instances inlined with their overrides, bound variables as theme utilities), mobile? (tailwind: a mobile frame with the same layer names; the code is mobile first with the desktop layer's classes behind lg:), unit?: px|rem (CSS, HTML, React, Leptos and Vue; default px), rootFontSize? (rem: pixels per rem, default 16)} ? {code, language, connected}. Acts on `id`. Reads the mode, part, selection. */
|
|
2774
|
+
"inspect.code": {
|
|
2775
|
+
id?: Json; /** default css; html, react, leptos and vue are the whole layer tree; components take their properties as parameters, instances pass their values; a component connected to code (codeConnect.set) gives its import and snippet instead; tailwind is React with Tailwind CSS v4 utilities for pages: fluid auto layout boxes, instances inlined with their overrides, bound variables as theme utilities */
|
|
2776
|
+
language?: "css" | "html" | "react" | "leptos" | "vue" | "tailwind" | "swiftui" | "compose" | "arkui";
|
|
2777
|
+
mobile?: boolean;
|
|
2778
|
+
rootFontSize?: number;
|
|
2779
|
+
unit?: "px" | "rem";
|
|
2780
|
+
};
|
|
2781
|
+
/** Ready for dev. Answers the frames and sections marked ready for dev (or changed or completed) on a page or every page. Params: {status?: readyForDev|changed|completed|any (default readyForDev; changed: ready for dev and changed since marked), page? (page id; default every page)} ? {items: [{id, name, page, status, changed}]} frames and sections by handoff status (set it with `node.set {devStatus}`). */
|
|
2782
|
+
"inspect.readyForDev": {
|
|
2783
|
+
page?: number;
|
|
2784
|
+
status?: "readyForDev" | "changed" | "completed" | "any";
|
|
2785
|
+
};
|
|
2786
|
+
/** Inspect assets. Answers the layers in and under the selection to hand over as files: those with export settings, icons and images. Params: {ids? (default the selection)} ? {assets: [{id, name, kind: export|icon|image, exports}]} the layers in and under them to hand over as files: those with export settings, icons (small, vector shapes only; SVG) and images (PNG). Export them with `file.exportLayers {assets: true}`. Acts on `ids`. Reads the selection. */
|
|
2787
|
+
"inspect.assets": {
|
|
2788
|
+
ids?: Array<Json>;
|
|
2789
|
+
};
|
|
2790
|
+
/** Inspect properties. Answers a layer's inspect properties (layout, auto layout, typography, fills, strokes, effects) as sections of rows. Params: {id?, colorFormat?: hex|rgb|css|hsl|hsb (default hex)} ? {sections: [{title, rows: [{label, value, color?, token?}]}]} layout (positions from the frame around the layer), auto layout, typography, fills, strokes and effects, with style and variable names. Acts on `id`. Reads the selection. */
|
|
2791
|
+
"inspect.properties": {
|
|
2792
|
+
colorFormat?: "hex" | "rgb" | "css" | "hsl" | "hsb"; /** an id */
|
|
2793
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2794
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
2795
|
+
target?: string;
|
|
2796
|
+
};
|
|
2797
|
+
/** Component code. Answers a component's code in a language with its properties as parameters. Params: {id? (component, set or instance; default the selection), language?: react|leptos|vue|swiftui|compose|arkui (default react)} ? {component, name, set, properties: [{name, param, type, default, value? (instances)}], definition, usage? (instances; the connected snippet when the component is connected to code), connected: {importPath, name, template, import, code} | null}. Acts on `id`. Reads the mode, part, selection. */
|
|
2798
|
+
"inspect.componentCode": {
|
|
2799
|
+
id?: Json; /** default react */
|
|
2800
|
+
language?: "react" | "leptos" | "vue" | "swiftui" | "compose" | "arkui";
|
|
2801
|
+
};
|
|
2802
|
+
/** Component playground. Answers what a component looks like and its code for given property values, without changing the design. Params: {id? (an instance, a component or a component set; default the selection), properties? {name: value} (variant, boolean, text and instance-swap properties, as instance.setProperties takes them), language? css|html|react|leptos|vue|swiftui|compose|arkui (default react), path? (write the preview there as a PNG), scale? (the PNG's, default 2)} ? {component, properties: [{name, type, options?, value}], language, code, width, height, path?} the component with those property values, tried on a copy: its code and its look. Nothing in the document changes. Acts on `id`. Reads the mode, part, selection. */
|
|
2803
|
+
"component.playground": {
|
|
2804
|
+
id?: Json; /** the PNG's, default 2 */
|
|
2805
|
+
scale?: number;
|
|
2806
|
+
};
|
|
2807
|
+
/** Connect to code. Connects a component to code in a language: import path, name and call template. Params: {id? (component, set or instance; default the selection), language?: react|leptos|vue|swiftui|compose|arkui (default react), importPath?, name? (default the generated name), template? (default a call passing every property)} links the component (its set, for a variant) to its code component; fields left out keep their current value. Placeholders: {property} (its name or parameter name) and {property ? "a" : "b"}; other {...} stay as written ? {component, language, code (the snippet for the layer), unknown (placeholder names that aren't properties)}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2808
|
+
"codeConnect.set": {
|
|
2809
|
+
id?: Json;
|
|
2810
|
+
importPath?: string; /** default react */
|
|
2811
|
+
language?: "react" | "leptos" | "vue" | "swiftui" | "compose" | "arkui"; /** default the generated name */
|
|
2812
|
+
name?: string;
|
|
2813
|
+
template?: string;
|
|
2814
|
+
};
|
|
2815
|
+
/** Disconnect from code. Removes a component's code connection for a language (or all). Params: {id? (component, set or instance; default the selection), language? (omit: every language)} ? {component, removed}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2816
|
+
"codeConnect.remove": {
|
|
2817
|
+
id?: Json;
|
|
2818
|
+
language?: "react" | "leptos" | "vue" | "swiftui" | "compose" | "arkui";
|
|
2819
|
+
};
|
|
2820
|
+
/** Export code connections. Answers (or writes) every component's code connections as a connect JSON file. Params: {path? (write it there, e.g. kition-design.connect.json in the code repository)} every component's links as {version: 1, links: [{component (its name), language, importPath, name, template}]}, sorted ? {text, links} or {path, links}. */
|
|
2821
|
+
"codeConnect.export": Record<string, never>;
|
|
2822
|
+
/** Import code connections. Imports code connections from connect JSON, linking each entry to components of that name. Params: {json (the connect JSON as codeConnect.export writes it: an object or JSON text) | path (a kition-design.connect.json)} links each entry to every component or set of that name (replacing its link for the language); invalid entries and unknown components are skipped with a warning ? {linked, warnings}. Changes the document. */
|
|
2823
|
+
"codeConnect.import": {
|
|
2824
|
+
json?: Json;
|
|
2825
|
+
};
|
|
2826
|
+
/** Add annotation. Adds a developer annotation to a layer with a note, pinned properties and a category. Params: {id? (default the first selected layer), label? (the note), properties?: [width|height|top|left|rotation|opacity|cornerRadius|direction|gap|padding|alignment|fontFamily|fontStyle|fontSize|lineHeight|letterSpacing|textAlign|fill|stroke|strokeWeight|effects], category? (id or name)} ? {id, index} (a note, pinned properties or both). Acts on `id`. Reads the selection. Changes the document. */
|
|
2827
|
+
"annotation.add": {
|
|
2828
|
+
category?: string; /** an id; default the first selected layer */
|
|
2829
|
+
id?: Json; /** the note */
|
|
2830
|
+
label?: string;
|
|
2831
|
+
properties?: Array<"width" | "height" | "top" | "left" | "rotation" | "opacity" | "cornerRadius" | "direction" | "gap" | "padding" | "alignment" | "fontFamily" | "fontStyle" | "fontSize" | "lineHeight" | "letterSpacing" | "textAlign" | "fill" | "stroke" | "strokeWeight" | "effects">;
|
|
2832
|
+
};
|
|
2833
|
+
/** Edit annotation. Edits a layer's annotation at index: its note, pinned properties or category. Params: {id?, index, label?, properties?: [..] (replaces the pinned properties), category? (id or name; null: none)}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2834
|
+
"annotation.edit": {
|
|
2835
|
+
category?: Json; /** an id */
|
|
2836
|
+
id?: Json; /** a position counted from 0 (the first is 0) */
|
|
2837
|
+
index?: number;
|
|
2838
|
+
label?: string; /** [..] (replaces the pinned properties); replaces the pinned properties */
|
|
2839
|
+
properties?: Array<Json>;
|
|
2840
|
+
};
|
|
2841
|
+
/** Remove annotation. Removes one or every annotation from a layer. Params: {id?, index? (omit: every annotation on the layer)}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2842
|
+
"annotation.remove": {
|
|
2843
|
+
id?: Json; /** a position counted from 0 (the first is 0); omit: every annotation on the layer */
|
|
2844
|
+
index?: number;
|
|
2845
|
+
};
|
|
2846
|
+
/** List annotations. Answers the annotations on layers or a page, optionally of one category. Params: {ids? | id? (those layers), page? (page id, or "all"; default the current page), category? (id or name, or "none": only those)} ? {annotations: [{id, name, index, label, category?: {id, name, color}, properties: [{property, label, value (null when the layer has none), token?, color?}]}]}. Acts on `ids`. Reads the mode, part, selection. */
|
|
2847
|
+
"annotation.list": {
|
|
2848
|
+
assets?: boolean;
|
|
2849
|
+
category?: string; /** an id; those layers; one of several alternative parameters */
|
|
2850
|
+
id?: Json; /** those layers; one of several alternative parameters */
|
|
2851
|
+
ids?: Array<Json>; /** page id, or "all"; default the current page */
|
|
2852
|
+
page?: number; /** read by the command beside its listed parameters */
|
|
2853
|
+
query?: string; /** read by the command beside its listed parameters */
|
|
2854
|
+
server?: string;
|
|
2855
|
+
};
|
|
2856
|
+
/** Annotation categories. Answers the annotation categories with their colours and use counts. Params: {} ? {categories: [{id, name, color, count (annotations in it, every page)}]}. */
|
|
2857
|
+
"annotation.categories": Record<string, never>;
|
|
2858
|
+
/** Add annotation category. Adds an annotation category with a name and colour; answers its id. Params: {name, color? (default the first unused colour)} ? {id}. Changes the document. */
|
|
2859
|
+
"annotation.addCategory": {
|
|
2860
|
+
color?: string;
|
|
2861
|
+
name?: string;
|
|
2862
|
+
};
|
|
2863
|
+
/** Edit annotation category. Renames or recolours an annotation category. Params: {id (id or name), name?, color?} (rename and/or recolour). Changes the document. */
|
|
2864
|
+
"annotation.editCategory": {
|
|
2865
|
+
assets?: boolean;
|
|
2866
|
+
color?: string; /** an id; id or name */
|
|
2867
|
+
id?: Json;
|
|
2868
|
+
name?: string; /** read by the command beside its listed parameters */
|
|
2869
|
+
page?: string; /** read by the command beside its listed parameters */
|
|
2870
|
+
query?: string; /** read by the command beside its listed parameters */
|
|
2871
|
+
server?: string;
|
|
2872
|
+
};
|
|
2873
|
+
/** Delete annotation category. Deletes an annotation category; its annotations stay uncategorised. Params: {id (id or name)} ? {id, uncategorized (how many annotations were in it)} (its annotations stay, without a category). Changes the document. */
|
|
2874
|
+
"annotation.removeCategory": {
|
|
2875
|
+
assets?: boolean; /** an id; id or name */
|
|
2876
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2877
|
+
page?: string; /** read by the command beside its listed parameters */
|
|
2878
|
+
query?: string; /** read by the command beside its listed parameters */
|
|
2879
|
+
server?: string;
|
|
2880
|
+
};
|
|
2881
|
+
/** Add dev resource. Adds a developer link (URL and name) to a layer; answers its index. Params: {id? (default the first selected layer), url (http or https), name? (default the URL without its scheme)} a link for developers on the layer; an instance also shows its main component's ? {id, index}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2882
|
+
"devResource.add": {
|
|
2883
|
+
id?: Json; /** default the URL without its scheme */
|
|
2884
|
+
name?: string; /** http or https */
|
|
2885
|
+
url?: string;
|
|
2886
|
+
};
|
|
2887
|
+
/** Edit dev resource. Edits a layer's own developer link at index. Params: {id?, index (of the layer's own), url?, name?} ? {id, index}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2888
|
+
"devResource.edit": {
|
|
2889
|
+
id?: Json; /** a position counted from 0 (the first is 0); of the layer's own */
|
|
2890
|
+
index?: number;
|
|
2891
|
+
name?: string;
|
|
2892
|
+
url?: string;
|
|
2893
|
+
};
|
|
2894
|
+
/** Remove dev resource. Removes one or every developer link of a layer's own. Params: {id?, index? (omit: every dev resource of the layer's own)} ? {removed}. Acts on `id`. Reads the selection. Changes the document. */
|
|
2895
|
+
"devResource.remove": {
|
|
2896
|
+
id?: Json; /** a position counted from 0 (the first is 0); omit: every dev resource of the layer's own */
|
|
2897
|
+
index?: number;
|
|
2898
|
+
};
|
|
2899
|
+
/** List dev resources. Answers a layer's developer links, its own first, then those inherited from its main component. Params: {id? (default the first selected layer)} the layer's links, its own first, then inherited from its main component and that component's set ? [{name, url, index? (own), from? (the layer it comes from)}]. Acts on `id`. Reads the selection. */
|
|
2900
|
+
"devResource.list": {
|
|
2901
|
+
id?: Json;
|
|
2902
|
+
};
|
|
2903
|
+
/** Add measurement. Keeps a measurement on the canvas between two layers or across one side of a layer. Params: {from? (default the first selected layer), to? (a layer on the same page), side? (top|right|bottom|left)} keeps a measurement on the canvas: between `from` and `to`, across one side of `from`, or (neither) to the layer around it; Dev Mode draws it and it follows the layers ? {from, index, lines}. Reads the selection. Changes the document. */
|
|
2904
|
+
"devMode.addMeasurement": {
|
|
2905
|
+
from?: Json;
|
|
2906
|
+
side?: "top" | "right" | "bottom" | "left"; /** an id (a number, or its digits as text) */
|
|
2907
|
+
to?: Json;
|
|
2908
|
+
};
|
|
2909
|
+
/** Remove measurement. Removes one or every kept measurement starting from a layer. Params: {from? (default the first selected layer), index? (omit: every measurement starting from the layer)} ? {removed}. Reads the selection. Changes the document. */
|
|
2910
|
+
"devMode.removeMeasurement": {
|
|
2911
|
+
from?: Json; /** read by the command beside its listed parameters */
|
|
2912
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2913
|
+
ids?: Array<Json>; /** a position counted from 0 (the first is 0); omit: every measurement starting from the layer */
|
|
2914
|
+
index?: number;
|
|
2915
|
+
};
|
|
2916
|
+
/** List measurements. Answers the kept measurements on a page, with their lines and labels. Params: {page? (default the current page), id? (only those from or to this layer)} ? [{from, fromName, index, to?, toName?, side?, labels, lines: [{x0, y0, x1, y1, label, dashed}]}] (page space). Acts on `id`. Reads the part. */
|
|
2917
|
+
"devMode.measurements": {
|
|
2918
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2919
|
+
ids?: Array<Json>; /** default the current page */
|
|
2920
|
+
page?: number;
|
|
2921
|
+
};
|
|
2922
|
+
/** Measure distances. Answers the distance lines from the selection to another layer (default its parent), as Alt-hover shows. Params: {ids? (default selection), to? (layer id; default the parent)} ? {lines: [{x0, y0, x1, y1, label, dashed}]} (page space; what Alt-hover shows). Acts on `ids`. Reads the part, selection. */
|
|
2923
|
+
"measure.distances": {
|
|
2924
|
+
id?: Json; /** default selection */
|
|
2925
|
+
ids?: Array<Json>; /** an id (a number, or its digits as text) */
|
|
2926
|
+
to?: Json;
|
|
2927
|
+
};
|
|
2928
|
+
/** Measure auto layout padding. Answers the padding and gap lines of an auto layout frame, as Shift+Alt-hover shows. Params: {id? (an auto layout frame or a child; default the selection)} ? {frame, lines} (padding and gaps; what Shift+Alt-hover shows). Acts on `id`. Reads the selection. */
|
|
2929
|
+
"measure.padding": {
|
|
2930
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2931
|
+
ids?: Array<Json>;
|
|
2932
|
+
};
|
|
2933
|
+
/** List branches. Answers the file's branches, oldest first, with their names, times and states. Params: {} the branches of the file shown (or of the file a branch tab belongs to), oldest first ? [{id, name, time (Unix seconds), state: active|merged|archived, index? (its open tab)}]. */
|
|
2934
|
+
"branch.list": Record<string, never>;
|
|
2935
|
+
/** Update from main. Brings the main file's changes since the branch was made into the branch, with conflict resolutions. Params: {id?, resolutions? ({<conflict key>: "branch" | "main"})} bring the main file's changes since the branch was made into the branch (a version in its history); refused while a conflict has no resolution. Not undoable (the branch tab's undo history starts over) ? {updated, changes, conflicts}. Changes the document. */
|
|
2936
|
+
"branch.updateFromMain": {
|
|
2937
|
+
id?: string;
|
|
2938
|
+
resolutions?: {
|
|
2939
|
+
[key: string]: Json;
|
|
2940
|
+
};
|
|
2941
|
+
};
|
|
2942
|
+
/** Merge branch. Merges the branch into the main file as one undo step, with conflict resolutions, then archives it. Params: {id?, resolutions? ({<conflict key>: "branch" | "main"})} merge the branch into the main file as one undo step (in a live session one edit everyone gets; refused on a view link), then archive it and show the main file; refused while a conflict has no resolution ? {merged, changes, conflicts, index}. Changes the document. */
|
|
2943
|
+
"branch.merge": {
|
|
2944
|
+
id?: string;
|
|
2945
|
+
resolutions?: {
|
|
2946
|
+
[key: string]: Json;
|
|
2947
|
+
};
|
|
2948
|
+
};
|
|
2949
|
+
/** Archive branch. Sets a branch aside without merging and closes its tab. Params: {id?} set the branch aside without merging (it stays in the file and can still be opened) and close its tab. Changes the document. */
|
|
2950
|
+
"branch.archive": {
|
|
2951
|
+
id?: string;
|
|
2952
|
+
};
|
|
2953
|
+
/** Insert widget. Inserts a widget drawn by a widget plugin at x, y; answers its state and output. Params: {plugin (a widget plugin's id), x?, y? (top-left; default: centred in the view), fuel?} the plugin draws it; one undo step ? {id, plugin, state, targets, output, logs, calls, fuel}. Reads the mode, part, selection. Changes the document. */
|
|
2954
|
+
"widget.insert": {
|
|
2955
|
+
fuel?: number;
|
|
2956
|
+
plugin?: string;
|
|
2957
|
+
x?: number; /** top-left; default: centred in the view */
|
|
2958
|
+
y?: number;
|
|
2959
|
+
};
|
|
2960
|
+
/** Click widget. Clicks a target of a widget so its plugin redraws it. Params: {id (a widget or a layer in one), target (see widget.list), fuel?} calls the widget's plugin back, which redraws it; one undo step ? like widget.insert. Acts on `id`. Reads the mode, part, selection. Changes the document. */
|
|
2961
|
+
"widget.click": {
|
|
2962
|
+
fuel?: number; /** an id; a widget or a layer in one */
|
|
2963
|
+
id?: Json; /** an id (a number, or its digits as text) */
|
|
2964
|
+
target?: Json;
|
|
2965
|
+
};
|
|
2966
|
+
/** Edit widget field. Types a value into an editable field of a widget. Params: {id (a widget or a layer in one), field (see widget.list), value (text, up to 1000 characters), fuel?} sets an editable field as typing in it would: the value goes into the state under the field's name and the plugin is called back; one undo step ? like widget.insert. Acts on `id`. Reads the mode, part, selection. Changes the document. */
|
|
2967
|
+
"widget.setText": {
|
|
2968
|
+
field?: string;
|
|
2969
|
+
fuel?: number; /** an id; a widget or a layer in one */
|
|
2970
|
+
id?: Json;
|
|
2971
|
+
value?: string;
|
|
2972
|
+
};
|
|
2973
|
+
/** Widget menu. Picks an item (toggle or colour) from a widget's property menu. Params: {id (a widget or a layer in one), item (see widget.list), value? (a toggle: on or off, default the opposite of now; a colour: one of its options), fuel?} picks an item of the widget's property menu: the plugin is called back; one undo step ? like widget.insert. Acts on `id`. Reads the mode, part, selection. Changes the document. */
|
|
2974
|
+
"widget.menu": {
|
|
2975
|
+
fuel?: number; /** an id; a widget or a layer in one */
|
|
2976
|
+
id?: Json; /** see widget.list */
|
|
2977
|
+
item?: number;
|
|
2978
|
+
value?: Json;
|
|
2979
|
+
};
|
|
2980
|
+
/** List widgets. Answers the widgets in the file with their plugin, state, targets, fields and menu. Params: {} ? {widgets: [{id, plugin, name, page, state, targets, fields, menu}]}. */
|
|
2981
|
+
"widget.list": {
|
|
2982
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
2983
|
+
ids?: Array<Json>; /** read by the command beside its listed parameters */
|
|
2984
|
+
item?: string; /** read by the command beside its listed parameters */
|
|
2985
|
+
value?: string;
|
|
2986
|
+
};
|
|
2987
|
+
/** Fill copies with data. Repeats a frame once per data row, filling named text layers, fills and visibility from each row. Params: {id (the frame to repeat), rows: [{<layer name>: text | {text?, fill? (#rrggbb), visible?, fit? (true or text.fit's {maxLines?, minSize?, orphans?}: size the text to its box)}, name? (the copy's name)}] (every layer with that name in the copy; up to 500 rows), gap? (between copies, placed in a row to the right; default 100), formats? ([{name?, width, height}]: each row once per size, the copy resized so its auto layout reflows and named <name>-<format name>; e.g. feed 1080?1350, story 1080?1920, square 1080?1080), dir? (export each copy there as <name>.<format>), format? (png|jpg|webp|svg|pdf; default png), scale? (default 1)} one undo step ? {ids (the copies, in row order), missing (keys no layer is named), files? (paths written, one per copy: same file names get a numbered suffix), errors? ([{id, path, error}] for exports that failed; the copies stay)}. Acts on `id`. Changes the document. */
|
|
2988
|
+
"data.fill": {
|
|
2989
|
+
dir?: "right" | "down";
|
|
2990
|
+
format?: {
|
|
2991
|
+
[key: string]: Json;
|
|
2992
|
+
};
|
|
2993
|
+
formats?: {
|
|
2994
|
+
[key: string]: Json;
|
|
2995
|
+
};
|
|
2996
|
+
gap?: number; /** an id; the frame to repeat */
|
|
2997
|
+
id?: Json; /** #rrggbb; true or text.fit's {maxLines?, minSize?, orphans?}: size the text to its box; the copy's name; every layer with that name in the copy; up to 500 rows */
|
|
2998
|
+
rows?: Array<{
|
|
2999
|
+
name?: string;
|
|
3000
|
+
}>; /** default 1 */
|
|
3001
|
+
scale?: number;
|
|
3002
|
+
};
|
|
3003
|
+
/** Fit text to its box. Shrinks the font of text layers so their text fits the box, within a minimum size and line limit. Params: {ids? (text layers; default the selection), maxLines? (default: no limit but the box height), minSize? (smallest font size, px; default 60% of the current), orphans? (avoid a one-word last line; default true)} needs a fixed width (fixed or auto-height text) ? {fitted: [{id, fontSize, lines, fits, orphan}]}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
3004
|
+
"text.fit": {
|
|
3005
|
+
ids?: Array<Json>;
|
|
3006
|
+
maxLines?: number;
|
|
3007
|
+
minSize?: number;
|
|
3008
|
+
orphans?: boolean;
|
|
3009
|
+
};
|
|
3010
|
+
/** Sticky note. Adds a sticky note with text and colour on a board; answers its id. Params: {x, y (its top-left, in the parent), text?, color? (yellow|orange|red|pink|violet|blue|green|gray or hex; default the sticky tool's), author? (a name, or false for none; default yours), parent?} ? {id, text}. Reads the mode, part. Changes the document. */
|
|
3011
|
+
"board.sticky": {
|
|
3012
|
+
author?: Json; /** yellow|orange|red|pink|violet|blue|green|gray or hex; default the sticky tool's */
|
|
3013
|
+
color?: string; /** read by the command beside its listed parameters */
|
|
3014
|
+
id?: Json; /** an id (a number, or its digits as text) */
|
|
3015
|
+
parent?: Json;
|
|
3016
|
+
text?: string;
|
|
3017
|
+
x?: number; /** its top-left, in the parent */
|
|
3018
|
+
y?: number;
|
|
3019
|
+
};
|
|
3020
|
+
/** Next sticky note. Adds a sticky of the same colour beside another (right, below, left or above). Params: {id? (a sticky; default the selected or edited one), side?: right|below|left|above (default right), edit? (start typing in it; default false)} ? {id, text} a sticky of the same colour beside it. Acts on `id`. Reads the mode, selection. Changes the document. */
|
|
3021
|
+
"board.nextSticky": {
|
|
3022
|
+
edit?: boolean; /** an id; a sticky; default the selected or edited one */
|
|
3023
|
+
id?: Json; /** default right */
|
|
3024
|
+
side?: "right" | "below" | "left" | "above";
|
|
3025
|
+
};
|
|
3026
|
+
/** Shape with text. Adds a shape with text (rectangle, ellipse, diamond, speech bubble and more) on a board. Params: {shape: rectangle|roundedRectangle|ellipse|diamond|triangle|speechBubble|chevron, x, y, width?, height? (default 160), text?, color?, parent?} ? {id, text}. Reads the mode, part. Changes the document. */
|
|
3027
|
+
"board.shape": {
|
|
3028
|
+
color?: string; /** default 160 */
|
|
3029
|
+
height?: number; /** read by the command beside its listed parameters */
|
|
3030
|
+
id?: Json; /** an id (a number, or its digits as text) */
|
|
3031
|
+
parent?: Json;
|
|
3032
|
+
shape?: "rectangle" | "roundedRectangle" | "ellipse" | "diamond" | "triangle" | "speechBubble" | "chevron";
|
|
3033
|
+
text?: string;
|
|
3034
|
+
width?: number;
|
|
3035
|
+
x?: number;
|
|
3036
|
+
y?: number;
|
|
3037
|
+
};
|
|
3038
|
+
/** Connector. Connects two layers or page points with a straight, elbow or curved connector with caps. Params: {from, to (each a layer id or {x, y} on the page), fromSide?, toSide? (auto|top|right|bottom|left), style?: straight|elbow|curved, startCap?, endCap? (none|lineArrow|triangleArrow|circleFilled|diamondFilled...; default an arrow at the end), label?} ? {id, label?} a line that follows the layers it joins. Acts on `id`. Reads the mode, part. Changes the document. */
|
|
3039
|
+
"board.connector": {
|
|
3040
|
+
endCap?: string;
|
|
3041
|
+
from?: Json;
|
|
3042
|
+
fromSide?: "auto" | "top" | "right" | "bottom" | "left"; /** read by the command beside its listed parameters */
|
|
3043
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
3044
|
+
ids?: Array<Json>;
|
|
3045
|
+
label?: string;
|
|
3046
|
+
startCap?: string;
|
|
3047
|
+
style?: "straight" | "elbow" | "curved";
|
|
3048
|
+
to?: Json;
|
|
3049
|
+
toSide?: "auto" | "top" | "right" | "bottom" | "left";
|
|
3050
|
+
};
|
|
3051
|
+
/** Reattach connector. Moves one end of a connector to another layer or a free page point. Params: {id? (a connector; default the selection), end: from|to, target (a layer id, or {x, y} on the page to leave the end free), side? (auto|top|right|bottom|left)} ? {id} moves one end of a connector. Acts on `id`. Reads the selection. Changes the document. */
|
|
3052
|
+
"board.reattach": {
|
|
3053
|
+
end?: "from" | "to"; /** an id; a connector; default the selection */
|
|
3054
|
+
id?: Json;
|
|
3055
|
+
side?: "auto" | "top" | "right" | "bottom" | "left";
|
|
3056
|
+
target?: Json;
|
|
3057
|
+
};
|
|
3058
|
+
/** Connector label. Sets (or removes) a connector's label text. Params: {id (a connector; default the selection), text (empty removes it)} ? {id, label}. Acts on `id`. Reads the selection. Changes the document. */
|
|
3059
|
+
"board.label": {
|
|
3060
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
3061
|
+
ids?: Array<Json>; /** empty removes it */
|
|
3062
|
+
text?: string;
|
|
3063
|
+
};
|
|
3064
|
+
/** Stamp. Places a stamp badge (thumbs up, heart, +1, star, question, check) on a board. Params: {x, y (its centre on the page), stamp: thumbsUp|heart|plusOne|star|question|check} ? {id} a badge with your name on hover. Reads the mode, part. Changes the document. */
|
|
3065
|
+
"board.stamp": {
|
|
3066
|
+
id?: Json;
|
|
3067
|
+
stamp?: "thumbsUp" | "heart" | "plusOne" | "star" | "question" | "check";
|
|
3068
|
+
x?: number; /** its centre on the page */
|
|
3069
|
+
y?: number;
|
|
3070
|
+
};
|
|
3071
|
+
/** Marker stroke. Draws a marker or highlighter stroke from SVG path data or points on a board. Params: {path? (SVG path data on the page), points?: [[x,y]] (instead of path), highlighter? (wide and see-through), color?, select? (default true)} ? {id}. Reads the mode, part. Changes the document. */
|
|
3072
|
+
"board.ink": {
|
|
3073
|
+
color?: string;
|
|
3074
|
+
highlighter?: boolean;
|
|
3075
|
+
path?: string; /** instead of path */
|
|
3076
|
+
points?: Array<Array<number>>;
|
|
3077
|
+
select?: boolean;
|
|
3078
|
+
};
|
|
3079
|
+
/** Board color. Sets the board colour of stickies, shapes, connectors and ink. Params: {ids?, color (a board colour name or hex)} stickies and shapes take it as their fill, connectors and ink as their line. Acts on `ids`. Reads the selection. Changes the document. */
|
|
3080
|
+
"board.setColor": {
|
|
3081
|
+
color?: string;
|
|
3082
|
+
ids?: Array<Json>;
|
|
3083
|
+
};
|
|
3084
|
+
/** Board style. Sets board styles: shape kind and font size of shapes, connector style and caps. Params: {ids?, shape? (shapes with text), fontSize? (their text), style?: straight|elbow|curved, startCap?, endCap? (connectors)}. Acts on `ids`. Reads the selection. Changes the document. */
|
|
3085
|
+
"board.setStyle": {
|
|
3086
|
+
endCap?: string;
|
|
3087
|
+
fontSize?: number; /** read by the command beside its listed parameters */
|
|
3088
|
+
id?: Json;
|
|
3089
|
+
ids?: Array<Json>;
|
|
3090
|
+
shape?: string;
|
|
3091
|
+
startCap?: string;
|
|
3092
|
+
style?: "straight" | "elbow" | "curved"; /** read by the command beside its listed parameters */
|
|
3093
|
+
text?: string;
|
|
3094
|
+
};
|
|
3095
|
+
/** Sticky note. Chooses the sticky note tool; use board.sticky to add one directly. Params: {color?} (a click places a sticky and starts typing in it). Reads the mode. */
|
|
3096
|
+
"tool.sticky": {
|
|
3097
|
+
color?: string; /** read by the command beside its listed parameters */
|
|
3098
|
+
id?: Json; /** read by the command beside its listed parameters */
|
|
3099
|
+
target?: string;
|
|
3100
|
+
};
|
|
3101
|
+
/** Shapes. Chooses the board shape tool; use board.shape to add one directly. Params: {shape?} (a click places a shape with text). Reads the mode. */
|
|
3102
|
+
"tool.shape": {
|
|
3103
|
+
id?: Json;
|
|
3104
|
+
shape?: string; /** read by the command beside its listed parameters */
|
|
3105
|
+
target?: string; /** read by the command beside its listed parameters */
|
|
3106
|
+
text?: string;
|
|
3107
|
+
};
|
|
3108
|
+
/** Connector. Chooses the connector tool; use board.connector to connect directly. Params: {style?: straight|elbow|curved} (drag from one object to another). Reads the mode. */
|
|
3109
|
+
"tool.connector": {
|
|
3110
|
+
style?: "straight" | "elbow" | "curved";
|
|
3111
|
+
};
|
|
3112
|
+
/** Marker. Chooses the marker tool; use board.ink to draw directly. Params: {color?}. Reads the mode. */
|
|
3113
|
+
"tool.marker": {
|
|
3114
|
+
color?: string;
|
|
3115
|
+
};
|
|
3116
|
+
/** Highlighter. Chooses the highlighter tool; use board.ink with highlighter to draw directly. Params: {color?}. Reads the mode. */
|
|
3117
|
+
"tool.highlighter": {
|
|
3118
|
+
color?: string;
|
|
3119
|
+
};
|
|
3120
|
+
/** Eraser. Chooses the board eraser that removes marker and highlighter strokes. Params: {} (drag over marker and highlighter strokes to remove them). Reads the mode. */
|
|
3121
|
+
"tool.eraser": Record<string, never>;
|
|
3122
|
+
/** Stamp. Chooses the stamp tool; use board.stamp to place one directly. Params: {stamp?} (a click places the stamp). Reads the mode. */
|
|
3123
|
+
"tool.stamp": {
|
|
3124
|
+
id?: Json;
|
|
3125
|
+
stamp?: string; /** read by the command beside its listed parameters */
|
|
3126
|
+
target?: string;
|
|
3127
|
+
};
|
|
3128
|
+
/** Timer. Starts, pauses, resumes, extends or stops the board's countdown timer; answers its state. Params: {action: start|pause|resume|add|stop, minutes? (start: default 5; add: default 1; up to 1440)} ? the timer's state (as board.timerState) one countdown per board, the same for everyone in a live session. Changes the document. */
|
|
3129
|
+
"board.timer": {
|
|
3130
|
+
action?: "start" | "pause" | "resume" | "add" | "stop";
|
|
3131
|
+
minutes?: number;
|
|
3132
|
+
};
|
|
3133
|
+
/** Timer state. Answers the board timer's state and time left. Params: {} ? {state: off|running|paused|done, left (ms), text (m:ss), ends? (ms since 1970, while running)}. */
|
|
3134
|
+
"board.timerState": {
|
|
3135
|
+
text?: string;
|
|
3136
|
+
};
|
|
3137
|
+
/** Voting session. Runs a voting session: starts it, casts or retracts a vote, ends or clears it. Params: {action: start|cast|retract|end|clear, votes? (start: per person, 1?99, default 3), on? (start: all|stickies|selection; default all), ids? (start with on: selection; default the selection), id (cast, retract: the object), voter? (default you)} ? the vote's state (as board.voteResults) one vote at a time; others' votes show once it ends. Acts on `ids`. Reads the mode, selection. Changes the document. */
|
|
3138
|
+
"board.vote": {
|
|
3139
|
+
action?: "start" | "cast" | "retract" | "end" | "clear"; /** an id; cast, retract: the object */
|
|
3140
|
+
id?: Json; /** start with on: selection; default the selection */
|
|
3141
|
+
ids?: Array<Json>;
|
|
3142
|
+
on?: "all" | "stickies" | "selection";
|
|
3143
|
+
voter?: string;
|
|
3144
|
+
votes?: number;
|
|
3145
|
+
};
|
|
3146
|
+
/** Voting results. Answers the voting session's state, your votes and, once ended, the ranked results. Params: {voter?} ? {state: off|running|ended, votesPerPerson, on, by, left (your votes left), mine [{id, votes}], voters, results? [{id, name, votes, rank}] (once ended, most votes first)}. Reads the mode. */
|
|
3147
|
+
"board.voteResults": {
|
|
3148
|
+
id?: Json;
|
|
3149
|
+
voter?: string;
|
|
3150
|
+
};
|
|
3151
|
+
/** Table. Adds a table of rows and columns (optionally filled from cells) on a board. Params: {rows?, columns? (default 3 ? 3, or the size of `cells`; at most 50 ? 20), cells? ([[text...]...] row by row), x?, y? (its top-left on the page; default centred in the view)} ? {id, rows, columns, cells: [[text id...]...]}. Reads the mode, part. Changes the document. */
|
|
3152
|
+
"board.table": {
|
|
3153
|
+
cells?: Array<Array<Json>>; /** default 3 ? 3, or the size of `cells`; at most 50 ? 20 */
|
|
3154
|
+
columns?: number;
|
|
3155
|
+
rows?: number;
|
|
3156
|
+
x?: number; /** its top-left on the page; default centred in the view */
|
|
3157
|
+
y?: number;
|
|
3158
|
+
};
|
|
3159
|
+
/** Edit table. Adds or removes a row or column of a board table. Params: {id? (a table or a layer in one; default the selection), action: addRow|addColumn|removeRow|removeColumn, index? (where the new one goes, or which one goes; default the last)} ? {id, rows, columns, cells}. Acts on `id`. Reads the selection. Changes the document. */
|
|
3160
|
+
"board.tableEdit": {
|
|
3161
|
+
action?: "addRow" | "addColumn" | "removeRow" | "removeColumn"; /** an id; a table or a layer in one; default the selection */
|
|
3162
|
+
id?: Json; /** a position counted from 0 (the first is 0); where the new one goes, or which one goes; default the last */
|
|
3163
|
+
index?: number;
|
|
3164
|
+
};
|
|
3165
|
+
/** Board template. Places a board template's sections, stickies, shapes and connectors; answers the ids. Params: {name (a template id from board.templates), x?, y? (its top-left on the page; default centred in the view)} ? {name, ids} its sections, stickies, shapes, connectors and text, selected. Reads the mode, part. Changes the document. */
|
|
3166
|
+
"board.template": {
|
|
3167
|
+
id?: Json; /** a template id from board.templates */
|
|
3168
|
+
name?: string; /** read by the command beside its listed parameters */
|
|
3169
|
+
text?: string;
|
|
3170
|
+
x?: number; /** its top-left on the page; default centred in the view */
|
|
3171
|
+
y?: number;
|
|
3172
|
+
};
|
|
3173
|
+
/** List board templates. Answers the board templates with their names, descriptions and sizes. Params: {} ? [{id, name, description, width, height}]. */
|
|
3174
|
+
"board.templates": {
|
|
3175
|
+
id?: Json;
|
|
3176
|
+
};
|
|
3177
|
+
/** Go to page. Makes a page the current one, by its id or its index, as clicking it in the Pages list does; answers its id, index and name. Agents name the page a step acts on with `at.part` instead, which goes there for that step only. Params: {id? (page id) | index? (from 0)} ? {id, index, name}. */
|
|
3178
|
+
"page.go": {
|
|
3179
|
+
id?: Json; /** The page to go to, counted from 0 (its `index` in inspect's `pages`). */
|
|
3180
|
+
index?: number;
|
|
3181
|
+
};
|
|
3182
|
+
/** List page layers. Lists the layers of any page (by id or index), or one layer and the layers in it (by its id), without going to that page: each with its id, name, type, `index` (its place among its siblings, 0 the first child: the bottom unless its frame stacks the first on top) and `z` (its place in paint order, 0 at the bottom), topmost first as the Layers panel shows them. Params: {id? (page or layer id) | index? (page, from 0)} ? {id, index, name, page, layers: [{id, name, type, index, z, hidden?, children?, childCount?}], truncated}. */
|
|
3183
|
+
"page.inspect": {
|
|
3184
|
+
id?: Json; /** The page to list, counted from 0 (its `index` in inspect's `pages`). */
|
|
3185
|
+
index?: number;
|
|
3186
|
+
};
|
|
3187
|
+
/** Render preview. Draws a view of the design as a PNG preview, a function of the design and the call alone: a page by id or number, a layer, a frame or an area of a page, framed to it; without a target the first page. Never the current page, the selection or the view, and never a change. Use it to look at the result of an edit. Params: {target? {pageId? (a page's id) | page? (counted from 1), objectId? | path? ("layer:<id>", a diagnostic's) | frame? (a frame's id), area? {x, y, width, height} (page coordinates)}, page? (counted from 1), slide? (a page counted from 0), scale? (up to 2, default 1), maxSize? (pixels on the longer side, up to 4096, default 2048)} ? {png (base64), mimeType, width, height, scale, page, pageId, pageName, drew, objectId, bounds}. */
|
|
3188
|
+
"file.render": {
|
|
3189
|
+
commands?: Array<Json>; /** read by the command beside its listed parameters */
|
|
3190
|
+
id?: Json; /** The most pixels on the longer side, 1 to 4096; default 2048. A larger view is drawn at a smaller scale. */
|
|
3191
|
+
maxSize?: number; /** The page to draw, counted from 1. */
|
|
3192
|
+
page?: number; /** Device pixels per canvas unit, above 0 and up to 2; default 1. */
|
|
3193
|
+
scale?: number; /** The page to draw, counted from 0 (what hosts send for one part of a document). */
|
|
3194
|
+
slide?: number; /** The view: a page (`pageId`, or `page` counted from 1), a layer (`objectId`, or a diagnostic's `path` `layer:<id>`), a frame (`frame`), or an `area` of a page; a layer names its page. Without one, the first page. */
|
|
3195
|
+
target?: {
|
|
3196
|
+
area?: {
|
|
3197
|
+
height?: number;
|
|
3198
|
+
width?: number;
|
|
3199
|
+
x?: number;
|
|
3200
|
+
y?: number;
|
|
3201
|
+
};
|
|
3202
|
+
frame?: Json;
|
|
3203
|
+
objectId?: Json;
|
|
3204
|
+
page?: number;
|
|
3205
|
+
pageId?: Json;
|
|
3206
|
+
path?: string;
|
|
3207
|
+
};
|
|
3208
|
+
};
|
|
3209
|
+
}
|
|
3210
|
+
/** A Design file opened with `openDocument<Design, DesignCommands>`. */
|
|
3211
|
+
export type DesignDocument = ModelDocument<Design, DesignCommands>;
|
|
3212
|
+
export type DesignContext = RequestContext<Design, DesignCommands>;
|
|
3213
|
+
export {};
|