@figma/plugin-typings
Advanced tools
Comparing version 1.33.0 to 1.34.1
@@ -1,2 +0,2 @@ | ||
// Figma Plugin API version 1, update 30 | ||
// Figma Plugin API version 1, update 34 | ||
@@ -23,2 +23,5 @@ declare global { | ||
readonly viewport: ViewportAPI | ||
readonly currentUser: CurrentUser | null | ||
closePlugin(message?: string): void | ||
@@ -28,2 +31,5 @@ | ||
commitUndo(): void | ||
triggerUndo(): void | ||
showUI(html: string, options?: ShowUIOptions): void | ||
@@ -179,11 +185,16 @@ readonly ui: UIAPI | ||
interface SuggestionResults { | ||
setSuggestions: (suggestions: string[]) => void | ||
setSuggestions: (suggestions: Array<string | { name: string; data?: any }>) => void | ||
} | ||
type ParameterChangeHandler = (parameters: ParameterValues, suggestionKey: string, result: SuggestionResults) => void | ||
type ParameterInputEvent = { | ||
query: string, | ||
key: string, | ||
parameters: ParameterValues, | ||
result: SuggestionResults, | ||
} | ||
interface ParametersAPI { | ||
on(type: "input", callback: ParameterChangeHandler): void | ||
once(type: "input", callback: ParameterChangeHandler): void | ||
off(type: "input", callback: ParameterChangeHandler): void | ||
on(type: "input", callback: (event: ParameterInputEvent) => void): void | ||
once(type: "input", callback: (event: ParameterInputEvent) => void): void | ||
off(type: "input", callback: (event: ParameterInputEvent) => void): void | ||
} | ||
@@ -765,2 +776,6 @@ | ||
interface VariantMixin { | ||
readonly variantProperties: {[property: string]: string} | null | ||
} | ||
interface TextSublayerNode { | ||
@@ -788,2 +803,3 @@ readonly hasMissingFont: boolean | ||
setRangeFontName(start: number, end: number, value: FontName): void | ||
getRangeAllFontNames(start: number, end: number): FontName[] | ||
getRangeTextCase(start: number, end: number): TextCase | PluginAPI['mixed'] | ||
@@ -845,2 +861,3 @@ setRangeTextCase(start: number, end: number, value: TextCase): void | ||
selectedTextRange: { node: TextNode, start: number, end: number } | null | ||
flowStartingPoints: ReadonlyArray<{ nodeId: string, name: string }> | ||
@@ -929,5 +946,6 @@ backgrounds: ReadonlyArray<Paint> | ||
readonly defaultVariant: ComponentNode | ||
readonly variantGroupProperties: {[property: string]: {values: string[]}} | ||
} | ||
interface ComponentNode extends DefaultFrameMixin, PublishableMixin { | ||
interface ComponentNode extends DefaultFrameMixin, PublishableMixin, VariantMixin { | ||
readonly type: "COMPONENT" | ||
@@ -938,3 +956,3 @@ clone(): ComponentNode | ||
interface InstanceNode extends DefaultFrameMixin { | ||
interface InstanceNode extends DefaultFrameMixin, VariantMixin { | ||
readonly type: "INSTANCE" | ||
@@ -944,2 +962,3 @@ clone(): InstanceNode | ||
swapComponent(componentNode: ComponentNode): void | ||
setProperties(properties: {[property: string]: string}): void | ||
detachInstance(): FrameNode | ||
@@ -1074,5 +1093,21 @@ scaleFactor: number | ||
} | ||
function setTimeout(callback: Function, timeout: number): number; | ||
function clearTimeout(handle: number): void; | ||
function setInterval(callback: Function, timeout: number): number; | ||
function clearInterval(handle: number): void; | ||
type HexCode = string | ||
interface CurrentUser { | ||
readonly id: string | ||
readonly name: string | ||
readonly photoURL: string | ||
// The current user's multiplayer color. This will match the color of their | ||
// dot stamps and cursor. | ||
readonly color: HexCode | ||
} | ||
} // declare global | ||
export {} |
{ | ||
"name": "@figma/plugin-typings", | ||
"version": "1.33.0", | ||
"version": "1.34.1", | ||
"description": "Typings for the Figma Plugin API", | ||
"main": "", | ||
"scripts": { | ||
"test": "tsc --noEmit --strict --typeRoots '[]' index.d.ts" | ||
"test": "tsc" | ||
}, | ||
@@ -9,0 +9,0 @@ "repository": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
37102
6
900
1