@figma/widget-typings
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -64,2 +64,3 @@ // Figma Widget API version 1, update 1 | ||
Fragment: Fragment | ||
Span: Span | ||
} | ||
@@ -111,7 +112,24 @@ | ||
type SVG = FunctionalWidget<SVGProps> | ||
type Span = (props: SpanProps) => FigmaVirtualNode<'span'> | ||
type FigmaDeclarativeNode = Object | any[] | string | null | undefined | false | ||
type FigmaVirtualNode<T> = { __type: T } | ||
type FigmaDeclarativeChildren<T> = | ||
| FigmaVirtualNode<T> | ||
| FigmaDeclarativeChildren<T>[] | ||
| string | ||
| null | ||
| undefined | ||
| false | ||
type FigmaDeclarativeNode = FigmaDeclarativeChildren<any> | ||
type FunctionalWidget<T> = (props: T) => FigmaDeclarativeNode | ||
type PropertyMenuItemType = 'action' | 'separator' | 'color-selector' | 'dropdown' | ||
type PropertyMenuItemType = | ||
| 'action' | ||
| 'separator' | ||
| 'color-selector' | ||
| 'dropdown' | ||
| 'toggle' | ||
| 'link' | ||
@@ -129,3 +147,7 @@ type HexCode = string | ||
} | ||
interface WidgetPropertyMenuLinkItem extends PropertyMenuItem { | ||
itemType: 'link' | ||
icon?: string | null | ||
href: string | ||
} | ||
interface WidgetPropertyMenuSeparatorItem { | ||
@@ -157,2 +179,8 @@ itemType: 'separator' | ||
interface WidgetPropertyMenuToggleItem extends PropertyMenuItem { | ||
itemType: 'toggle' | ||
icon?: string | ||
isToggled: boolean | ||
} | ||
type WidgetPropertyMenuItem = | ||
@@ -163,2 +191,4 @@ | WidgetPropertyMenuActionItem | ||
| WidgetPropertyMenuDropdownItem | ||
| WidgetPropertyMenuToggleItem | ||
| WidgetPropertyMenuLinkItem | ||
@@ -183,7 +213,16 @@ type WidgetPropertyMenu = WidgetPropertyMenuItem[] | ||
interface TextProps extends BaseProps, WidgetJSX.TextProps { | ||
interface TextChildren { | ||
children?: | ||
| FigmaVirtualNode<'span'> | ||
| string | ||
| number | ||
| (FigmaVirtualNode<'span'> | string | number)[] | ||
} | ||
interface TextProps extends BaseProps, WidgetJSX.TextProps, TextChildren { | ||
font?: { family: string; style: string } | ||
children?: string | number | (string | number)[] | ||
} | ||
interface SpanProps extends WidgetJSX.SpanProps, TextChildren {} | ||
interface TextEditEvent { | ||
@@ -190,0 +229,0 @@ characters: string |
{ | ||
"name": "@figma/widget-typings", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "Typings for the Figma Widget API", | ||
@@ -5,0 +5,0 @@ "main": "", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24609
546
1