/** * Figma Plan Generator * * Extracts structured section summaries from Figma nodes and generates * a detailed IMPLEMENTATION_PLAN.md with concrete design values * (dimensions, layout, colors, typography, images) per section. */ import type { FigmaNode } from '../types.js'; export interface NotableComponent { /** Component name from Figma */ name: string; /** Semantic category */ category: 'indicator' | 'sidebar' | 'nav' | 'footer' | 'decorative' | 'other'; /** Absolute position within the section */ position: { x: number; y: number; } | null; /** Element dimensions */ dimensions: { width: number; height: number; } | null; /** All text content found within this component */ textContent: string[]; /** Whether the element overlaps siblings (needs absolute/fixed positioning) */ isOverlapping: boolean; /** Position hint relative to section (e.g. "right-80 top-326") */ positionHint: string | null; /** Scroll behavior if the element or a child has FIXED/STICKY positioning */ scrollBehavior?: 'fixed' | 'sticky'; /** Computed opacity (cumulative with parents) for decorative elements */ opacity?: number; } export interface SectionSummary { name: string; dimensions: { width: number; height: number; } | null; layout: { direction: 'horizontal' | 'vertical' | null; gap: number | null; rowGap: number | null; padding: string | null; mainAlign: string | null; crossAlign: string | null; wrap: boolean; } | null; background: string | null; images: Array<{ path: string; scaleMode: string; isHero: boolean; dimensions: string; }>; compositeImage: { path: string; dimensions: string; hasTextOverlays?: boolean; parentBackgroundColor?: string; } | null; icons: string[]; typography: Array<{ font: string; size: number; weight: number; lineHeight: number | null; color: string | null; usage: string; letterSpacing?: number; textDecoration?: string; textTransform?: string; }>; borderRadius: string | null; overflow: string | null; scrollBehavior: string | null; effects: string[]; border: string | null; childCount: number; /** Notable sub-components that need explicit implementation (indicators, sidebars, etc.) */ notableComponents: NotableComponent[]; /** Content sub-sections detected within this frame (e.g., "01 - Get Started", "02 - Essentials") */ contentSections: Array<{ name: string; position: { x: number; y: number; }; dimensions: { width: number; height: number; }; images: SectionSummary['images']; typography: SectionSummary['typography']; notableComponents: NotableComponent[]; /** Whether the image is placed left or right within this sub-section */ imagePosition?: 'left' | 'right' | null; }>; } export interface SectionSummaryOptions { imageFillUrls?: Record; compositeImages?: Map; /** Node IDs of composites that have text overlays (visual-dominant composites) */ compositeTextOverlays?: Set; /** Parent background colors for composites (nodeId → CSS color string) */ compositeBackgroundColors?: Map; exportedIcons?: Map; fontSubstitutions?: Map; } export interface FigmaPlanOptions { fileName: string; projectStack?: string | null; imagesDownloaded?: boolean; hasDesignTokens?: boolean; iconFilenames?: string[]; fontNames?: string[]; } /** * Extract structured summaries from top-level Figma sections. * * Walks direct FRAME children of CANVAS nodes (or specific requested nodes) * and extracts layout, colors, typography, images, etc. from each section. */ export declare function extractSectionSummaries(nodes: FigmaNode[], options?: SectionSummaryOptions): SectionSummary[]; /** * Generate a detailed IMPLEMENTATION_PLAN.md from section summaries. */ export declare function extractFigmaPlan(sections: SectionSummary[], options: FigmaPlanOptions): string; //# sourceMappingURL=plan-generator.d.ts.map