@bamboocss/generator
Advanced tools
| import { Context, StyleDecoder, Stylesheet } from "@bamboocss/core"; | ||
| import { ArtifactId, CssArtifactType, LoadConfigResult, SpecFile, SpecType, SpecTypeMap } from "@bamboocss/types"; | ||
| //#region src/generator.d.ts | ||
| interface SplitCssArtifact { | ||
| type: 'layer' | 'recipe' | 'theme'; | ||
| name: string; | ||
| file: string; | ||
| code: string; | ||
| /** Directory relative to styles/ */ | ||
| dir?: string; | ||
| } | ||
| interface SplitCssResult { | ||
| /** Layer CSS files (reset, global, tokens, utilities) */ | ||
| layers: SplitCssArtifact[]; | ||
| /** Recipe CSS files */ | ||
| recipes: SplitCssArtifact[]; | ||
| /** Theme CSS files (not auto-imported) */ | ||
| themes: SplitCssArtifact[]; | ||
| /** Content for recipes.css */ | ||
| recipesIndex: string; | ||
| /** Content for main styles.css */ | ||
| index: string; | ||
| } | ||
| declare class Generator extends Context { | ||
| constructor(conf: LoadConfigResult); | ||
| getArtifacts: (ids?: ArtifactId[] | undefined) => import("@bamboocss/types").Artifact[]; | ||
| appendCssOfType: (type: CssArtifactType, sheet: Stylesheet) => void; | ||
| appendLayerParams: (sheet: Stylesheet) => void; | ||
| appendBaselineCss: (sheet: Stylesheet) => void; | ||
| appendParserCss: (sheet: Stylesheet) => void; | ||
| getParserCss: (decoder: StyleDecoder) => string; | ||
| getCss: (stylesheet?: Stylesheet) => string; | ||
| /** | ||
| * Get CSS for a specific layer from the stylesheet | ||
| */ | ||
| getLayerCss: (sheet: Stylesheet, layer: "reset" | "base" | "tokens" | "recipes" | "utilities") => string; | ||
| /** | ||
| * Get CSS for a specific recipe | ||
| */ | ||
| getRecipeCss: (recipeName: string) => string; | ||
| /** | ||
| * Get all recipe names from the decoder | ||
| */ | ||
| getRecipeNames: () => string[]; | ||
| /** | ||
| * Get all split CSS artifacts for the stylesheet | ||
| * Used when --splitting flag is enabled | ||
| */ | ||
| getSplitCssArtifacts: (sheet: Stylesheet) => SplitCssResult; | ||
| getSpec: () => SpecFile[]; | ||
| getSpecOfType: <T extends SpecType>(type: T) => T extends "color-palette" | "themes" ? SpecTypeMap[T] | undefined : SpecTypeMap[T]; | ||
| } | ||
| //#endregion | ||
| //#region src/artifacts/js/themes.d.ts | ||
| /** | ||
| * Get CSS for a specific theme | ||
| */ | ||
| declare function getThemeCss(ctx: Context, themeName: string): string; | ||
| //#endregion | ||
| export { Generator, SplitCssArtifact, SplitCssResult, getThemeCss }; |
| import { Context, StyleDecoder, Stylesheet } from "@bamboocss/core"; | ||
| import { ArtifactId, CssArtifactType, LoadConfigResult, SpecFile, SpecType, SpecTypeMap } from "@bamboocss/types"; | ||
| //#region src/generator.d.ts | ||
| interface SplitCssArtifact { | ||
| type: 'layer' | 'recipe' | 'theme'; | ||
| name: string; | ||
| file: string; | ||
| code: string; | ||
| /** Directory relative to styles/ */ | ||
| dir?: string; | ||
| } | ||
| interface SplitCssResult { | ||
| /** Layer CSS files (reset, global, tokens, utilities) */ | ||
| layers: SplitCssArtifact[]; | ||
| /** Recipe CSS files */ | ||
| recipes: SplitCssArtifact[]; | ||
| /** Theme CSS files (not auto-imported) */ | ||
| themes: SplitCssArtifact[]; | ||
| /** Content for recipes.css */ | ||
| recipesIndex: string; | ||
| /** Content for main styles.css */ | ||
| index: string; | ||
| } | ||
| declare class Generator extends Context { | ||
| constructor(conf: LoadConfigResult); | ||
| getArtifacts: (ids?: ArtifactId[] | undefined) => import("@bamboocss/types").Artifact[]; | ||
| appendCssOfType: (type: CssArtifactType, sheet: Stylesheet) => void; | ||
| appendLayerParams: (sheet: Stylesheet) => void; | ||
| appendBaselineCss: (sheet: Stylesheet) => void; | ||
| appendParserCss: (sheet: Stylesheet) => void; | ||
| getParserCss: (decoder: StyleDecoder) => string; | ||
| getCss: (stylesheet?: Stylesheet) => string; | ||
| /** | ||
| * Get CSS for a specific layer from the stylesheet | ||
| */ | ||
| getLayerCss: (sheet: Stylesheet, layer: "reset" | "base" | "tokens" | "recipes" | "utilities") => string; | ||
| /** | ||
| * Get CSS for a specific recipe | ||
| */ | ||
| getRecipeCss: (recipeName: string) => string; | ||
| /** | ||
| * Get all recipe names from the decoder | ||
| */ | ||
| getRecipeNames: () => string[]; | ||
| /** | ||
| * Get all split CSS artifacts for the stylesheet | ||
| * Used when --splitting flag is enabled | ||
| */ | ||
| getSplitCssArtifacts: (sheet: Stylesheet) => SplitCssResult; | ||
| getSpec: () => SpecFile[]; | ||
| getSpecOfType: <T extends SpecType>(type: T) => T extends "color-palette" | "themes" ? SpecTypeMap[T] | undefined : SpecTypeMap[T]; | ||
| } | ||
| //#endregion | ||
| //#region src/artifacts/js/themes.d.ts | ||
| /** | ||
| * Get CSS for a specific theme | ||
| */ | ||
| declare function getThemeCss(ctx: Context, themeName: string): string; | ||
| //#endregion | ||
| export { Generator, SplitCssArtifact, SplitCssResult, getThemeCss }; |
+7
-7
| { | ||
| "name": "@bamboocss/generator", | ||
| "version": "1.12.2", | ||
| "version": "1.12.3", | ||
| "description": "The css generator for css bamboo", | ||
@@ -41,8 +41,8 @@ "homepage": "https://bamboo-css.com", | ||
| "ts-pattern": "5.9.0", | ||
| "@bamboocss/is-valid-prop": "^1.12.2", | ||
| "@bamboocss/core": "1.12.2", | ||
| "@bamboocss/shared": "1.12.2", | ||
| "@bamboocss/types": "1.12.2", | ||
| "@bamboocss/logger": "1.12.2", | ||
| "@bamboocss/token-dictionary": "1.12.2" | ||
| "@bamboocss/core": "1.12.3", | ||
| "@bamboocss/is-valid-prop": "^1.12.3", | ||
| "@bamboocss/logger": "1.12.3", | ||
| "@bamboocss/shared": "1.12.3", | ||
| "@bamboocss/types": "1.12.3", | ||
| "@bamboocss/token-dictionary": "1.12.3" | ||
| }, | ||
@@ -49,0 +49,0 @@ "devDependencies": { |
2993375
0.15%6
50%+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated
Updated