/** * Node data type definition */ export interface NodeData { type: string; name?: string; styles?: string; text?: string; children?: NodeData[]; props?: Record; data?: Record; vectorPaths?: any[]; } /** * Vector node data interface */ export interface VectorNodeData extends NodeData { type: 'VECTOR'; paths: string[]; windingRule?: 'NONZERO' | 'EVENODD'; } /** * Creates a frame with multiple child nodes. * @param styles Style string to apply (Tailwind CSS format) * @param children Child nodes * @param props Additional properties (optional) * @returns Created frame node */ export declare function createFrame(styles?: string, children?: (SceneNode | string)[] | SceneNode | string, props?: Record): FrameNode; /** * Creates a text node. * @param text Text content * @param styles Style string to apply (Tailwind CSS format) * @param props Additional properties (optional) * @returns Created text node */ export declare function createText(text: string, styles?: string, props?: Record): TextNode; /** * Creates a Figma node based on node data. * * @param data Node data * @param parent Optional parent node to append to * @returns Created Figma node * * @example * ```typescript * // Create a simple card component * const cardData = { * type: 'FRAME', * name: 'Card', * styles: 'flex-col bg-white rounded-lg p-[16] gap-[8]', * children: [ * { * type: 'FRAME', * name: 'Image', * styles: 'w-full h-[150] bg-gray-200 rounded-md' * }, * { * type: 'TEXT', * name: 'Title', * styles: 'text-xl font-bold', * text: 'Card Title' * }, * { * type: 'TEXT', * name: 'Description', * styles: 'text-sm text-gray-600', * text: 'Card description text.' * } * ] * }; * * const cardNode = createNodeForData(cardData); * figma.currentPage.appendChild(cardNode); * * // Create a vector node * const iconData = { * type: 'VECTOR', * name: 'Arrow Icon', * styles: 'stroke-black stroke-2 fill-transparent', * paths: [ * "M10 10L20 20M20 20L10 30", * "M30 20H50" * ] * }; * * const iconNode = createNodeForData(iconData); * figma.currentPage.appendChild(iconNode); * ``` */ export declare function createNodeForData(data: NodeData, parent?: BaseNode & ChildrenMixin): SceneNode; /** * Creates multiple Figma nodes based on an array of node data. * * @param dataArray Array of node data * @returns Array of created Figma nodes */ export declare function createNodesForDataArray(dataArray: NodeData[]): SceneNode[]; /** * Creates a component based on component data. * * @param componentData Component data * @returns Created component node */ export declare function createComponentFromData(componentData: NodeData): ComponentNode; /** * Creates an instance based on a component node. * * @param componentNode Component node * @param instanceData Instance data (optional) * @returns Created instance node */ export declare function createInstanceFromComponent(componentNode: ComponentNode, instanceData?: Partial): InstanceNode; /** * Creates a node with data binding based on template and data. * * @param template Template data * @param data Data to bind * @returns Created Figma node */ export declare function createNodeWithDataBinding(template: NodeData, data: Record): SceneNode; /** * Creates a list node based on data. * * @param containerTemplate Container template * @param itemTemplate Item template * @param dataArray Array of data * @returns Created list node */ export declare function createListFromData(containerTemplate: NodeData, itemTemplate: NodeData, dataArray: Record[]): SceneNode; /** * Converts SVG path string to Figma vector node. * * @param svgPath SVG path string * @param styles Style string to apply (optional) * @param props Additional properties (optional) * @returns Created vector node * * @example * ```typescript * // Create an arrow icon * const arrowIcon = createVectorFromSVGPath( * "M10 10L20 20M20 20L10 30", * "stroke-black stroke-2 fill-transparent" * ); * figma.currentPage.appendChild(arrowIcon); * ``` */ export declare function createVectorFromSVGPath(svgPath: string, styles?: string, props?: Record): VectorNode;