@bamboocss/generator 1.11.1 → 1.11.2
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.cjs +6229 -0
- package/dist/index.d.cts +61 -0
- package/dist/index.d.mts +61 -0
- package/dist/index.mjs +2852 -3152
- package/package.json +14 -14
- package/dist/index.js +0 -6540
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Context, StyleDecoder, Stylesheet } from "@bamboocss/core";
|
|
2
|
+
import { ArtifactId, CssArtifactType, LoadConfigResult, SpecFile, SpecType, SpecTypeMap } from "@bamboocss/types";
|
|
3
|
+
|
|
4
|
+
//#region src/generator.d.ts
|
|
5
|
+
interface SplitCssArtifact {
|
|
6
|
+
type: 'layer' | 'recipe' | 'theme';
|
|
7
|
+
name: string;
|
|
8
|
+
file: string;
|
|
9
|
+
code: string;
|
|
10
|
+
/** Directory relative to styles/ */
|
|
11
|
+
dir?: string;
|
|
12
|
+
}
|
|
13
|
+
interface SplitCssResult {
|
|
14
|
+
/** Layer CSS files (reset, global, tokens, utilities) */
|
|
15
|
+
layers: SplitCssArtifact[];
|
|
16
|
+
/** Recipe CSS files */
|
|
17
|
+
recipes: SplitCssArtifact[];
|
|
18
|
+
/** Theme CSS files (not auto-imported) */
|
|
19
|
+
themes: SplitCssArtifact[];
|
|
20
|
+
/** Content for recipes.css */
|
|
21
|
+
recipesIndex: string;
|
|
22
|
+
/** Content for main styles.css */
|
|
23
|
+
index: string;
|
|
24
|
+
}
|
|
25
|
+
declare class Generator extends Context {
|
|
26
|
+
constructor(conf: LoadConfigResult);
|
|
27
|
+
getArtifacts: (ids?: ArtifactId[] | undefined) => import("@bamboocss/types").Artifact[];
|
|
28
|
+
appendCssOfType: (type: CssArtifactType, sheet: Stylesheet) => void;
|
|
29
|
+
appendLayerParams: (sheet: Stylesheet) => void;
|
|
30
|
+
appendBaselineCss: (sheet: Stylesheet) => void;
|
|
31
|
+
appendParserCss: (sheet: Stylesheet) => void;
|
|
32
|
+
getParserCss: (decoder: StyleDecoder) => string;
|
|
33
|
+
getCss: (stylesheet?: Stylesheet) => string;
|
|
34
|
+
/**
|
|
35
|
+
* Get CSS for a specific layer from the stylesheet
|
|
36
|
+
*/
|
|
37
|
+
getLayerCss: (sheet: Stylesheet, layer: "reset" | "base" | "tokens" | "recipes" | "utilities") => string;
|
|
38
|
+
/**
|
|
39
|
+
* Get CSS for a specific recipe
|
|
40
|
+
*/
|
|
41
|
+
getRecipeCss: (recipeName: string) => string;
|
|
42
|
+
/**
|
|
43
|
+
* Get all recipe names from the decoder
|
|
44
|
+
*/
|
|
45
|
+
getRecipeNames: () => string[];
|
|
46
|
+
/**
|
|
47
|
+
* Get all split CSS artifacts for the stylesheet
|
|
48
|
+
* Used when --splitting flag is enabled
|
|
49
|
+
*/
|
|
50
|
+
getSplitCssArtifacts: (sheet: Stylesheet) => SplitCssResult;
|
|
51
|
+
getSpec: () => SpecFile[];
|
|
52
|
+
getSpecOfType: <T extends SpecType>(type: T) => T extends "color-palette" | "themes" ? SpecTypeMap[T] | undefined : SpecTypeMap[T];
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/artifacts/js/themes.d.ts
|
|
56
|
+
/**
|
|
57
|
+
* Get CSS for a specific theme
|
|
58
|
+
*/
|
|
59
|
+
declare function getThemeCss(ctx: Context, themeName: string): string;
|
|
60
|
+
//#endregion
|
|
61
|
+
export { Generator, SplitCssArtifact, SplitCssResult, getThemeCss };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Context, StyleDecoder, Stylesheet } from "@bamboocss/core";
|
|
2
|
+
import { ArtifactId, CssArtifactType, LoadConfigResult, SpecFile, SpecType, SpecTypeMap } from "@bamboocss/types";
|
|
3
|
+
|
|
4
|
+
//#region src/generator.d.ts
|
|
5
|
+
interface SplitCssArtifact {
|
|
6
|
+
type: 'layer' | 'recipe' | 'theme';
|
|
7
|
+
name: string;
|
|
8
|
+
file: string;
|
|
9
|
+
code: string;
|
|
10
|
+
/** Directory relative to styles/ */
|
|
11
|
+
dir?: string;
|
|
12
|
+
}
|
|
13
|
+
interface SplitCssResult {
|
|
14
|
+
/** Layer CSS files (reset, global, tokens, utilities) */
|
|
15
|
+
layers: SplitCssArtifact[];
|
|
16
|
+
/** Recipe CSS files */
|
|
17
|
+
recipes: SplitCssArtifact[];
|
|
18
|
+
/** Theme CSS files (not auto-imported) */
|
|
19
|
+
themes: SplitCssArtifact[];
|
|
20
|
+
/** Content for recipes.css */
|
|
21
|
+
recipesIndex: string;
|
|
22
|
+
/** Content for main styles.css */
|
|
23
|
+
index: string;
|
|
24
|
+
}
|
|
25
|
+
declare class Generator extends Context {
|
|
26
|
+
constructor(conf: LoadConfigResult);
|
|
27
|
+
getArtifacts: (ids?: ArtifactId[] | undefined) => import("@bamboocss/types").Artifact[];
|
|
28
|
+
appendCssOfType: (type: CssArtifactType, sheet: Stylesheet) => void;
|
|
29
|
+
appendLayerParams: (sheet: Stylesheet) => void;
|
|
30
|
+
appendBaselineCss: (sheet: Stylesheet) => void;
|
|
31
|
+
appendParserCss: (sheet: Stylesheet) => void;
|
|
32
|
+
getParserCss: (decoder: StyleDecoder) => string;
|
|
33
|
+
getCss: (stylesheet?: Stylesheet) => string;
|
|
34
|
+
/**
|
|
35
|
+
* Get CSS for a specific layer from the stylesheet
|
|
36
|
+
*/
|
|
37
|
+
getLayerCss: (sheet: Stylesheet, layer: "reset" | "base" | "tokens" | "recipes" | "utilities") => string;
|
|
38
|
+
/**
|
|
39
|
+
* Get CSS for a specific recipe
|
|
40
|
+
*/
|
|
41
|
+
getRecipeCss: (recipeName: string) => string;
|
|
42
|
+
/**
|
|
43
|
+
* Get all recipe names from the decoder
|
|
44
|
+
*/
|
|
45
|
+
getRecipeNames: () => string[];
|
|
46
|
+
/**
|
|
47
|
+
* Get all split CSS artifacts for the stylesheet
|
|
48
|
+
* Used when --splitting flag is enabled
|
|
49
|
+
*/
|
|
50
|
+
getSplitCssArtifacts: (sheet: Stylesheet) => SplitCssResult;
|
|
51
|
+
getSpec: () => SpecFile[];
|
|
52
|
+
getSpecOfType: <T extends SpecType>(type: T) => T extends "color-palette" | "themes" ? SpecTypeMap[T] | undefined : SpecTypeMap[T];
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/artifacts/js/themes.d.ts
|
|
56
|
+
/**
|
|
57
|
+
* Get CSS for a specific theme
|
|
58
|
+
*/
|
|
59
|
+
declare function getThemeCss(ctx: Context, themeName: string): string;
|
|
60
|
+
//#endregion
|
|
61
|
+
export { Generator, SplitCssArtifact, SplitCssResult, getThemeCss };
|