@styleframe/figma 1.0.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.d.ts +440 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +831 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin/code.js +3803 -0
- package/dist/plugin/ui.html +1045 -0
- package/manifest.json +16 -0
- package/package.json +61 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
//#region src/types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Figma color in normalized RGB format (0-1 range)
|
|
4
|
+
*/
|
|
5
|
+
interface FigmaRGBA {
|
|
6
|
+
r: number;
|
|
7
|
+
g: number;
|
|
8
|
+
b: number;
|
|
9
|
+
a?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Figma variable alias reference
|
|
13
|
+
*/
|
|
14
|
+
interface FigmaVariableAlias {
|
|
15
|
+
type: "VARIABLE_ALIAS";
|
|
16
|
+
id: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Figma variable resolved types
|
|
20
|
+
*/
|
|
21
|
+
type FigmaVariableType = "COLOR" | "FLOAT" | "STRING" | "BOOLEAN";
|
|
22
|
+
/**
|
|
23
|
+
* Figma variable value by type
|
|
24
|
+
*/
|
|
25
|
+
type FigmaVariableValue = FigmaRGBA | number | string | boolean | FigmaVariableAlias;
|
|
26
|
+
/**
|
|
27
|
+
* A single variable in the intermediate format
|
|
28
|
+
*/
|
|
29
|
+
interface FigmaExportVariable {
|
|
30
|
+
/** Variable name in Figma format (slash notation, e.g., "color/primary") */
|
|
31
|
+
name: string;
|
|
32
|
+
/** Original Styleframe name (dot notation, e.g., "color.primary") */
|
|
33
|
+
styleframeName?: string;
|
|
34
|
+
/** Variable type */
|
|
35
|
+
type: FigmaVariableType;
|
|
36
|
+
/** Values by mode name */
|
|
37
|
+
values: Record<string, FigmaVariableValue>;
|
|
38
|
+
/** If this is a reference/alias, the target variable name */
|
|
39
|
+
aliasTo?: string;
|
|
40
|
+
/** Description/comment for the variable */
|
|
41
|
+
description?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The intermediate JSON format for Styleframe <-> Figma sync
|
|
45
|
+
*/
|
|
46
|
+
interface FigmaExportFormat {
|
|
47
|
+
/** Collection name */
|
|
48
|
+
collection: string;
|
|
49
|
+
/** Mode names (first is default) */
|
|
50
|
+
modes: string[];
|
|
51
|
+
/** Variables in the collection */
|
|
52
|
+
variables: FigmaExportVariable[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Options for converting Styleframe to Figma format
|
|
56
|
+
*/
|
|
57
|
+
interface StyleframeToFigmaOptions {
|
|
58
|
+
/** Collection name (default: "Design Tokens") */
|
|
59
|
+
collectionName?: string;
|
|
60
|
+
/** Default mode name (default: "Default") */
|
|
61
|
+
defaultModeName?: string;
|
|
62
|
+
/** Base font size for rem conversion (default: 16) */
|
|
63
|
+
baseFontSize?: number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Options for converting Figma to Styleframe format
|
|
67
|
+
*/
|
|
68
|
+
interface FigmaToStyleframeOptions {
|
|
69
|
+
/** Use composables (useColor, useSpacing, etc.) when possible */
|
|
70
|
+
useComposables?: boolean;
|
|
71
|
+
/** Use rem units for dimensions */
|
|
72
|
+
useRem?: boolean;
|
|
73
|
+
/** Base font size for rem conversion (default: 16) */
|
|
74
|
+
baseFontSize?: number;
|
|
75
|
+
/** Instance variable name (default: "s") */
|
|
76
|
+
instanceName?: string;
|
|
77
|
+
/** Which mode to treat as the default/base (default: first mode) */
|
|
78
|
+
defaultModeName?: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Parsed variable from Figma for code generation
|
|
82
|
+
*/
|
|
83
|
+
interface ParsedVariable {
|
|
84
|
+
/** Styleframe name (dot notation) */
|
|
85
|
+
name: string;
|
|
86
|
+
/** Variable value (CSS string or number) */
|
|
87
|
+
value: string | number | boolean;
|
|
88
|
+
/** Variable type category */
|
|
89
|
+
type: "color" | "number" | "string" | "boolean";
|
|
90
|
+
/** First segment of name (e.g., "color" from "color.primary") */
|
|
91
|
+
category: string;
|
|
92
|
+
/** Whether this is a reference to another variable */
|
|
93
|
+
isReference: boolean;
|
|
94
|
+
/** If reference, the target variable name */
|
|
95
|
+
referenceTo?: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Parsed theme from Figma for code generation
|
|
99
|
+
*/
|
|
100
|
+
interface ParsedTheme {
|
|
101
|
+
/** Theme name (e.g., "dark") */
|
|
102
|
+
name: string;
|
|
103
|
+
/** Variables with overridden values in this theme */
|
|
104
|
+
variables: ParsedVariable[];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Result of code generation
|
|
108
|
+
*/
|
|
109
|
+
interface CodegenResult {
|
|
110
|
+
/** Generated TypeScript code */
|
|
111
|
+
code: string;
|
|
112
|
+
/** Parsed variables */
|
|
113
|
+
variables: ParsedVariable[];
|
|
114
|
+
/** Parsed themes */
|
|
115
|
+
themes: ParsedTheme[];
|
|
116
|
+
/** Required imports */
|
|
117
|
+
imports: string[];
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=types.d.ts.map
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/converters/name-mapping.d.ts
|
|
122
|
+
/**
|
|
123
|
+
* Convert Styleframe variable name to Figma format
|
|
124
|
+
* @example "color.primary" → "color/primary"
|
|
125
|
+
*/
|
|
126
|
+
declare function styleframeToFigmaName(name: string): string;
|
|
127
|
+
/**
|
|
128
|
+
* Convert Figma variable name to Styleframe format
|
|
129
|
+
* @example "color/primary" → "color.primary"
|
|
130
|
+
*/
|
|
131
|
+
declare function figmaToStyleframeName(name: string): string;
|
|
132
|
+
/**
|
|
133
|
+
* Extract the category (first segment) from a variable name
|
|
134
|
+
* @example "color.primary.500" → "color"
|
|
135
|
+
* @example "color/primary/500" → "color"
|
|
136
|
+
*/
|
|
137
|
+
declare function extractCategory(name: string): string;
|
|
138
|
+
/**
|
|
139
|
+
* Extract the key (last segment) from a variable name
|
|
140
|
+
* @example "color.primary.500" → "500"
|
|
141
|
+
* @example "spacing.md" → "md"
|
|
142
|
+
*/
|
|
143
|
+
declare function extractKey(name: string): string;
|
|
144
|
+
/**
|
|
145
|
+
* Convert a Styleframe variable name to a camelCase JavaScript identifier
|
|
146
|
+
* @example "color.primary" → "colorPrimary"
|
|
147
|
+
* @example "spacing.md" → "spacingMd"
|
|
148
|
+
*/
|
|
149
|
+
declare function toVariableIdentifier(name: string): string;
|
|
150
|
+
/**
|
|
151
|
+
* Convert a CSS custom property name to Styleframe format
|
|
152
|
+
* @example "--color--primary" → "color.primary"
|
|
153
|
+
*/
|
|
154
|
+
declare function cssVariableToStyleframeName(cssName: string): string;
|
|
155
|
+
/**
|
|
156
|
+
* Convert a Styleframe name to CSS custom property format
|
|
157
|
+
* @example "color.primary" → "--color--primary"
|
|
158
|
+
*/
|
|
159
|
+
declare function styleframeToCssVariable(name: string): string;
|
|
160
|
+
//# sourceMappingURL=name-mapping.d.ts.map
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/converters/value-parsing.d.ts
|
|
163
|
+
/**
|
|
164
|
+
* Convert a CSS color string to Figma RGBA format (0-1 range)
|
|
165
|
+
* Supports: hex, rgb(), rgba(), hsl(), hsla(), named colors
|
|
166
|
+
*/
|
|
167
|
+
declare function cssColorToFigma(value: string): FigmaRGBA | null;
|
|
168
|
+
/**
|
|
169
|
+
* Convert Figma RGBA format (0-1 range) to CSS hex color
|
|
170
|
+
*/
|
|
171
|
+
declare function figmaColorToCss(rgba: FigmaRGBA): string;
|
|
172
|
+
/**
|
|
173
|
+
* Parse a CSS dimension value (e.g., "16px", "1rem", "1.5em")
|
|
174
|
+
*/
|
|
175
|
+
interface ParsedDimension {
|
|
176
|
+
value: number;
|
|
177
|
+
unit: string;
|
|
178
|
+
}
|
|
179
|
+
declare function parseDimension(value: string): ParsedDimension | null;
|
|
180
|
+
/**
|
|
181
|
+
* Convert a CSS dimension to a pixel number
|
|
182
|
+
*/
|
|
183
|
+
declare function dimensionToPixels(value: string, baseFontSize?: number): number | null;
|
|
184
|
+
/**
|
|
185
|
+
* Convert a pixel value to a CSS dimension
|
|
186
|
+
*/
|
|
187
|
+
declare function pixelsToDimension(pixels: number, unit?: string, baseFontSize?: number): string;
|
|
188
|
+
/**
|
|
189
|
+
* Detect if a string value is a color
|
|
190
|
+
*/
|
|
191
|
+
declare function isColorValue(value: string): boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Detect if a string value is a dimension
|
|
194
|
+
*/
|
|
195
|
+
declare function isDimensionValue(value: string): boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Detect the Figma variable type from a Styleframe value
|
|
198
|
+
*/
|
|
199
|
+
declare function detectFigmaType(value: unknown): FigmaVariableType;
|
|
200
|
+
/**
|
|
201
|
+
* Convert a Styleframe token value to a Figma-compatible value
|
|
202
|
+
*/
|
|
203
|
+
declare function styleframeValueToFigma(value: unknown, type: FigmaVariableType, baseFontSize?: number): FigmaRGBA | number | string | boolean | null;
|
|
204
|
+
/**
|
|
205
|
+
* Convert a Figma variable value to a Styleframe-compatible CSS value
|
|
206
|
+
*/
|
|
207
|
+
declare function figmaValueToStyleframe(value: FigmaRGBA | number | string | boolean, type: FigmaVariableType, useRem?: boolean, baseFontSize?: number): string | number | boolean;
|
|
208
|
+
//# sourceMappingURL=value-parsing.d.ts.map
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region src/converters/codegen.d.ts
|
|
211
|
+
/**
|
|
212
|
+
* Generate Styleframe TypeScript code from Figma export format
|
|
213
|
+
*/
|
|
214
|
+
declare function generateStyleframeCode(data: FigmaExportFormat, options?: FigmaToStyleframeOptions): CodegenResult;
|
|
215
|
+
//# sourceMappingURL=codegen.d.ts.map
|
|
216
|
+
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/converters/dtcg/types.d.ts
|
|
219
|
+
/**
|
|
220
|
+
* DTCG (Design Tokens Community Group) format types
|
|
221
|
+
* Based on W3C Draft: https://www.designtokens.org/tr/drafts/format/
|
|
222
|
+
*/
|
|
223
|
+
/**
|
|
224
|
+
* DTCG token types as defined in W3C Draft
|
|
225
|
+
*/
|
|
226
|
+
type DTCGTokenType = "color" | "dimension" | "fontFamily" | "fontWeight" | "duration" | "cubicBezier" | "number" | "string";
|
|
227
|
+
/**
|
|
228
|
+
* DTCG alias reference (e.g., "{color.primary}")
|
|
229
|
+
*/
|
|
230
|
+
type DTCGAliasValue = `{${string}}`;
|
|
231
|
+
/**
|
|
232
|
+
* Check if a value is a DTCG alias
|
|
233
|
+
*/
|
|
234
|
+
declare function isDTCGAlias(value: unknown): value is DTCGAliasValue;
|
|
235
|
+
/**
|
|
236
|
+
* DTCG cubic bezier value
|
|
237
|
+
*/
|
|
238
|
+
type DTCGCubicBezierValue = [number, number, number, number];
|
|
239
|
+
/**
|
|
240
|
+
* DTCG token value types
|
|
241
|
+
*/
|
|
242
|
+
type DTCGTokenValue = string | number | boolean | DTCGCubicBezierValue | DTCGAliasValue;
|
|
243
|
+
/**
|
|
244
|
+
* DTCG Modifier context - contains token overrides for a specific context
|
|
245
|
+
* Token paths use dot notation (e.g., "color.background")
|
|
246
|
+
*/
|
|
247
|
+
interface DTCGModifierContext {
|
|
248
|
+
[tokenPath: string]: {
|
|
249
|
+
$value: DTCGTokenValue;
|
|
250
|
+
} | DTCGModifierContext;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* DTCG Modifier definition
|
|
254
|
+
* @see https://www.designtokens.org/tr/2025.10/
|
|
255
|
+
*/
|
|
256
|
+
interface DTCGModifier {
|
|
257
|
+
$type: "modifier";
|
|
258
|
+
/** The default context name (optional) */
|
|
259
|
+
$default?: string;
|
|
260
|
+
/** Context definitions with token overrides */
|
|
261
|
+
contexts: Record<string, DTCGModifierContext>;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* DTCG Modifiers section at document root
|
|
265
|
+
*/
|
|
266
|
+
interface DTCGModifiers {
|
|
267
|
+
theme?: DTCGModifier;
|
|
268
|
+
[key: string]: DTCGModifier | undefined;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Styleframe-specific extensions for DTCG format
|
|
272
|
+
*/
|
|
273
|
+
interface DTCGStyleframeExtensions {
|
|
274
|
+
/** Multi-mode values (key: mode name, value: token value) */
|
|
275
|
+
modes?: Record<string, DTCGTokenValue>;
|
|
276
|
+
/** Original Styleframe variable name */
|
|
277
|
+
styleframeName?: string;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Generic extensions object
|
|
281
|
+
*/
|
|
282
|
+
interface DTCGExtensions {
|
|
283
|
+
"dev.styleframe"?: DTCGStyleframeExtensions;
|
|
284
|
+
[key: string]: unknown;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Document-level Styleframe extensions
|
|
288
|
+
*/
|
|
289
|
+
interface DTCGDocumentStyleframeExtensions {
|
|
290
|
+
/** Collection name */
|
|
291
|
+
collection?: string;
|
|
292
|
+
/** Mode names (first is default) */
|
|
293
|
+
modes?: string[];
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Document-level extensions
|
|
297
|
+
*/
|
|
298
|
+
interface DTCGDocumentExtensions {
|
|
299
|
+
"dev.styleframe"?: DTCGDocumentStyleframeExtensions;
|
|
300
|
+
[key: string]: unknown;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Base DTCG token interface
|
|
304
|
+
*/
|
|
305
|
+
interface DTCGToken {
|
|
306
|
+
$value: DTCGTokenValue;
|
|
307
|
+
$type?: DTCGTokenType;
|
|
308
|
+
$description?: string;
|
|
309
|
+
$deprecated?: boolean | string;
|
|
310
|
+
$extensions?: DTCGExtensions;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* DTCG group node (can contain tokens or nested groups)
|
|
314
|
+
*/
|
|
315
|
+
interface DTCGGroup {
|
|
316
|
+
$type?: DTCGTokenType;
|
|
317
|
+
$description?: string;
|
|
318
|
+
$extensions?: DTCGExtensions;
|
|
319
|
+
[key: string]: DTCGToken | DTCGGroup | DTCGTokenType | string | boolean | DTCGExtensions | undefined;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Root DTCG document structure
|
|
323
|
+
*/
|
|
324
|
+
interface DTCGDocument {
|
|
325
|
+
$schema?: string;
|
|
326
|
+
$description?: string;
|
|
327
|
+
$extensions?: DTCGDocumentExtensions;
|
|
328
|
+
$modifiers?: DTCGModifiers;
|
|
329
|
+
[key: string]: DTCGToken | DTCGGroup | DTCGModifiers | string | DTCGDocumentExtensions | undefined;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Options for DTCG export
|
|
333
|
+
*/
|
|
334
|
+
interface ToDTCGOptions {
|
|
335
|
+
/** Include $schema field */
|
|
336
|
+
includeSchema?: boolean;
|
|
337
|
+
/** DTCG schema URL */
|
|
338
|
+
schemaUrl?: string;
|
|
339
|
+
/** Use DTCG modifier format for multi-mode values (default: true) */
|
|
340
|
+
useModifiers?: boolean;
|
|
341
|
+
/**
|
|
342
|
+
* Theme names from Styleframe configuration.
|
|
343
|
+
* When provided, only these modes will be used to generate $modifiers.theme.
|
|
344
|
+
* If not provided, all non-default modes are treated as themes.
|
|
345
|
+
*/
|
|
346
|
+
themeNames?: string[];
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Options for DTCG import
|
|
350
|
+
*/
|
|
351
|
+
interface FromDTCGOptions {
|
|
352
|
+
/** Default mode name when no modes extension is present */
|
|
353
|
+
defaultModeName?: string;
|
|
354
|
+
/** Collection name override */
|
|
355
|
+
collectionName?: string;
|
|
356
|
+
/** Preferred modifier to use for modes if multiple exist (default: "theme") */
|
|
357
|
+
preferredModifier?: string;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Type guard to check if a value is a DTCGToken (has $value property)
|
|
361
|
+
*/
|
|
362
|
+
declare function isDTCGToken(value: unknown): value is DTCGToken;
|
|
363
|
+
/**
|
|
364
|
+
* Type guard to check if a value is a DTCGGroup (object without $value)
|
|
365
|
+
*/
|
|
366
|
+
declare function isDTCGGroup(value: unknown): value is DTCGGroup;
|
|
367
|
+
//# sourceMappingURL=types.d.ts.map
|
|
368
|
+
//#endregion
|
|
369
|
+
//#region src/converters/dtcg/type-mapping.d.ts
|
|
370
|
+
/**
|
|
371
|
+
* Map Figma variable types to DTCG types
|
|
372
|
+
*/
|
|
373
|
+
declare function figmaTypeToDTCG(figmaType: FigmaVariableType): DTCGTokenType;
|
|
374
|
+
/**
|
|
375
|
+
* Map DTCG types to Figma variable types
|
|
376
|
+
*/
|
|
377
|
+
declare function dtcgTypeToFigma(dtcgType: DTCGTokenType): FigmaVariableType;
|
|
378
|
+
/**
|
|
379
|
+
* Detect DTCG type from a value
|
|
380
|
+
*/
|
|
381
|
+
declare function detectDTCGType(value: unknown): DTCGTokenType;
|
|
382
|
+
//# sourceMappingURL=type-mapping.d.ts.map
|
|
383
|
+
//#endregion
|
|
384
|
+
//#region src/converters/dtcg/alias-parsing.d.ts
|
|
385
|
+
/**
|
|
386
|
+
* Parse a DTCG alias string to get the referenced path
|
|
387
|
+
* @example "{color.primary}" → "color.primary"
|
|
388
|
+
*/
|
|
389
|
+
declare function parseAlias(alias: DTCGAliasValue): string;
|
|
390
|
+
/**
|
|
391
|
+
* Create a DTCG alias string from a token path
|
|
392
|
+
* @example "color.primary" → "{color.primary}"
|
|
393
|
+
*/
|
|
394
|
+
declare function createAlias(path: string): DTCGAliasValue;
|
|
395
|
+
/**
|
|
396
|
+
* Convert Figma slash notation to DTCG dot notation
|
|
397
|
+
* @example "color/primary" → "color.primary"
|
|
398
|
+
*/
|
|
399
|
+
declare function figmaPathToDTCG(figmaPath: string): string;
|
|
400
|
+
/**
|
|
401
|
+
* Convert DTCG dot notation to Figma slash notation
|
|
402
|
+
* @example "color.primary" → "color/primary"
|
|
403
|
+
*/
|
|
404
|
+
declare function dtcgPathToFigma(dtcgPath: string): string;
|
|
405
|
+
/**
|
|
406
|
+
* Check if a value is an alias and resolve it to Figma format
|
|
407
|
+
*/
|
|
408
|
+
declare function resolveAliasForFigma(value: unknown): {
|
|
409
|
+
isAlias: boolean;
|
|
410
|
+
target?: string;
|
|
411
|
+
};
|
|
412
|
+
/**
|
|
413
|
+
* Get the segments of a token path
|
|
414
|
+
* @example "color.primary.500" → ["color", "primary", "500"]
|
|
415
|
+
*/
|
|
416
|
+
declare function getPathSegments(path: string): string[];
|
|
417
|
+
/**
|
|
418
|
+
* Join path segments into a DTCG path
|
|
419
|
+
* @example ["color", "primary", "500"] → "color.primary.500"
|
|
420
|
+
*/
|
|
421
|
+
declare function joinPath(segments: string[]): string;
|
|
422
|
+
//# sourceMappingURL=alias-parsing.d.ts.map
|
|
423
|
+
//#endregion
|
|
424
|
+
//#region src/converters/dtcg/to-dtcg.d.ts
|
|
425
|
+
/**
|
|
426
|
+
* Convert FigmaExportFormat to DTCG format
|
|
427
|
+
*/
|
|
428
|
+
declare function toDTCG(data: FigmaExportFormat, options?: ToDTCGOptions): DTCGDocument;
|
|
429
|
+
//# sourceMappingURL=to-dtcg.d.ts.map
|
|
430
|
+
//#endregion
|
|
431
|
+
//#region src/converters/dtcg/from-dtcg.d.ts
|
|
432
|
+
/**
|
|
433
|
+
* Convert DTCG format to FigmaExportFormat
|
|
434
|
+
*/
|
|
435
|
+
declare function fromDTCG(doc: DTCGDocument, options?: FromDTCGOptions): FigmaExportFormat;
|
|
436
|
+
//# sourceMappingURL=from-dtcg.d.ts.map
|
|
437
|
+
|
|
438
|
+
//#endregion
|
|
439
|
+
export { CodegenResult, DTCGAliasValue, DTCGCubicBezierValue, DTCGDocument, DTCGDocumentExtensions, DTCGDocumentStyleframeExtensions, DTCGExtensions, DTCGGroup, DTCGModifier, DTCGModifierContext, DTCGModifiers, DTCGStyleframeExtensions, DTCGToken, DTCGTokenType, DTCGTokenValue, FigmaExportFormat, FigmaExportVariable, FigmaRGBA, FigmaToStyleframeOptions, FigmaVariableAlias, FigmaVariableType, FigmaVariableValue, FromDTCGOptions, ParsedDimension, ParsedTheme, ParsedVariable, StyleframeToFigmaOptions, ToDTCGOptions, createAlias, cssColorToFigma, cssVariableToStyleframeName, detectDTCGType, detectFigmaType, dimensionToPixels, dtcgPathToFigma, dtcgTypeToFigma, extractCategory, extractKey, figmaColorToCss, figmaPathToDTCG, figmaToStyleframeName, figmaTypeToDTCG, figmaValueToStyleframe, fromDTCG, generateStyleframeCode, getPathSegments, isColorValue, isDTCGAlias, isDTCGGroup, isDTCGToken, isDimensionValue, joinPath, parseAlias, parseDimension, pixelsToDimension, resolveAliasForFigma, styleframeToCssVariable, styleframeToFigmaName, styleframeValueToFigma, toDTCG, toVariableIdentifier };
|
|
440
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/converters/name-mapping.ts","../src/converters/value-parsing.ts","../src/converters/codegen.ts","../src/converters/dtcg/types.ts","../src/converters/dtcg/type-mapping.ts","../src/converters/dtcg/alias-parsing.ts","../src/converters/dtcg/to-dtcg.ts","../src/converters/dtcg/from-dtcg.ts"],"sourcesContent":[],"mappings":";;AAGA;AAUA;AAQY,UAlBK,SAAA,CAkBY;EAKjB,CAAA,EAAA,MAAA;EAAkB,CAAA,EAAA,MAAA;KAC3B,MAAA;MAIA,MAAA;;AAKH;;;AAQwB,UA/BP,kBAAA,CA+BO;MAAf,EAAA,gBAAA;EAAM,EAAA,EAAA,MAAA;AAUf;AAYA;AAYA;AAgBA;AAkBiB,KA3FL,iBAAA,GA+FA,OAAA,GAAA,OAAc,GAAA,QAAA,GAAA,SAAA;AAM1B;;;AAMS,KAtGG,kBAAA,GACT,SAqGM,GAAA,MAAA,GAAA,MAAA,GAAA,OAAA,GAjGN,kBAiGM;;;;UA5FQ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