@directededges/specs-from-figma 0.22.0 → 0.24.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.
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/dist/Adapters/RestApi/NodeIndexer.d.ts +0 -118
- package/dist/Adapters/RestApi/RestBaseNode.d.ts +0 -271
- package/dist/Adapters/RestApi/RestComponentNode.d.ts +0 -30
- package/dist/Adapters/RestApi/RestInstanceNode.d.ts +0 -50
- package/dist/Adapters/RestApi/RestLibraryFile.d.ts +0 -51
- package/dist/Adapters/RestApi/RestTextNode.d.ts +0 -41
- package/dist/Component/Anatomy/Anatomy.d.ts +0 -97
- package/dist/Component/Anatomy/AnatomyElement.d.ts +0 -24
- package/dist/Component/Children/Children.d.ts +0 -96
- package/dist/Component/Color/Color.d.ts +0 -63
- package/dist/Component/Component.d.ts +0 -71
- package/dist/Component/Effects/Blur.d.ts +0 -41
- package/dist/Component/Effects/Effects.d.ts +0 -51
- package/dist/Component/Effects/EffectsProcessor.d.ts +0 -15
- package/dist/Component/Effects/Shadow.d.ts +0 -51
- package/dist/Component/Effects/index.d.ts +0 -4
- package/dist/Component/Elements/BaseElement.d.ts +0 -87
- package/dist/Component/Elements/ElementFactory.d.ts +0 -7
- package/dist/Component/Elements/ElementFactoryRegistry.d.ts +0 -21
- package/dist/Component/Elements/Elements.d.ts +0 -86
- package/dist/Component/Elements/Primitives/ComponentElement.d.ts +0 -8
- package/dist/Component/Elements/Primitives/EllipseElement.d.ts +0 -8
- package/dist/Component/Elements/Primitives/FrameElement.d.ts +0 -8
- package/dist/Component/Elements/Primitives/GlyphElement.d.ts +0 -21
- package/dist/Component/Elements/Primitives/InstanceElement.d.ts +0 -24
- package/dist/Component/Elements/Primitives/LineElement.d.ts +0 -8
- package/dist/Component/Elements/Primitives/PolygonElement.d.ts +0 -8
- package/dist/Component/Elements/Primitives/RectangleElement.d.ts +0 -8
- package/dist/Component/Elements/Primitives/SlotElement.d.ts +0 -8
- package/dist/Component/Elements/Primitives/StarElement.d.ts +0 -8
- package/dist/Component/Elements/Primitives/TextElement.d.ts +0 -8
- package/dist/Component/Elements/Primitives/VectorElement.d.ts +0 -8
- package/dist/Component/Elements/index.d.ts +0 -12
- package/dist/Component/Gradient/Gradient.d.ts +0 -73
- package/dist/Component/Gradient/GradientProcessor.d.ts +0 -18
- package/dist/Component/Gradient/index.d.ts +0 -2
- package/dist/Component/InstanceExamples/InstanceExample.d.ts +0 -35
- package/dist/Component/InstanceExamples/InstanceExamples.d.ts +0 -49
- package/dist/Component/Layout/Layout.d.ts +0 -26
- package/dist/Component/Layout/types.d.ts +0 -61
- package/dist/Component/Metadata/Metadata.d.ts +0 -13
- package/dist/Component/Metadata/constants.d.ts +0 -8
- package/dist/Component/Nodes/types.d.ts +0 -4
- package/dist/Component/PropConfigurations/PropConfiguration.d.ts +0 -15
- package/dist/Component/PropConfigurations/PropConfigurations.d.ts +0 -55
- package/dist/Component/Props/CodeOnlyProps/BooleanCodeOnlyProp.d.ts +0 -11
- package/dist/Component/Props/CodeOnlyProps/CodeOnlyProps.d.ts +0 -36
- package/dist/Component/Props/CodeOnlyProps/InstanceCodeOnlyProp.d.ts +0 -19
- package/dist/Component/Props/CodeOnlyProps/TextCodeOnlyProp.d.ts +0 -18
- package/dist/Component/Props/CodeOnlyProps/index.d.ts +0 -4
- package/dist/Component/Props/PropBinding.d.ts +0 -69
- package/dist/Component/Props/PropPair.d.ts +0 -16
- package/dist/Component/Props/PropPairings.d.ts +0 -89
- package/dist/Component/Props/Props.d.ts +0 -93
- package/dist/Component/Props/SlotConstraints.d.ts +0 -37
- package/dist/Component/SlotContent/SlotCandidate.d.ts +0 -42
- package/dist/Component/SlotContent/SlotContent.d.ts +0 -84
- package/dist/Component/SlotContent/SlotDetector.d.ts +0 -85
- package/dist/Component/SlotContent/SlotItem.d.ts +0 -44
- package/dist/Component/SlotContent/SlotRegistry.d.ts +0 -61
- package/dist/Component/Styles/Composites/BiaxialComposite.d.ts +0 -64
- package/dist/Component/Styles/Composites/QuadComposite.d.ts +0 -80
- package/dist/Component/Styles/Composites/index.d.ts +0 -4
- package/dist/Component/Styles/Primitives/AspectRatioStyle.d.ts +0 -34
- package/dist/Component/Styles/Primitives/BooleanStyle.d.ts +0 -6
- package/dist/Component/Styles/Primitives/ColorStyle.d.ts +0 -29
- package/dist/Component/Styles/Primitives/ConditionalStyle.d.ts +0 -30
- package/dist/Component/Styles/Primitives/CornerStyle.d.ts +0 -12
- package/dist/Component/Styles/Primitives/EffectsStyle.d.ts +0 -13
- package/dist/Component/Styles/Primitives/IconFillStyle.d.ts +0 -40
- package/dist/Component/Styles/Primitives/MixedStyle.d.ts +0 -5
- package/dist/Component/Styles/Primitives/NumberStyle.d.ts +0 -7
- package/dist/Component/Styles/Primitives/PaddingStyle.d.ts +0 -13
- package/dist/Component/Styles/Primitives/StringStyle.d.ts +0 -5
- package/dist/Component/Styles/Primitives/StrokeStyle.d.ts +0 -12
- package/dist/Component/Styles/Primitives/TypographyStyle.d.ts +0 -21
- package/dist/Component/Styles/Primitives/index.d.ts +0 -13
- package/dist/Component/Styles/Primitives/mapping.d.ts +0 -85
- package/dist/Component/Styles/References/FigmaStyleReference.d.ts +0 -45
- package/dist/Component/Styles/References/FigmaVariableReference.d.ts +0 -61
- package/dist/Component/Styles/References/index.d.ts +0 -24
- package/dist/Component/Styles/Style.d.ts +0 -88
- package/dist/Component/Styles/Styles.d.ts +0 -108
- package/dist/Component/Styles/StylesProcessor.d.ts +0 -96
- package/dist/Component/Styles/defaults.d.ts +0 -2
- package/dist/Component/Styles/figmaKeyMap.d.ts +0 -12
- package/dist/Component/Styles/keys.d.ts +0 -20
- package/dist/Component/Subcomponents/Subcomponent.d.ts +0 -20
- package/dist/Component/Subcomponents/Subcomponents.d.ts +0 -83
- package/dist/Component/Typography/FontStyle.d.ts +0 -6
- package/dist/Component/Typography/LetterSpacingStyle.d.ts +0 -4
- package/dist/Component/Typography/LineHeightStyle.d.ts +0 -4
- package/dist/Component/Typography/Typography.d.ts +0 -105
- package/dist/Component/Typography/TypographyProcessor.d.ts +0 -33
- package/dist/Component/Typography/constants.d.ts +0 -20
- package/dist/Component/Typography/defaults.d.ts +0 -30
- package/dist/Component/Typography/keys.d.ts +0 -12
- package/dist/Component/Variants/Differencer.d.ts +0 -47
- package/dist/Component/Variants/Variant.d.ts +0 -55
- package/dist/Component/Variants/Variants.d.ts +0 -91
- package/dist/Components/Components.d.ts +0 -68
- package/dist/Config/types.Settings.d.ts +0 -30
- package/dist/Constants/ApiMappings.d.ts +0 -31
- package/dist/Constants/BindingKeys.d.ts +0 -2
- package/dist/Constants/DevSettings.d.ts +0 -4
- package/dist/Constants/Nodes.d.ts +0 -1
- package/dist/License/LicenseManager.d.ts +0 -43
- package/dist/License/ProxyClient.d.ts +0 -25
- package/dist/License/constants.d.ts +0 -41
- package/dist/License/types.d.ts +0 -83
- package/dist/Progress/PhaseConfiguration.d.ts +0 -20
- package/dist/Progress/Progress.d.ts +0 -107
- package/dist/Progress/ProgressCoordinator.d.ts +0 -33
- package/dist/Runtime/Context/interfaces.d.ts +0 -73
- package/dist/Runtime/Foundations/FigmaPluginFoundations.d.ts +0 -37
- package/dist/Runtime/Foundations/FigmaRESTFoundations.d.ts +0 -72
- package/dist/Runtime/Foundations/FigmaRESTMaps.d.ts +0 -55
- package/dist/Runtime/Foundations/interfaces.d.ts +0 -72
- package/dist/Runtime/Nodes/FigmaPluginNodes.d.ts +0 -45
- package/dist/Runtime/Nodes/FigmaRestNodes.d.ts +0 -43
- package/dist/Runtime/Nodes/NodeAccess.d.ts +0 -23
- package/dist/Runtime/Nodes/interfaces.d.ts +0 -60
- package/dist/Utilities/Utilities.d.ts +0 -44
- package/dist/Utilities/types.ReferenceValue.d.ts +0 -16
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { ResolvedConfig } from '@directededges/specs-schema';
|
|
2
|
-
import { FigmaVariableReference } from '../References/index.js';
|
|
3
|
-
import type { FigmaElementNode } from '../../Nodes/types.js';
|
|
4
|
-
/** Per-field value: raw number or variable reference */
|
|
5
|
-
export type BiaxialFieldValue = number | FigmaVariableReference;
|
|
6
|
-
export type BiaxialValue = number | FigmaVariableReference | BiaxialComposite;
|
|
7
|
-
/**
|
|
8
|
-
* Bi-axial composite for `{ horizontal, vertical }` spacing values.
|
|
9
|
-
* Used for `itemSpacing` when wrap is enabled and axes differ.
|
|
10
|
-
* Direction-aware: maps Figma primary/counter-axis to absolute horizontal/vertical
|
|
11
|
-
* based on layoutMode.
|
|
12
|
-
*/
|
|
13
|
-
export declare class BiaxialComposite {
|
|
14
|
-
private _fields;
|
|
15
|
-
constructor(fields: {
|
|
16
|
-
horizontal?: BiaxialFieldValue;
|
|
17
|
-
vertical?: BiaxialFieldValue;
|
|
18
|
-
});
|
|
19
|
-
/**
|
|
20
|
-
* Factory: read itemSpacing + counterAxisSpacing from a Figma node and produce
|
|
21
|
-
* a BiaxialComposite with direction-aware axis mapping.
|
|
22
|
-
* Picks up variable bindings when present and licensed.
|
|
23
|
-
*/
|
|
24
|
-
static fromNode(node: FigmaElementNode, layoutMode: 'HORIZONTAL' | 'VERTICAL', licensed?: boolean): BiaxialComposite;
|
|
25
|
-
/**
|
|
26
|
-
* Resolve a bound variable for a Figma node property key.
|
|
27
|
-
*/
|
|
28
|
-
private static getVariableForKey;
|
|
29
|
-
/**
|
|
30
|
-
* Compare against a baseline. Returns a sparse composite with only changed fields,
|
|
31
|
-
* or null if no fields differ.
|
|
32
|
-
*/
|
|
33
|
-
difference(baseline: BiaxialValue): BiaxialValue | null;
|
|
34
|
-
/**
|
|
35
|
-
* Style-level union router (like QuadComposite.differenceValues).
|
|
36
|
-
* Returns undefined when biaxial semantics do not apply.
|
|
37
|
-
*/
|
|
38
|
-
static differenceValues(current: unknown, baseline: unknown): BiaxialValue | null | undefined;
|
|
39
|
-
/**
|
|
40
|
-
* Merge a layered variant composite onto a baseline.
|
|
41
|
-
* Layer wins on overlapping axes.
|
|
42
|
-
*/
|
|
43
|
-
static merge(base: BiaxialValue, layer: BiaxialComposite | null): BiaxialValue;
|
|
44
|
-
clone(): BiaxialComposite;
|
|
45
|
-
data(config: ResolvedConfig): Record<string, unknown>;
|
|
46
|
-
/** Resolve variable names for all FigmaVariableReference fields */
|
|
47
|
-
resolveVariables(foundations: import('../../../Runtime/Foundations/interfaces.js').FigmaFoundations | undefined): Promise<void>;
|
|
48
|
-
/** True when all fields are plain numbers equal to the given scalar (for default removal) */
|
|
49
|
-
isEqualToScalar(scalar: number): boolean;
|
|
50
|
-
/** Get a field value by axis name */
|
|
51
|
-
get(field: 'horizontal' | 'vertical'): BiaxialFieldValue | undefined;
|
|
52
|
-
/** Returns axis names that have values */
|
|
53
|
-
fields(): string[];
|
|
54
|
-
private fieldValue;
|
|
55
|
-
private static resolveField;
|
|
56
|
-
private static fieldDiffers;
|
|
57
|
-
private static cloneField;
|
|
58
|
-
private static cloneValue;
|
|
59
|
-
/**
|
|
60
|
-
* Normalize: always preserve composite form (never collapse to scalar).
|
|
61
|
-
* Bi-axial values remain explicit even when both axes are equal.
|
|
62
|
-
*/
|
|
63
|
-
private static normalize;
|
|
64
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import type { ResolvedConfig } from '@directededges/specs-schema';
|
|
2
|
-
import { FigmaVariableReference } from '../References/index.js';
|
|
3
|
-
import { FigmaElementNode } from '../../Nodes/types.js';
|
|
4
|
-
/** Per-field value: raw number or variable reference */
|
|
5
|
-
export type FieldValue = number | FigmaVariableReference;
|
|
6
|
-
export type QuadValue = number | FigmaVariableReference | QuadComposite;
|
|
7
|
-
export type QuadKind = 'SIDES' | 'CORNERS';
|
|
8
|
-
/** Collected per-field data from Figma node reading */
|
|
9
|
-
export type CollectedField = {
|
|
10
|
-
logicalKey: string;
|
|
11
|
-
raw: number | null;
|
|
12
|
-
variable: FigmaVariableReference | null;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Generic composite for per-field numeric values (padding, strokeWeight, cornerRadius).
|
|
16
|
-
* Fields hold raw numbers or FigmaVariableReference instances keyed by logical name.
|
|
17
|
-
* Serializes to the anova `Sides` or `Corners` output type via data().
|
|
18
|
-
*/
|
|
19
|
-
export declare class QuadComposite {
|
|
20
|
-
private _fields;
|
|
21
|
-
private _kind;
|
|
22
|
-
/** Inherited shorthand default for fields not explicitly set (used during layered diffing) */
|
|
23
|
-
private _default;
|
|
24
|
-
/**
|
|
25
|
-
* Resolve a bound variable for a Figma node property key.
|
|
26
|
-
*/
|
|
27
|
-
static getVariableForKey(node: FigmaElementNode, figmaKey: string, rawValue: number | null): FigmaVariableReference | null;
|
|
28
|
-
/**
|
|
29
|
-
* Collect per-field raw values and variables from a Figma node using a key map.
|
|
30
|
-
*/
|
|
31
|
-
static collectFields(node: FigmaElementNode, figmaKeyMap: Record<string, string>, includeVariables: boolean, getVariable?: (node: FigmaElementNode, figmaKey: string, raw: number | null) => FigmaVariableReference | null, getRawValue?: (node: FigmaElementNode, figmaKey: string) => number | null): CollectedField[];
|
|
32
|
-
/**
|
|
33
|
-
* Build a QuadComposite (or collapse to scalar) from collected per-field data.
|
|
34
|
-
* Returns a single FigmaVariableReference if all fields share the same variable,
|
|
35
|
-
* a scalar number if all fields have the same raw value, or a QuadComposite.
|
|
36
|
-
*/
|
|
37
|
-
static fromFields(fields: CollectedField[], kind: QuadKind): QuadValue;
|
|
38
|
-
/**
|
|
39
|
-
* Merge a layered variant object onto a baseline shorthand/object.
|
|
40
|
-
* Variant wins on overlapping properties.
|
|
41
|
-
*/
|
|
42
|
-
static merge(base: QuadValue, layer: QuadComposite | null): QuadValue;
|
|
43
|
-
constructor(fields: Record<string, FieldValue>, kind?: QuadKind);
|
|
44
|
-
/**
|
|
45
|
-
* Compare against a baseline. Returns a sparse composite with only changed fields,
|
|
46
|
-
* or null if no fields differ.
|
|
47
|
-
*/
|
|
48
|
-
difference(baseline: QuadValue): QuadValue | null;
|
|
49
|
-
/**
|
|
50
|
-
* Quad-aware difference router for Style-level union values.
|
|
51
|
-
*
|
|
52
|
-
* Returns:
|
|
53
|
-
* - `undefined` when quad semantics do not apply
|
|
54
|
-
* - `null` when values participate in quad comparison and are equal
|
|
55
|
-
* - `QuadValue` when values participate and differ
|
|
56
|
-
*/
|
|
57
|
-
static differenceValues(current: unknown, baseline: unknown): QuadValue | null | undefined;
|
|
58
|
-
clone(): QuadComposite;
|
|
59
|
-
data(config: ResolvedConfig): Record<string, unknown>;
|
|
60
|
-
/** Returns logical field names that have values */
|
|
61
|
-
fields(): string[];
|
|
62
|
-
get kind(): QuadKind;
|
|
63
|
-
/** True when all fields are plain numbers equal to the given scalar (for default removal) */
|
|
64
|
-
isEqualToScalar(scalar: number): boolean;
|
|
65
|
-
/** Get a field value by logical name */
|
|
66
|
-
get(field: string): FieldValue | undefined;
|
|
67
|
-
/** Set a field value by logical name */
|
|
68
|
-
set(field: string, value: FieldValue): void;
|
|
69
|
-
private fieldValue;
|
|
70
|
-
private static fieldDiffers;
|
|
71
|
-
private static cloneFieldValue;
|
|
72
|
-
private static cloneQuadValue;
|
|
73
|
-
private static quadFieldValue;
|
|
74
|
-
private static normalizeQuadOutput;
|
|
75
|
-
private static keysForKind;
|
|
76
|
-
private static inferKindFromFields;
|
|
77
|
-
private static resolveKind;
|
|
78
|
-
/** Resolve variable names for all FigmaVariableReference fields */
|
|
79
|
-
resolveVariables(foundations: import('../../../Runtime/Foundations/interfaces.js').FigmaFoundations | undefined): Promise<void>;
|
|
80
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { AspectRatioValue } from '@directededges/specs-schema';
|
|
2
|
-
import type { FigmaElementNode } from '../../Nodes/types.js';
|
|
3
|
-
export declare class AspectRatioStyle {
|
|
4
|
-
/**
|
|
5
|
-
* Evaluate the aspectRatio value for a node:
|
|
6
|
-
* - If `targetAspectRatio` is set to a non-null Vector → return `{ x, y }` verbatim
|
|
7
|
-
* - Otherwise → return `null`
|
|
8
|
-
*
|
|
9
|
-
* The `targetAspectRatio` property is available on nodes with LayoutMixin.
|
|
10
|
-
* When the aspect ratio is locked via "Lock aspect ratio" in Figma UI,
|
|
11
|
-
* this property contains a Vector with x/y values matching the ratio.
|
|
12
|
-
* When unlocked, the property is `null`.
|
|
13
|
-
*/
|
|
14
|
-
static value(node: FigmaElementNode): AspectRatioValue | null;
|
|
15
|
-
/**
|
|
16
|
-
* Compare two AspectRatioValue instances for equality.
|
|
17
|
-
* Returns true if they differ, false if they are equivalent.
|
|
18
|
-
*
|
|
19
|
-
* @param a - First aspect ratio value (or null)
|
|
20
|
-
* @param b - Second aspect ratio value (or null)
|
|
21
|
-
* @returns true if values differ, false if equivalent
|
|
22
|
-
*/
|
|
23
|
-
static difference(a: AspectRatioValue | null, b: AspectRatioValue | null): boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Explicit type guard for AspectRatioValue.
|
|
26
|
-
* The key must be 'aspectRatio' and the value must be non-null.
|
|
27
|
-
* Use this guard when narrowing a bare `StyleValue` where the key is known.
|
|
28
|
-
*
|
|
29
|
-
* @param key - The style key to check
|
|
30
|
-
* @param v - The value to check
|
|
31
|
-
* @returns true if v is a valid AspectRatioValue
|
|
32
|
-
*/
|
|
33
|
-
static isAspectRatioStyle(key: string, v: unknown): v is AspectRatioValue;
|
|
34
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { RawStyle } from '../Style.js';
|
|
2
|
-
import { StyleKey } from "../keys.js";
|
|
3
|
-
import { FigmaElementNode } from '../../Nodes/types.js';
|
|
4
|
-
import { Gradient } from '../../Gradient/Gradient.js';
|
|
5
|
-
import { Color } from '../../Color/Color.js';
|
|
6
|
-
import type { ProcessingContext } from '../../../Runtime/Context/interfaces.js';
|
|
7
|
-
export declare class ColorStyle {
|
|
8
|
-
static extractFirstPaint(node: FigmaElementNode, key: string): Paint | undefined;
|
|
9
|
-
/**
|
|
10
|
-
* Convert Figma RGB channels (0–1) + opacity to a Color instance.
|
|
11
|
-
* Always emits sRGB; alpha is omitted when fully opaque.
|
|
12
|
-
*/
|
|
13
|
-
static toColorValue(color: RGB | (RGB & {
|
|
14
|
-
a: number;
|
|
15
|
-
}), opacity?: number): Color;
|
|
16
|
-
/**
|
|
17
|
-
* Extract alpha component from a paint or effect as a percentage string suffix.
|
|
18
|
-
* Retained for future color format configuration (RGBA, HSLA, etc.).
|
|
19
|
-
*/
|
|
20
|
-
static alpha(color: Paint | Effect): string;
|
|
21
|
-
/**
|
|
22
|
-
* Convert a paint or effect color to an HSLA string.
|
|
23
|
-
* Retained for future color format configuration (RGBA, HSLA, etc.).
|
|
24
|
-
*/
|
|
25
|
-
static HSLA2(paintOrEffect: Paint | Effect): string;
|
|
26
|
-
static value(node: FigmaElementNode, key: StyleKey, context?: ProcessingContext): RawStyle | Color | Gradient | null;
|
|
27
|
-
static styleFromPaints(colorArray: Paint[] | Effect[], context?: ProcessingContext): RawStyle | Color | Gradient | null;
|
|
28
|
-
private static toHexByte;
|
|
29
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Conditional, ResolvedConfig } from '@directededges/specs-schema';
|
|
2
|
-
import type { PropPair } from '../../Props/PropPair.js';
|
|
3
|
-
/**
|
|
4
|
-
* ConditionalStyle — Style primitive for visibility conditionals.
|
|
5
|
-
*
|
|
6
|
-
* Stores the content prop name from a validated binding pair.
|
|
7
|
-
* Builds the Conditional object on serialization via data().
|
|
8
|
-
*/
|
|
9
|
-
export declare class ConditionalStyle {
|
|
10
|
-
private readonly _contentPropName;
|
|
11
|
-
private readonly _booleanPropName;
|
|
12
|
-
constructor(pair: PropPair);
|
|
13
|
-
/**
|
|
14
|
-
* The commensurate Figma BOOLEAN prop that drives this element's visibility
|
|
15
|
-
* (e.g. `showIcon`), as opposed to the content prop referenced in the
|
|
16
|
-
* serialized condition (e.g. `icon`). Exposed for consumers that render the
|
|
17
|
-
* binding directly from the model — e.g. the plugin's canvas output renders a
|
|
18
|
-
* boolean prop pill for it. NOT part of the serialized `data()` shape, so this
|
|
19
|
-
* does not affect schema output.
|
|
20
|
-
*/
|
|
21
|
-
get booleanPropName(): string;
|
|
22
|
-
data(config: ResolvedConfig): Conditional;
|
|
23
|
-
clone(): ConditionalStyle;
|
|
24
|
-
/**
|
|
25
|
-
* Compare two values where at least one may be a ConditionalStyle.
|
|
26
|
-
* Returns true if different, false if identical.
|
|
27
|
-
*/
|
|
28
|
-
static difference(a: unknown, b: unknown): boolean;
|
|
29
|
-
static is(value: unknown): value is ConditionalStyle;
|
|
30
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { FigmaCorneredNode, FigmaElementNode } from '../../Nodes/types.js';
|
|
2
|
-
import { QuadComposite } from '../Composites/index.js';
|
|
3
|
-
import { FigmaVariableReference } from '../References/index.js';
|
|
4
|
-
import { type ProcessingContext } from '../../../Runtime/Context/interfaces.js';
|
|
5
|
-
/**
|
|
6
|
-
* Evaluates corner radius from a Figma node.
|
|
7
|
-
* Returns scalar number (uniform), FigmaVariableReference (uniform token),
|
|
8
|
-
* CornersQuadComposite (non-uniform), or null (no corners).
|
|
9
|
-
*/
|
|
10
|
-
export declare class CornerStyle {
|
|
11
|
-
static value(node: FigmaCorneredNode | FigmaElementNode, context?: ProcessingContext): number | FigmaVariableReference | QuadComposite | null;
|
|
12
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { FigmaElementNode } from '../../Nodes/types.js';
|
|
2
|
-
import { FigmaStyleReference } from '../Style.js';
|
|
3
|
-
import { Effects } from '../../Effects/Effects.js';
|
|
4
|
-
import { type ProcessingContext } from '../../../Runtime/Context/interfaces.js';
|
|
5
|
-
export declare class EffectsStyle {
|
|
6
|
-
/**
|
|
7
|
-
* Evaluate the effects value for a node:
|
|
8
|
-
* - If `effectStyleId` is set and entitled → return `FigmaStyleReference` (named style)
|
|
9
|
-
* - If inline effects exist → return populated `Effects` (shadows gated by context)
|
|
10
|
-
* - Otherwise → return `null`
|
|
11
|
-
*/
|
|
12
|
-
static value(node: FigmaElementNode, context?: ProcessingContext): Effects | FigmaStyleReference | null;
|
|
13
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { RawStyle } from '../Style.js';
|
|
2
|
-
import { StyleKey } from '../keys.js';
|
|
3
|
-
import { FigmaElementNode } from '../../Nodes/types.js';
|
|
4
|
-
import { Color } from '../../Color/Color.js';
|
|
5
|
-
import { FigmaVariableReference } from '../References/FigmaVariableReference.js';
|
|
6
|
-
import { FigmaStyleReference } from '../References/FigmaStyleReference.js';
|
|
7
|
-
/**
|
|
8
|
-
* Specialized style handler for icon element `fillColor`.
|
|
9
|
-
*
|
|
10
|
-
* Handles the full resolution chain (variable ref → style ref → raw color)
|
|
11
|
-
* at whichever node has fills, with recursive child drill-down and a
|
|
12
|
-
* solid-only constraint on fills[0].
|
|
13
|
-
*
|
|
14
|
-
* Registered in Style.applySpecializedKeyHandler() so it runs before the
|
|
15
|
-
* generic applyVariableReference / applyColorStyleReference steps — those
|
|
16
|
-
* check the top-level node, but icon fills may live on a child.
|
|
17
|
-
*/
|
|
18
|
-
export declare class IconFillStyle {
|
|
19
|
-
/**
|
|
20
|
-
* Evaluate fillColor for an icon element.
|
|
21
|
-
*
|
|
22
|
-
* Two-pass depth-first search:
|
|
23
|
-
* 1. Prefer a node with a variable or style binding (richer data).
|
|
24
|
-
* 2. Fall back to the first node with any solid fill (raw color).
|
|
25
|
-
*
|
|
26
|
-
* This ensures intermediate GROUP nodes with unbound fills don't shadow
|
|
27
|
-
* deeper children that carry the actual variable binding (see #99).
|
|
28
|
-
*/
|
|
29
|
-
static evaluate(node: FigmaElementNode, key: StyleKey, resolveVariables: boolean): RawStyle | Color | FigmaVariableReference | FigmaStyleReference | null;
|
|
30
|
-
/** Depth-first walk returning the first matching fill result. */
|
|
31
|
-
private static walk;
|
|
32
|
-
/**
|
|
33
|
-
* Evaluate a single node's fills[0] with full resolution chain.
|
|
34
|
-
* Order: style ref → variable ref → raw solid color.
|
|
35
|
-
*
|
|
36
|
-
* When `bindingsOnly` is true, returns null instead of a raw color —
|
|
37
|
-
* only style/variable references are returned.
|
|
38
|
-
*/
|
|
39
|
-
private static evaluateNode;
|
|
40
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { RawStyle } from '../Style.js';
|
|
2
|
-
import { StyleKey } from '../keys.js';
|
|
3
|
-
import { FigmaElementNode } from '../../Nodes/types.js';
|
|
4
|
-
export declare class NumberStyle {
|
|
5
|
-
static value(node: FigmaElementNode, key: StyleKey): RawStyle | null;
|
|
6
|
-
static rounded(value: number | null | undefined): number | null;
|
|
7
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FigmaElementNode } from '../../Nodes/types.js';
|
|
2
|
-
import { QuadComposite } from '../Composites/index.js';
|
|
3
|
-
import { FigmaVariableReference } from '../References/index.js';
|
|
4
|
-
import { type ProcessingContext } from '../../../Runtime/Context/interfaces.js';
|
|
5
|
-
/**
|
|
6
|
-
* Evaluates padding from a Figma node.
|
|
7
|
-
* Returns scalar number (uniform), FigmaVariableReference (uniform token),
|
|
8
|
-
* QuadComposite (non-uniform), or null (no padding).
|
|
9
|
-
*/
|
|
10
|
-
export declare class PaddingStyle {
|
|
11
|
-
static value(node: FigmaElementNode, context?: ProcessingContext): number | FigmaVariableReference | QuadComposite | null;
|
|
12
|
-
private static getVariableForKey;
|
|
13
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { FigmaElementNode } from '../../Nodes/types.js';
|
|
2
|
-
import { QuadComposite } from '../Composites/index.js';
|
|
3
|
-
import { FigmaVariableReference } from '../References/index.js';
|
|
4
|
-
import { type ProcessingContext } from '../../../Runtime/Context/interfaces.js';
|
|
5
|
-
/**
|
|
6
|
-
* Evaluates stroke weight from a Figma node.
|
|
7
|
-
* Returns scalar number (uniform), FigmaVariableReference (uniform token),
|
|
8
|
-
* SidesQuadComposite (non-uniform), or null (no strokes).
|
|
9
|
-
*/
|
|
10
|
-
export declare class StrokeStyle {
|
|
11
|
-
static value(node: FigmaElementNode, context?: ProcessingContext): number | FigmaVariableReference | QuadComposite | null;
|
|
12
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { FigmaStyleReference } from '../Style.js';
|
|
2
|
-
import { Typography } from '../../Typography/Typography.js';
|
|
3
|
-
import { type ProcessingContext } from '../../../Runtime/Context/interfaces.js';
|
|
4
|
-
/**
|
|
5
|
-
* TypographyStyle - Minimal orchestration primitive for typography evaluation.
|
|
6
|
-
*
|
|
7
|
-
* Priority:
|
|
8
|
-
* 1. Named text style (textStyleId) → FigmaStyleReference (PRO only)
|
|
9
|
-
* 2. Inline typography → Typography.evaluate(node, context)
|
|
10
|
-
*
|
|
11
|
-
* @see Typography.evaluate() for evaluation implementation
|
|
12
|
-
* @see EffectsStyle for similar primitive pattern
|
|
13
|
-
*/
|
|
14
|
-
export declare class TypographyStyle {
|
|
15
|
-
/**
|
|
16
|
-
* Evaluate typography value for a TextNode.
|
|
17
|
-
* When not entitled to PRO, named text styles are skipped and inline
|
|
18
|
-
* Typography is returned instead (with variable references also gated).
|
|
19
|
-
*/
|
|
20
|
-
static value(node: TextNode, context?: ProcessingContext): FigmaStyleReference | Typography | null;
|
|
21
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { AspectRatioStyle } from './AspectRatioStyle.js';
|
|
2
|
-
export { BooleanStyle } from './BooleanStyle.js';
|
|
3
|
-
export { ColorStyle } from './ColorStyle.js';
|
|
4
|
-
export { CornerStyle } from './CornerStyle.js';
|
|
5
|
-
export { EffectsStyle } from './EffectsStyle.js';
|
|
6
|
-
export { IconFillStyle } from './IconFillStyle.js';
|
|
7
|
-
export { MixedStyle } from './MixedStyle.js';
|
|
8
|
-
export { NumberStyle } from './NumberStyle.js';
|
|
9
|
-
export { PaddingStyle } from './PaddingStyle.js';
|
|
10
|
-
export { StringStyle } from './StringStyle.js';
|
|
11
|
-
export { StrokeStyle } from './StrokeStyle.js';
|
|
12
|
-
export { TypographyStyle } from './TypographyStyle.js';
|
|
13
|
-
export { ConditionalStyle } from './ConditionalStyle.js';
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { TokenReference } from '@directededges/specs-schema';
|
|
2
|
-
export declare const SIDES_DIRECTION_MAP: {
|
|
3
|
-
readonly left: "start";
|
|
4
|
-
readonly right: "end";
|
|
5
|
-
readonly top: "top";
|
|
6
|
-
readonly bottom: "bottom";
|
|
7
|
-
};
|
|
8
|
-
export declare const CORNERS_DIRECTION_MAP: {
|
|
9
|
-
readonly topLeft: "topStart";
|
|
10
|
-
readonly topRight: "topEnd";
|
|
11
|
-
readonly bottomRight: "bottomEnd";
|
|
12
|
-
readonly bottomLeft: "bottomStart";
|
|
13
|
-
};
|
|
14
|
-
export type LogicalSide = typeof SIDES_DIRECTION_MAP[keyof typeof SIDES_DIRECTION_MAP];
|
|
15
|
-
export type LogicalCorner = typeof CORNERS_DIRECTION_MAP[keyof typeof CORNERS_DIRECTION_MAP];
|
|
16
|
-
export declare const PADDING_FIGMA_KEYS: {
|
|
17
|
-
readonly paddingTop: "top";
|
|
18
|
-
readonly paddingBottom: "bottom";
|
|
19
|
-
readonly paddingLeft: "start";
|
|
20
|
-
readonly paddingRight: "end";
|
|
21
|
-
};
|
|
22
|
-
export declare const STROKE_WEIGHT_FIGMA_KEYS: {
|
|
23
|
-
readonly strokeTopWeight: "top";
|
|
24
|
-
readonly strokeBottomWeight: "bottom";
|
|
25
|
-
readonly strokeLeftWeight: "start";
|
|
26
|
-
readonly strokeRightWeight: "end";
|
|
27
|
-
};
|
|
28
|
-
export declare const CORNER_RADIUS_FIGMA_KEYS: {
|
|
29
|
-
readonly topLeftRadius: "topStart";
|
|
30
|
-
readonly topRightRadius: "topEnd";
|
|
31
|
-
readonly bottomRightRadius: "bottomEnd";
|
|
32
|
-
readonly bottomLeftRadius: "bottomStart";
|
|
33
|
-
};
|
|
34
|
-
export declare const STYLE_KEYS_PRIMITIVE_MAP: {
|
|
35
|
-
TYPOGRAPHY: {
|
|
36
|
-
keys: string[];
|
|
37
|
-
tokenType: "typography";
|
|
38
|
-
};
|
|
39
|
-
COLOR: {
|
|
40
|
-
keys: string[];
|
|
41
|
-
tokenType: "color";
|
|
42
|
-
};
|
|
43
|
-
STROKE: {
|
|
44
|
-
keys: string[];
|
|
45
|
-
tokenType: "dimension";
|
|
46
|
-
};
|
|
47
|
-
CORNER: {
|
|
48
|
-
keys: string[];
|
|
49
|
-
tokenType: "dimension";
|
|
50
|
-
};
|
|
51
|
-
PADDING: {
|
|
52
|
-
keys: string[];
|
|
53
|
-
tokenType: "dimension";
|
|
54
|
-
};
|
|
55
|
-
PURE_NUMBER_DIMENSIONLESS: {
|
|
56
|
-
keys: string[];
|
|
57
|
-
tokenType: "number";
|
|
58
|
-
};
|
|
59
|
-
PURE_NUMBER_DIMENSIONS: {
|
|
60
|
-
keys: string[];
|
|
61
|
-
tokenType: "dimension";
|
|
62
|
-
};
|
|
63
|
-
MIXABLE_STRING: {
|
|
64
|
-
keys: string[];
|
|
65
|
-
tokenType: "string";
|
|
66
|
-
};
|
|
67
|
-
PURE_STRING: {
|
|
68
|
-
keys: string[];
|
|
69
|
-
tokenType: "string";
|
|
70
|
-
};
|
|
71
|
-
BOOLEAN: {
|
|
72
|
-
keys: string[];
|
|
73
|
-
tokenType: undefined;
|
|
74
|
-
};
|
|
75
|
-
EFFECTS: {
|
|
76
|
-
keys: string[];
|
|
77
|
-
tokenType: "effects";
|
|
78
|
-
};
|
|
79
|
-
ASPECT_RATIO: {
|
|
80
|
-
keys: string[];
|
|
81
|
-
tokenType: undefined;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
export declare const STYLE_KEYS_PRIMITIVE: Record<string, string>;
|
|
85
|
-
export declare const STYLE_KEY_TO_TOKEN_TYPE: Record<string, TokenReference['$type']>;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { FigmaElementNode } from '../../Nodes/types.js';
|
|
2
|
-
import type { StyleKey } from '../keys.js';
|
|
3
|
-
import type { ResolvedConfig, TokenReference } from '@directededges/specs-schema';
|
|
4
|
-
import type { FigmaFoundations } from '../../../Runtime/Foundations/interfaces.js';
|
|
5
|
-
/**
|
|
6
|
-
* FigmaStyleReference - instance-based published style binding.
|
|
7
|
-
*
|
|
8
|
-
* Represents a node property bound to a published Figma style. Instance-based lifecycle
|
|
9
|
-
* matches Effects, Gradient, Typography pattern.
|
|
10
|
-
*/
|
|
11
|
-
export declare class FigmaStyleReference {
|
|
12
|
-
readonly id: string;
|
|
13
|
-
readonly tokenType: TokenReference['$type'];
|
|
14
|
-
name?: string;
|
|
15
|
-
customValue?: Record<string, unknown>;
|
|
16
|
-
constructor(id: string, tokenType: TokenReference['$type']);
|
|
17
|
-
/**
|
|
18
|
-
* Evaluate Figma published style binding for a property.
|
|
19
|
-
*
|
|
20
|
-
* Handles:
|
|
21
|
-
* - textStyleId (top-level property)
|
|
22
|
-
* - fillStyleId (color styles for fills)
|
|
23
|
-
* - strokeStyleId (color styles for strokes)
|
|
24
|
-
*
|
|
25
|
-
* @param node - Figma node to evaluate
|
|
26
|
-
* @param key - Style key to check for style binding
|
|
27
|
-
* @param tokenType - The TokenReference $type for this style reference
|
|
28
|
-
* @returns FigmaStyleReference instance if bound to published style, null otherwise
|
|
29
|
-
*/
|
|
30
|
-
static evaluate(node: FigmaElementNode, key: StyleKey, tokenType: TokenReference['$type']): FigmaStyleReference | null;
|
|
31
|
-
/**
|
|
32
|
-
* Type guard for FigmaStyleReference instances.
|
|
33
|
-
*/
|
|
34
|
-
static is(v: unknown): v is FigmaStyleReference;
|
|
35
|
-
difference(other: FigmaStyleReference): boolean;
|
|
36
|
-
clone(): FigmaStyleReference;
|
|
37
|
-
data(config: ResolvedConfig): string | TokenReference;
|
|
38
|
-
/**
|
|
39
|
-
* Convert style name to token path using Figma's native `/` separator.
|
|
40
|
-
* Uses `/` for all profiles to avoid DTCG-restricted characters (`.`, `{`, `}`).
|
|
41
|
-
* Returns fallback string if name not yet resolved.
|
|
42
|
-
*/
|
|
43
|
-
private toTokenPath;
|
|
44
|
-
resolveName(foundations: FigmaFoundations | undefined): Promise<void>;
|
|
45
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { FigmaElementNode } from '../../Nodes/types.js';
|
|
2
|
-
import type { StyleKey } from '../keys.js';
|
|
3
|
-
import type { ResolvedConfig, TokenReference } from '@directededges/specs-schema';
|
|
4
|
-
import type { FigmaFoundations } from '../../../Runtime/Foundations/interfaces.js';
|
|
5
|
-
import type { Color } from '../../Color/Color.js';
|
|
6
|
-
export type RawStyle = string | number | boolean;
|
|
7
|
-
/**
|
|
8
|
-
* FigmaVariableReference - instance-based variable binding.
|
|
9
|
-
*
|
|
10
|
-
* Represents a style value bound to a Figma variable. Instance-based lifecycle
|
|
11
|
-
* matches Effects, Gradient, Typography pattern.
|
|
12
|
-
*/
|
|
13
|
-
export declare class FigmaVariableReference {
|
|
14
|
-
readonly id: string;
|
|
15
|
-
readonly rawValue: RawStyle | Color;
|
|
16
|
-
readonly tokenType: TokenReference['$type'];
|
|
17
|
-
variableName?: string;
|
|
18
|
-
collectionName?: string;
|
|
19
|
-
collectionId?: string;
|
|
20
|
-
customValue?: Record<string, unknown>;
|
|
21
|
-
codeSyntax?: {
|
|
22
|
-
WEB?: string;
|
|
23
|
-
ANDROID?: string;
|
|
24
|
-
iOS?: string;
|
|
25
|
-
};
|
|
26
|
-
constructor(id: string, rawValue: RawStyle | Color, tokenType: TokenReference['$type']);
|
|
27
|
-
/**
|
|
28
|
-
* Evaluate variable binding for a style property.
|
|
29
|
-
*
|
|
30
|
-
* @param node - Figma node to evaluate
|
|
31
|
-
* @param key - Style key to check for variable binding
|
|
32
|
-
* @param rawValueGetter - Function to compute the raw value if variable binding exists
|
|
33
|
-
* @returns FigmaVariableReference instance if bound to variable, null otherwise
|
|
34
|
-
*/
|
|
35
|
-
static evaluate(node: FigmaElementNode, key: StyleKey, rawValueGetter: () => RawStyle | Color): FigmaVariableReference | null;
|
|
36
|
-
/**
|
|
37
|
-
* Type guard for FigmaVariableReference instances.
|
|
38
|
-
*/
|
|
39
|
-
static is(v: unknown): v is FigmaVariableReference;
|
|
40
|
-
difference(other: FigmaVariableReference): boolean;
|
|
41
|
-
clone(): FigmaVariableReference;
|
|
42
|
-
data(config: ResolvedConfig): string | TokenReference;
|
|
43
|
-
/**
|
|
44
|
-
* Emit the `TOKEN` shape (`{ $token, $type }`) using the platform's Figma
|
|
45
|
-
* `codeSyntax` as the `$token`, falling back to the resolved token path when
|
|
46
|
-
* the token has no code syntax defined for that platform (ADR-051). The
|
|
47
|
-
* fall-back is a transformer responsibility, not a schema rule.
|
|
48
|
-
*/
|
|
49
|
-
private codeSyntaxOrTokenFallback;
|
|
50
|
-
/**
|
|
51
|
-
* Convert variable name to token path using Figma's native `/` separator.
|
|
52
|
-
* Uses `/` for all profiles to avoid DTCG-restricted characters (`.`, `{`, `}`).
|
|
53
|
-
* Returns fallback string if name data not yet resolved.
|
|
54
|
-
*/
|
|
55
|
-
private toTokenPath;
|
|
56
|
-
/**
|
|
57
|
-
* Serialize rawValue for output — Color instances emit ColorObject, primitives pass through.
|
|
58
|
-
*/
|
|
59
|
-
private serializedRawValue;
|
|
60
|
-
resolveName(foundations: FigmaFoundations | undefined, includeCollection: boolean): Promise<void>;
|
|
61
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Figma reference types for indirection (variables, styles, component properties).
|
|
3
|
-
*
|
|
4
|
-
* These types represent pointers to values defined elsewhere in Figma:
|
|
5
|
-
* - FigmaVariableReference: Design tokens/variables (instance class)
|
|
6
|
-
* - FigmaStyleReference: Published color/text/effect styles (instance class)
|
|
7
|
-
* - PropBinding: Component property bindings (instance class, defined in Props/)
|
|
8
|
-
*/
|
|
9
|
-
export type { RawStyle } from './FigmaVariableReference.js';
|
|
10
|
-
export { FigmaVariableReference } from './FigmaVariableReference.js';
|
|
11
|
-
export { FigmaStyleReference } from './FigmaStyleReference.js';
|
|
12
|
-
import { FigmaVariableReference } from './FigmaVariableReference.js';
|
|
13
|
-
import { FigmaStyleReference } from './FigmaStyleReference.js';
|
|
14
|
-
/**
|
|
15
|
-
* Type guard for FigmaVariableReference instances.
|
|
16
|
-
*/
|
|
17
|
-
export declare function isFigmaVariableReference(v: unknown): v is FigmaVariableReference;
|
|
18
|
-
/**
|
|
19
|
-
* Type guard for FigmaStyleReference instances.
|
|
20
|
-
*
|
|
21
|
-
* Prefer `style.type === 'STYLE'` when the enclosing Style object is available.
|
|
22
|
-
* Use this guard when narrowing a bare StyleValue.
|
|
23
|
-
*/
|
|
24
|
-
export declare function isFigmaStyleReference(v: unknown): v is FigmaStyleReference;
|