@tenphi/tasty 0.0.0-snapshot.26b4630 → 0.0.0-snapshot.2705ab9
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 +315 -159
- package/dist/chunks/cacheKey.js +16 -8
- package/dist/chunks/cacheKey.js.map +1 -1
- package/dist/chunks/definitions.d.ts +1 -1
- package/dist/chunks/definitions.js +2 -3
- package/dist/chunks/definitions.js.map +1 -1
- package/dist/chunks/renderChunk.js +31 -32
- package/dist/chunks/renderChunk.js.map +1 -1
- package/dist/config.d.ts +98 -12
- package/dist/config.js +134 -33
- package/dist/config.js.map +1 -1
- package/dist/core/index.d.ts +11 -10
- package/dist/core/index.js +8 -7
- package/dist/counter-style/index.js +51 -0
- package/dist/counter-style/index.js.map +1 -0
- package/dist/debug.d.ts +26 -141
- package/dist/debug.js +356 -635
- package/dist/debug.js.map +1 -1
- package/dist/font-face/index.js +63 -0
- package/dist/font-face/index.js.map +1 -0
- package/dist/hooks/resolve-ssr-collector.js +15 -0
- package/dist/hooks/resolve-ssr-collector.js.map +1 -0
- package/dist/hooks/useCounterStyle.d.ts +50 -0
- package/dist/hooks/useCounterStyle.js +47 -0
- package/dist/hooks/useCounterStyle.js.map +1 -0
- package/dist/hooks/useFontFace.d.ts +43 -0
- package/dist/hooks/useFontFace.js +71 -0
- package/dist/hooks/useFontFace.js.map +1 -0
- package/dist/hooks/useGlobalStyles.d.ts +3 -0
- package/dist/hooks/useGlobalStyles.js +24 -1
- package/dist/hooks/useGlobalStyles.js.map +1 -1
- package/dist/hooks/useKeyframes.js +14 -3
- package/dist/hooks/useKeyframes.js.map +1 -1
- package/dist/hooks/useProperty.js +32 -13
- package/dist/hooks/useProperty.js.map +1 -1
- package/dist/hooks/useRawCSS.js +9 -1
- package/dist/hooks/useRawCSS.js.map +1 -1
- package/dist/hooks/useStyles.d.ts +5 -0
- package/dist/hooks/useStyles.js +115 -46
- package/dist/hooks/useStyles.js.map +1 -1
- package/dist/index.d.ts +22 -11
- package/dist/index.js +10 -7
- package/dist/injector/index.d.ts +28 -2
- package/dist/injector/index.js +27 -1
- package/dist/injector/index.js.map +1 -1
- package/dist/injector/injector.d.ts +28 -1
- package/dist/injector/injector.js +93 -32
- package/dist/injector/injector.js.map +1 -1
- package/dist/injector/sheet-manager.d.ts +16 -7
- package/dist/injector/sheet-manager.js +31 -11
- package/dist/injector/sheet-manager.js.map +1 -1
- package/dist/injector/types.d.ts +70 -1
- package/dist/parser/classify.js +5 -4
- package/dist/parser/classify.js.map +1 -1
- package/dist/parser/const.js +17 -1
- package/dist/parser/const.js.map +1 -1
- package/dist/parser/parser.js +1 -1
- package/dist/pipeline/conditions.js +14 -8
- package/dist/pipeline/conditions.js.map +1 -1
- package/dist/pipeline/index.d.ts +3 -1
- package/dist/pipeline/index.js +137 -69
- package/dist/pipeline/index.js.map +1 -1
- package/dist/pipeline/materialize.js +404 -208
- package/dist/pipeline/materialize.js.map +1 -1
- package/dist/pipeline/parseStateKey.d.ts +1 -1
- package/dist/pipeline/parseStateKey.js +37 -20
- package/dist/pipeline/parseStateKey.js.map +1 -1
- package/dist/pipeline/simplify.js +111 -152
- package/dist/pipeline/simplify.js.map +1 -1
- package/dist/pipeline/warnings.js +18 -0
- package/dist/pipeline/warnings.js.map +1 -0
- package/dist/plugins/okhsl-plugin.js +2 -275
- package/dist/plugins/okhsl-plugin.js.map +1 -1
- package/dist/plugins/types.d.ts +9 -2
- package/dist/properties/index.js +82 -17
- package/dist/properties/index.js.map +1 -1
- package/dist/properties/property-type-resolver.d.ts +24 -0
- package/dist/properties/property-type-resolver.js +91 -0
- package/dist/properties/property-type-resolver.js.map +1 -0
- package/dist/ssr/astro.d.ts +29 -0
- package/dist/ssr/astro.js +65 -0
- package/dist/ssr/astro.js.map +1 -0
- package/dist/ssr/async-storage.d.ts +17 -0
- package/dist/ssr/async-storage.js +35 -0
- package/dist/ssr/async-storage.js.map +1 -0
- package/dist/ssr/collect-auto-properties.js +40 -0
- package/dist/ssr/collect-auto-properties.js.map +1 -0
- package/dist/ssr/collector.d.ts +102 -0
- package/dist/ssr/collector.js +227 -0
- package/dist/ssr/collector.js.map +1 -0
- package/dist/ssr/context.d.ts +8 -0
- package/dist/ssr/context.js +14 -0
- package/dist/ssr/context.js.map +1 -0
- package/dist/ssr/format-global-rules.js +22 -0
- package/dist/ssr/format-global-rules.js.map +1 -0
- package/dist/ssr/format-keyframes.js +70 -0
- package/dist/ssr/format-keyframes.js.map +1 -0
- package/dist/ssr/format-property.js +50 -0
- package/dist/ssr/format-property.js.map +1 -0
- package/dist/ssr/format-rules.js +73 -0
- package/dist/ssr/format-rules.js.map +1 -0
- package/dist/ssr/hydrate.d.ts +22 -0
- package/dist/ssr/hydrate.js +50 -0
- package/dist/ssr/hydrate.js.map +1 -0
- package/dist/ssr/index.d.ts +5 -0
- package/dist/ssr/index.js +12 -0
- package/dist/ssr/index.js.map +1 -0
- package/dist/ssr/next.d.ts +45 -0
- package/dist/ssr/next.js +71 -0
- package/dist/ssr/next.js.map +1 -0
- package/dist/ssr/ssr-collector-ref.js +12 -0
- package/dist/ssr/ssr-collector-ref.js.map +1 -0
- package/dist/states/index.js +12 -257
- package/dist/states/index.js.map +1 -1
- package/dist/styles/align.d.ts +1 -1
- package/dist/styles/align.js.map +1 -1
- package/dist/styles/border.d.ts +1 -1
- package/dist/styles/border.js +2 -2
- package/dist/styles/border.js.map +1 -1
- package/dist/styles/color.d.ts +2 -2
- package/dist/styles/color.js +9 -5
- package/dist/styles/color.js.map +1 -1
- package/dist/styles/createStyle.js +25 -22
- package/dist/styles/createStyle.js.map +1 -1
- package/dist/styles/fade.d.ts +1 -1
- package/dist/styles/fade.js.map +1 -1
- package/dist/styles/fill.d.ts +14 -16
- package/dist/styles/fill.js +6 -5
- package/dist/styles/fill.js.map +1 -1
- package/dist/styles/flow.d.ts +3 -3
- package/dist/styles/flow.js.map +1 -1
- package/dist/styles/index.js +1 -1
- package/dist/styles/justify.d.ts +1 -1
- package/dist/styles/justify.js.map +1 -1
- package/dist/styles/predefined.d.ts +0 -2
- package/dist/styles/predefined.js +1 -4
- package/dist/styles/predefined.js.map +1 -1
- package/dist/styles/preset.d.ts +5 -0
- package/dist/styles/preset.js +48 -47
- package/dist/styles/preset.js.map +1 -1
- package/dist/styles/radius.d.ts +1 -1
- package/dist/styles/radius.js.map +1 -1
- package/dist/styles/scrollbar.d.ts +9 -5
- package/dist/styles/scrollbar.js +25 -82
- package/dist/styles/scrollbar.js.map +1 -1
- package/dist/styles/shadow.d.ts +2 -2
- package/dist/styles/shadow.js.map +1 -1
- package/dist/styles/transition.d.ts +1 -1
- package/dist/styles/transition.js +1 -1
- package/dist/styles/transition.js.map +1 -1
- package/dist/styles/types.d.ts +70 -21
- package/dist/tasty.d.ts +30 -893
- package/dist/tasty.js +60 -19
- package/dist/tasty.js.map +1 -1
- package/dist/types.d.ts +3 -3
- package/dist/utils/cache-wrapper.js +4 -8
- package/dist/utils/cache-wrapper.js.map +1 -1
- package/dist/utils/color-math.d.ts +46 -0
- package/dist/utils/color-math.js +749 -0
- package/dist/utils/color-math.js.map +1 -0
- package/dist/utils/color-space.d.ts +5 -0
- package/dist/utils/color-space.js +229 -0
- package/dist/utils/color-space.js.map +1 -0
- package/dist/utils/colors.d.ts +1 -1
- package/dist/utils/colors.js +3 -1
- package/dist/utils/colors.js.map +1 -1
- package/dist/utils/css-types.d.ts +1 -1
- package/dist/utils/dotize.d.ts +1 -1
- package/dist/utils/has-keys.js +13 -0
- package/dist/utils/has-keys.js.map +1 -0
- package/dist/utils/mod-attrs.js +2 -2
- package/dist/utils/mod-attrs.js.map +1 -1
- package/dist/utils/process-tokens.d.ts +3 -13
- package/dist/utils/process-tokens.js +18 -98
- package/dist/utils/process-tokens.js.map +1 -1
- package/dist/utils/selector-transform.js +32 -0
- package/dist/utils/selector-transform.js.map +1 -0
- package/dist/utils/string.js.map +1 -1
- package/dist/utils/styles.d.ts +4 -88
- package/dist/utils/styles.js +34 -398
- package/dist/utils/styles.js.map +1 -1
- package/dist/utils/typography.d.ts +24 -13
- package/dist/utils/typography.js +14 -16
- package/dist/utils/typography.js.map +1 -1
- package/dist/zero/babel.d.ts +67 -8
- package/dist/zero/babel.js +109 -17
- package/dist/zero/babel.js.map +1 -1
- package/dist/zero/extractor.js +118 -1
- package/dist/zero/extractor.js.map +1 -1
- package/dist/zero/next.d.ts +44 -30
- package/dist/zero/next.js +102 -38
- package/dist/zero/next.js.map +1 -1
- package/docs/PIPELINE.md +519 -0
- package/docs/README.md +31 -0
- package/docs/adoption.md +296 -0
- package/docs/comparison.md +420 -0
- package/docs/configuration.md +326 -0
- package/docs/debug.md +318 -0
- package/docs/design-system.md +424 -0
- package/docs/dsl.md +673 -0
- package/docs/getting-started.md +217 -0
- package/docs/injector.md +528 -0
- package/docs/methodology.md +567 -0
- package/docs/runtime.md +485 -0
- package/docs/ssr.md +384 -0
- package/docs/styles.md +579 -0
- package/docs/tasty-static.md +433 -0
- package/package.json +98 -28
- package/dist/styles/styledScrollbar.d.ts +0 -47
- package/dist/styles/styledScrollbar.js +0 -38
- package/dist/styles/styledScrollbar.js.map +0 -1
- package/dist/tokens/typography.d.ts +0 -19
- package/dist/tokens/typography.js +0 -237
- package/dist/tokens/typography.js.map +0 -1
- package/dist/utils/hsl-to-rgb.js +0 -38
- package/dist/utils/hsl-to-rgb.js.map +0 -1
- package/dist/utils/okhsl-to-rgb.js +0 -296
- package/dist/utils/okhsl-to-rgb.js.map +0 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//#region src/counter-style/index.ts
|
|
2
|
+
const COUNTER_STYLE_KEY = "@counterStyle";
|
|
3
|
+
/**
|
|
4
|
+
* Check if styles object has local @counterStyle definition.
|
|
5
|
+
*/
|
|
6
|
+
function hasLocalCounterStyle(styles) {
|
|
7
|
+
return COUNTER_STYLE_KEY in styles;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Extract local @counterStyle from styles object.
|
|
11
|
+
* Returns null if no local counter styles (fast path).
|
|
12
|
+
*/
|
|
13
|
+
function extractLocalCounterStyle(styles) {
|
|
14
|
+
const counterStyle = styles[COUNTER_STYLE_KEY];
|
|
15
|
+
if (!counterStyle || typeof counterStyle !== "object") return null;
|
|
16
|
+
return counterStyle;
|
|
17
|
+
}
|
|
18
|
+
const COUNTER_STYLE_DESCRIPTOR_MAP = {
|
|
19
|
+
system: "system",
|
|
20
|
+
symbols: "symbols",
|
|
21
|
+
additiveSymbols: "additive-symbols",
|
|
22
|
+
prefix: "prefix",
|
|
23
|
+
suffix: "suffix",
|
|
24
|
+
negative: "negative",
|
|
25
|
+
range: "range",
|
|
26
|
+
pad: "pad",
|
|
27
|
+
fallback: "fallback",
|
|
28
|
+
speakAs: "speak-as"
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Format the inner declarations of a @counter-style rule (no wrapper).
|
|
32
|
+
* Used by the injector which needs selector and declarations separately.
|
|
33
|
+
*/
|
|
34
|
+
function formatCounterStyleDeclarations(descriptors) {
|
|
35
|
+
const parts = [];
|
|
36
|
+
for (const [key, cssName] of Object.entries(COUNTER_STYLE_DESCRIPTOR_MAP)) {
|
|
37
|
+
const value = descriptors[key];
|
|
38
|
+
if (value !== void 0) parts.push(`${cssName}: ${value};`);
|
|
39
|
+
}
|
|
40
|
+
return parts.join(" ");
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Format a @counter-style rule as CSS.
|
|
44
|
+
*/
|
|
45
|
+
function formatCounterStyleRule(name, descriptors) {
|
|
46
|
+
return `@counter-style ${name} { ${formatCounterStyleDeclarations(descriptors)} }`;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { extractLocalCounterStyle, formatCounterStyleDeclarations, formatCounterStyleRule, hasLocalCounterStyle };
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/counter-style/index.ts"],"sourcesContent":["/**\n * Counter Style Utilities\n *\n * Utilities for extracting and processing CSS @counter-style definitions in styles.\n * Counter-style rules are permanent once injected and do not need cleanup.\n */\n\nimport type { CounterStyleDescriptors } from '../injector/types';\nimport type { Styles } from '../styles/types';\n\n// ============================================================================\n// Constants\n// ============================================================================\n\nconst COUNTER_STYLE_KEY = '@counterStyle';\n\n// ============================================================================\n// Extraction Functions\n// ============================================================================\n\n/**\n * Check if styles object has local @counterStyle definition.\n */\nexport function hasLocalCounterStyle(styles: Styles): boolean {\n return COUNTER_STYLE_KEY in styles;\n}\n\n/**\n * Extract local @counterStyle from styles object.\n * Returns null if no local counter styles (fast path).\n */\nexport function extractLocalCounterStyle(\n styles: Styles,\n): Record<string, CounterStyleDescriptors> | null {\n const counterStyle = styles[COUNTER_STYLE_KEY];\n if (!counterStyle || typeof counterStyle !== 'object') {\n return null;\n }\n return counterStyle as Record<string, CounterStyleDescriptors>;\n}\n\n// ============================================================================\n// CSS Formatting\n// ============================================================================\n\nconst COUNTER_STYLE_DESCRIPTOR_MAP: Record<string, string> = {\n system: 'system',\n symbols: 'symbols',\n additiveSymbols: 'additive-symbols',\n prefix: 'prefix',\n suffix: 'suffix',\n negative: 'negative',\n range: 'range',\n pad: 'pad',\n fallback: 'fallback',\n speakAs: 'speak-as',\n};\n\n/**\n * Format the inner declarations of a @counter-style rule (no wrapper).\n * Used by the injector which needs selector and declarations separately.\n */\nexport function formatCounterStyleDeclarations(\n descriptors: CounterStyleDescriptors,\n): string {\n const parts: string[] = [];\n\n for (const [key, cssName] of Object.entries(COUNTER_STYLE_DESCRIPTOR_MAP)) {\n const value = descriptors[key as keyof CounterStyleDescriptors];\n if (value !== undefined) {\n parts.push(`${cssName}: ${value};`);\n }\n }\n\n return parts.join(' ');\n}\n\n/**\n * Format a @counter-style rule as CSS.\n */\nexport function formatCounterStyleRule(\n name: string,\n descriptors: CounterStyleDescriptors,\n): string {\n return `@counter-style ${name} { ${formatCounterStyleDeclarations(descriptors)} }`;\n}\n"],"mappings":";AAcA,MAAM,oBAAoB;;;;AAS1B,SAAgB,qBAAqB,QAAyB;AAC5D,QAAO,qBAAqB;;;;;;AAO9B,SAAgB,yBACd,QACgD;CAChD,MAAM,eAAe,OAAO;AAC5B,KAAI,CAAC,gBAAgB,OAAO,iBAAiB,SAC3C,QAAO;AAET,QAAO;;AAOT,MAAM,+BAAuD;CAC3D,QAAQ;CACR,SAAS;CACT,iBAAiB;CACjB,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,OAAO;CACP,KAAK;CACL,UAAU;CACV,SAAS;CACV;;;;;AAMD,SAAgB,+BACd,aACQ;CACR,MAAM,QAAkB,EAAE;AAE1B,MAAK,MAAM,CAAC,KAAK,YAAY,OAAO,QAAQ,6BAA6B,EAAE;EACzE,MAAM,QAAQ,YAAY;AAC1B,MAAI,UAAU,OACZ,OAAM,KAAK,GAAG,QAAQ,IAAI,MAAM,GAAG;;AAIvC,QAAO,MAAM,KAAK,IAAI;;;;;AAMxB,SAAgB,uBACd,MACA,aACQ;AACR,QAAO,kBAAkB,KAAK,KAAK,+BAA+B,YAAY,CAAC"}
|
package/dist/debug.d.ts
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
+
import { CacheMetrics } from "./injector/types.js";
|
|
2
|
+
|
|
1
3
|
//#region src/debug.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Debug utilities for inspecting tasty-generated CSS at runtime
|
|
4
|
-
*/
|
|
5
4
|
declare global {
|
|
6
5
|
interface Window {
|
|
7
6
|
tastyDebug?: typeof tastyDebug;
|
|
8
7
|
}
|
|
9
8
|
}
|
|
10
9
|
type CSSTarget = 'all' | 'global' | 'active' | 'unused' | 'page' | string | string[] | Element;
|
|
11
|
-
interface
|
|
10
|
+
interface DebugOptions {
|
|
12
11
|
root?: Document | ShadowRoot;
|
|
12
|
+
/** Suppress console logging and return data only (default: false) */
|
|
13
|
+
raw?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface CssOptions extends DebugOptions {
|
|
13
16
|
prettify?: boolean;
|
|
14
|
-
|
|
17
|
+
/** Read from stored source CSS (dev-mode only) instead of live CSSOM */
|
|
18
|
+
source?: boolean;
|
|
15
19
|
}
|
|
16
20
|
interface ChunkInfo {
|
|
17
21
|
className: string;
|
|
@@ -25,22 +29,6 @@ interface InspectResult {
|
|
|
25
29
|
size: number;
|
|
26
30
|
rules: number;
|
|
27
31
|
}
|
|
28
|
-
interface CacheMetrics {
|
|
29
|
-
hits: number;
|
|
30
|
-
misses: number;
|
|
31
|
-
bulkCleanups: number;
|
|
32
|
-
totalInsertions: number;
|
|
33
|
-
totalUnused: number;
|
|
34
|
-
stylesCleanedUp: number;
|
|
35
|
-
cleanupHistory: {
|
|
36
|
-
timestamp: number;
|
|
37
|
-
classesDeleted: number;
|
|
38
|
-
cssSize: number;
|
|
39
|
-
rulesDeleted: number;
|
|
40
|
-
}[];
|
|
41
|
-
startTime: number;
|
|
42
|
-
unusedHits?: number;
|
|
43
|
-
}
|
|
44
32
|
interface CacheStatus {
|
|
45
33
|
classes: {
|
|
46
34
|
active: string[];
|
|
@@ -49,17 +37,14 @@ interface CacheStatus {
|
|
|
49
37
|
};
|
|
50
38
|
metrics: CacheMetrics | null;
|
|
51
39
|
}
|
|
52
|
-
interface
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
root?: Document | ShadowRoot;
|
|
61
|
-
log?: boolean;
|
|
62
|
-
includePageCSS?: false | true | 'all';
|
|
40
|
+
interface ChunkBreakdown {
|
|
41
|
+
byChunk: Record<string, {
|
|
42
|
+
classes: string[];
|
|
43
|
+
cssSize: number;
|
|
44
|
+
ruleCount: number;
|
|
45
|
+
}>;
|
|
46
|
+
totalChunkTypes: number;
|
|
47
|
+
totalClasses: number;
|
|
63
48
|
}
|
|
64
49
|
interface Summary {
|
|
65
50
|
activeClasses: string[];
|
|
@@ -72,132 +57,32 @@ interface Summary {
|
|
|
72
57
|
keyframesCSSSize: number;
|
|
73
58
|
propertyCSSSize: number;
|
|
74
59
|
totalCSSSize: number;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
globalCSS: string;
|
|
78
|
-
rawCSS: string;
|
|
79
|
-
keyframesCSS: string;
|
|
80
|
-
propertyCSS: string;
|
|
81
|
-
allCSS: string;
|
|
60
|
+
activeRuleCount: number;
|
|
61
|
+
unusedRuleCount: number;
|
|
82
62
|
globalRuleCount: number;
|
|
83
63
|
rawRuleCount: number;
|
|
84
64
|
keyframesRuleCount: number;
|
|
85
65
|
propertyRuleCount: number;
|
|
86
|
-
|
|
87
|
-
css?: string;
|
|
88
|
-
cssSize: number;
|
|
89
|
-
ruleCount: number;
|
|
90
|
-
stylesheetCount: number;
|
|
91
|
-
skippedStylesheets: number;
|
|
92
|
-
};
|
|
66
|
+
totalRuleCount: number;
|
|
93
67
|
metrics: CacheMetrics | null;
|
|
94
68
|
definedProperties: string[];
|
|
95
69
|
definedKeyframes: {
|
|
96
70
|
name: string;
|
|
97
71
|
refCount: number;
|
|
98
72
|
}[];
|
|
99
|
-
|
|
100
|
-
keyframeCount: number;
|
|
101
|
-
cleanupSummary: {
|
|
102
|
-
enabled: boolean;
|
|
103
|
-
totalCleanups: number;
|
|
104
|
-
totalClassesDeleted: number;
|
|
105
|
-
totalCssDeleted: number;
|
|
106
|
-
totalRulesDeleted: number;
|
|
107
|
-
averageClassesPerCleanup: number;
|
|
108
|
-
averageCssPerCleanup: number;
|
|
109
|
-
averageRulesPerCleanup: number;
|
|
110
|
-
lastCleanup?: {
|
|
111
|
-
timestamp: number;
|
|
112
|
-
date: string;
|
|
113
|
-
classesDeleted: number;
|
|
114
|
-
cssSize: number;
|
|
115
|
-
rulesDeleted: number;
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
chunkBreakdown: {
|
|
119
|
-
byChunk: Record<string, {
|
|
120
|
-
classes: string[];
|
|
121
|
-
cssSize: number;
|
|
122
|
-
ruleCount: number;
|
|
123
|
-
}>;
|
|
124
|
-
totalChunkTypes: number;
|
|
125
|
-
};
|
|
73
|
+
chunkBreakdown: ChunkBreakdown;
|
|
126
74
|
}
|
|
127
|
-
/**
|
|
128
|
-
* Concise tastyDebug API for inspecting styles at runtime
|
|
129
|
-
*/
|
|
130
75
|
declare const tastyDebug: {
|
|
131
76
|
css(target: CSSTarget, opts?: CssOptions): string;
|
|
132
|
-
inspect(target: string | Element, opts?:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
cache(opts?:
|
|
136
|
-
root?: Document | ShadowRoot;
|
|
137
|
-
includeHistory?: boolean;
|
|
138
|
-
}): CacheStatus;
|
|
77
|
+
inspect(target: string | Element, opts?: DebugOptions): InspectResult;
|
|
78
|
+
summary(opts?: DebugOptions): Summary;
|
|
79
|
+
chunks(opts?: DebugOptions): ChunkBreakdown;
|
|
80
|
+
cache(opts?: DebugOptions): CacheStatus;
|
|
139
81
|
cleanup(opts?: {
|
|
140
82
|
root?: Document | ShadowRoot;
|
|
141
83
|
}): void;
|
|
142
|
-
metrics(opts?: {
|
|
143
|
-
root?: Document | ShadowRoot;
|
|
144
|
-
}): CacheMetrics | null;
|
|
145
|
-
resetMetrics(opts?: {
|
|
146
|
-
root?: Document | ShadowRoot;
|
|
147
|
-
}): void;
|
|
148
|
-
/**
|
|
149
|
-
* Get breakdown of styles by chunk type.
|
|
150
|
-
*
|
|
151
|
-
* With style chunking enabled, styles are split into logical chunks
|
|
152
|
-
* (appearance, font, dimension, container, etc.) for better caching
|
|
153
|
-
* and CSS reuse.
|
|
154
|
-
*
|
|
155
|
-
* @param opts - Options including root document/shadow root
|
|
156
|
-
* @returns Breakdown by chunk type with class counts and CSS sizes
|
|
157
|
-
*/
|
|
158
|
-
chunks(opts?: {
|
|
159
|
-
root?: Document | ShadowRoot;
|
|
160
|
-
log?: boolean;
|
|
161
|
-
}): {
|
|
162
|
-
byChunk: Record<string, {
|
|
163
|
-
classes: string[];
|
|
164
|
-
cssSize: number;
|
|
165
|
-
ruleCount: number;
|
|
166
|
-
}>;
|
|
167
|
-
totalChunkTypes: number;
|
|
168
|
-
totalClasses: number;
|
|
169
|
-
};
|
|
170
|
-
getGlobalTypeCSS(type: "global" | "raw" | "keyframes" | "property", opts?: {
|
|
171
|
-
root?: Document | ShadowRoot;
|
|
172
|
-
}): {
|
|
173
|
-
css: string;
|
|
174
|
-
ruleCount: number;
|
|
175
|
-
size: number;
|
|
176
|
-
};
|
|
177
|
-
defs(opts?: {
|
|
178
|
-
root?: Document | ShadowRoot;
|
|
179
|
-
}): Definitions;
|
|
180
|
-
summary(opts?: SummaryOptions): Summary;
|
|
181
|
-
pageCSS(opts?: {
|
|
182
|
-
root?: Document | ShadowRoot;
|
|
183
|
-
prettify?: boolean;
|
|
184
|
-
log?: boolean;
|
|
185
|
-
includeCrossOrigin?: boolean;
|
|
186
|
-
}): string;
|
|
187
|
-
pageStats(opts?: {
|
|
188
|
-
root?: Document | ShadowRoot;
|
|
189
|
-
includeCrossOrigin?: boolean;
|
|
190
|
-
}): {
|
|
191
|
-
cssSize: number;
|
|
192
|
-
ruleCount: number;
|
|
193
|
-
stylesheetCount: number;
|
|
194
|
-
skippedStylesheets: number;
|
|
195
|
-
};
|
|
196
|
-
install(): void;
|
|
197
|
-
log(target: CSSTarget, opts?: CssOptions & {
|
|
198
|
-
title?: string;
|
|
199
|
-
}): void;
|
|
200
84
|
help(): void;
|
|
85
|
+
install(): void;
|
|
201
86
|
};
|
|
202
87
|
//#endregion
|
|
203
88
|
export { tastyDebug };
|