import { SimplifiedLayout } from "../transformers/layout"; import type { GetFileNodesResponse, Paint, Vector, GetFileResponse } from "@figma/rest-api-spec"; import { StyleId } from "../utils/common"; import { SimplifiedStroke } from "../transformers/style"; import { SimplifiedEffects } from "../transformers/effects"; export type TextStyle = Partial<{ fontFamily: string; fontWeight: number; fontSize: number; lineHeight: string; letterSpacing: string; textCase: string; textAlignHorizontal: string; textAlignVertical: string; }>; export type StrokeWeights = { top: number; right: number; bottom: number; left: number; }; type StyleTypes = TextStyle | SimplifiedFill[] | SimplifiedLayout | SimplifiedStroke | SimplifiedEffects | string; type GlobalVars = { styles: Record; }; export interface SimplifiedDesign { name: string; lastModified: string; thumbnailUrl: string; nodes: SimplifiedNode[]; globalVars: GlobalVars; } export interface SimplifiedNode { id: string; name: string; type: string; boundingBox?: BoundingBox; text?: string; textStyle?: string; fills?: string; styles?: string; strokes?: string; effects?: string; opacity?: number; borderRadius?: string; layout?: string; children?: SimplifiedNode[]; } export interface BoundingBox { x: number; y: number; width: number; height: number; } export type CSSRGBAColor = `rgba(${number}, ${number}, ${number}, ${number})`; export type CSSHexColor = `#${string}`; export type SimplifiedFill = { type?: Paint["type"]; hex?: string; rgba?: string; opacity?: number; imageRef?: string; scaleMode?: string; gradientHandlePositions?: Vector[]; gradientStops?: { position: number; color: ColorValue | string; }[]; } | CSSRGBAColor | CSSHexColor; export interface ColorValue { hex: string; opacity: number; } export declare function parseFigmaResponse(data: GetFileResponse | GetFileNodesResponse): SimplifiedDesign; export {};