@figma/plugin-typings
Advanced tools
Comparing version 1.40.0 to 1.41.0
{ | ||
"name": "@figma/plugin-typings", | ||
"version": "1.40.0", | ||
"version": "1.41.0", | ||
"description": "Typings for the Figma Plugin API", | ||
@@ -5,0 +5,0 @@ "main": "", |
@@ -13,2 +13,4 @@ | ||
skipInvisibleInstanceChildren: boolean | ||
readonly timer?: TimerAPI | ||
@@ -109,3 +111,3 @@ readonly viewport: ViewportAPI | ||
createImage(data: Uint8Array): Image | ||
getImageByHash(hash: string): Image | ||
getImageByHash(hash: string): Image | null | ||
@@ -122,2 +124,5 @@ createLinkPreviewAsync(url:string): Promise<EmbedNode | LinkUnfurlNode> | ||
exclude(nodes: ReadonlyArray<BaseNode>, parent: BaseNode & ChildrenMixin, index?: number): BooleanOperationNode | ||
base64Encode(data: Uint8Array): string | ||
base64Decode(data: string): Uint8Array | ||
} | ||
@@ -128,2 +133,4 @@ | ||
setAsync(key: string, value: any): Promise<void> | ||
deleteAsync(key: string): Promise<void> | ||
keysAsync(): Promise<string[]> | ||
} | ||
@@ -616,6 +623,13 @@ | ||
type ConnectorStrokeCap = | ||
| "NONE" | ||
| "ARROW_EQUILATERAL" | ||
| "ARROW_LINES" | ||
| "TRIANGLE_FILLED" | ||
| "DIAMOND_FILLED"; | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// Mixins | ||
interface BaseNodeMixin { | ||
interface BaseNodeMixin extends PluginDataMixin { | ||
readonly id: string | ||
@@ -628,4 +642,10 @@ readonly parent: (BaseNode & ChildrenMixin) | null | ||
setRelaunchData(data: { [command: string]: /* description */ string }): void | ||
getRelaunchData(): { [command: string]: /* description */ string } | ||
} | ||
interface PluginDataMixin { | ||
getPluginData(key: string): string | ||
setPluginData(key: string, value: string): void | ||
getPluginDataKeys(): string[] | ||
@@ -636,3 +656,3 @@ // Namespace is a string that must be at least 3 alphanumeric characters, and should | ||
setSharedPluginData(namespace: string, key: string, value: string): void | ||
setRelaunchData(data: { [command: string]: /* description */ string }): void | ||
getSharedPluginDataKeys(namespace: string): string[] | ||
} | ||
@@ -665,2 +685,4 @@ | ||
findOne(callback: (node: SceneNode) => boolean): SceneNode | null | ||
findAllWithCriteria<T extends NodeType[]>(criteria: { types: T }): Array<{ type: T[number] } & SceneNode> | ||
} | ||
@@ -902,2 +924,4 @@ | ||
findOne(callback: (node: PageNode | SceneNode) => boolean): PageNode | SceneNode | null | ||
findAllWithCriteria<T extends NodeType[]>(criteria: { types: T }): Array<{ type: T[number] } & (PageNode | SceneNode)> | ||
} | ||
@@ -917,2 +941,4 @@ | ||
prototypeBackgrounds: ReadonlyArray<Paint> | ||
readonly prototypeStartNode: FrameNode | GroupNode | ComponentNode | InstanceNode | null | ||
@@ -1066,2 +1092,4 @@ } | ||
connectorEnd: ConnectorEndpoint | ||
connectorStartStrokeCap: ConnectorStrokeCap | ||
connectorEndStrokeCap: ConnectorStrokeCap | ||
clone(): ConnectorNode | ||
@@ -1141,3 +1169,3 @@ } | ||
interface BaseStyle extends PublishableMixin { | ||
interface BaseStyle extends PublishableMixin, PluginDataMixin { | ||
readonly id: string | ||
@@ -1144,0 +1172,0 @@ readonly type: StyleType |
40813
1022