Skip to content

[Request] Add MinimalEffectsMixin interface for consistency #291

Description

@andreincu

This is a feature request for adding MinimalEffectsMixin for being consistent with the rest, plus adding the ability to extract nodes that support effects.

Before:
interface BlendMixin extends MinimalBlendMixin {
  isMask: boolean
  maskType: MaskType
  effects: ReadonlyArray<Effect>
  effectStyleId: string
  setEffectStyleIdAsync(styleId: string): Promise<void>
}
After:
interface MinimalEffectsMixin {
  effects: ReadonlyArray<Effect>
  effectStyleId: string
  setEffectStyleIdAsync(styleId: string): Promise<void>
}
  
interface BlendMixin extends MinimalBlendMixin, MinimalEffectsMixin {
  isMask: boolean
  maskType: MaskType
}

This will allow doing the following:

type NodeWithEffects = Extract<SceneNode, MinimalBlendMixin>
// Output: type NodeWithEffects = FrameNode | GroupNode | ComponentSetNode | ComponentNode | InstanceNode | BooleanOperationNode | VectorNode | StarNode | LineNode | EllipseNode | PolygonNode | RectangleNode | TextNode | StampNode | HighlightNode | WashiTapeNode

https://github.com/figma/plugin-typings/blob/67cdb4a189db19caa1d4e5f87971e7a3931e273b/plugin-api.d.ts#L1626C1-L1627C24

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions