@jesscss/plugin-less-compat 2.0.0-alpha.7 → 2.0.0-alpha.9

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 (49) hide show
  1. package/README.md +34 -122
  2. package/lib/index.cjs +13 -821
  3. package/lib/index.d.ts +0 -3
  4. package/lib/index.js +15 -786
  5. package/lib/plugin.d.ts +17 -109
  6. package/package.json +5 -15
  7. package/lib/less-adapter.cjs +0 -216
  8. package/lib/less-adapter.js +0 -181
  9. package/lib/less-compat-structures.cjs +0 -378
  10. package/lib/less-compat-structures.d.ts +0 -108
  11. package/lib/less-compat-structures.js +0 -374
  12. package/lib/nodes/at-rule.d.ts +0 -2
  13. package/lib/nodes/attribute-selector.d.ts +0 -2
  14. package/lib/nodes/call.d.ts +0 -2
  15. package/lib/nodes/color.d.ts +0 -2
  16. package/lib/nodes/combinator.d.ts +0 -2
  17. package/lib/nodes/comment.d.ts +0 -2
  18. package/lib/nodes/condition.d.ts +0 -2
  19. package/lib/nodes/declaration.d.ts +0 -2
  20. package/lib/nodes/dimension.d.ts +0 -2
  21. package/lib/nodes/expression.d.ts +0 -2
  22. package/lib/nodes/extend.d.ts +0 -2
  23. package/lib/nodes/import.d.ts +0 -2
  24. package/lib/nodes/index.d.ts +0 -45
  25. package/lib/nodes/keyword.d.ts +0 -2
  26. package/lib/nodes/list.d.ts +0 -3
  27. package/lib/nodes/mixin.d.ts +0 -2
  28. package/lib/nodes/negative.d.ts +0 -2
  29. package/lib/nodes/operation.d.ts +0 -2
  30. package/lib/nodes/paren.d.ts +0 -2
  31. package/lib/nodes/quoted.d.ts +0 -2
  32. package/lib/nodes/reference.d.ts +0 -2
  33. package/lib/nodes/ruleset.d.ts +0 -2
  34. package/lib/nodes/selector.d.ts +0 -3
  35. package/lib/nodes/sequence.d.ts +0 -2
  36. package/lib/nodes/url.d.ts +0 -2
  37. package/lib/nodes/var-declaration.d.ts +0 -2
  38. package/lib/plugin-utils.d.ts +0 -20
  39. package/lib/transform/adapter.d.ts +0 -31
  40. package/lib/transform/from-less.d.ts +0 -30
  41. package/lib/transform/index.cjs +0 -13
  42. package/lib/transform/index.d.ts +0 -7
  43. package/lib/transform/index.js +0 -3
  44. package/lib/transform/less-adapter.d.ts +0 -29
  45. package/lib/transform/to-less.d.ts +0 -17
  46. package/lib/transform/type-map.d.ts +0 -27
  47. package/lib/transform.cjs +0 -1045
  48. package/lib/transform.js +0 -1015
  49. package/lib/types.d.ts +0 -158
@@ -1,29 +0,0 @@
1
- import { Node } from '@jesscss/core';
2
- declare const LESS_ADAPTER_SYMBOL: unique symbol;
3
- declare const JESS_NODE_SYMBOL: unique symbol;
4
- export declare const IS_ADAPTING_SYMBOL: unique symbol;
5
- export type LessAdapterField<T extends Node> = ((node: T, cache?: WeakMap<Node, unknown>) => unknown) | {
6
- get: (node: T, cache?: WeakMap<Node, unknown>) => unknown;
7
- set?: (node: T, value: unknown, cache?: WeakMap<Node, unknown>) => void;
8
- enumerable?: boolean;
9
- };
10
- export interface LessAdapterDefinition<T extends Node> {
11
- lessType?: string | ((node: T) => string);
12
- fields?: Record<string, LessAdapterField<T>>;
13
- accept?: (node: T, visitor: any, cache?: WeakMap<Node, unknown>) => any;
14
- }
15
- export type LessAdapterInstance<T extends Node = Node> = LessAdapterBase<T> & {
16
- type: string;
17
- typeIndex: number | undefined;
18
- accept(visitor: unknown): T | unknown;
19
- };
20
- export declare class LessAdapterBase<T extends Node = Node> {
21
- readonly [LESS_ADAPTER_SYMBOL] = true;
22
- readonly [JESS_NODE_SYMBOL]: T;
23
- readonly ['__jessNode']: T;
24
- constructor(node: T);
25
- get jessNode(): T;
26
- }
27
- export declare function createLessAdapter<T extends Node>(jessNode: T, definition: LessAdapterDefinition<T>, cache?: WeakMap<Node, unknown>): LessAdapterInstance<T>;
28
- export declare function isAdaptingNode(node: Node): boolean;
29
- export {};
@@ -1,17 +0,0 @@
1
- import { Node, Rules } from '@jesscss/core';
2
- export type LessNode = any;
3
- export interface ToLessOptions {
4
- /** Cache conversions to avoid repeated work */
5
- cache?: WeakMap<Node, any>;
6
- /** Preserve original Jess node reference */
7
- preserveOriginal?: boolean;
8
- }
9
- export declare function toLessNode(jessNode: Node, options?: ToLessOptions): LessNode;
10
- /**
11
- * Convert an entire Jess Rules tree to Less-compatible format
12
- *
13
- * @param jessRules - The Jess Rules tree to convert
14
- * @param options - Conversion options
15
- * @returns A Less-compatible tree
16
- */
17
- export declare function toLessTree(jessRules: Rules | Node, options?: ToLessOptions): LessNode;
@@ -1,27 +0,0 @@
1
- /**
2
- * Type mapping utilities for converting between Jess and Less node types
3
- */
4
- /**
5
- * Map Jess node types to Less node types
6
- *
7
- * @param jessType - The Jess node type
8
- * @returns The corresponding Less node type
9
- */
10
- export declare function mapJessTypeToLessType(jessType: string): string;
11
- /**
12
- * Map Less node types to Jess node types
13
- *
14
- * @param lessType - The Less node type
15
- * @returns The corresponding Jess node type
16
- */
17
- export declare function mapLessTypeToJessType(lessType: string): string;
18
- /**
19
- * Get Less typeIndex for a Jess node type
20
- *
21
- * Less.js uses typeIndex for visitor caching. This function
22
- * maps Jess types to their corresponding Less typeIndex values.
23
- *
24
- * @param jessType - The Jess node type
25
- * @returns The Less typeIndex, or undefined if not found
26
- */
27
- export declare function getLessTypeIndex(_jessType: string): number | undefined;