Skip to content

Commit

Permalink
Text decorations update
Browse files Browse the repository at this point in the history
  • Loading branch information
ahurtado-figma committed Dec 19, 2024
1 parent 9ed43ef commit d04670b
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 1 deletion.
58 changes: 57 additions & 1 deletion plugin-api-standalone.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,30 @@ declare type TextCase =
| 'SMALL_CAPS'
| 'SMALL_CAPS_FORCED'
declare type TextDecoration = 'NONE' | 'UNDERLINE' | 'STRIKETHROUGH'
declare type TextDecorationStyle = 'SOLID' | 'WAVY' | 'DOTTED'
declare type TextDecorationOffset =
| {
readonly value: number
readonly unit: 'PIXELS' | 'PERCENT'
}
| {
readonly unit: 'AUTO'
}
declare type TextDecorationThickness =
| {
readonly value: number
readonly unit: 'PIXELS' | 'PERCENT'
}
| {
readonly unit: 'AUTO'
}
declare type TextDecorationColor =
| {
readonly value: SolidPaint
}
| {
readonly value: 'AUTO'
}
declare type OpenTypeFeature =
| 'PCAP'
| 'C2PC'
Expand Down Expand Up @@ -1229,6 +1253,11 @@ interface StyledTextSegment {
fontName: FontName
fontWeight: number
textDecoration: TextDecoration
textDecorationStyle: TextDecorationStyle | null
textDecorationOffset: TextDecorationOffset | null
textDecorationThickness: TextDecorationThickness | null
textDecorationColor: TextDecorationColor | null
textDecorationSkipInk: boolean | null
textCase: TextCase
lineHeight: LineHeight
letterSpacing: LetterSpacing
Expand Down Expand Up @@ -1935,6 +1964,11 @@ interface NonResizableTextMixin {
}
| PluginAPI['mixed']
textDecoration: TextDecoration | PluginAPI['mixed']
textDecorationStyle: TextDecorationStyle | PluginAPI['mixed'] | null
textDecorationOffset: TextDecorationOffset | PluginAPI['mixed'] | null
textDecorationThickness: TextDecorationThickness | PluginAPI['mixed'] | null
textDecorationColor: TextDecorationColor | PluginAPI['mixed'] | null
textDecorationSkipInk: boolean | PluginAPI['mixed'] | null
letterSpacing: LetterSpacing | PluginAPI['mixed']
lineHeight: LineHeight | PluginAPI['mixed']
leadingTrim: LeadingTrim | PluginAPI['mixed']
Expand All @@ -1960,6 +1994,28 @@ interface NonResizableTextMixin {
| PluginAPI['mixed']
getRangeTextDecoration(start: number, end: number): TextDecoration | PluginAPI['mixed']
setRangeTextDecoration(start: number, end: number, value: TextDecoration): void
getRangeTextDecorationStyle(
start: number,
end: number,
): TextDecorationStyle | PluginAPI['mixed'] | null
setRangeTextDecorationStyle(start: number, end: number, value: TextDecorationStyle): void
getRangeTextDecorationOffset(
start: number,
end: number,
): TextDecorationOffset | PluginAPI['mixed'] | null
setRangeTextDecorationOffset(start: number, end: number, value: TextDecorationOffset): void
getRangeTextDecorationThickness(
start: number,
end: number,
): TextDecorationThickness | PluginAPI['mixed'] | null
setRangeTextDecorationThickness(start: number, end: number, value: TextDecorationThickness): void
getRangeTextDecorationColor(
start: number,
end: number,
): TextDecorationColor | PluginAPI['mixed'] | null
setRangeTextDecorationColor(start: number, end: number, value: TextDecorationColor): void
getRangeTextDecorationSkipInk(start: number, end: number): boolean | PluginAPI['mixed'] | null
setRangeTextDecorationSkipInk(start: number, end: number, value: boolean): void
getRangeLetterSpacing(start: number, end: number): LetterSpacing | PluginAPI['mixed']
setRangeLetterSpacing(start: number, end: number, value: LetterSpacing): void
getRangeLineHeight(start: number, end: number): LineHeight | PluginAPI['mixed']
Expand Down Expand Up @@ -2622,4 +2678,4 @@ interface FindAllCriteria<T extends NodeType[]> {
}

// prettier-ignore
export { ArgFreeEventType, PluginAPI, VersionHistoryResult, VariablesAPI, LibraryVariableCollection, LibraryVariable, TeamLibraryAPI, PaymentStatus, PaymentsAPI, ClientStorageAPI, NotificationOptions, NotifyDequeueReason, NotificationHandler, ShowUIOptions, UIPostMessageOptions, OnMessageProperties, MessageEventHandler, UIAPI, UtilAPI, ColorPalette, ColorPalettes, ConstantsAPI, CodegenEvent, CodegenPreferences, CodegenPreferencesEvent, CodegenResult, CodegenAPI, DevResource, DevResourceWithNodeId, LinkPreviewEvent, PlainTextElement, LinkPreviewResult, AuthEvent, DevResourceOpenEvent, AuthResult, VSCodeAPI, DevResourcesAPI, TimerAPI, ViewportAPI, TextReviewAPI, ParameterValues, SuggestionResults, ParameterInputEvent, ParametersAPI, RunParametersEvent, OpenDevResourcesEvent, RunEvent, DropEvent, DropItem, DropFile, DocumentChangeEvent, StyleChangeEvent, StyleChange, BaseDocumentChange, BaseNodeChange, RemovedNode, CreateChange, DeleteChange, PropertyChange, BaseStyleChange, StyleCreateChange, StyleDeleteChange, StylePropertyChange, DocumentChange, NodeChangeProperty, NodeChangeEvent, NodeChange, StyleChangeProperty, TextReviewEvent, TextReviewRange, Transform, Vector, Rect, RGB, RGBA, FontName, TextCase, TextDecoration, OpenTypeFeature, ArcData, DropShadowEffect, InnerShadowEffect, BlurEffect, Effect, ConstraintType, Constraints, ColorStop, ImageFilters, SolidPaint, GradientPaint, ImagePaint, VideoPaint, Paint, Guide, RowsColsLayoutGrid, GridLayoutGrid, LayoutGrid, ExportSettingsConstraints, ExportSettingsImage, ExportSettingsSVGBase, ExportSettingsSVG, ExportSettingsSVGString, ExportSettingsPDF, ExportSettingsREST, ExportSettings, WindingRule, VectorVertex, VectorSegment, VectorRegion, VectorNetwork, VectorPath, VectorPaths, LetterSpacing, LineHeight, LeadingTrim, HyperlinkTarget, TextListOptions, BlendMode, MaskType, Font, TextStyleOverrideType, StyledTextSegment, Reaction, VariableDataType, ExpressionFunction, Expression, VariableValueWithExpression, VariableData, ConditionalBlock, DevStatus, Action, SimpleTransition, DirectionalTransition, Transition, Trigger, Navigation, Easing, EasingFunctionBezier, EasingFunctionSpring, OverflowDirection, OverlayPositionType, OverlayBackground, OverlayBackgroundInteraction, PublishStatus, ConnectorEndpointPosition, ConnectorEndpointPositionAndEndpointNodeId, ConnectorEndpointEndpointNodeIdAndMagnet, ConnectorEndpoint, ConnectorStrokeCap, BaseNodeMixin, PluginDataMixin, DevResourcesMixin, DevStatusMixin, SceneNodeMixin, VariableBindableNodeField, VariableBindableTextField, VariableBindablePaintField, VariableBindablePaintStyleField, VariableBindableColorStopField, VariableBindableEffectField, VariableBindableEffectStyleField, VariableBindableLayoutGridField, VariableBindableGridStyleField, VariableBindableComponentPropertyField, VariableBindableComponentPropertyDefinitionField, StickableMixin, ChildrenMixin, ConstraintMixin, DimensionAndPositionMixin, LayoutMixin, BlendMixin, ContainerMixin, DeprecatedBackgroundMixin, StrokeCap, StrokeJoin, HandleMirroring, AutoLayoutMixin, AutoLayoutChildrenMixin, InferredAutoLayoutResult, DetachedInfo, MinimalStrokesMixin, IndividualStrokesMixin, MinimalFillsMixin, GeometryMixin, CornerMixin, RectangleCornerMixin, ExportMixin, FramePrototypingMixin, VectorLikeMixin, ReactionMixin, DocumentationLink, PublishableMixin, DefaultShapeMixin, BaseFrameMixin, DefaultFrameMixin, OpaqueNodeMixin, MinimalBlendMixin, Annotation, AnnotationProperty, AnnotationPropertyType, AnnotationsMixin, Measurement, MeasurementSide, MeasurementOffset, MeasurementsMixin, VariantMixin, ComponentPropertiesMixin, NonResizableTextMixin, TextSublayerNode, DocumentNode, ExplicitVariableModesMixin, PageNode, FrameNode, GroupNode, SliceNode, RectangleNode, LineNode, EllipseNode, PolygonNode, StarNode, VectorNode, TextNode, ComponentPropertyType, InstanceSwapPreferredValue, ComponentPropertyOptions, ComponentPropertyDefinitions, ComponentSetNode, ComponentNode, ComponentProperties, InstanceNode, BooleanOperationNode, StickyNode, StampNode, TableNode, TableCellNode, HighlightNode, WashiTapeNode, ShapeWithTextNode, CodeBlockNode, LabelSublayerNode, ConnectorNode, VariableResolvedDataType, VariableAlias, VariableValue, VariableScope, CodeSyntaxPlatform, Variable, VariableCollection, WidgetNode, EmbedData, EmbedNode, LinkUnfurlData, LinkUnfurlNode, MediaData, MediaNode, SectionNode, BaseNode, SceneNode, NodeType, StyleType, InheritedStyleField, StyleConsumers, BaseStyleMixin, PaintStyle, TextStyle, EffectStyle, GridStyle, BaseStyle, Image, Video, BaseUser, User, ActiveUser, FindAllCriteria }
export { ArgFreeEventType, PluginAPI, VersionHistoryResult, VariablesAPI, LibraryVariableCollection, LibraryVariable, TeamLibraryAPI, PaymentStatus, PaymentsAPI, ClientStorageAPI, NotificationOptions, NotifyDequeueReason, NotificationHandler, ShowUIOptions, UIPostMessageOptions, OnMessageProperties, MessageEventHandler, UIAPI, UtilAPI, ColorPalette, ColorPalettes, ConstantsAPI, CodegenEvent, CodegenPreferences, CodegenPreferencesEvent, CodegenResult, CodegenAPI, DevResource, DevResourceWithNodeId, LinkPreviewEvent, PlainTextElement, LinkPreviewResult, AuthEvent, DevResourceOpenEvent, AuthResult, VSCodeAPI, DevResourcesAPI, TimerAPI, ViewportAPI, TextReviewAPI, ParameterValues, SuggestionResults, ParameterInputEvent, ParametersAPI, RunParametersEvent, OpenDevResourcesEvent, RunEvent, DropEvent, DropItem, DropFile, DocumentChangeEvent, StyleChangeEvent, StyleChange, BaseDocumentChange, BaseNodeChange, RemovedNode, CreateChange, DeleteChange, PropertyChange, BaseStyleChange, StyleCreateChange, StyleDeleteChange, StylePropertyChange, DocumentChange, NodeChangeProperty, NodeChangeEvent, NodeChange, StyleChangeProperty, TextReviewEvent, TextReviewRange, Transform, Vector, Rect, RGB, RGBA, FontName, TextCase, TextDecoration, TextDecorationStyle, TextDecorationOffset, TextDecorationThickness, TextDecorationColor, OpenTypeFeature, ArcData, DropShadowEffect, InnerShadowEffect, BlurEffect, Effect, ConstraintType, Constraints, ColorStop, ImageFilters, SolidPaint, GradientPaint, ImagePaint, VideoPaint, Paint, Guide, RowsColsLayoutGrid, GridLayoutGrid, LayoutGrid, ExportSettingsConstraints, ExportSettingsImage, ExportSettingsSVGBase, ExportSettingsSVG, ExportSettingsSVGString, ExportSettingsPDF, ExportSettingsREST, ExportSettings, WindingRule, VectorVertex, VectorSegment, VectorRegion, VectorNetwork, VectorPath, VectorPaths, LetterSpacing, LineHeight, LeadingTrim, HyperlinkTarget, TextListOptions, BlendMode, MaskType, Font, TextStyleOverrideType, StyledTextSegment, Reaction, VariableDataType, ExpressionFunction, Expression, VariableValueWithExpression, VariableData, ConditionalBlock, DevStatus, Action, SimpleTransition, DirectionalTransition, Transition, Trigger, Navigation, Easing, EasingFunctionBezier, EasingFunctionSpring, OverflowDirection, OverlayPositionType, OverlayBackground, OverlayBackgroundInteraction, PublishStatus, ConnectorEndpointPosition, ConnectorEndpointPositionAndEndpointNodeId, ConnectorEndpointEndpointNodeIdAndMagnet, ConnectorEndpoint, ConnectorStrokeCap, BaseNodeMixin, PluginDataMixin, DevResourcesMixin, DevStatusMixin, SceneNodeMixin, VariableBindableNodeField, VariableBindableTextField, VariableBindablePaintField, VariableBindablePaintStyleField, VariableBindableColorStopField, VariableBindableEffectField, VariableBindableEffectStyleField, VariableBindableLayoutGridField, VariableBindableGridStyleField, VariableBindableComponentPropertyField, VariableBindableComponentPropertyDefinitionField, StickableMixin, ChildrenMixin, ConstraintMixin, DimensionAndPositionMixin, LayoutMixin, BlendMixin, ContainerMixin, DeprecatedBackgroundMixin, StrokeCap, StrokeJoin, HandleMirroring, AutoLayoutMixin, AutoLayoutChildrenMixin, InferredAutoLayoutResult, DetachedInfo, MinimalStrokesMixin, IndividualStrokesMixin, MinimalFillsMixin, GeometryMixin, CornerMixin, RectangleCornerMixin, ExportMixin, FramePrototypingMixin, VectorLikeMixin, ReactionMixin, DocumentationLink, PublishableMixin, DefaultShapeMixin, BaseFrameMixin, DefaultFrameMixin, OpaqueNodeMixin, MinimalBlendMixin, Annotation, AnnotationProperty, AnnotationPropertyType, AnnotationsMixin, Measurement, MeasurementSide, MeasurementOffset, MeasurementsMixin, VariantMixin, ComponentPropertiesMixin, NonResizableTextMixin, TextSublayerNode, DocumentNode, ExplicitVariableModesMixin, PageNode, FrameNode, GroupNode, SliceNode, RectangleNode, LineNode, EllipseNode, PolygonNode, StarNode, VectorNode, TextNode, ComponentPropertyType, InstanceSwapPreferredValue, ComponentPropertyOptions, ComponentPropertyDefinitions, ComponentSetNode, ComponentNode, ComponentProperties, InstanceNode, BooleanOperationNode, StickyNode, StampNode, TableNode, TableCellNode, HighlightNode, WashiTapeNode, ShapeWithTextNode, CodeBlockNode, LabelSublayerNode, ConnectorNode, VariableResolvedDataType, VariableAlias, VariableValue, VariableScope, CodeSyntaxPlatform, Variable, VariableCollection, WidgetNode, EmbedData, EmbedNode, LinkUnfurlData, LinkUnfurlNode, MediaData, MediaNode, SectionNode, BaseNode, SceneNode, NodeType, StyleType, InheritedStyleField, StyleConsumers, BaseStyleMixin, PaintStyle, TextStyle, EffectStyle, GridStyle, BaseStyle, Image, Video, BaseUser, User, ActiveUser, FindAllCriteria }
56 changes: 56 additions & 0 deletions plugin-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,30 @@ declare type TextCase =
| 'SMALL_CAPS'
| 'SMALL_CAPS_FORCED'
declare type TextDecoration = 'NONE' | 'UNDERLINE' | 'STRIKETHROUGH'
declare type TextDecorationStyle = 'SOLID' | 'WAVY' | 'DOTTED'
declare type TextDecorationOffset =
| {
readonly value: number
readonly unit: 'PIXELS' | 'PERCENT'
}
| {
readonly unit: 'AUTO'
}
declare type TextDecorationThickness =
| {
readonly value: number
readonly unit: 'PIXELS' | 'PERCENT'
}
| {
readonly unit: 'AUTO'
}
declare type TextDecorationColor =
| {
readonly value: SolidPaint
}
| {
readonly value: 'AUTO'
}
declare type OpenTypeFeature =
| 'PCAP'
| 'C2PC'
Expand Down Expand Up @@ -1225,6 +1249,11 @@ interface StyledTextSegment {
fontName: FontName
fontWeight: number
textDecoration: TextDecoration
textDecorationStyle: TextDecorationStyle | null
textDecorationOffset: TextDecorationOffset | null
textDecorationThickness: TextDecorationThickness | null
textDecorationColor: TextDecorationColor | null
textDecorationSkipInk: boolean | null
textCase: TextCase
lineHeight: LineHeight
letterSpacing: LetterSpacing
Expand Down Expand Up @@ -1931,6 +1960,11 @@ interface NonResizableTextMixin {
}
| PluginAPI['mixed']
textDecoration: TextDecoration | PluginAPI['mixed']
textDecorationStyle: TextDecorationStyle | PluginAPI['mixed'] | null
textDecorationOffset: TextDecorationOffset | PluginAPI['mixed'] | null
textDecorationThickness: TextDecorationThickness | PluginAPI['mixed'] | null
textDecorationColor: TextDecorationColor | PluginAPI['mixed'] | null
textDecorationSkipInk: boolean | PluginAPI['mixed'] | null
letterSpacing: LetterSpacing | PluginAPI['mixed']
lineHeight: LineHeight | PluginAPI['mixed']
leadingTrim: LeadingTrim | PluginAPI['mixed']
Expand All @@ -1956,6 +1990,28 @@ interface NonResizableTextMixin {
| PluginAPI['mixed']
getRangeTextDecoration(start: number, end: number): TextDecoration | PluginAPI['mixed']
setRangeTextDecoration(start: number, end: number, value: TextDecoration): void
getRangeTextDecorationStyle(
start: number,
end: number,
): TextDecorationStyle | PluginAPI['mixed'] | null
setRangeTextDecorationStyle(start: number, end: number, value: TextDecorationStyle): void
getRangeTextDecorationOffset(
start: number,
end: number,
): TextDecorationOffset | PluginAPI['mixed'] | null
setRangeTextDecorationOffset(start: number, end: number, value: TextDecorationOffset): void
getRangeTextDecorationThickness(
start: number,
end: number,
): TextDecorationThickness | PluginAPI['mixed'] | null
setRangeTextDecorationThickness(start: number, end: number, value: TextDecorationThickness): void
getRangeTextDecorationColor(
start: number,
end: number,
): TextDecorationColor | PluginAPI['mixed'] | null
setRangeTextDecorationColor(start: number, end: number, value: TextDecorationColor): void
getRangeTextDecorationSkipInk(start: number, end: number): boolean | PluginAPI['mixed'] | null
setRangeTextDecorationSkipInk(start: number, end: number, value: boolean): void
getRangeLetterSpacing(start: number, end: number): LetterSpacing | PluginAPI['mixed']
setRangeLetterSpacing(start: number, end: number, value: LetterSpacing): void
getRangeLineHeight(start: number, end: number): LineHeight | PluginAPI['mixed']
Expand Down

0 comments on commit d04670b

Please sign in to comment.