@plumeria/codemod 18.2.17 → 18.2.19

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.
@@ -0,0 +1,45 @@
1
+ export interface PlumeriaReport {
2
+ line: number;
3
+ column: number;
4
+ kind: string;
5
+ hint: string;
6
+ }
7
+ export interface PlumeriaModule {
8
+ binding: string;
9
+ css: string;
10
+ globalCss: string;
11
+ keys: string[];
12
+ functions: Record<string, {
13
+ params: string[];
14
+ variables: string[];
15
+ }>;
16
+ aliases: Record<string, Record<string, string>>;
17
+ definitionOnly: boolean;
18
+ reports: PlumeriaReport[];
19
+ }
20
+ export interface ThemeExtraction {
21
+ bindings: Record<string, Record<string, string>>;
22
+ globalCss: string;
23
+ reports: PlumeriaReport[];
24
+ }
25
+ export interface StaticExtraction {
26
+ bindings: Record<string, Record<string, unknown>>;
27
+ reports: PlumeriaReport[];
28
+ }
29
+ export interface AnimationExtraction {
30
+ bindings: Record<string, string>;
31
+ keyframes: string[];
32
+ viewTransitions: string[];
33
+ globalCss: string;
34
+ reports: PlumeriaReport[];
35
+ }
36
+ export declare const __private: {
37
+ propertyKey: (node: any) => string | undefined;
38
+ memberPath: (node: any) => string[] | undefined;
39
+ evaluate: (node: any, values: Map<string, unknown>) => unknown;
40
+ bindsElsewhere: (ast: any, name: string, declared: any) => boolean;
41
+ };
42
+ export declare function extractPlumeriaThemes(source: string): ThemeExtraction;
43
+ export declare function extractPlumeriaStatics(source: string, externalValues?: Record<string, unknown>): StaticExtraction;
44
+ export declare function extractPlumeriaAnimations(source: string, externalValues?: Record<string, unknown>): AnimationExtraction;
45
+ export declare function convertPlumeriaModule(source: string, externalValues?: Record<string, unknown>): PlumeriaModule | null;
@@ -0,0 +1,555 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.__private = void 0;
4
+ exports.extractPlumeriaThemes = extractPlumeriaThemes;
5
+ exports.extractPlumeriaStatics = extractPlumeriaStatics;
6
+ exports.extractPlumeriaAnimations = extractPlumeriaAnimations;
7
+ exports.convertPlumeriaModule = convertPlumeriaModule;
8
+ const parser_1 = require("@typescript-eslint/parser");
9
+ const zss_engine_1 = require("zss-engine");
10
+ const toIdent = (value) => value.replace(/[^A-Za-z0-9-]/g, '');
11
+ const markerVariable = (id, pseudo) => {
12
+ const hash = (0, zss_engine_1.genBase36Hash)({ [id]: pseudo }, 1, 8);
13
+ return `--${hash}-${toIdent(id)}-${toIdent(pseudo.split('(')[0])}`;
14
+ };
15
+ const propertyKey = (node) => {
16
+ if (!node)
17
+ return undefined;
18
+ if (node.type === 'Identifier')
19
+ return node.name;
20
+ return node.type === 'Literal' ? String(node.value) : undefined;
21
+ };
22
+ const memberPath = (node) => {
23
+ if (node?.type === 'Identifier')
24
+ return [node.name];
25
+ if (node?.type !== 'MemberExpression')
26
+ return undefined;
27
+ const parent = memberPath(node.object);
28
+ const key = node.computed
29
+ ? propertyKey(node.property)
30
+ : node.property?.type === 'Identifier'
31
+ ? node.property.name
32
+ : undefined;
33
+ return parent && key !== undefined ? [...parent, key] : undefined;
34
+ };
35
+ const lookup = (path, values) => {
36
+ let value = values.get(path[0]);
37
+ for (const key of path.slice(1)) {
38
+ if (!value || typeof value !== 'object')
39
+ return undefined;
40
+ value = value[key];
41
+ }
42
+ return value;
43
+ };
44
+ const markerArguments = (node, method, values) => {
45
+ if (node?.type !== 'CallExpression')
46
+ return undefined;
47
+ const path = memberPath(node.callee);
48
+ if (path?.length !== 2 || path[1] !== method)
49
+ return undefined;
50
+ const id = evaluate(node.arguments[0], values);
51
+ const pseudo = evaluate(node.arguments[1], values);
52
+ return typeof id === 'string' && typeof pseudo === 'string'
53
+ ? { id, pseudo }
54
+ : undefined;
55
+ };
56
+ const evaluate = (node, values) => {
57
+ if (!node)
58
+ return undefined;
59
+ if (node.type === 'CallExpression') {
60
+ const extended = markerArguments(node, 'extended', values);
61
+ return extended
62
+ ? `@container style(${markerVariable(extended.id, extended.pseudo)}: 1)`
63
+ : undefined;
64
+ }
65
+ if (node.type === 'Literal')
66
+ return node.value;
67
+ if (node.type === 'Identifier')
68
+ return values.get(node.name);
69
+ if (node.type === 'MemberExpression') {
70
+ const path = memberPath(node);
71
+ return path ? lookup(path, values) : undefined;
72
+ }
73
+ if (node.type === 'TemplateLiteral') {
74
+ let result = '';
75
+ for (let index = 0; index < node.quasis.length; index++) {
76
+ result += node.quasis[index].value.cooked;
77
+ if (index < node.expressions.length) {
78
+ const value = evaluate(node.expressions[index], values);
79
+ if (value === undefined || typeof value === 'object')
80
+ return undefined;
81
+ result += String(value);
82
+ }
83
+ }
84
+ return result;
85
+ }
86
+ if (node.type === 'ObjectExpression') {
87
+ const result = {};
88
+ for (const property of node.properties) {
89
+ if (property.type !== 'Property' || property.kind !== 'init')
90
+ return undefined;
91
+ const key = property.computed
92
+ ? evaluate(property.key, values)
93
+ : propertyKey(property.key);
94
+ if (typeof key !== 'string')
95
+ return undefined;
96
+ const value = evaluate(property.value, values);
97
+ if (value === undefined)
98
+ return undefined;
99
+ result[key] = value;
100
+ }
101
+ return result;
102
+ }
103
+ return undefined;
104
+ };
105
+ const bindsElsewhere = (ast, name, declared) => {
106
+ const skipped = new Set(['loc', 'range', 'parent']);
107
+ const visit = (node, parent) => {
108
+ if (!node || typeof node !== 'object' || node === declared)
109
+ return false;
110
+ if (Array.isArray(node))
111
+ return node.some((child) => visit(child, parent));
112
+ if (typeof node.type !== 'string')
113
+ return false;
114
+ if (node.type === 'Identifier' && node.name === name) {
115
+ if (parent?.type === 'ExportSpecifier')
116
+ return false;
117
+ if (parent?.type === 'MemberExpression' && parent.property === node)
118
+ return !!parent.computed;
119
+ if (parent?.type === 'Property' && parent.key === node)
120
+ return !!parent.computed;
121
+ return true;
122
+ }
123
+ return Object.keys(node).some((key) => !skipped.has(key) && visit(node[key], node));
124
+ };
125
+ return visit(ast, undefined);
126
+ };
127
+ exports.__private = { propertyKey, memberPath, evaluate, bindsElsewhere };
128
+ const isCall = (node, method) => {
129
+ if (node?.type !== 'CallExpression')
130
+ return false;
131
+ const path = memberPath(node.callee);
132
+ return path?.length === 2 && path[1] === method;
133
+ };
134
+ const declarationOf = (statement) => statement.type === 'ExportNamedDeclaration'
135
+ ? statement.declaration
136
+ : statement;
137
+ const readThemes = (ast) => {
138
+ const values = new Map();
139
+ const reports = [];
140
+ const globalRules = [];
141
+ const report = (node, kind, hint) => {
142
+ reports.push({
143
+ line: node.loc.start.line,
144
+ column: node.loc.start.column + 1,
145
+ kind,
146
+ hint,
147
+ });
148
+ };
149
+ for (const raw of ast.body) {
150
+ const statement = declarationOf(raw);
151
+ if (statement?.type !== 'VariableDeclaration')
152
+ continue;
153
+ for (const declaration of statement.declarations) {
154
+ if (declaration.id.type !== 'Identifier' ||
155
+ !isCall(declaration.init, 'createTheme'))
156
+ continue;
157
+ const selector = evaluate(declaration.init.arguments[0], new Map());
158
+ const theme = evaluate(declaration.init.arguments[1], new Map());
159
+ if (typeof selector !== 'string' || !theme || typeof theme !== 'object') {
160
+ report(declaration.init, 'dynamic-create-theme', '`createTheme` needs a static selector and static token values.');
161
+ continue;
162
+ }
163
+ const rootDeclarations = [];
164
+ const themeDeclarations = [];
165
+ const references = {};
166
+ let valid = true;
167
+ for (const [key, rawPair] of Object.entries(theme)) {
168
+ if (!rawPair || typeof rawPair !== 'object') {
169
+ valid = false;
170
+ break;
171
+ }
172
+ const pair = rawPair;
173
+ if ((typeof pair.default !== 'string' &&
174
+ typeof pair.default !== 'number') ||
175
+ (typeof pair.theme !== 'string' && typeof pair.theme !== 'number')) {
176
+ valid = false;
177
+ break;
178
+ }
179
+ const hash = (0, zss_engine_1.genBase36Hash)({ [key]: pair }, 1, 8);
180
+ const variable = `--${hash}-${(0, zss_engine_1.camelToKebabCase)(key)}`;
181
+ rootDeclarations.push(` ${variable}: ${String(pair.default)};`);
182
+ themeDeclarations.push(` ${variable}: ${String(pair.theme)};`);
183
+ references[key] = `var(${variable})`;
184
+ }
185
+ if (!valid) {
186
+ report(declaration.init, 'dynamic-create-theme', 'Every theme token needs static `default` and `theme` values.');
187
+ continue;
188
+ }
189
+ values.set(declaration.id.name, references);
190
+ globalRules.push(`:where(:root) {\n${rootDeclarations.join('\n')}\n}`);
191
+ const target = selector.startsWith('@') ||
192
+ selector.startsWith('.') ||
193
+ selector.startsWith('#') ||
194
+ selector.startsWith(':') ||
195
+ selector.startsWith('[')
196
+ ? selector
197
+ : `.${selector}`;
198
+ if ((0, zss_engine_1.isAtRule)(target)) {
199
+ globalRules.push(`${target} {\n :where(:root) {\n${themeDeclarations
200
+ .map((line) => ` ${line}`)
201
+ .join('\n')}\n }\n}`);
202
+ }
203
+ else {
204
+ globalRules.push(`${target} {\n${themeDeclarations.join('\n')}\n}`);
205
+ }
206
+ }
207
+ }
208
+ return {
209
+ bindings: Object.fromEntries(values),
210
+ globalCss: globalRules.length > 0 ? `${globalRules.join('\n\n')}\n` : '',
211
+ reports,
212
+ };
213
+ };
214
+ function extractPlumeriaThemes(source) {
215
+ const ast = (0, parser_1.parse)(source, {
216
+ sourceType: 'module',
217
+ ecmaFeatures: { jsx: true },
218
+ loc: true,
219
+ range: true,
220
+ });
221
+ return readThemes(ast);
222
+ }
223
+ const emitGlobalObject = (selector, object) => {
224
+ const declarations = [];
225
+ const children = [];
226
+ for (const [key, value] of Object.entries(object)) {
227
+ if (value && typeof value === 'object') {
228
+ children.push(emitGlobalObject(key, value)
229
+ .split('\n')
230
+ .map((line) => ` ${line}`)
231
+ .join('\n'));
232
+ }
233
+ else if (typeof value === 'string' || typeof value === 'number') {
234
+ const property = (0, zss_engine_1.camelToKebabCase)(key);
235
+ declarations.push(` ${property}: ${(0, zss_engine_1.applyCssValue)(value, property)};`);
236
+ }
237
+ }
238
+ const content = [...declarations, ...children].join('\n');
239
+ return `${selector} {\n${content}\n}`;
240
+ };
241
+ function extractPlumeriaStatics(source, externalValues = {}) {
242
+ const ast = (0, parser_1.parse)(source, {
243
+ sourceType: 'module',
244
+ ecmaFeatures: { jsx: true },
245
+ loc: true,
246
+ range: true,
247
+ });
248
+ const values = new Map(Object.entries(externalValues));
249
+ const bindings = {};
250
+ const reports = [];
251
+ for (const raw of ast.body) {
252
+ const statement = declarationOf(raw);
253
+ if (statement?.type !== 'VariableDeclaration')
254
+ continue;
255
+ for (const declaration of statement.declarations) {
256
+ if (declaration.id.type !== 'Identifier' ||
257
+ !isCall(declaration.init, 'createStatic'))
258
+ continue;
259
+ const value = evaluate(declaration.init.arguments[0], values);
260
+ if (value && typeof value === 'object') {
261
+ values.set(declaration.id.name, value);
262
+ bindings[declaration.id.name] = value;
263
+ }
264
+ else {
265
+ reports.push({
266
+ line: declaration.init.loc.start.line,
267
+ column: declaration.init.loc.start.column + 1,
268
+ kind: 'dynamic-create-static',
269
+ hint: '`createStatic` must contain values that can be written into CSS.',
270
+ });
271
+ }
272
+ }
273
+ }
274
+ return { bindings, reports };
275
+ }
276
+ function extractPlumeriaAnimations(source, externalValues = {}) {
277
+ const ast = (0, parser_1.parse)(source, {
278
+ sourceType: 'module',
279
+ ecmaFeatures: { jsx: true },
280
+ loc: true,
281
+ range: true,
282
+ });
283
+ const values = new Map(Object.entries(externalValues));
284
+ const bindings = {};
285
+ const reports = [];
286
+ const rules = [];
287
+ const keyframes = [];
288
+ const viewTransitions = [];
289
+ const report = (node, kind, hint) => {
290
+ reports.push({
291
+ line: node.loc.start.line,
292
+ column: node.loc.start.column + 1,
293
+ kind,
294
+ hint,
295
+ });
296
+ };
297
+ const declarations = ast.body.flatMap((raw) => {
298
+ const statement = declarationOf(raw);
299
+ return statement?.type === 'VariableDeclaration'
300
+ ? statement.declarations
301
+ : [];
302
+ });
303
+ for (const declaration of declarations) {
304
+ if (declaration.id.type !== 'Identifier' ||
305
+ !isCall(declaration.init, 'keyframes'))
306
+ continue;
307
+ const object = evaluate(declaration.init.arguments[0], values);
308
+ if (!object || typeof object !== 'object') {
309
+ report(declaration.init, 'dynamic-keyframes', '`keyframes` needs a statically resolvable object.');
310
+ continue;
311
+ }
312
+ const hash = (0, zss_engine_1.genBase36Hash)(object, 1, 8);
313
+ const name = `kf-${hash}`;
314
+ values.set(declaration.id.name, name);
315
+ bindings[declaration.id.name] = name;
316
+ keyframes.push(declaration.id.name);
317
+ rules.push(emitGlobalObject(`@keyframes ${name}`, object));
318
+ }
319
+ for (const declaration of declarations) {
320
+ if (declaration.id.type !== 'Identifier' ||
321
+ !isCall(declaration.init, 'viewTransition'))
322
+ continue;
323
+ const object = evaluate(declaration.init.arguments[0], values);
324
+ if (!object || typeof object !== 'object') {
325
+ report(declaration.init, 'dynamic-view-transition', '`viewTransition` needs a statically resolvable object.');
326
+ continue;
327
+ }
328
+ const hash = (0, zss_engine_1.genBase36Hash)(object, 1, 8);
329
+ const name = `vt-${hash}`;
330
+ values.set(declaration.id.name, name);
331
+ bindings[declaration.id.name] = name;
332
+ viewTransitions.push(declaration.id.name);
333
+ for (const part of ['group', 'imagePair', 'old', 'new']) {
334
+ const style = object[part];
335
+ if (style && typeof style === 'object') {
336
+ const pseudoPart = part === 'imagePair' ? 'image-pair' : part;
337
+ rules.push(emitGlobalObject(`::view-transition-${pseudoPart}(${name})`, style));
338
+ }
339
+ }
340
+ }
341
+ return {
342
+ bindings,
343
+ keyframes,
344
+ viewTransitions,
345
+ globalCss: rules.length > 0 ? `${rules.join('\n\n')}\n` : '',
346
+ reports,
347
+ };
348
+ }
349
+ function convertPlumeriaModule(source, externalValues = {}) {
350
+ const ast = (0, parser_1.parse)(source, {
351
+ sourceType: 'module',
352
+ ecmaFeatures: { jsx: true },
353
+ loc: true,
354
+ range: true,
355
+ });
356
+ const themes = readThemes(ast);
357
+ const animations = extractPlumeriaAnimations(source, {
358
+ ...externalValues,
359
+ ...themes.bindings,
360
+ });
361
+ const values = new Map([
362
+ ...Object.entries(externalValues),
363
+ ...Object.entries(themes.bindings),
364
+ ...Object.entries(animations.bindings),
365
+ ]);
366
+ const reports = [...themes.reports, ...animations.reports];
367
+ const creates = [];
368
+ const report = (node, kind, hint) => {
369
+ reports.push({
370
+ line: node.loc.start.line,
371
+ column: node.loc.start.column + 1,
372
+ kind,
373
+ hint,
374
+ });
375
+ };
376
+ for (const raw of ast.body) {
377
+ const statement = declarationOf(raw);
378
+ if (statement?.type !== 'VariableDeclaration')
379
+ continue;
380
+ for (const declaration of statement.declarations) {
381
+ if (declaration.id.type !== 'Identifier')
382
+ continue;
383
+ if (isCall(declaration.init, 'createStatic')) {
384
+ const value = evaluate(declaration.init.arguments[0], values);
385
+ if (value && typeof value === 'object') {
386
+ values.set(declaration.id.name, value);
387
+ }
388
+ else {
389
+ report(declaration.init, 'dynamic-create-static', '`createStatic` must contain values that can be written into CSS.');
390
+ }
391
+ }
392
+ if (isCall(declaration.init, 'create')) {
393
+ const object = declaration.init.arguments[0];
394
+ if (object?.type === 'ObjectExpression') {
395
+ creates.push({ binding: declaration.id.name, object, declaration });
396
+ }
397
+ else {
398
+ report(declaration.init, 'dynamic-create', '`css.create` must receive an object literal.');
399
+ }
400
+ }
401
+ }
402
+ }
403
+ if (creates.length === 0)
404
+ return null;
405
+ const { binding } = creates[0];
406
+ const rules = [];
407
+ const keys = [];
408
+ const aliases = {};
409
+ const taken = new Set();
410
+ const functions = {};
411
+ const classNameFor = (owner, key) => {
412
+ if (!taken.has(key))
413
+ return key;
414
+ const namespaced = `${owner}-${key}`;
415
+ let candidate = namespaced;
416
+ let suffix = 2;
417
+ while (taken.has(candidate))
418
+ candidate = `${namespaced}-${suffix++}`;
419
+ return candidate;
420
+ };
421
+ const emit = (style, selector, wrappers = [], scope = values) => {
422
+ if (style?.type !== 'ObjectExpression') {
423
+ report(style, 'dynamic-style', 'Only static style objects are exported.');
424
+ return;
425
+ }
426
+ const declarations = [];
427
+ const nested = [];
428
+ const markers = [];
429
+ for (const property of style.properties) {
430
+ if (property.type === 'SpreadElement') {
431
+ const marker = markerArguments(property.argument, 'marker', scope);
432
+ if (marker) {
433
+ markers.push({
434
+ pseudo: marker.pseudo,
435
+ variable: markerVariable(marker.id, marker.pseudo),
436
+ });
437
+ continue;
438
+ }
439
+ }
440
+ if (property.type !== 'Property' || property.kind !== 'init') {
441
+ report(property, 'spread-style', 'Spread styles must be expanded before exporting to CSS Modules.');
442
+ continue;
443
+ }
444
+ const rawKey = property.computed
445
+ ? evaluate(property.key, scope)
446
+ : propertyKey(property.key);
447
+ if (typeof rawKey !== 'string') {
448
+ report(property.key, 'dynamic-key', 'Selector and property keys must be statically known.');
449
+ continue;
450
+ }
451
+ if (rawKey.startsWith(':') ||
452
+ rawKey.startsWith('[') ||
453
+ rawKey.startsWith('@')) {
454
+ nested.push({ key: rawKey, value: property.value });
455
+ continue;
456
+ }
457
+ const value = evaluate(property.value, scope);
458
+ if (typeof value !== 'string' && typeof value !== 'number') {
459
+ report(property.value, 'dynamic-value', `The value of \`${rawKey}\` cannot be represented statically.`);
460
+ continue;
461
+ }
462
+ const cssProperty = (0, zss_engine_1.camelToKebabCase)(rawKey);
463
+ declarations.push(` ${cssProperty}: ${(0, zss_engine_1.applyCssValue)(value, cssProperty)};`);
464
+ }
465
+ const pushRule = (target, lines) => {
466
+ if (lines.length === 0)
467
+ return;
468
+ let rule = `${target} {\n${lines.join('\n')}\n}`;
469
+ for (const wrapper of [...wrappers].reverse()) {
470
+ rule = `${wrapper} {\n${rule
471
+ .split('\n')
472
+ .map((line) => ` ${line}`)
473
+ .join('\n')}\n}`;
474
+ }
475
+ rules.push(rule);
476
+ };
477
+ pushRule(selector, declarations);
478
+ for (const marker of markers) {
479
+ pushRule(`${selector}${marker.pseudo}`, [` ${marker.variable}: 1;`]);
480
+ }
481
+ for (const child of nested) {
482
+ if (child.key.startsWith('@')) {
483
+ emit(child.value, selector, [...wrappers, child.key], scope);
484
+ }
485
+ else {
486
+ emit(child.value, `${selector}${child.key}`, wrappers, scope);
487
+ }
488
+ }
489
+ };
490
+ for (const create of creates) {
491
+ const owner = create.binding;
492
+ const alias = {};
493
+ for (const property of create.object.properties) {
494
+ if (property.type !== 'Property' || property.kind !== 'init') {
495
+ report(property, 'spread-create', 'Top-level spreads cannot name a CSS Module class.');
496
+ continue;
497
+ }
498
+ const key = property.computed
499
+ ? evaluate(property.key, values)
500
+ : propertyKey(property.key);
501
+ if (typeof key !== 'string') {
502
+ report(property.key, 'dynamic-style-key', 'Style names must be statically known.');
503
+ continue;
504
+ }
505
+ const className = classNameFor(owner, key);
506
+ taken.add(className);
507
+ if (owner !== binding)
508
+ alias[key] = className;
509
+ if (property.value.type === 'ArrowFunctionExpression' ||
510
+ property.value.type === 'FunctionExpression') {
511
+ const params = [];
512
+ let valid = true;
513
+ for (const parameter of property.value.params) {
514
+ if (parameter.type !== 'Identifier') {
515
+ valid = false;
516
+ break;
517
+ }
518
+ params.push(parameter.name);
519
+ }
520
+ let body = property.value.body;
521
+ if (body.type === 'BlockStatement') {
522
+ const returned = body.body.find((statement) => statement.type === 'ReturnStatement');
523
+ body = returned?.argument;
524
+ }
525
+ if (!valid || body?.type !== 'ObjectExpression') {
526
+ report(property.value, 'function-style', 'Function style keys need identifier parameters and an object return value.');
527
+ continue;
528
+ }
529
+ const variables = params.map((parameter) => `--${(0, zss_engine_1.camelToKebabCase)(owner)}-${(0, zss_engine_1.camelToKebabCase)(key)}-${(0, zss_engine_1.camelToKebabCase)(parameter)}`);
530
+ const scope = new Map(values);
531
+ params.forEach((parameter, index) => {
532
+ scope.set(parameter, `var(${variables[index]})`);
533
+ });
534
+ functions[className] = { params, variables };
535
+ keys.push(className);
536
+ emit(body, `.${className}`, [], scope);
537
+ continue;
538
+ }
539
+ keys.push(className);
540
+ emit(property.value, `.${className}`);
541
+ }
542
+ if (owner !== binding)
543
+ aliases[owner] = alias;
544
+ }
545
+ return {
546
+ binding,
547
+ css: rules.length > 0 ? `${rules.join('\n\n')}\n` : '',
548
+ globalCss: `${themes.globalCss}${animations.globalCss}`,
549
+ keys,
550
+ functions,
551
+ aliases,
552
+ definitionOnly: creates.every((create) => !bindsElsewhere(ast, create.binding, create.declaration.id)),
553
+ reports,
554
+ };
555
+ }
@@ -0,0 +1,26 @@
1
+ import type { Rule } from 'eslint';
2
+ export interface ReleaseModule {
3
+ source: string;
4
+ target?: string;
5
+ binding: string;
6
+ definitionOnly?: boolean;
7
+ aliases?: Record<string, Record<string, string>>;
8
+ functions?: Record<string, {
9
+ params: string[];
10
+ variables: string[];
11
+ }>;
12
+ }
13
+ export interface ReleaseStylesOptions {
14
+ modules: Record<string, ReleaseModule>;
15
+ themes?: Record<string, string[]>;
16
+ animations?: Record<string, string[]>;
17
+ statics?: Record<string, string[]>;
18
+ styleProp?: string;
19
+ active?: boolean;
20
+ }
21
+ export declare const __private: {
22
+ memberPath: (node: any) => string[] | undefined;
23
+ isCreate: (node: any) => boolean;
24
+ needsFilter: (node: any) => boolean;
25
+ };
26
+ export declare const releaseStyles: Rule.RuleModule;