UNPKG

zp-figma-converter

Version:

Convert Figma designs to various code formats

62 lines 1.94 kB
/** * Controller for Figma to CSD conversion * Acts as a facade for the entire conversion process */ export declare class FigmaController { private fileKey; private outputDir; private figmaApi; private parser; private converters; private assetsDir; /** * Create a new Figma controller * @param fileKey Figma file key * @param outputDir Directory to save output files */ constructor(fileKey: string, outputDir?: string); /** * Convert a Figma node to a specific format * @param nodeId Node ID * @param format Target format (e.g., 'xml', 'csd') * @param outputPath Output file path (optional) * @returns Path to the generated file */ convertNode(nodeId: string, format: string, outputPath?: string): Promise<string>; /** * Collect nodes with image references * @param node Intermediate node * @returns List of nodes with images */ private collectImageNodes; /** * Download assets from Figma * @param nodeIds List of node IDs to download * @param format Image format (png, svg, jpg) * @returns List of downloaded file paths */ downloadAssets(nodeIds: { id: string; filePath: string; }[], format?: "png" | "svg" | "jpg"): Promise<string[]>; /** * Get file info from Figma * @returns Figma file data */ getFileInfo(): Promise<import("./types").FigmaFile>; /** * Get specific node from Figma * @param nodeId Node ID * @returns Figma node data */ getNode(nodeId: string): Promise<import("./types").FigmaNode>; /** * Create default output file path * @param baseName Base name for file * @param outputDir Output directory (default: 'csd') * @param extension File extension (default: '.csd') * @returns Generated file path */ private generateOutputPath; } //# sourceMappingURL=figma-controller.d.ts.map