UNPKG

@zeplin/extension-model

Version:

Models exposed to Zeplin extensions

44 lines (43 loc) 1.31 kB
/** * Enum for layer constraint sizing mode */ export declare enum LayerConstraintSizingMode { FIXED = "fixed", STRETCH = "stretch", HUG_CONTENTS = "hug-contents" } /** * Interface for layer constraint data */ export interface LayerConstraintData { min?: boolean; max?: boolean; sizingMode: LayerConstraintSizingMode; } /** * An interface to represent the constraint of {@link Layer} */ export declare class LayerConstraint { /** * Determines if there is a fixed distance to starting edge (top for vertical, left for horizontal). */ min?: boolean; /** * Determines if there is a fixed distance to ending edge (bottom for vertical, right for horizontal). */ max?: boolean; /** * Sizing mode of the layer. Possible values are defined in {@link LayerConstraint.SIZING_MODE} */ sizingMode: LayerConstraintSizingMode; static get SIZING_MODE(): typeof LayerConstraintSizingMode; static get ALLOWED_FIELDS(): string[]; constructor(layerConstraintData: LayerConstraintData); /** * Creates a LayerConstraint instance from a JSON string * * @param json JSON string representing a layer constraint * @returns A new LayerConstraint instance */ static fromJSON(json: string): LayerConstraint; }