UNPKG

@zeplin/extension-model

Version:

Models exposed to Zeplin extensions

87 lines (86 loc) 2.64 kB
import { Color } from "./color.js"; import { Gradient } from "./gradient.js"; export declare const FILL_TYPES: Record<string, string>; export declare const BLEND_MODES: { readonly NORMAL: "normal"; readonly DARKEN: "darken"; readonly MULTIPLY: "multiply"; readonly COLOR_BURN: "color-burn"; readonly LIGHTEN: "lighten"; readonly SCREEN: "screen"; readonly COLOR_DODGE: "color-dodge"; readonly OVERLAY: "overlay"; readonly SOFT_LIGHT: "soft-light"; readonly HARD_LIGHT: "hard-light"; readonly DIFFERENCE: "difference"; readonly EXCLUSION: "exclusion"; readonly HUE: "hue"; readonly SATURATION: "saturation"; readonly COLOR: "color"; readonly LUMINOSITY: "luminosity"; readonly SOURCE_IN: "source-in"; readonly SOURCE_OUT: "source-out"; readonly SOURCE_ATOP: "source-atop"; readonly DESTINATION_OVER: "destination-over"; readonly DESTINATION_IN: "destination-in"; readonly DESTINATION_OUT: "destination-out"; readonly DESTINATION_ATOP: "destination-atop"; readonly DISSOLVE: "dissolve"; readonly LINEAR_BURN: "linear-burn"; readonly LINEAR_DODGE: "linear-dodge"; readonly DARKER_COLOR: "darker-color"; readonly LIGHTER_COLOR: "lighter-color"; readonly VIVID_LIGHT: "vivid-light"; readonly LINEAR_LIGHT: "linear-light"; readonly PIN_LIGHT: "pin-light"; readonly HARD_MIX: "hard-mix"; readonly SUBTRACT: "subtract"; readonly DIVIDE: "divide"; }; export interface FillData { fillType: string; color?: any; gradient?: any; opacity?: number; blendMode?: string; variableReferences?: Array<{ propertyName: string; variableSourceId: string; }>; } /** * An interface to represent fill */ export declare class Fill { /** * Type of the fill. Possible values are "color" and "gradient" */ type: string; /** * Color of the fill. */ color?: Color; /** * Gradient of the fill. */ gradient?: Gradient; /** * Opacity of the fill. A number in interval [0, 1]. */ opacity?: number; /** * Blend mode of the fill. Possible values are defined in {@link Fill.BLEND_MODE} */ blendMode?: string; static get TYPE(): typeof FILL_TYPES; static get BLEND_MODE(): typeof BLEND_MODES; static get ALLOWED_FIELDS(): string[]; constructor(fillData: FillData, w?: number, h?: number); /** * Creates a Fill instance from a JSON string * * @param json JSON string representing a fill * @returns A new Fill instance */ static fromJSON(json: string): Fill; }