@directededges/specs-from-figma 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +2 -2
  3. package/dist/Adapters/RestApi/NodeIndexer.d.ts +0 -118
  4. package/dist/Adapters/RestApi/RestBaseNode.d.ts +0 -271
  5. package/dist/Adapters/RestApi/RestComponentNode.d.ts +0 -30
  6. package/dist/Adapters/RestApi/RestInstanceNode.d.ts +0 -50
  7. package/dist/Adapters/RestApi/RestLibraryFile.d.ts +0 -51
  8. package/dist/Adapters/RestApi/RestTextNode.d.ts +0 -41
  9. package/dist/Component/Anatomy/Anatomy.d.ts +0 -97
  10. package/dist/Component/Anatomy/AnatomyElement.d.ts +0 -24
  11. package/dist/Component/Children/Children.d.ts +0 -96
  12. package/dist/Component/Color/Color.d.ts +0 -63
  13. package/dist/Component/Component.d.ts +0 -71
  14. package/dist/Component/Effects/Blur.d.ts +0 -41
  15. package/dist/Component/Effects/Effects.d.ts +0 -51
  16. package/dist/Component/Effects/EffectsProcessor.d.ts +0 -15
  17. package/dist/Component/Effects/Shadow.d.ts +0 -51
  18. package/dist/Component/Effects/index.d.ts +0 -4
  19. package/dist/Component/Elements/BaseElement.d.ts +0 -87
  20. package/dist/Component/Elements/ElementFactory.d.ts +0 -7
  21. package/dist/Component/Elements/ElementFactoryRegistry.d.ts +0 -21
  22. package/dist/Component/Elements/Elements.d.ts +0 -86
  23. package/dist/Component/Elements/Primitives/ComponentElement.d.ts +0 -8
  24. package/dist/Component/Elements/Primitives/EllipseElement.d.ts +0 -8
  25. package/dist/Component/Elements/Primitives/FrameElement.d.ts +0 -8
  26. package/dist/Component/Elements/Primitives/GlyphElement.d.ts +0 -21
  27. package/dist/Component/Elements/Primitives/InstanceElement.d.ts +0 -24
  28. package/dist/Component/Elements/Primitives/LineElement.d.ts +0 -8
  29. package/dist/Component/Elements/Primitives/PolygonElement.d.ts +0 -8
  30. package/dist/Component/Elements/Primitives/RectangleElement.d.ts +0 -8
  31. package/dist/Component/Elements/Primitives/SlotElement.d.ts +0 -8
  32. package/dist/Component/Elements/Primitives/StarElement.d.ts +0 -8
  33. package/dist/Component/Elements/Primitives/TextElement.d.ts +0 -8
  34. package/dist/Component/Elements/Primitives/VectorElement.d.ts +0 -8
  35. package/dist/Component/Elements/index.d.ts +0 -12
  36. package/dist/Component/Gradient/Gradient.d.ts +0 -73
  37. package/dist/Component/Gradient/GradientProcessor.d.ts +0 -18
  38. package/dist/Component/Gradient/index.d.ts +0 -2
  39. package/dist/Component/InstanceExamples/InstanceExample.d.ts +0 -35
  40. package/dist/Component/InstanceExamples/InstanceExamples.d.ts +0 -49
  41. package/dist/Component/Layout/Layout.d.ts +0 -26
  42. package/dist/Component/Layout/types.d.ts +0 -61
  43. package/dist/Component/Metadata/Metadata.d.ts +0 -13
  44. package/dist/Component/Metadata/constants.d.ts +0 -8
  45. package/dist/Component/Nodes/types.d.ts +0 -4
  46. package/dist/Component/PropConfigurations/PropConfiguration.d.ts +0 -15
  47. package/dist/Component/PropConfigurations/PropConfigurations.d.ts +0 -55
  48. package/dist/Component/Props/CodeOnlyProps/BooleanCodeOnlyProp.d.ts +0 -11
  49. package/dist/Component/Props/CodeOnlyProps/CodeOnlyProps.d.ts +0 -36
  50. package/dist/Component/Props/CodeOnlyProps/InstanceCodeOnlyProp.d.ts +0 -19
  51. package/dist/Component/Props/CodeOnlyProps/TextCodeOnlyProp.d.ts +0 -18
  52. package/dist/Component/Props/CodeOnlyProps/index.d.ts +0 -4
  53. package/dist/Component/Props/PropBinding.d.ts +0 -69
  54. package/dist/Component/Props/PropPair.d.ts +0 -16
  55. package/dist/Component/Props/PropPairings.d.ts +0 -89
  56. package/dist/Component/Props/Props.d.ts +0 -93
  57. package/dist/Component/Props/SlotConstraints.d.ts +0 -37
  58. package/dist/Component/SlotContent/SlotCandidate.d.ts +0 -42
  59. package/dist/Component/SlotContent/SlotContent.d.ts +0 -84
  60. package/dist/Component/SlotContent/SlotDetector.d.ts +0 -85
  61. package/dist/Component/SlotContent/SlotItem.d.ts +0 -44
  62. package/dist/Component/SlotContent/SlotRegistry.d.ts +0 -61
  63. package/dist/Component/Styles/Composites/BiaxialComposite.d.ts +0 -64
  64. package/dist/Component/Styles/Composites/QuadComposite.d.ts +0 -80
  65. package/dist/Component/Styles/Composites/index.d.ts +0 -4
  66. package/dist/Component/Styles/Primitives/AspectRatioStyle.d.ts +0 -34
  67. package/dist/Component/Styles/Primitives/BooleanStyle.d.ts +0 -6
  68. package/dist/Component/Styles/Primitives/ColorStyle.d.ts +0 -29
  69. package/dist/Component/Styles/Primitives/ConditionalStyle.d.ts +0 -30
  70. package/dist/Component/Styles/Primitives/CornerStyle.d.ts +0 -12
  71. package/dist/Component/Styles/Primitives/EffectsStyle.d.ts +0 -13
  72. package/dist/Component/Styles/Primitives/IconFillStyle.d.ts +0 -40
  73. package/dist/Component/Styles/Primitives/MixedStyle.d.ts +0 -5
  74. package/dist/Component/Styles/Primitives/NumberStyle.d.ts +0 -7
  75. package/dist/Component/Styles/Primitives/PaddingStyle.d.ts +0 -13
  76. package/dist/Component/Styles/Primitives/StringStyle.d.ts +0 -5
  77. package/dist/Component/Styles/Primitives/StrokeStyle.d.ts +0 -12
  78. package/dist/Component/Styles/Primitives/TypographyStyle.d.ts +0 -21
  79. package/dist/Component/Styles/Primitives/index.d.ts +0 -13
  80. package/dist/Component/Styles/Primitives/mapping.d.ts +0 -85
  81. package/dist/Component/Styles/References/FigmaStyleReference.d.ts +0 -45
  82. package/dist/Component/Styles/References/FigmaVariableReference.d.ts +0 -61
  83. package/dist/Component/Styles/References/index.d.ts +0 -24
  84. package/dist/Component/Styles/Style.d.ts +0 -88
  85. package/dist/Component/Styles/Styles.d.ts +0 -108
  86. package/dist/Component/Styles/StylesProcessor.d.ts +0 -96
  87. package/dist/Component/Styles/defaults.d.ts +0 -2
  88. package/dist/Component/Styles/figmaKeyMap.d.ts +0 -12
  89. package/dist/Component/Styles/keys.d.ts +0 -20
  90. package/dist/Component/Subcomponents/Subcomponent.d.ts +0 -20
  91. package/dist/Component/Subcomponents/Subcomponents.d.ts +0 -83
  92. package/dist/Component/Typography/FontStyle.d.ts +0 -6
  93. package/dist/Component/Typography/LetterSpacingStyle.d.ts +0 -4
  94. package/dist/Component/Typography/LineHeightStyle.d.ts +0 -4
  95. package/dist/Component/Typography/Typography.d.ts +0 -105
  96. package/dist/Component/Typography/TypographyProcessor.d.ts +0 -33
  97. package/dist/Component/Typography/constants.d.ts +0 -20
  98. package/dist/Component/Typography/defaults.d.ts +0 -30
  99. package/dist/Component/Typography/keys.d.ts +0 -12
  100. package/dist/Component/Variants/Differencer.d.ts +0 -47
  101. package/dist/Component/Variants/Variant.d.ts +0 -55
  102. package/dist/Component/Variants/Variants.d.ts +0 -91
  103. package/dist/Components/Components.d.ts +0 -68
  104. package/dist/Config/types.Settings.d.ts +0 -30
  105. package/dist/Constants/ApiMappings.d.ts +0 -31
  106. package/dist/Constants/BindingKeys.d.ts +0 -2
  107. package/dist/Constants/DevSettings.d.ts +0 -4
  108. package/dist/Constants/Nodes.d.ts +0 -1
  109. package/dist/License/LicenseManager.d.ts +0 -43
  110. package/dist/License/ProxyClient.d.ts +0 -25
  111. package/dist/License/constants.d.ts +0 -41
  112. package/dist/License/types.d.ts +0 -83
  113. package/dist/Progress/PhaseConfiguration.d.ts +0 -20
  114. package/dist/Progress/Progress.d.ts +0 -107
  115. package/dist/Progress/ProgressCoordinator.d.ts +0 -33
  116. package/dist/Runtime/Context/interfaces.d.ts +0 -73
  117. package/dist/Runtime/Foundations/FigmaPluginFoundations.d.ts +0 -37
  118. package/dist/Runtime/Foundations/FigmaRESTFoundations.d.ts +0 -72
  119. package/dist/Runtime/Foundations/FigmaRESTMaps.d.ts +0 -55
  120. package/dist/Runtime/Foundations/interfaces.d.ts +0 -72
  121. package/dist/Runtime/Nodes/FigmaPluginNodes.d.ts +0 -45
  122. package/dist/Runtime/Nodes/FigmaRestNodes.d.ts +0 -43
  123. package/dist/Runtime/Nodes/NodeAccess.d.ts +0 -23
  124. package/dist/Runtime/Nodes/interfaces.d.ts +0 -60
  125. package/dist/Utilities/Utilities.d.ts +0 -44
  126. package/dist/Utilities/types.ReferenceValue.d.ts +0 -16
@@ -1,21 +0,0 @@
1
- import { BaseElement } from "../BaseElement.js";
2
- import { ResolvedConfig, Element as AnovaElement } from '@directededges/specs-schema';
3
- import type { FigmaElementNode } from '../../Nodes/types.js';
4
- import type { ProcessingContext } from '../../../Runtime/Context/interfaces.js';
5
- export declare class GlyphElement extends BaseElement {
6
- private _glyphName;
7
- constructor(node: FigmaElementNode, config: ResolvedConfig, glyphName: string);
8
- get glyphName(): string;
9
- /**
10
- * Match a resolved component name against a glyph name pattern.
11
- * Returns the extracted glyph name if matched, or null if no match.
12
- * The pattern uses {i} as a placeholder for the glyph name portion.
13
- */
14
- static patternMatch(resolvedName: string, pattern: string): string | null;
15
- protected extendedEvaluate(): Promise<void>;
16
- data(config: ResolvedConfig, subcomponentRefs?: Map<string, string>): AnovaElement | undefined;
17
- protected extendedPostProcess(_context?: ProcessingContext): Promise<void>;
18
- clone(): BaseElement;
19
- merge(layer: BaseElement): BaseElement;
20
- compare(baseline: BaseElement | undefined): BaseElement | undefined;
21
- }
@@ -1,24 +0,0 @@
1
- import { BaseElement } from "../BaseElement.js";
2
- import { ResolvedConfig } from '@directededges/specs-schema';
3
- import { type ProcessingContext } from '../../../Runtime/Context/interfaces.js';
4
- export declare class InstanceElement extends BaseElement {
5
- resolvedInstanceName?: string;
6
- constructor(node: InstanceNode, config: ResolvedConfig);
7
- protected extendedEvaluate(): Promise<void>;
8
- /**
9
- * Resolve the main component name for an instance node.
10
- * Returns the component set name if the main component belongs to a set,
11
- * otherwise returns the component name directly.
12
- */
13
- static resolveMainComponentName(node: InstanceNode): Promise<string>;
14
- /**
15
- * Determine the main component reference asynchronously.
16
- * Uses cached resolvedInstanceName from detect() if available.
17
- */
18
- private instanceName;
19
- /**
20
- * Post-process for InstanceElement.
21
- * With unified bindings, instanceOf already contains the binding info.
22
- */
23
- protected extendedPostProcess(context?: ProcessingContext): Promise<void>;
24
- }
@@ -1,8 +0,0 @@
1
- import { BaseElement } from "../BaseElement.js";
2
- import { ResolvedConfig } from '@directededges/specs-schema';
3
- import type { ProcessingContext } from '../../../Runtime/Context/interfaces.js';
4
- export declare class LineElement extends BaseElement {
5
- constructor(node: LineNode, config: ResolvedConfig);
6
- protected extendedEvaluate(): Promise<void>;
7
- protected extendedPostProcess(_context?: ProcessingContext): Promise<void>;
8
- }
@@ -1,8 +0,0 @@
1
- import { BaseElement } from "../BaseElement.js";
2
- import { ResolvedConfig } from '@directededges/specs-schema';
3
- import type { ProcessingContext } from '../../../Runtime/Context/interfaces.js';
4
- export declare class PolygonElement extends BaseElement {
5
- constructor(node: PolygonNode, config: ResolvedConfig);
6
- protected extendedEvaluate(): Promise<void>;
7
- protected extendedPostProcess(_context?: ProcessingContext): Promise<void>;
8
- }
@@ -1,8 +0,0 @@
1
- import { BaseElement } from "../BaseElement.js";
2
- import { ResolvedConfig } from '@directededges/specs-schema';
3
- import type { ProcessingContext } from '../../../Runtime/Context/interfaces.js';
4
- export declare class RectangleElement extends BaseElement {
5
- constructor(node: RectangleNode, config: ResolvedConfig);
6
- protected extendedEvaluate(): Promise<void>;
7
- protected extendedPostProcess(_context?: ProcessingContext): Promise<void>;
8
- }
@@ -1,8 +0,0 @@
1
- import { BaseElement } from "../BaseElement.js";
2
- import { ResolvedConfig } from '@directededges/specs-schema';
3
- import type { ProcessingContext } from '../../../Runtime/Context/interfaces.js';
4
- export declare class SlotElement extends BaseElement {
5
- constructor(node: SlotNode, config: ResolvedConfig);
6
- protected extendedEvaluate(): Promise<void>;
7
- protected extendedPostProcess(_context?: ProcessingContext): Promise<void>;
8
- }
@@ -1,8 +0,0 @@
1
- import { BaseElement } from "../BaseElement.js";
2
- import { ResolvedConfig } from '@directededges/specs-schema';
3
- import type { ProcessingContext } from '../../../Runtime/Context/interfaces.js';
4
- export declare class StarElement extends BaseElement {
5
- constructor(node: StarNode, config: ResolvedConfig);
6
- protected extendedEvaluate(): Promise<void>;
7
- protected extendedPostProcess(_context?: ProcessingContext): Promise<void>;
8
- }
@@ -1,8 +0,0 @@
1
- import { BaseElement } from "../BaseElement.js";
2
- import { ResolvedConfig } from '@directededges/specs-schema';
3
- import type { ProcessingContext } from '../../../Runtime/Context/interfaces.js';
4
- export declare class TextElement extends BaseElement {
5
- constructor(node: TextNode, config: ResolvedConfig);
6
- protected extendedEvaluate(): Promise<void>;
7
- protected extendedPostProcess(_context?: ProcessingContext): Promise<void>;
8
- }
@@ -1,8 +0,0 @@
1
- import { BaseElement } from "../BaseElement.js";
2
- import { ResolvedConfig } from '@directededges/specs-schema';
3
- import type { ProcessingContext } from '../../../Runtime/Context/interfaces.js';
4
- export declare class VectorElement extends BaseElement {
5
- constructor(node: VectorNode, config: ResolvedConfig);
6
- protected extendedEvaluate(): Promise<void>;
7
- protected extendedPostProcess(_context?: ProcessingContext): Promise<void>;
8
- }
@@ -1,12 +0,0 @@
1
- export { BaseElement } from "./BaseElement.js";
2
- export { ElementFactory } from "./ElementFactory.js";
3
- export { ComponentElement } from "./Primitives/ComponentElement.js";
4
- export { FrameElement } from "./Primitives/FrameElement.js";
5
- export { InstanceElement } from "./Primitives/InstanceElement.js";
6
- export { TextElement } from "./Primitives/TextElement.js";
7
- export { VectorElement } from "./Primitives/VectorElement.js";
8
- export { LineElement } from "./Primitives/LineElement.js";
9
- export { StarElement } from "./Primitives/StarElement.js";
10
- export { PolygonElement } from "./Primitives/PolygonElement.js";
11
- export { RectangleElement } from "./Primitives/RectangleElement.js";
12
- export { EllipseElement } from "./Primitives/EllipseElement.js";
@@ -1,73 +0,0 @@
1
- import type { GradientValue, GradientStop, ResolvedConfig } from '@directededges/specs-schema';
2
- import { type ProcessingContext } from '../../Runtime/Context/interfaces.js';
3
- /**
4
- * Type guard for gradient paints
5
- */
6
- type GradientPaint = Extract<Paint, {
7
- type: 'GRADIENT_LINEAR' | 'GRADIENT_RADIAL' | 'GRADIENT_ANGULAR' | 'GRADIENT_DIAMOND';
8
- }>;
9
- /**
10
- * Gradient — first-class component for Figma gradient fills
11
- *
12
- * Instance-based class (peer to Shadow/Blur/Effects) that wraps a GradientValue.
13
- * Provides lifecycle methods (difference, clone, data) and handles conversion
14
- * from Figma gradient paints to structured gradient values.
15
- *
16
- * Usage:
17
- * const gradient = new Gradient();
18
- * gradient.evaluate(paint);
19
- */
20
- export declare class Gradient {
21
- private _value;
22
- constructor(value?: GradientValue);
23
- get value(): GradientValue;
24
- get type(): 'LINEAR' | 'RADIAL' | 'ANGULAR';
25
- get stops(): GradientStop[];
26
- /**
27
- * Returns true if this Gradient differs from base.
28
- * Compares gradient type, geometry (angle/center), and all stops.
29
- */
30
- difference(base: Gradient): boolean;
31
- /**
32
- * Serialize this Gradient for output, respecting config.format.tokens.
33
- * FigmaVariableReference stop colors are converted per config profile.
34
- * Color instances serialize via .data(config.format.color).
35
- */
36
- data(config: ResolvedConfig): GradientValue;
37
- /**
38
- * Create a deep clone of this Gradient instance.
39
- */
40
- clone(): Gradient;
41
- /**
42
- * Populate gradient value from a Figma gradient paint.
43
- * Returns true if evaluation succeeded, false if paint is unsupported/invalid.
44
- *
45
- * @param paint - Figma gradient paint (GRADIENT_LINEAR, GRADIENT_RADIAL, GRADIENT_ANGULAR)
46
- */
47
- evaluate(paint: GradientPaint, context?: ProcessingContext): boolean;
48
- /**
49
- * Static factory: construct and evaluate in one call.
50
- * Returns Gradient instance or null if evaluation failed.
51
- *
52
- * @param paint - Figma gradient paint
53
- */
54
- static fromPaint(paint: GradientPaint, context?: ProcessingContext): Gradient | null;
55
- /**
56
- * Check if a paint is a gradient type (LINEAR, RADIAL, ANGULAR, or DIAMOND)
57
- */
58
- static isGradientPaint(paint: Paint | undefined): boolean;
59
- /**
60
- * Extract CSS-equivalent angle from Figma linear gradient transform
61
- */
62
- private static evaluateAngle;
63
- /**
64
- * Extract center position from Figma radial/angular gradient transform
65
- */
66
- private static evaluateCenter;
67
- /**
68
- * Convert Figma gradient stops to GradientStop array.
69
- * Returns null if < 2 stops (Figma requires at least 2).
70
- */
71
- private static evaluateStops;
72
- }
73
- export {};
@@ -1,18 +0,0 @@
1
- import { Gradient } from './Gradient.js';
2
- import type { ProcessingContext } from '../../Runtime/Context/interfaces.js';
3
- /**
4
- * GradientProcessor — post-processing logic for Gradient instances
5
- *
6
- * Handles variable name resolution for gradient stop colors.
7
- * Peer to EffectsProcessor.
8
- */
9
- export declare class GradientProcessor {
10
- /**
11
- * Performs post-processing on a Gradient instance.
12
- * Resolves variable names for any FigmaVariableReference stop colors.
13
- *
14
- * @param gradient The Gradient instance to process
15
- * @param context Optional processing context with foundations loader
16
- */
17
- static postProcess(gradient: Gradient | null, context?: ProcessingContext): Promise<void>;
18
- }
@@ -1,2 +0,0 @@
1
- export { Gradient } from './Gradient.js';
2
- export { GradientProcessor } from './GradientProcessor.js';
@@ -1,35 +0,0 @@
1
- import type { InstanceExample as AnovaInstanceExample, ResolvedConfig, SlotContentRef } from '@directededges/specs-schema';
2
- import type { ProcessingContext } from '../../Runtime/Context/interfaces.js';
3
- /**
4
- * Per-example builder (ADR-048 / ADR-050). Maps one detected INSTANCE node into an
5
- * `InstanceExample` — `{ title, propConfigurations? }`.
6
- *
7
- * Scalar prop configuration (TEXT/BOOLEAN/VARIANT/INSTANCE_SWAP coercion, key
8
- * formatting, instance-swap name resolution, and slot-constraint folding) is
9
- * delegated to `PropConfigurations` — the same machinery instance elements use —
10
- * so an example serializes a configured instance identically to the rest of the
11
- * spec. Slot props are supplied as pre-resolved `SlotContentRef`s by the owning
12
- * `InstanceExamples` collaborator (which performs slot detection and owns the
13
- * shared registry); the example holds no slot content of its own.
14
- *
15
- * `PropBinding` is never emitted — an instance example is a documented configuration,
16
- * not a live data binding (ADR-048).
17
- *
18
- * Construction mirrors sibling per-item builders (`Subcomponent`, `PropConfigurations`):
19
- * `(node, config)`; per-call context arrives via `resolve()` / `data()`.
20
- */
21
- export declare class InstanceExample {
22
- private _node;
23
- private _props;
24
- constructor(node: InstanceNode, config: ResolvedConfig);
25
- /** The original node name, used as the human-readable title. */
26
- get title(): string;
27
- /** Resolve scalar prop configurations (incl. INSTANCE_SWAP names). Run before `data()`. */
28
- resolve(context?: ProcessingContext): Promise<void>;
29
- /**
30
- * Build the `InstanceExample`. `slotRefs` are the example's resolved slot-prop
31
- * references (keyed by slot prop key), supplied by `InstanceExamples`.
32
- * `propConfigurations` is omitted when the example exposes no configurable props.
33
- */
34
- data(slotRefs: Record<string, SlotContentRef>): AnovaInstanceExample;
35
- }
@@ -1,49 +0,0 @@
1
- import type { InstanceExamples as AnovaInstanceExamples, ResolvedConfig } from '@directededges/specs-schema';
2
- import type { SlotRegistry } from '../SlotContent/SlotRegistry.js';
3
- import { type ProcessingContext } from '../../Runtime/Context/interfaces.js';
4
- /**
5
- * Top-level collaborator for instance examples (ADR-048 + ADR-050) — sibling to
6
- * Subcomponents and SlotContent. Reads `processing.instanceExamples`, gathers
7
- * candidate nodes by scope (PAGE | FILE), applies match/exclude/parentNames
8
- * filtering, and builds keyed `InstanceExample` entries.
9
- *
10
- * Detection mirrors `processing.subcomponents`. Output gating
11
- * (`include.instanceExamples`) is applied by the caller in `Component.data()`.
12
- */
13
- export declare class InstanceExamples {
14
- /** example key → builder + its resolved slot-prop refs */
15
- private _items;
16
- private config;
17
- constructor(config: ResolvedConfig);
18
- /**
19
- * Compile an example name pattern (with `{C}` and `*`) into a RegExp and test it.
20
- * `{C}` expands to the (escaped) component name; `*` becomes `.*`.
21
- * Independent of `Subcomponents.matchesPatterns` (which uses `{S}` capture semantics).
22
- */
23
- static matchesExamplePattern(name: string, patterns: string[], componentName: string): boolean;
24
- /**
25
- * Detect instance examples for the given host component and contribute their
26
- * slot fills to the shared registry.
27
- *
28
- * Candidates are INSTANCE nodes only (FRAME nodes are rejected), found via a
29
- * boundary-respecting walk (the runtime's getPageSiblings / getAllPagesNodes,
30
- * which stop at COMPONENT/COMPONENT_SET/INSTANCE). Applies for both PAGE and
31
- * FILE scope. No-op when `processing.instanceExamples` is absent.
32
- *
33
- * `stampReferences` (= include.instanceExamples) controls whether slot refs are
34
- * stamped and registry entries marked referenced. Detection always runs so the
35
- * shared registry is populated regardless of the include flag.
36
- */
37
- evaluate(componentName: string, basePath: string, registry: SlotRegistry, stampReferences: boolean, acceptableComponentIds: Set<string>, context?: ProcessingContext, rootNodeId?: string): Promise<void>;
38
- /**
39
- * Detect filled slots inside an example instance (recursively, incl. slot ›
40
- * instance › slot nesting) via the shared SlotDetector, contribute every level
41
- * to the shared registry (deduped, example-key-prefixed), and — when stamping —
42
- * mark referenced and wire nested refs. Returns the top-level slot-prop refs.
43
- */
44
- private _contributeSlots;
45
- /** Serialize to the keyed `InstanceExamples` record, sorted by key for determinism. */
46
- data(): AnovaInstanceExamples;
47
- get size(): number;
48
- get isEmpty(): boolean;
49
- }
@@ -1,26 +0,0 @@
1
- import { ResolvedConfig } from '@directededges/specs-schema';
2
- import type { LayoutTree, LayoutSerializedNode } from './types.js';
3
- /**
4
- * Layout: builds and compares per-variant element hierarchy as a nested tree.
5
- * Primary construction is via constructor with a provided node list.
6
- */
7
- export declare class Layout {
8
- private _tree;
9
- private _config;
10
- constructor(config: ResolvedConfig, tree: LayoutTree);
11
- /**
12
- * Get the internal layout tree.
13
- */
14
- get tree(): LayoutTree;
15
- /**
16
- * Compare the current layout tree against a baseline.
17
- * Follows BaseElement.compare pattern: returns undefined if equal,
18
- * otherwise returns a new Layout instance with the current tree when different.
19
- */
20
- compare(baseline: Layout | undefined): Layout | undefined;
21
- /**
22
- * Return nested array representation suitable for serialization.
23
- */
24
- data(): LayoutSerializedNode[];
25
- private serialize;
26
- }
@@ -1,61 +0,0 @@
1
- /**
2
- * Nested layout tree node used internally.
3
- */
4
- export interface LayoutNode {
5
- name: string;
6
- children: LayoutNode[];
7
- }
8
- /**
9
- * Rooted layout tree container.
10
- */
11
- export interface LayoutTree {
12
- root: LayoutNode;
13
- }
14
- /**
15
- * Serialized tree representation returned by data().
16
- * Format: Array containing the root node object.
17
- * Leaf nodes are strings, parent nodes are { [nodeName]: children[] }.
18
- * Example:
19
- * [
20
- * {
21
- * "root": [
22
- * {
23
- * "labelContainer": [
24
- * "requiredIndicator",
25
- * "label",
26
- * "secondaryDescription"
27
- * ]
28
- * },
29
- * {
30
- * "control": [
31
- * "value",
32
- * "placeholder",
33
- * "startIcon"
34
- * ]
35
- * }
36
- * ]
37
- * }
38
- * ]
39
- */
40
- export type LayoutSerializedNode = string | {
41
- [nodeName: string]: LayoutSerializedNode[];
42
- };
43
- export type LayoutData = LayoutSerializedNode[];
44
- /**
45
- * Whole-tree comparison result.
46
- */
47
- export interface LayoutComparison {
48
- equal: boolean;
49
- added: string[];
50
- removed: string[];
51
- moved: Array<{
52
- name: string;
53
- fromPath: string[];
54
- toPath: string[];
55
- }>;
56
- orderChanges: Array<{
57
- parent: string;
58
- previousOrder: string[];
59
- currentOrder: string[];
60
- }>;
61
- }
@@ -1,13 +0,0 @@
1
- import { Metadata as AnovaMetadata } from '@directededges/specs-schema';
2
- import { SpecableNode } from "../Nodes/types";
3
- import { ResolvedConfig } from '@directededges/specs-schema';
4
- import type { ProcessingContext } from "../../Runtime/Context/interfaces";
5
- export declare class Metadata {
6
- /**
7
- * Find the page ID by traversing up the parent chain
8
- * Handles both Plugin and REST contexts
9
- * Note: Plugin API uses 'PAGE' type, REST API uses 'CANVAS' type for pages
10
- */
11
- private static findPageId;
12
- static create(node: SpecableNode, config: ResolvedConfig, context?: ProcessingContext): AnovaMetadata;
13
- }
@@ -1,8 +0,0 @@
1
- export declare const METADATA: {
2
- PLUGIN_VERSION: string;
3
- PLUGIN_NAME: string;
4
- PLUGIN_URL: string;
5
- SCHEMA_VERSION: string;
6
- SCHEMA_URL: string;
7
- SCHEMA_LATEST_URL: string;
8
- };
@@ -1,4 +0,0 @@
1
- export type SpecableNode = ComponentNode | ComponentSetNode | FrameNode;
2
- export type FigmaElementNode = ComponentNode | FrameNode | InstanceNode | TextNode | VectorNode | LineNode | StarNode | PolygonNode | RectangleNode | EllipseNode | SlotNode;
3
- export type FigmaContainerNode = ComponentNode | FrameNode | InstanceNode;
4
- export type FigmaCorneredNode = ComponentNode | InstanceNode | FrameNode | RectangleNode;
@@ -1,15 +0,0 @@
1
- import type { PropConfigurationValue } from './PropConfigurations';
2
- /**
3
- * PropConfiguration
4
- *
5
- * Represents a single component property configuration value.
6
- * Wrapper class to enable type-safe iteration and Output rendering.
7
- *
8
- * Pattern: Singular wrapper (like Style.ts) for individual entries
9
- * Used by: PropConfigurations.entries() → Attribute → Value
10
- */
11
- export declare class PropConfiguration {
12
- readonly key: string;
13
- readonly value: PropConfigurationValue;
14
- constructor(key: string, value: PropConfigurationValue);
15
- }
@@ -1,55 +0,0 @@
1
- import type { PropConfigurations as AnovaPropConfigurations } from '@directededges/specs-schema';
2
- import { ResolvedConfig } from '@directededges/specs-schema';
3
- import type { ProcessingContext } from '../../Runtime/Context/interfaces.js';
4
- import { PropConfiguration } from './PropConfiguration.js';
5
- export type PropConfigurationValue = string | number | boolean;
6
- export declare class PropConfigurations {
7
- private _items;
8
- private _types;
9
- private _node;
10
- private config;
11
- constructor(node: InstanceNode, config: ResolvedConfig);
12
- /**
13
- * Evaluate component properties. Stores raw values (including component IDs
14
- * for INSTANCE_SWAP) so that merge/compare operate on cheap identity checks.
15
- * Name resolution for INSTANCE_SWAP happens lazily at data() time.
16
- */
17
- evaluate(): void;
18
- /**
19
- * Merge another PropConfigurations instance onto this one.
20
- * Layer properties take precedence over base properties.
21
- * Performs property-level merge: base properties are preserved unless layer overrides them.
22
- *
23
- * @param layer - The PropConfigurations to merge onto this one
24
- * @returns A new PropConfigurations instance with merged values
25
- */
26
- merge(layer: PropConfigurations): PropConfigurations;
27
- /**
28
- * Compare this PropConfigurations against a baseline to identify differences.
29
- * Returns a new PropConfigurations instance containing only differences.
30
- *
31
- * @param baseline - The PropConfigurations to compare against
32
- * @returns A new PropConfigurations instance with differences, or empty if no differences
33
- */
34
- compare(baseline: PropConfigurations): PropConfigurations;
35
- /**
36
- * Resolve INSTANCE_SWAP component IDs to human-readable names.
37
- * Called during postProcess (after merge/compare) so that evaluate/compare
38
- * operate on cheap raw IDs and name lookup only happens for the final output set.
39
- * Writes resolved names back into _items so that entries()/get() return
40
- * resolved values without dual-state — before postProcess they hold raw IDs,
41
- * after postProcess they hold resolved names.
42
- */
43
- postProcess(context?: ProcessingContext): Promise<void>;
44
- data(): AnovaPropConfigurations | undefined;
45
- get(name: string): PropConfigurationValue | undefined;
46
- set(name: string, value: PropConfigurationValue | PropConfiguration): void;
47
- [Symbol.iterator](): IterableIterator<[string, PropConfiguration]>;
48
- entries(): IterableIterator<[string, PropConfiguration]>;
49
- values(): IterableIterator<PropConfigurationValue>;
50
- keys(): IterableIterator<string>;
51
- get size(): number;
52
- isEmpty(): boolean;
53
- copy(source: PropConfigurations, keys?: Set<string> | string[]): void;
54
- clone(): PropConfigurations;
55
- }
@@ -1,11 +0,0 @@
1
- import type { BooleanProp } from '@directededges/specs-schema';
2
- import type { FigmaElementNode } from '../../Nodes/types.js';
3
- /**
4
- * Extracts BooleanProp from a node whose visibility is bound to a BOOLEAN prop.
5
- */
6
- export declare class BooleanCodeOnlyProp {
7
- /** A node is extractable if it has a 'visible' binding. */
8
- static canExtract(node: FigmaElementNode): boolean;
9
- /** Extract a BooleanProp. The current visible state becomes the default. */
10
- static extract(node: FigmaElementNode): BooleanProp;
11
- }
@@ -1,36 +0,0 @@
1
- import type { AnyProp, ResolvedConfig, Props as AnovaProps } from '@directededges/specs-schema';
2
- import type { FigmaElementNode } from '../../Nodes/types.js';
3
- /**
4
- * Orchestrator for code-only prop extraction.
5
- * Routes descendant nodes to specialized extractors (Text, Boolean, Instance)
6
- * and merges results into the native props map.
7
- */
8
- export declare class CodeOnlyProps {
9
- /**
10
- * Full code-only props pipeline: extract, merge with native props,
11
- * and post-process slot constraints.
12
- *
13
- * Keys are stored raw (unformatted). Props.data() handles formatting and sorting.
14
- * Mutates nativeProps in place.
15
- */
16
- static process(container: FigmaElementNode, nativeProps: AnovaProps, processing: ResolvedConfig['processing']): Promise<void>;
17
- /**
18
- * Returns the set of raw (unformatted) prop names that will be extracted from the container.
19
- * Used by Props.process() to pre-exclude these from native prop extraction.
20
- */
21
- static getCodeOnlyPropNames(container: FigmaElementNode): Set<string>;
22
- /**
23
- * Extract code-only props from a container node by routing each descendant
24
- * to the appropriate specialized extractor.
25
- */
26
- static extract(container: FigmaElementNode, existingProps: Record<string, AnyProp>, processing: ResolvedConfig['processing']): Promise<Map<string, AnyProp>>;
27
- /**
28
- * Extract the component property name from a node's componentPropertyReferences.
29
- * Ref values are formatted as "PropName#nodeId" — returns the part before '#'.
30
- */
31
- private static getPropNameFromRefs;
32
- /**
33
- * Recursively collect all descendant nodes from a container.
34
- */
35
- private static descendants;
36
- }
@@ -1,19 +0,0 @@
1
- import type { BooleanProp, EnumProp } from '@directededges/specs-schema';
2
- import type { FigmaElementNode } from '../../Nodes/types.js';
3
- /**
4
- * Extracts BooleanProp or EnumProp from an INSTANCE node used as a code-only prop picker.
5
- * The instance's component must have exactly one VARIANT property in componentPropertyDefinitions.
6
- */
7
- export declare class InstanceCodeOnlyProp {
8
- /** An INSTANCE node is extractable if it has type 'INSTANCE'. */
9
- static canExtract(node: FigmaElementNode): boolean;
10
- /**
11
- * Extract a BooleanProp or EnumProp from the instance's variant definition.
12
- * Returns null if the instance does not meet the single-VARIANT contract.
13
- * Returns `propName` derived from the VARIANT key (not the node name).
14
- */
15
- static extract(node: FigmaElementNode): Promise<{
16
- prop: BooleanProp | EnumProp;
17
- propName: string;
18
- } | null>;
19
- }
@@ -1,18 +0,0 @@
1
- import type { StringProp, NumberProp } from '@directededges/specs-schema';
2
- import type { FigmaElementNode } from '../../Nodes/types.js';
3
- /**
4
- * Extracts StringProp or NumberProp from a TEXT layer bound to a characters prop.
5
- */
6
- export declare class TextCodeOnlyProp {
7
- /** A TEXT node is extractable if it has a 'characters' binding. */
8
- static canExtract(node: FigmaElementNode): boolean;
9
- /**
10
- * Extract a StringProp or NumberProp from a text layer.
11
- * When `inferNumber` is true and the text content passes the numeric guard,
12
- * emits NumberProp instead of StringProp (ADR 029).
13
- */
14
- static extract(node: FigmaElementNode, inferNumber?: boolean): StringProp | NumberProp;
15
- private static buildStringProp;
16
- private static buildNumberProp;
17
- private static extensions;
18
- }
@@ -1,4 +0,0 @@
1
- export { CodeOnlyProps } from './CodeOnlyProps.js';
2
- export { TextCodeOnlyProp } from './TextCodeOnlyProp.js';
3
- export { BooleanCodeOnlyProp } from './BooleanCodeOnlyProp.js';
4
- export { InstanceCodeOnlyProp } from './InstanceCodeOnlyProp.js';