@zeplin/extension-model
    Preparing search index...

    Class Layer

    An interface that represents a Layer.

    Index

    Constructors

    Properties

    assets?: AssetContent[]

    Asset contents of the layer.

    blendMode?: string

    Blend mode of the layer. Possible values are defined in Fill.BLEND_MODE

    blur?: Blur

    Blur applied to the layer.

    borderRadius: number | number[]

    Border radius of the layer.

    borders: Border[]

    Borders of the layer.

    componentName?: string

    Component name of the layer.

    componentSourceId?: string

    Component source identifier of the layer.

    constraints?: LayerConstraints

    Constraints of the layer.

    content?: string

    Text content of the layer.

    cornerRadius?: CornerRadius

    Corner radius of the layer.

    exportable?: boolean

    Indicates whether the layer is exportable or not.

    fills: Fill[]

    Fills applied to the layer.

    inspectable?: boolean

    Whether the layer is inspectable in Zeplin.

    layers?: Layer[]

    Layers contained by the layer.

    layout?: Layout

    Layout properties of the layer.

    layoutAlignment?: string

    Alignment of the layer. Possible values are defined in Layout.ALIGNMENT

    layoutGrow?: number

    Grow rate of the layer. This property specifies how much of the remaining space in the parent layer should be assigned to the item. Can be zero or a positive number.

    maxHeight?: number

    Max height of the layer.

    maxLines?: number

    Max lines of the text layer.

    maxWidth?: number

    Max width of the layer.

    minHeight?: number

    Min height of the layer.

    minWidth?: number

    Min width of the layer.

    name: string

    Name of the layer

    opacity: number

    Opacity of the layer. A number in interval [0, 1].

    parent: null | Layer

    Parent layer of the layer.

    rect: Rect

    Bounding rectangle of the layer.

    rotation?: number

    Rotation applied to the layer.

    shadows: Shadow[]

    Shadows applied to the layer.

    shapeType?: string

    Shape type of the shape layer. Possible values are defined in Layer.SHAPE_TYPE

    sourceId?: string

    Id of the layer in the source design document.

    styleName?: string

    Shared style name of the layer.

    styleSourceId?: string

    Shared style source identifier of the layer.

    textStyleName?: string

    Shared text style name of the layer.

    textStyles?: TextStyleWithRange[]

    List of text styles used in the layer.

    textStyleSourceId?: string

    Shared text style identifier of the layer.

    textTruncation?: string

    Determines how long text should be truncated for the text layers. Possible value is "end".

    type: string

    Type of the layer. Possible values are defined in Layer.TYPE

    version?: Version

    Version containing the layer.

    Accessors

    • get defaultTextStyle(): undefined | TextStyle

      Gets the default text style of the layer

      Returns undefined | TextStyle

      The default text style of the layer, or undefined if the layer is not a text layer or has no text styles

    • get ALLOWED_FIELDS(): string[]

      Returns string[]

    • get SHAPE_TYPE(): Record<string, string>

      Returns Record<string, string>

    • get TYPE(): Record<string, string>

      Returns Record<string, string>

    Methods

    • Creates a Layer instance from a JSON string

      Parameters

      • json: string

        JSON string representing a layer

      Returns Layer

      A new Layer instance