/** * S-Expression Parser for KiCad format * Parses KiCad symbol and footprint S-expressions for browser-side rendering */ export type SExpr = string | SExpr[]; /** * Parse S-expression string into nested structure */ export declare function parseSExpr(input: string): SExpr; /** * Check if expression is a list */ export declare function isList(expr: SExpr): expr is SExpr[]; /** * Check if expression is an atom (string) */ export declare function isAtom(expr: SExpr): expr is string; /** * Get the first element of a list (the tag/type) */ export declare function getTag(expr: SExpr): string | undefined; /** * Find a child element by its tag name * Returns first match or undefined */ export declare function findChild(expr: SExpr, tag: string): SExpr[] | undefined; /** * Find all child elements with a given tag */ export declare function findChildren(expr: SExpr, tag: string): SExpr[][]; /** * Get a simple attribute value: (tag value) -> value */ export declare function getAttr(expr: SExpr, tag: string): string | undefined; /** * Get a numeric attribute value */ export declare function getNumericAttr(expr: SExpr, tag: string): number | undefined; /** * Get a point from (tag x y) format */ export declare function getPoint(expr: SExpr, tag: string): { x: number; y: number; } | undefined; /** * Get point with optional rotation: (tag x y [rotation]) */ export declare function getPointWithRotation(expr: SExpr, tag: string): { x: number; y: number; rotation?: number; } | undefined; /** * Get size from (size w h) format */ export declare function getSize(expr: SExpr): { width: number; height: number; } | undefined; /** * Get stroke properties from (stroke ...) element */ export declare function getStroke(expr: SExpr): { width: number; type: string; } | undefined; /** * Get fill type from (fill ...) element * Handles both (fill solid) and (fill (type solid)) formats */ export declare function getFillType(expr: SExpr): string | undefined; /** * Get all XY points from (pts (xy x y) (xy x y) ...) structure */ export declare function getPoints(expr: SExpr): Array<{ x: number; y: number; }>; /** * Get layers from (layers "Layer1" "Layer2" ...) or (layer "Layer") */ export declare function getLayers(expr: SExpr): string[]; //# sourceMappingURL=sexpr-parser.d.ts.map