/** * Semantic FigJam Data Extractor * * Extracts semantically meaningful data from FigJam boards while discarding * positional/visual information. Produces deterministic, diff-friendly output. */ import type { SimplifiedDesign, SimplifiedNode } from "./types.js"; export type StickyCategory = "blocker" | "tbd" | "investigation" | "done" | "info" | "note" | "unknown"; /** Legacy alias for "investigation" (pre-v33 name) — accepted on input, never emitted. */ export type LegacyStickyCategory = "si-investigation"; export interface SemanticExtract { fileKey: string; nodeId: string | null; title: string; fetchedAt: string; sections: SectionSummary[]; stickies: StickyNote[]; components: ComponentSummary[]; textNodes: TextNodeSummary[]; shapes: ShapeSummary[]; connectors: ConnectorSummary[]; userStories: UserStoryRef[]; stats: { totalNodes: number; nodesDropped: number; }; } export interface SectionSummary { id: string; name: string; parentSectionId: string | null; } export interface StickyNote { id: string; category: StickyCategory; text: string; parentSectionId: string | null; } export interface ComponentSummary { id: string; type: string; name: string; text: string; parentSectionId: string | null; componentId?: string; properties?: Record; } export interface TextNodeSummary { id: string; text: string; parentSectionId: string | null; } export interface ShapeSummary { id: string; text: string; parentSectionId: string | null; } export interface ConnectorSummary { id: string; fromNodeId: string; toNodeId: string; fromNodeName?: string; toNodeName?: string; label?: string; } export interface UserStoryRef { id: number; type: "US" | "Story" | "Task" | "Bug"; foundIn: string[]; contexts: string[]; } export interface SemanticExtractOptions { /** Custom sticky color category overrides (hex -> category). Accepts the legacy "si-investigation" alias. */ stickyColorOverrides?: Record; /** Custom regex pattern for story ID extraction */ storyIdPattern?: RegExp; } /** * Categorize a sticky note based on its fill color. * Accepts fills in the format from SimplifiedNode (string reference to globalVars * or direct color value). */ export declare function categorizeStickyColor(fills: string | undefined, globalVars?: { styles?: Record; }, overrides?: Record): StickyCategory; /** * Extract user story/task/bug IDs from text content. * Uses strict pattern requiring prefix. */ export declare function extractUserStories(nodes: SimplifiedNode[], pattern?: RegExp): UserStoryRef[]; /** * Extract semantic data from a simplified Figma design. * * @param design - The simplified design from getFigmaData * @param fileKey - The Figma file key * @param nodeId - Optional node ID that was fetched * @param options - Extraction options * @returns Semantic extract with deterministic, diff-friendly structure */ export declare function extractSemanticData(design: SimplifiedDesign, fileKey: string, nodeId?: string, options?: SemanticExtractOptions): SemanticExtract; //# sourceMappingURL=semantic-extractor.d.ts.map