css-typed-vars 0.5.0 → 0.7.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/README.md +152 -5
- package/dist/chunk-6YWE4A6S.js +691 -0
- package/dist/chunk-HBUSLYYB.js +127 -0
- package/dist/chunk-PLO2JWR7.js +88 -0
- package/dist/cli.cjs +480 -57
- package/dist/cli.js +51 -9
- package/dist/esbuild.cjs +433 -60
- package/dist/esbuild.d.cts +1 -1
- package/dist/esbuild.d.ts +1 -1
- package/dist/esbuild.js +2 -2
- package/dist/generator-C1iVNsry.d.cts +49 -0
- package/dist/generator-C1iVNsry.d.ts +49 -0
- package/dist/index.cjs +452 -47
- package/dist/index.d.cts +27 -6
- package/dist/index.d.ts +27 -6
- package/dist/index.js +14 -2
- package/dist/rollup.cjs +433 -60
- package/dist/rollup.d.cts +1 -1
- package/dist/rollup.d.ts +1 -1
- package/dist/rollup.js +2 -2
- package/dist/unplugin.cjs +433 -60
- package/dist/unplugin.d.cts +17 -1
- package/dist/unplugin.d.ts +17 -1
- package/dist/unplugin.js +2 -2
- package/dist/vite.cjs +433 -60
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +2 -2
- package/dist/webpack.cjs +433 -60
- package/dist/webpack.d.cts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +2 -2
- package/package.json +6 -2
- package/dist/chunk-H3T6RMQQ.js +0 -51
- package/dist/chunk-JDZAH2YQ.js +0 -320
- package/dist/chunk-YBZGHG2G.js +0 -91
- package/dist/generator-t6h8Ic7V.d.cts +0 -6
- package/dist/generator-t6h8Ic7V.d.ts +0 -6
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
declare function parseVarNames(css: string, selectors?: string[]): string[];
|
|
2
|
+
declare function parseVarDeclarations(css: string, selectors?: string[]): Map<string, string>;
|
|
3
|
+
interface ThemedDeclarations {
|
|
4
|
+
/** Base values, from `:root`/`@theme`/`selectors` blocks outside any theme block. */
|
|
5
|
+
declarations: Map<string, string>;
|
|
6
|
+
/** Per theme name, the values declared inside that theme's blocks. */
|
|
7
|
+
themes: Map<string, Map<string, string>>;
|
|
8
|
+
}
|
|
9
|
+
declare function parseThemedDeclarations(css: string, selectors: string[] | undefined, themes: Record<string, string>): ThemedDeclarations;
|
|
10
|
+
interface PropertyRule {
|
|
11
|
+
syntax?: string;
|
|
12
|
+
inherits?: string;
|
|
13
|
+
initialValue?: string;
|
|
14
|
+
}
|
|
15
|
+
declare function parsePropertyRules(css: string): Map<string, PropertyRule>;
|
|
16
|
+
|
|
17
|
+
type NamingConvention = 'camelCase' | 'snake' | 'kebab' | 'constant' | 'pascal';
|
|
18
|
+
interface GeneratorOptions {
|
|
19
|
+
prefix?: string;
|
|
20
|
+
naming?: NamingConvention;
|
|
21
|
+
/** Declared value per var name, emitted as a `@default` JSDoc tag. */
|
|
22
|
+
declarations?: Map<string, string>;
|
|
23
|
+
group?: boolean;
|
|
24
|
+
/** `@property` rules per var name, emitted as `@syntax` JSDoc tags and enum union types. */
|
|
25
|
+
properties?: Map<string, PropertyRule>;
|
|
26
|
+
/** Also emit the `CssVarRef` type and `getCssVar`/`setCssVar` runtime helpers. */
|
|
27
|
+
helpers?: boolean;
|
|
28
|
+
/** Per theme name, the values declared for it, emitted as `@theme <name> <value>` JSDoc tags. */
|
|
29
|
+
themes?: Map<string, Map<string, string>>;
|
|
30
|
+
}
|
|
31
|
+
type LegacyArgs = [
|
|
32
|
+
prefix?: string,
|
|
33
|
+
naming?: NamingConvention,
|
|
34
|
+
declarations?: Map<string, string>,
|
|
35
|
+
group?: boolean,
|
|
36
|
+
properties?: Map<string, PropertyRule>
|
|
37
|
+
];
|
|
38
|
+
declare function generateCode(varNames: string[], options?: GeneratorOptions): string;
|
|
39
|
+
/** @deprecated Pass a `GeneratorOptions` object as the second argument instead. */
|
|
40
|
+
declare function generateCode(varNames: string[], ...args: LegacyArgs): string;
|
|
41
|
+
declare function generateJs(varNames: string[], options?: GeneratorOptions): string;
|
|
42
|
+
/** @deprecated Pass a `GeneratorOptions` object as the second argument instead. */
|
|
43
|
+
declare function generateJs(varNames: string[], ...args: LegacyArgs): string;
|
|
44
|
+
declare function generateDeclaration(varNames: string[], options?: GeneratorOptions): string;
|
|
45
|
+
/** @deprecated Pass a `GeneratorOptions` object as the second argument instead. */
|
|
46
|
+
declare function generateDeclaration(varNames: string[], ...args: LegacyArgs): string;
|
|
47
|
+
declare function generateTokens(varNames: string[], options?: GeneratorOptions): string;
|
|
48
|
+
|
|
49
|
+
export { type GeneratorOptions as G, type NamingConvention as N, type PropertyRule as P, type ThemedDeclarations as T, generateDeclaration as a, generateJs as b, generateTokens as c, parseThemedDeclarations as d, parseVarDeclarations as e, parseVarNames as f, generateCode as g, parsePropertyRules as p };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
declare function parseVarNames(css: string, selectors?: string[]): string[];
|
|
2
|
+
declare function parseVarDeclarations(css: string, selectors?: string[]): Map<string, string>;
|
|
3
|
+
interface ThemedDeclarations {
|
|
4
|
+
/** Base values, from `:root`/`@theme`/`selectors` blocks outside any theme block. */
|
|
5
|
+
declarations: Map<string, string>;
|
|
6
|
+
/** Per theme name, the values declared inside that theme's blocks. */
|
|
7
|
+
themes: Map<string, Map<string, string>>;
|
|
8
|
+
}
|
|
9
|
+
declare function parseThemedDeclarations(css: string, selectors: string[] | undefined, themes: Record<string, string>): ThemedDeclarations;
|
|
10
|
+
interface PropertyRule {
|
|
11
|
+
syntax?: string;
|
|
12
|
+
inherits?: string;
|
|
13
|
+
initialValue?: string;
|
|
14
|
+
}
|
|
15
|
+
declare function parsePropertyRules(css: string): Map<string, PropertyRule>;
|
|
16
|
+
|
|
17
|
+
type NamingConvention = 'camelCase' | 'snake' | 'kebab' | 'constant' | 'pascal';
|
|
18
|
+
interface GeneratorOptions {
|
|
19
|
+
prefix?: string;
|
|
20
|
+
naming?: NamingConvention;
|
|
21
|
+
/** Declared value per var name, emitted as a `@default` JSDoc tag. */
|
|
22
|
+
declarations?: Map<string, string>;
|
|
23
|
+
group?: boolean;
|
|
24
|
+
/** `@property` rules per var name, emitted as `@syntax` JSDoc tags and enum union types. */
|
|
25
|
+
properties?: Map<string, PropertyRule>;
|
|
26
|
+
/** Also emit the `CssVarRef` type and `getCssVar`/`setCssVar` runtime helpers. */
|
|
27
|
+
helpers?: boolean;
|
|
28
|
+
/** Per theme name, the values declared for it, emitted as `@theme <name> <value>` JSDoc tags. */
|
|
29
|
+
themes?: Map<string, Map<string, string>>;
|
|
30
|
+
}
|
|
31
|
+
type LegacyArgs = [
|
|
32
|
+
prefix?: string,
|
|
33
|
+
naming?: NamingConvention,
|
|
34
|
+
declarations?: Map<string, string>,
|
|
35
|
+
group?: boolean,
|
|
36
|
+
properties?: Map<string, PropertyRule>
|
|
37
|
+
];
|
|
38
|
+
declare function generateCode(varNames: string[], options?: GeneratorOptions): string;
|
|
39
|
+
/** @deprecated Pass a `GeneratorOptions` object as the second argument instead. */
|
|
40
|
+
declare function generateCode(varNames: string[], ...args: LegacyArgs): string;
|
|
41
|
+
declare function generateJs(varNames: string[], options?: GeneratorOptions): string;
|
|
42
|
+
/** @deprecated Pass a `GeneratorOptions` object as the second argument instead. */
|
|
43
|
+
declare function generateJs(varNames: string[], ...args: LegacyArgs): string;
|
|
44
|
+
declare function generateDeclaration(varNames: string[], options?: GeneratorOptions): string;
|
|
45
|
+
/** @deprecated Pass a `GeneratorOptions` object as the second argument instead. */
|
|
46
|
+
declare function generateDeclaration(varNames: string[], ...args: LegacyArgs): string;
|
|
47
|
+
declare function generateTokens(varNames: string[], options?: GeneratorOptions): string;
|
|
48
|
+
|
|
49
|
+
export { type GeneratorOptions as G, type NamingConvention as N, type PropertyRule as P, type ThemedDeclarations as T, generateDeclaration as a, generateJs as b, generateTokens as c, parseThemedDeclarations as d, parseVarDeclarations as e, parseVarNames as f, generateCode as g, parsePropertyRules as p };
|