-
Notifications
You must be signed in to change notification settings - Fork 45
/
plugin-api.d.ts
2606 lines (2606 loc) · 69.2 KB
/
plugin-api.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* plugin-typings are auto-generated. Do not update them directly. See plugin-docs/ for instructions. */
declare type ArgFreeEventType =
| 'selectionchange'
| 'currentpagechange'
| 'close'
| 'timerstart'
| 'timerstop'
| 'timerpause'
| 'timerresume'
| 'timeradjust'
| 'timerdone'
interface PluginAPI {
readonly apiVersion: '1.0.0'
readonly command: string
readonly editorType: 'figma' | 'figjam' | 'dev'
readonly mode: 'default' | 'textreview' | 'inspect' | 'codegen' | 'linkpreview' | 'auth'
readonly pluginId?: string
readonly widgetId?: string
readonly fileKey: string | undefined
skipInvisibleInstanceChildren: boolean
readonly timer?: TimerAPI
readonly viewport: ViewportAPI
readonly currentUser: User | null
readonly activeUsers: ActiveUser[]
readonly textreview?: TextReviewAPI
readonly codegen: CodegenAPI
readonly vscode?: VSCodeAPI
readonly devResources?: DevResourcesAPI
readonly payments?: PaymentsAPI
closePlugin(message?: string): void
notify(message: string, options?: NotificationOptions): NotificationHandler
commitUndo(): void
triggerUndo(): void
saveVersionHistoryAsync(title: string, description?: string): Promise<VersionHistoryResult>
openExternal(url: string): void
showUI(html: string, options?: ShowUIOptions): void
readonly ui: UIAPI
readonly util: UtilAPI
readonly constants: ConstantsAPI
readonly clientStorage: ClientStorageAPI
readonly parameters: ParametersAPI
getNodeByIdAsync(id: string): Promise<BaseNode | null>
getNodeById(id: string): BaseNode | null
getStyleByIdAsync(id: string): Promise<BaseStyle | null>
getStyleById(id: string): BaseStyle | null
readonly variables: VariablesAPI
readonly teamLibrary: TeamLibraryAPI
readonly root: DocumentNode
currentPage: PageNode
setCurrentPageAsync(page: PageNode): Promise<void>
on(type: ArgFreeEventType, callback: () => void): void
on(type: 'run', callback: (event: RunEvent) => void): void
on(type: 'drop', callback: (event: DropEvent) => boolean): void
on(type: 'documentchange', callback: (event: DocumentChangeEvent) => void): void
on(
type: 'textreview',
callback: (event: TextReviewEvent) => Promise<TextReviewRange[]> | TextReviewRange[],
): void
on(type: 'stylechange', callback: (event: StyleChangeEvent) => void): void
once(type: ArgFreeEventType, callback: () => void): void
once(type: 'run', callback: (event: RunEvent) => void): void
once(type: 'drop', callback: (event: DropEvent) => boolean): void
once(type: 'documentchange', callback: (event: DocumentChangeEvent) => void): void
once(
type: 'textreview',
callback: (event: TextReviewEvent) => Promise<TextReviewRange[]> | TextReviewRange[],
): void
once(type: 'stylechange', callback: (event: StyleChangeEvent) => void): void
off(type: ArgFreeEventType, callback: () => void): void
off(type: 'run', callback: (event: RunEvent) => void): void
off(type: 'drop', callback: (event: DropEvent) => boolean): void
off(type: 'documentchange', callback: (event: DocumentChangeEvent) => void): void
off(
type: 'textreview',
callback: (event: TextReviewEvent) => Promise<TextReviewRange[]> | TextReviewRange[],
): void
off(type: 'stylechange', callback: (event: StyleChangeEvent) => void): void
readonly mixed: unique symbol
createRectangle(): RectangleNode
createLine(): LineNode
createEllipse(): EllipseNode
createPolygon(): PolygonNode
createStar(): StarNode
createVector(): VectorNode
createText(): TextNode
createFrame(): FrameNode
createComponent(): ComponentNode
createComponentFromNode(node: SceneNode): ComponentNode
createPage(): PageNode
createPageDivider(dividerName?: string): PageNode
createSlice(): SliceNode
createSticky(): StickyNode
createConnector(): ConnectorNode
createShapeWithText(): ShapeWithTextNode
createCodeBlock(): CodeBlockNode
createSection(): SectionNode
createTable(numRows?: number, numColumns?: number): TableNode
createNodeFromJSXAsync(jsx: any): Promise<SceneNode>
createBooleanOperation(): BooleanOperationNode
createPaintStyle(): PaintStyle
createTextStyle(): TextStyle
createEffectStyle(): EffectStyle
createGridStyle(): GridStyle
getLocalPaintStylesAsync(): Promise<PaintStyle[]>
getLocalPaintStyles(): PaintStyle[]
getLocalTextStylesAsync(): Promise<TextStyle[]>
getLocalTextStyles(): TextStyle[]
getLocalEffectStylesAsync(): Promise<EffectStyle[]>
getLocalEffectStyles(): EffectStyle[]
getLocalGridStylesAsync(): Promise<GridStyle[]>
getLocalGridStyles(): GridStyle[]
getSelectionColors(): null | {
paints: Paint[]
styles: PaintStyle[]
}
moveLocalPaintStyleAfter(targetNode: PaintStyle, reference: PaintStyle | null): void
moveLocalTextStyleAfter(targetNode: TextStyle, reference: TextStyle | null): void
moveLocalEffectStyleAfter(targetNode: EffectStyle, reference: EffectStyle | null): void
moveLocalGridStyleAfter(targetNode: GridStyle, reference: GridStyle | null): void
moveLocalPaintFolderAfter(targetFolder: string, reference: string | null): void
moveLocalTextFolderAfter(targetFolder: string, reference: string | null): void
moveLocalEffectFolderAfter(targetFolder: string, reference: string | null): void
moveLocalGridFolderAfter(targetFolder: string, reference: string | null): void
importComponentByKeyAsync(key: string): Promise<ComponentNode>
importComponentSetByKeyAsync(key: string): Promise<ComponentSetNode>
importStyleByKeyAsync(key: string): Promise<BaseStyle>
listAvailableFontsAsync(): Promise<Font[]>
loadFontAsync(fontName: FontName): Promise<void>
readonly hasMissingFont: boolean
createNodeFromSvg(svg: string): FrameNode
createImage(data: Uint8Array): Image
createImageAsync(src: string): Promise<Image>
getImageByHash(hash: string): Image | null
createVideoAsync(data: Uint8Array): Promise<Video>
createLinkPreviewAsync(url: string): Promise<EmbedNode | LinkUnfurlNode>
createGif(hash: string): MediaNode
combineAsVariants(
nodes: ReadonlyArray<ComponentNode>,
parent: BaseNode & ChildrenMixin,
index?: number,
): ComponentSetNode
group(nodes: ReadonlyArray<BaseNode>, parent: BaseNode & ChildrenMixin, index?: number): GroupNode
flatten(
nodes: ReadonlyArray<BaseNode>,
parent?: BaseNode & ChildrenMixin,
index?: number,
): VectorNode
union(
nodes: ReadonlyArray<BaseNode>,
parent: BaseNode & ChildrenMixin,
index?: number,
): BooleanOperationNode
subtract(
nodes: ReadonlyArray<BaseNode>,
parent: BaseNode & ChildrenMixin,
index?: number,
): BooleanOperationNode
intersect(
nodes: ReadonlyArray<BaseNode>,
parent: BaseNode & ChildrenMixin,
index?: number,
): BooleanOperationNode
exclude(
nodes: ReadonlyArray<BaseNode>,
parent: BaseNode & ChildrenMixin,
index?: number,
): BooleanOperationNode
ungroup(node: SceneNode & ChildrenMixin): Array<SceneNode>
base64Encode(data: Uint8Array): string
base64Decode(data: string): Uint8Array
getFileThumbnailNodeAsync(): Promise<
FrameNode | ComponentNode | ComponentSetNode | SectionNode | null
>
getFileThumbnailNode(): FrameNode | ComponentNode | ComponentSetNode | SectionNode | null
setFileThumbnailNodeAsync(
node: FrameNode | ComponentNode | ComponentSetNode | SectionNode | null,
): Promise<void>
loadAllPagesAsync(): Promise<void>
}
interface VersionHistoryResult {
id: string
}
interface VariablesAPI {
getVariableByIdAsync(id: string): Promise<Variable | null>
getVariableById(id: string): Variable | null
getVariableCollectionByIdAsync(id: string): Promise<VariableCollection | null>
getVariableCollectionById(id: string): VariableCollection | null
getLocalVariablesAsync(type?: VariableResolvedDataType): Promise<Variable[]>
getLocalVariables(type?: VariableResolvedDataType): Variable[]
getLocalVariableCollectionsAsync(): Promise<VariableCollection[]>
getLocalVariableCollections(): VariableCollection[]
createVariable(
name: string,
collectionId: string,
resolvedType: VariableResolvedDataType,
): Variable
createVariable(
name: string,
collection: VariableCollection,
resolvedType: VariableResolvedDataType,
): Variable
createVariableCollection(name: string): VariableCollection
createVariableAlias(variable: Variable): VariableAlias
createVariableAliasByIdAsync(variableId: string): Promise<VariableAlias>
setBoundVariableForPaint(
paint: SolidPaint,
field: VariableBindablePaintField,
variable: Variable | null,
): SolidPaint
setBoundVariableForEffect(
effect: Effect,
field: VariableBindableEffectField,
variable: Variable | null,
): Effect
setBoundVariableForLayoutGrid(
layoutGrid: LayoutGrid,
field: VariableBindableLayoutGridField,
variable: Variable | null,
): LayoutGrid
importVariableByKeyAsync(key: string): Promise<Variable>
}
interface LibraryVariableCollection {
name: string
key: string
libraryName: string
}
interface LibraryVariable {
name: string
key: string
resolvedType: VariableResolvedDataType
}
interface TeamLibraryAPI {
getAvailableLibraryVariableCollectionsAsync(): Promise<LibraryVariableCollection[]>
getVariablesInLibraryCollectionAsync(libraryCollectionKey: string): Promise<LibraryVariable[]>
}
declare type PaymentStatus = {
type: 'UNPAID' | 'PAID' | 'NOT_SUPPORTED'
}
interface PaymentsAPI {
readonly status: PaymentStatus
setPaymentStatusInDevelopment(status: PaymentStatus): void
getUserFirstRanSecondsAgo(): number
initiateCheckoutAsync(options?: {
interstitial?: 'PAID_FEATURE' | 'TRIAL_ENDED' | 'SKIP'
}): Promise<void>
requestCheckout(): void
getPluginPaymentTokenAsync(): Promise<string>
}
interface ClientStorageAPI {
getAsync(key: string): Promise<any | undefined>
setAsync(key: string, value: any): Promise<void>
deleteAsync(key: string): Promise<void>
keysAsync(): Promise<string[]>
}
interface NotificationOptions {
timeout?: number
error?: boolean
onDequeue?: (reason: NotifyDequeueReason) => void
button?: {
text: string
action: () => boolean | void
}
}
declare type NotifyDequeueReason = 'timeout' | 'dismiss' | 'action_button_click'
interface NotificationHandler {
cancel: () => void
}
interface ShowUIOptions {
visible?: boolean
title?: string
width?: number
height?: number
position?: {
x: number
y: number
}
themeColors?: boolean
}
interface UIPostMessageOptions {
origin?: string
}
interface OnMessageProperties {
origin: string
}
declare type MessageEventHandler = (pluginMessage: any, props: OnMessageProperties) => void
interface UIAPI {
show(): void
hide(): void
resize(width: number, height: number): void
reposition(x: number, y: number): void
close(): void
postMessage(pluginMessage: any, options?: UIPostMessageOptions): void
onmessage: MessageEventHandler | undefined
on(type: 'message', callback: MessageEventHandler): void
once(type: 'message', callback: MessageEventHandler): void
off(type: 'message', callback: MessageEventHandler): void
}
interface UtilAPI {
rgb(color: string | RGB | RGBA): RGB
rgba(color: string | RGB | RGBA): RGBA
solidPaint(color: string | RGB | RGBA, overrides?: Partial<SolidPaint>): SolidPaint
}
interface ColorPalette {
[key: string]: string
}
interface ColorPalettes {
figJamBase: ColorPalette
figJamBaseLight: ColorPalette
}
interface ConstantsAPI {
colors: ColorPalettes
}
declare type CodegenEvent = {
node: SceneNode
language: string
}
declare type CodegenPreferences = {
readonly unit: 'pixel' | 'scaled'
readonly scaleFactor?: number
readonly customSettings: Record<string, string>
}
declare type CodegenPreferencesEvent = {
propertyName: string
}
declare type CodegenResult = {
title: string
code: string
language:
| 'TYPESCRIPT'
| 'CPP'
| 'RUBY'
| 'CSS'
| 'JAVASCRIPT'
| 'HTML'
| 'JSON'
| 'GRAPHQL'
| 'PYTHON'
| 'GO'
| 'SQL'
| 'SWIFT'
| 'KOTLIN'
| 'RUST'
| 'BASH'
| 'PLAINTEXT'
}
interface CodegenAPI {
on(
type: 'generate',
callback: (event: CodegenEvent) => Promise<CodegenResult[]> | CodegenResult[],
): void
on(type: 'preferenceschange', callback: (event: CodegenPreferencesEvent) => Promise<void>): void
once(
type: 'generate',
callback: (event: CodegenEvent) => Promise<CodegenResult[]> | CodegenResult[],
): void
once(type: 'preferenceschange', callback: (event: CodegenPreferencesEvent) => Promise<void>): void
off(
type: 'generate',
callback: (event: CodegenEvent) => Promise<CodegenResult[]> | CodegenResult[],
): void
off(type: 'preferenceschange', callback: (event: CodegenPreferencesEvent) => Promise<void>): void
readonly preferences: CodegenPreferences
refresh: () => void
}
interface DevResource {
readonly name: string
readonly url: string
readonly inheritedNodeId?: string
}
interface DevResourceWithNodeId extends DevResource {
nodeId: string
}
declare type LinkPreviewEvent = {
link: DevResource
}
declare type PlainTextElement = {
type: 'PLAIN_TEXT'
text: string
}
declare type LinkPreviewResult =
| {
type: 'AUTH_REQUIRED'
}
| PlainTextElement
| null
declare type AuthEvent = {
links: DevResource[]
}
declare type DevResourceOpenEvent = {
devResource: DevResourceWithNodeId
}
declare type AuthResult = {
type: 'AUTH_SUCCESS'
} | null
interface VSCodeAPI {}
interface DevResourcesAPI {
on(
type: 'linkpreview',
callback: (event: LinkPreviewEvent) => Promise<LinkPreviewResult> | LinkPreviewResult,
): void
on(type: 'auth', callback: (event: AuthEvent) => Promise<AuthResult> | AuthResult): void
on(type: 'open', callback: (event: DevResourceOpenEvent) => void): void
once(
type: 'linkpreview',
callback: (event: LinkPreviewEvent) => Promise<LinkPreviewResult> | LinkPreviewResult,
): void
once(type: 'auth', callback: (event: AuthEvent) => Promise<AuthResult> | AuthResult): void
once(type: 'open', callback: (event: DevResourceOpenEvent) => void): void
off(
type: 'linkpreview',
callback: (event: LinkPreviewEvent) => Promise<LinkPreviewResult> | LinkPreviewResult,
): void
off(type: 'auth', callback: (event: AuthEvent) => Promise<AuthResult> | AuthResult): void
off(type: 'open', callback: (event: DevResourceOpenEvent) => void): void
}
interface TimerAPI {
readonly remaining: number
readonly total: number
readonly state: 'STOPPED' | 'PAUSED' | 'RUNNING'
pause: () => void
resume: () => void
start: (seconds: number) => void
stop: () => void
}
interface ViewportAPI {
center: Vector
zoom: number
scrollAndZoomIntoView(nodes: ReadonlyArray<BaseNode>): void
readonly bounds: Rect
}
interface TextReviewAPI {
requestToBeEnabledAsync(): Promise<void>
requestToBeDisabledAsync(): Promise<void>
readonly isEnabled: boolean
}
interface ParameterValues {
[key: string]: any
}
interface SuggestionResults {
setSuggestions(
suggestions: Array<
| string
| {
name: string
data?: any
icon?: string | Uint8Array
iconUrl?: string
}
>,
): void
setError(message: string): void
setLoadingMessage(message: string): void
}
declare type ParameterInputEvent<ParametersType = ParameterValues> = {
query: string
key: string
parameters: Partial<ParametersType>
result: SuggestionResults
}
interface ParametersAPI {
on(type: 'input', callback: (event: ParameterInputEvent) => void): void
once(type: 'input', callback: (event: ParameterInputEvent) => void): void
off(type: 'input', callback: (event: ParameterInputEvent) => void): void
}
interface RunParametersEvent<ParametersType = ParameterValues | undefined> {
command: string
parameters: ParametersType
}
interface OpenDevResourcesEvent {
command: 'open-dev-resource'
parameters?: undefined
link: {
url: string
name: string
}
}
declare type RunEvent = RunParametersEvent | OpenDevResourcesEvent
interface DropEvent {
node: BaseNode | SceneNode
x: number
y: number
absoluteX: number
absoluteY: number
items: DropItem[]
files: DropFile[]
dropMetadata?: any
}
interface DropItem {
type: string
data: string
}
interface DropFile {
name: string
type: string
getBytesAsync(): Promise<Uint8Array>
getTextAsync(): Promise<string>
}
interface DocumentChangeEvent {
documentChanges: DocumentChange[]
}
interface StyleChangeEvent {
styleChanges: StyleChange[]
}
declare type StyleChange = StyleCreateChange | StyleDeleteChange | StylePropertyChange
interface BaseDocumentChange {
id: string
origin: 'LOCAL' | 'REMOTE'
}
interface BaseNodeChange extends BaseDocumentChange {
node: SceneNode | RemovedNode
}
interface RemovedNode {
readonly removed: true
readonly type: NodeType
readonly id: string
}
interface CreateChange extends BaseNodeChange {
type: 'CREATE'
}
interface DeleteChange extends BaseNodeChange {
type: 'DELETE'
}
interface PropertyChange extends BaseNodeChange {
type: 'PROPERTY_CHANGE'
properties: NodeChangeProperty[]
}
interface BaseStyleChange extends BaseDocumentChange {
style: BaseStyle | null
}
interface StyleCreateChange extends BaseStyleChange {
type: 'STYLE_CREATE'
}
interface StyleDeleteChange extends BaseStyleChange {
type: 'STYLE_DELETE'
style: null
}
interface StylePropertyChange extends BaseStyleChange {
type: 'STYLE_PROPERTY_CHANGE'
properties: StyleChangeProperty[]
}
declare type DocumentChange =
| CreateChange
| DeleteChange
| PropertyChange
| StyleCreateChange
| StyleDeleteChange
| StylePropertyChange
declare type NodeChangeProperty =
| 'pointCount'
| 'name'
| 'width'
| 'height'
| 'minWidth'
| 'maxWidth'
| 'minHeight'
| 'maxHeight'
| 'parent'
| 'pluginData'
| 'constraints'
| 'locked'
| 'visible'
| 'opacity'
| 'blendMode'
| 'layoutGrids'
| 'guides'
| 'characters'
| 'openTypeFeatures'
| 'styledTextSegments'
| 'vectorNetwork'
| 'effects'
| 'exportSettings'
| 'arcData'
| 'autoRename'
| 'fontName'
| 'innerRadius'
| 'fontSize'
| 'lineHeight'
| 'leadingTrim'
| 'paragraphIndent'
| 'paragraphSpacing'
| 'listSpacing'
| 'hangingPunctuation'
| 'hangingList'
| 'letterSpacing'
| 'textAlignHorizontal'
| 'textAlignVertical'
| 'textCase'
| 'textDecoration'
| 'textAutoResize'
| 'textTruncation'
| 'maxLines'
| 'fills'
| 'topLeftRadius'
| 'topRightRadius'
| 'bottomLeftRadius'
| 'bottomRightRadius'
| 'constrainProportions'
| 'strokes'
| 'strokeWeight'
| 'strokeAlign'
| 'strokeCap'
| 'strokeJoin'
| 'strokeMiterLimit'
| 'booleanOperation'
| 'overflowDirection'
| 'dashPattern'
| 'backgrounds'
| 'handleMirroring'
| 'cornerRadius'
| 'cornerSmoothing'
| 'relativeTransform'
| 'x'
| 'y'
| 'rotation'
| 'isMask'
| 'maskType'
| 'clipsContent'
| 'type'
| 'overlayPositionType'
| 'overlayBackgroundInteraction'
| 'overlayBackground'
| 'prototypeStartNode'
| 'prototypeBackgrounds'
| 'expanded'
| 'fillStyleId'
| 'strokeStyleId'
| 'backgroundStyleId'
| 'textStyleId'
| 'effectStyleId'
| 'gridStyleId'
| 'description'
| 'layoutMode'
| 'layoutWrap'
| 'paddingLeft'
| 'paddingTop'
| 'paddingRight'
| 'paddingBottom'
| 'itemSpacing'
| 'counterAxisSpacing'
| 'layoutAlign'
| 'counterAxisSizingMode'
| 'primaryAxisSizingMode'
| 'primaryAxisAlignItems'
| 'counterAxisAlignItems'
| 'counterAxisAlignContent'
| 'layoutGrow'
| 'layoutPositioning'
| 'itemReverseZIndex'
| 'hyperlink'
| 'mediaData'
| 'stokeTopWeight'
| 'strokeBottomWeight'
| 'strokeLeftWeight'
| 'strokeRightWeight'
| 'reactions'
| 'flowStartingPoints'
| 'shapeType'
| 'connectorStart'
| 'connectorEnd'
| 'connectorLineType'
| 'connectorStartStrokeCap'
| 'connectorEndStrokeCap'
| 'codeLanguage'
| 'widgetSyncedState'
| 'componentPropertyDefinitions'
| 'componentPropertyReferences'
| 'componentProperties'
| 'embedData'
| 'linkUnfurlData'
| 'text'
| 'authorVisible'
| 'authorName'
| 'code'
| 'textBackground'
interface NodeChangeEvent {
nodeChanges: NodeChange[]
}
declare type NodeChange = CreateChange | DeleteChange | PropertyChange
declare type StyleChangeProperty =
| 'name'
| 'pluginData'
| 'type'
| 'description'
| 'remote'
| 'documentationLinks'
| 'fontSize'
| 'textDecoration'
| 'letterSpacing'
| 'lineHeight'
| 'leadingTrim'
| 'paragraphIndent'
| 'paragraphSpacing'
| 'listSpacing'
| 'hangingPunctuation'
| 'hangingList'
| 'textCase'
| 'paint'
| 'effects'
| 'layoutGrids'
declare type TextReviewEvent = {
text: string
}
declare type TextReviewRange = {
start: number
end: number
suggestions: string[]
color?: 'RED' | 'GREEN' | 'BLUE'
}
declare type Transform = [[number, number, number], [number, number, number]]
interface Vector {
readonly x: number
readonly y: number
}
interface Rect {
readonly x: number
readonly y: number
readonly width: number
readonly height: number
}
interface RGB {
readonly r: number
readonly g: number
readonly b: number
}
interface RGBA {
readonly r: number
readonly g: number
readonly b: number
readonly a: number
}
interface FontName {
readonly family: string
readonly style: string
}
declare type TextCase =
| 'ORIGINAL'
| 'UPPER'
| 'LOWER'
| 'TITLE'
| 'SMALL_CAPS'
| 'SMALL_CAPS_FORCED'
declare type TextDecoration = 'NONE' | 'UNDERLINE' | 'STRIKETHROUGH'
declare type OpenTypeFeature =
| 'PCAP'
| 'C2PC'
| 'CASE'
| 'CPSP'
| 'TITL'
| 'UNIC'
| 'ZERO'
| 'SINF'
| 'ORDN'
| 'AFRC'
| 'DNOM'
| 'NUMR'
| 'LIGA'
| 'CLIG'
| 'DLIG'
| 'HLIG'
| 'RLIG'
| 'AALT'
| 'CALT'
| 'RCLT'
| 'SALT'
| 'RVRN'
| 'VERT'
| 'SWSH'
| 'CSWH'
| 'NALT'
| 'CCMP'
| 'STCH'
| 'HIST'
| 'SIZE'
| 'ORNM'
| 'ITAL'
| 'RAND'
| 'DTLS'
| 'FLAC'
| 'MGRK'
| 'SSTY'
| 'KERN'
| 'FWID'
| 'HWID'
| 'HALT'
| 'TWID'
| 'QWID'
| 'PWID'
| 'JUST'
| 'LFBD'
| 'OPBD'
| 'RTBD'
| 'PALT'
| 'PKNA'
| 'LTRA'
| 'LTRM'
| 'RTLA'
| 'RTLM'
| 'ABRV'
| 'ABVM'
| 'ABVS'
| 'VALT'
| 'VHAL'
| 'BLWF'
| 'BLWM'
| 'BLWS'
| 'AKHN'
| 'CJCT'
| 'CFAR'
| 'CPCT'
| 'CURS'
| 'DIST'
| 'EXPT'
| 'FALT'
| 'FINA'
| 'FIN2'
| 'FIN3'
| 'HALF'
| 'HALN'
| 'HKNA'
| 'HNGL'
| 'HOJO'
| 'INIT'
| 'ISOL'
| 'JP78'
| 'JP83'
| 'JP90'
| 'JP04'
| 'LJMO'
| 'LOCL'
| 'MARK'
| 'MEDI'
| 'MED2'
| 'MKMK'
| 'NLCK'
| 'NUKT'
| 'PREF'
| 'PRES'
| 'VPAL'
| 'PSTF'
| 'PSTS'
| 'RKRF'
| 'RPHF'
| 'RUBY'
| 'SMPL'
| 'TJMO'
| 'TNAM'
| 'TRAD'
| 'VATU'
| 'VJMO'
| 'VKNA'
| 'VKRN'
| 'VRTR'
| 'VRT2'
| 'SS01'
| 'SS02'
| 'SS03'
| 'SS04'
| 'SS05'
| 'SS06'
| 'SS07'
| 'SS08'
| 'SS09'
| 'SS10'
| 'SS11'
| 'SS12'
| 'SS13'
| 'SS14'
| 'SS15'
| 'SS16'
| 'SS17'
| 'SS18'
| 'SS19'
| 'SS20'
| 'CV01'
| 'CV02'
| 'CV03'
| 'CV04'
| 'CV05'
| 'CV06'
| 'CV07'
| 'CV08'
| 'CV09'
| 'CV10'
| 'CV11'
| 'CV12'
| 'CV13'
| 'CV14'
| 'CV15'
| 'CV16'
| 'CV17'
| 'CV18'
| 'CV19'
| 'CV20'
| 'CV21'
| 'CV22'
| 'CV23'
| 'CV24'
| 'CV25'
| 'CV26'
| 'CV27'
| 'CV28'
| 'CV29'
| 'CV30'
| 'CV31'
| 'CV32'
| 'CV33'
| 'CV34'
| 'CV35'
| 'CV36'
| 'CV37'
| 'CV38'
| 'CV39'
| 'CV40'
| 'CV41'
| 'CV42'
| 'CV43'
| 'CV44'
| 'CV45'
| 'CV46'
| 'CV47'
| 'CV48'
| 'CV49'
| 'CV50'
| 'CV51'
| 'CV52'
| 'CV53'
| 'CV54'
| 'CV55'
| 'CV56'
| 'CV57'
| 'CV58'
| 'CV59'
| 'CV60'
| 'CV61'
| 'CV62'
| 'CV63'
| 'CV64'
| 'CV65'
| 'CV66'
| 'CV67'
| 'CV68'
| 'CV69'
| 'CV70'
| 'CV71'
| 'CV72'
| 'CV73'
| 'CV74'
| 'CV75'
| 'CV76'
| 'CV77'
| 'CV78'
| 'CV79'
| 'CV80'
| 'CV81'
| 'CV82'
| 'CV83'
| 'CV84'
| 'CV85'
| 'CV86'
| 'CV87'
| 'CV88'
| 'CV89'
| 'CV90'
| 'CV91'
| 'CV92'
| 'CV93'
| 'CV94'
| 'CV95'
| 'CV96'
| 'CV97'
| 'CV98'
| 'CV99'
interface ArcData {
readonly startingAngle: number
readonly endingAngle: number
readonly innerRadius: number
}
interface DropShadowEffect {
readonly type: 'DROP_SHADOW'
readonly color: RGBA
readonly offset: Vector
readonly radius: number
readonly spread?: number
readonly visible: boolean
readonly blendMode: BlendMode
readonly showShadowBehindNode?: boolean
readonly boundVariables?: {
[field in VariableBindableEffectField]?: VariableAlias
}
}
interface InnerShadowEffect {
readonly type: 'INNER_SHADOW'
readonly color: RGBA
readonly offset: Vector
readonly radius: number
readonly spread?: number
readonly visible: boolean
readonly blendMode: BlendMode
readonly boundVariables?: {
[field in VariableBindableEffectField]?: VariableAlias