@zeplin/extension-model
Version:
Models exposed to Zeplin extensions
70 lines (69 loc) • 1.7 kB
TypeScript
import { Color } from "./color.js";
export type ShadowType = "inner" | "outer";
export declare const SHADOW_TYPES: Record<string, ShadowType>;
export interface ShadowData {
type: ShadowType;
offsetX: number;
offsetY: number;
blurRadius: number;
spread: number;
color: any;
opacity?: number;
blendMode?: string;
enabled?: boolean;
variableReferences?: Array<{
propertyName: string;
variableSourceId: string;
}>;
}
/**
* An interface to represent shadow of a Layer.
*/
export declare class Shadow {
/**
* Type of the shadow. Possible values are defined in {@link Shadow.TYPE}
*/
type: ShadowType;
/**
* Horizontal distance of the shadow.
*/
offsetX: number;
/**
* Vertical distance of the shadow.
*/
offsetY: number;
/**
* Radius of the blur applied to the shadow. It is a positive integer.
*/
blurRadius: number;
/**
* Spread of the shadow.
*/
spread: number;
/**
* Color used in the shadow.
*/
color: Color;
/**
* Opacity of the shadow.
*/
opacity?: number;
/**
* Blend mode of the shadow. Possible values are defined in {@link Fill.BLEND_MODE}
*/
blendMode?: string;
/**
* Whether the shadow is enabled
*/
enabled: boolean;
static get TYPE(): Record<string, ShadowType>;
static get ALLOWED_FIELDS(): string[];
constructor(shadowData: ShadowData);
/**
* Creates a Shadow instance from a JSON string
*
* @param json JSON string representing a shadow
* @returns A new Shadow instance
*/
static fromJSON(json: string): Shadow;
}