elit 3.0.0 → 3.0.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.
Files changed (87) hide show
  1. package/dist/build.d.ts +4 -12
  2. package/dist/build.d.ts.map +1 -0
  3. package/dist/chokidar.d.ts +7 -9
  4. package/dist/chokidar.d.ts.map +1 -0
  5. package/dist/cli.d.ts +6 -0
  6. package/dist/cli.d.ts.map +1 -0
  7. package/dist/cli.js +17 -4
  8. package/dist/config.d.ts +29 -0
  9. package/dist/config.d.ts.map +1 -0
  10. package/dist/dom.d.ts +7 -14
  11. package/dist/dom.d.ts.map +1 -0
  12. package/dist/el.d.ts +19 -191
  13. package/dist/el.d.ts.map +1 -0
  14. package/dist/fs.d.ts +35 -35
  15. package/dist/fs.d.ts.map +1 -0
  16. package/dist/hmr.d.ts +3 -3
  17. package/dist/hmr.d.ts.map +1 -0
  18. package/dist/http.d.ts +20 -22
  19. package/dist/http.d.ts.map +1 -0
  20. package/dist/https.d.ts +12 -15
  21. package/dist/https.d.ts.map +1 -0
  22. package/dist/index.d.ts +10 -629
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/mime-types.d.ts +9 -9
  25. package/dist/mime-types.d.ts.map +1 -0
  26. package/dist/path.d.ts +22 -19
  27. package/dist/path.d.ts.map +1 -0
  28. package/dist/router.d.ts +10 -17
  29. package/dist/router.d.ts.map +1 -0
  30. package/dist/runtime.d.ts +5 -6
  31. package/dist/runtime.d.ts.map +1 -0
  32. package/dist/server.d.ts +105 -7
  33. package/dist/server.d.ts.map +1 -0
  34. package/dist/server.js +14 -2
  35. package/dist/server.mjs +14 -2
  36. package/dist/state.d.ts +21 -27
  37. package/dist/state.d.ts.map +1 -0
  38. package/dist/style.d.ts +14 -55
  39. package/dist/style.d.ts.map +1 -0
  40. package/dist/types.d.ts +26 -240
  41. package/dist/types.d.ts.map +1 -0
  42. package/dist/ws.d.ts +14 -17
  43. package/dist/ws.d.ts.map +1 -0
  44. package/dist/wss.d.ts +16 -16
  45. package/dist/wss.d.ts.map +1 -0
  46. package/package.json +3 -2
  47. package/src/build.ts +337 -0
  48. package/src/chokidar.ts +401 -0
  49. package/src/cli.ts +638 -0
  50. package/src/config.ts +205 -0
  51. package/src/dom.ts +817 -0
  52. package/src/el.ts +164 -0
  53. package/src/fs.ts +727 -0
  54. package/src/hmr.ts +137 -0
  55. package/src/http.ts +775 -0
  56. package/src/https.ts +411 -0
  57. package/src/index.ts +14 -0
  58. package/src/mime-types.ts +222 -0
  59. package/src/path.ts +493 -0
  60. package/src/router.ts +237 -0
  61. package/src/runtime.ts +97 -0
  62. package/src/server.ts +1290 -0
  63. package/src/state.ts +468 -0
  64. package/src/style.ts +524 -0
  65. package/{dist/types-Du6kfwTm.d.ts → src/types.ts} +58 -141
  66. package/src/ws.ts +506 -0
  67. package/src/wss.ts +241 -0
  68. package/dist/build.d.mts +0 -20
  69. package/dist/chokidar.d.mts +0 -134
  70. package/dist/dom.d.mts +0 -87
  71. package/dist/el.d.mts +0 -207
  72. package/dist/fs.d.mts +0 -255
  73. package/dist/hmr.d.mts +0 -38
  74. package/dist/http.d.mts +0 -163
  75. package/dist/https.d.mts +0 -108
  76. package/dist/index.d.mts +0 -629
  77. package/dist/mime-types.d.mts +0 -48
  78. package/dist/path.d.mts +0 -163
  79. package/dist/router.d.mts +0 -47
  80. package/dist/runtime.d.mts +0 -97
  81. package/dist/server.d.mts +0 -7
  82. package/dist/state.d.mts +0 -111
  83. package/dist/style.d.mts +0 -159
  84. package/dist/types-C0nGi6MX.d.mts +0 -346
  85. package/dist/types.d.mts +0 -452
  86. package/dist/ws.d.mts +0 -195
  87. package/dist/wss.d.mts +0 -108
package/dist/path.d.mts DELETED
@@ -1,163 +0,0 @@
1
- /**
2
- * Path module with unified API across runtimes
3
- * Pure implementation without external dependencies
4
- * Compatible with Node.js 'path' module API
5
- * Works on Node.js, Bun, and Deno
6
- */
7
- /**
8
- * Path separator
9
- */
10
- declare const sep: string;
11
- /**
12
- * Path delimiter
13
- */
14
- declare const delimiter: string;
15
- /**
16
- * POSIX path operations
17
- */
18
- declare const posix: {
19
- sep: string;
20
- delimiter: string;
21
- normalize: (path: string) => string;
22
- join: (...paths: string[]) => string;
23
- resolve: (...paths: string[]) => string;
24
- isAbsolute: (path: string) => boolean;
25
- relative: (from: string, to: string) => string;
26
- dirname: (path: string) => string;
27
- basename: (path: string, ext?: string) => string;
28
- extname: (path: string) => string;
29
- parse: (path: string) => ParsedPath;
30
- format: (pathObject: FormatInputPathObject) => string;
31
- };
32
- /**
33
- * Windows path operations
34
- */
35
- declare const win32: {
36
- sep: string;
37
- delimiter: string;
38
- normalize: (path: string) => string;
39
- join: (...paths: string[]) => string;
40
- resolve: (...paths: string[]) => string;
41
- isAbsolute: (path: string) => boolean;
42
- relative: (from: string, to: string) => string;
43
- dirname: (path: string) => string;
44
- basename: (path: string, ext?: string) => string;
45
- extname: (path: string) => string;
46
- parse: (path: string) => ParsedPath;
47
- format: (pathObject: FormatInputPathObject) => string;
48
- };
49
- /**
50
- * Path object interface
51
- */
52
- interface ParsedPath {
53
- root: string;
54
- dir: string;
55
- base: string;
56
- ext: string;
57
- name: string;
58
- }
59
- interface FormatInputPathObject {
60
- root?: string;
61
- dir?: string;
62
- base?: string;
63
- ext?: string;
64
- name?: string;
65
- }
66
- /**
67
- * Normalize a path (platform-specific)
68
- */
69
- declare function normalize(path: string): string;
70
- /**
71
- * Join paths (platform-specific)
72
- */
73
- declare function join(...paths: string[]): string;
74
- /**
75
- * Resolve paths to absolute path (platform-specific)
76
- */
77
- declare function resolve(...paths: string[]): string;
78
- /**
79
- * Check if path is absolute (platform-specific)
80
- */
81
- declare function isAbsolute(path: string): boolean;
82
- /**
83
- * Get relative path (platform-specific)
84
- */
85
- declare function relative(from: string, to: string): string;
86
- /**
87
- * Get directory name (platform-specific)
88
- */
89
- declare function dirname(path: string): string;
90
- /**
91
- * Get base name (platform-specific)
92
- */
93
- declare function basename(path: string, ext?: string): string;
94
- /**
95
- * Get extension name
96
- */
97
- declare function extname(path: string): string;
98
- /**
99
- * Parse path into components (platform-specific)
100
- */
101
- declare function parse(path: string): ParsedPath;
102
- /**
103
- * Format path from components (platform-specific)
104
- */
105
- declare function format(pathObject: FormatInputPathObject): string;
106
- /**
107
- * Convert to namespaced path (Windows only)
108
- */
109
- declare function toNamespacedPath(path: string): string;
110
- /**
111
- * Get current runtime
112
- */
113
- declare function getRuntime(): 'node' | 'bun' | 'deno';
114
-
115
- /**
116
- * Default export
117
- */
118
- declare const _default: {
119
- sep: string;
120
- delimiter: string;
121
- normalize: typeof normalize;
122
- join: typeof join;
123
- resolve: typeof resolve;
124
- isAbsolute: typeof isAbsolute;
125
- relative: typeof relative;
126
- dirname: typeof dirname;
127
- basename: typeof basename;
128
- extname: typeof extname;
129
- parse: typeof parse;
130
- format: typeof format;
131
- toNamespacedPath: typeof toNamespacedPath;
132
- posix: {
133
- sep: string;
134
- delimiter: string;
135
- normalize: (path: string) => string;
136
- join: (...paths: string[]) => string;
137
- resolve: (...paths: string[]) => string;
138
- isAbsolute: (path: string) => boolean;
139
- relative: (from: string, to: string) => string;
140
- dirname: (path: string) => string;
141
- basename: (path: string, ext?: string) => string;
142
- extname: (path: string) => string;
143
- parse: (path: string) => ParsedPath;
144
- format: (pathObject: FormatInputPathObject) => string;
145
- };
146
- win32: {
147
- sep: string;
148
- delimiter: string;
149
- normalize: (path: string) => string;
150
- join: (...paths: string[]) => string;
151
- resolve: (...paths: string[]) => string;
152
- isAbsolute: (path: string) => boolean;
153
- relative: (from: string, to: string) => string;
154
- dirname: (path: string) => string;
155
- basename: (path: string, ext?: string) => string;
156
- extname: (path: string) => string;
157
- parse: (path: string) => ParsedPath;
158
- format: (pathObject: FormatInputPathObject) => string;
159
- };
160
- getRuntime: typeof getRuntime;
161
- };
162
-
163
- export { type FormatInputPathObject, type ParsedPath, basename, _default as default, delimiter, dirname, extname, format, getRuntime, isAbsolute, join, normalize, parse, posix, relative, resolve, sep, toNamespacedPath, win32 };
package/dist/router.d.mts DELETED
@@ -1,47 +0,0 @@
1
- import { VNode, Child, State, Props } from './types.mjs';
2
- import 'node:events';
3
- import 'events';
4
- import 'http';
5
- import 'ws';
6
-
7
- /**
8
- * Elit - Router - Client-side routing
9
- */
10
-
11
- interface Route {
12
- path: string;
13
- component: (params: RouteParams) => VNode | Child;
14
- beforeEnter?: (to: RouteLocation, from: RouteLocation | null) => boolean | string | void;
15
- }
16
- interface RouteParams {
17
- [key: string]: string;
18
- }
19
- interface RouteLocation {
20
- path: string;
21
- params: RouteParams;
22
- query: Record<string, string>;
23
- hash: string;
24
- }
25
- interface RouterOptions {
26
- mode?: 'history' | 'hash';
27
- base?: string;
28
- routes: Route[];
29
- notFound?: (params: RouteParams) => VNode | Child;
30
- }
31
- interface Router {
32
- currentRoute: State<RouteLocation>;
33
- push: (path: string) => void;
34
- replace: (path: string) => void;
35
- back: () => void;
36
- forward: () => void;
37
- go: (delta: number) => void;
38
- beforeEach: (guard: (to: RouteLocation, from: RouteLocation | null) => boolean | string | void) => void;
39
- destroy: () => void;
40
- }
41
- declare function createRouter(options: RouterOptions): Router;
42
- declare function createRouterView(router: Router, options: RouterOptions): () => VNode;
43
- declare const routerLink: (router: Router, props: Props & {
44
- to: string;
45
- }, ...children: Child[]) => VNode;
46
-
47
- export { type Route, type RouteLocation, type RouteParams, type Router, type RouterOptions, createRouter, createRouterView, routerLink };
@@ -1,97 +0,0 @@
1
- /**
2
- * Runtime detection and global type declarations
3
- * Shared across all modules for consistency
4
- */
5
- /**
6
- * Runtime detection (cached at module load)
7
- */
8
- declare const runtime: "node" | "bun" | "deno";
9
- declare const isNode: boolean;
10
- declare const isBun: boolean;
11
- declare const isDeno: boolean;
12
- declare global {
13
- const Bun: {
14
- build(options: {
15
- entrypoints: string[];
16
- outdir?: string;
17
- target?: string;
18
- format?: string;
19
- minify?: boolean;
20
- sourcemap?: string;
21
- external?: string[];
22
- naming?: string;
23
- plugins?: any[];
24
- define?: Record<string, string>;
25
- }): Promise<{
26
- success: boolean;
27
- outputs: Array<{
28
- path: string;
29
- size: number;
30
- }>;
31
- logs: any[];
32
- }>;
33
- Transpiler: new (options?: {
34
- loader?: string;
35
- target?: string;
36
- minify?: boolean;
37
- }) => {
38
- transform(code: string, loader?: string): Promise<string>;
39
- transformSync(code: string, loader?: string): string;
40
- };
41
- file(path: string): {
42
- size: number;
43
- arrayBuffer(): ArrayBuffer | Promise<ArrayBuffer>;
44
- exists(): Promise<boolean>;
45
- };
46
- write(path: string, data: string | Buffer | Uint8Array): Promise<void>;
47
- } | undefined;
48
- const Deno: {
49
- emit(rootSpecifier: string | URL, options?: {
50
- bundle?: 'module' | 'classic';
51
- check?: boolean;
52
- compilerOptions?: any;
53
- importMap?: string;
54
- importMapPath?: string;
55
- sources?: Record<string, string>;
56
- }): Promise<{
57
- files: Record<string, string>;
58
- diagnostics: any[];
59
- }>;
60
- writeTextFile(path: string, data: string): Promise<void>;
61
- readFile(path: string): Promise<Uint8Array>;
62
- readFileSync(path: string): Uint8Array;
63
- writeFile(path: string, data: Uint8Array): Promise<void>;
64
- writeFileSync(path: string, data: Uint8Array): void;
65
- stat(path: string): Promise<any>;
66
- statSync(path: string): any;
67
- mkdir(path: string, options?: {
68
- recursive?: boolean;
69
- }): Promise<void>;
70
- mkdirSync(path: string, options?: {
71
- recursive?: boolean;
72
- }): void;
73
- readDir(path: string): AsyncIterable<any>;
74
- readDirSync(path: string): Iterable<any>;
75
- remove(path: string, options?: {
76
- recursive?: boolean;
77
- }): Promise<void>;
78
- removeSync(path: string, options?: {
79
- recursive?: boolean;
80
- }): void;
81
- rename(oldPath: string, newPath: string): Promise<void>;
82
- renameSync(oldPath: string, newPath: string): void;
83
- copyFile(src: string, dest: string): Promise<void>;
84
- copyFileSync(src: string, dest: string): void;
85
- realPath(path: string): Promise<string>;
86
- realPathSync(path: string): string;
87
- watchFs(paths: string | string[]): AsyncIterable<{
88
- kind: string;
89
- paths: string[];
90
- }>;
91
- build: {
92
- os: string;
93
- };
94
- } | undefined;
95
- }
96
-
97
- export { isBun, isDeno, isNode, runtime };
package/dist/server.d.mts DELETED
@@ -1,7 +0,0 @@
1
- import './http.mjs';
2
- import './ws.mjs';
3
- export { l as HttpMethod, M as Middleware, m as ServerRouteContext, n as ServerRouteHandler, o as ServerRouter, K as SharedState, I as SharedStateOptions, G as StateChangeHandler, L as StateManager, x as bodyLimit, y as cacheControl, z as compress, r as cors, N as createDevServer, F as createProxyHandler, v as errorHandler, q as html, p as json, u as logger, w as rateLimit, A as security, s as status, t as text } from './types-C0nGi6MX.mjs';
4
- import 'node:events';
5
- import 'events';
6
- import 'http';
7
- import 'ws';
package/dist/state.d.mts DELETED
@@ -1,111 +0,0 @@
1
- import { StateOptions, State, VNode, VirtualListController, Child, Props } from './types.mjs';
2
- import 'node:events';
3
- import 'events';
4
- import 'http';
5
- import 'ws';
6
-
7
- /**
8
- * Elit - State Management
9
- */
10
-
11
- declare const createState: <T>(initial: T, options?: StateOptions) => State<T>;
12
- declare const computed: <T extends any[], R>(states: { [K in keyof T]: State<T[K]>; }, fn: (...values: T) => R) => State<R>;
13
- declare const effect: (fn: () => void) => void;
14
- declare const batchRender: (container: string | HTMLElement, vNodes: VNode[]) => HTMLElement;
15
- declare const renderChunked: (container: string | HTMLElement, vNodes: VNode[], chunkSize?: number, onProgress?: (current: number, total: number) => void) => HTMLElement;
16
- declare const createVirtualList: <T>(container: HTMLElement, items: T[], renderItem: (item: T, index: number) => VNode, itemHeight?: number, bufferSize?: number) => VirtualListController;
17
- declare const lazy: <T extends any[], R>(loadFn: () => Promise<(...args: T) => R>) => (...args: T) => Promise<VNode | R>;
18
- declare const cleanupUnused: (root: HTMLElement) => number;
19
- declare const throttle: <T extends any[]>(fn: (...args: T) => void, delay: number) => (...args: T) => void;
20
- declare const debounce: <T extends any[]>(fn: (...args: T) => void, delay: number) => (...args: T) => void;
21
- type StateChangeCallback<T = any> = (value: T, oldValue: T) => void;
22
- /**
23
- * Shared State - syncs with elit-server
24
- */
25
- declare class SharedState<T = any> {
26
- readonly key: string;
27
- private wsUrl?;
28
- private localState;
29
- private ws;
30
- private pendingUpdates;
31
- private previousValue;
32
- constructor(key: string, defaultValue: T, wsUrl?: string | undefined);
33
- /**
34
- * Get current value
35
- */
36
- get value(): T;
37
- /**
38
- * Set new value and sync to server
39
- */
40
- set value(newValue: T);
41
- /**
42
- * Get the underlying Elit State (for reactive binding)
43
- */
44
- get state(): State<T>;
45
- /**
46
- * Subscribe to changes (returns Elit State for reactive)
47
- */
48
- onChange(callback: StateChangeCallback<T>): () => void;
49
- /**
50
- * Update value using a function
51
- */
52
- update(updater: (current: T) => T): void;
53
- /**
54
- * Connect to WebSocket
55
- */
56
- private connect;
57
- /**
58
- * Subscribe to server state
59
- */
60
- private subscribe;
61
- /**
62
- * Handle message from server
63
- */
64
- private handleMessage;
65
- /**
66
- * Send value to server
67
- */
68
- private sendToServer;
69
- /**
70
- * Disconnect
71
- */
72
- disconnect(): void;
73
- /**
74
- * Destroy state and cleanup
75
- */
76
- destroy(): void;
77
- }
78
- /**
79
- * Create a shared state that syncs with elit-server
80
- */
81
- declare function createSharedState<T>(key: string, defaultValue: T, wsUrl?: string): SharedState<T>;
82
- /**
83
- * Shared State Manager for managing multiple shared states
84
- */
85
- declare class SharedStateManager {
86
- private states;
87
- /**
88
- * Create or get a shared state
89
- */
90
- create<T>(key: string, defaultValue: T, wsUrl?: string): SharedState<T>;
91
- /**
92
- * Get existing state
93
- */
94
- get<T>(key: string): SharedState<T> | undefined;
95
- /**
96
- * Delete a state
97
- */
98
- delete(key: string): boolean;
99
- /**
100
- * Clear all states
101
- */
102
- clear(): void;
103
- }
104
- declare const sharedStateManager: SharedStateManager;
105
- declare const reactive: <T>(state: State<T>, renderFn: (value: T) => VNode | Child) => VNode;
106
- declare const reactiveAs: <T>(tagName: string, state: State<T>, renderFn: (value: T) => VNode | Child, props?: Props) => VNode;
107
- declare const text: (state: State<any> | any) => VNode | string;
108
- declare const bindValue: <T extends string | number>(state: State<T>) => Props;
109
- declare const bindChecked: (state: State<boolean>) => Props;
110
-
111
- export { SharedState, batchRender, bindChecked, bindValue, cleanupUnused, computed, createSharedState, createState, createVirtualList, debounce, effect, lazy, reactive, reactiveAs, renderChunked, sharedStateManager, text, throttle };
package/dist/style.d.mts DELETED
@@ -1,159 +0,0 @@
1
- /**
2
- * Elit - CreateStyle CSS Generation System
3
- */
4
- interface CSSVariable {
5
- name: string;
6
- value: string;
7
- toString(): string;
8
- }
9
- interface CSSRule {
10
- selector: string;
11
- styles: Record<string, string | number>;
12
- nested?: CSSRule[];
13
- type: 'tag' | 'class' | 'id' | 'pseudo-class' | 'pseudo-element' | 'name' | 'custom' | 'media' | 'attribute';
14
- }
15
- interface MediaRule {
16
- type: string;
17
- condition: string;
18
- rules: CSSRule[];
19
- }
20
- interface KeyframeStep {
21
- step: string | number;
22
- styles: Record<string, string | number>;
23
- }
24
- interface Keyframes {
25
- name: string;
26
- steps: KeyframeStep[];
27
- }
28
- interface FontFace {
29
- fontFamily: string;
30
- src: string;
31
- fontWeight?: string | number;
32
- fontStyle?: string;
33
- fontDisplay?: string;
34
- unicodeRange?: string;
35
- }
36
- interface ContainerRule {
37
- name?: string;
38
- condition: string;
39
- rules: CSSRule[];
40
- }
41
- interface SupportsRule {
42
- condition: string;
43
- rules: CSSRule[];
44
- }
45
- interface LayerRule {
46
- name: string;
47
- rules: CSSRule[];
48
- }
49
- declare class CreateStyle {
50
- private variables;
51
- private rules;
52
- private mediaRules;
53
- private keyframes;
54
- private fontFaces;
55
- private imports;
56
- private containerRules;
57
- private supportsRules;
58
- private layerRules;
59
- private _layerOrder;
60
- addVar(name: string, value: string): CSSVariable;
61
- var(variable: CSSVariable | string, fallback?: string): string;
62
- addTag(tag: string, styles: Record<string, string | number>): CSSRule;
63
- addClass(name: string, styles: Record<string, string | number>): CSSRule;
64
- addId(name: string, styles: Record<string, string | number>): CSSRule;
65
- addPseudoClass(pseudo: string, styles: Record<string, string | number>, baseSelector?: string): CSSRule;
66
- addPseudoElement(pseudo: string, styles: Record<string, string | number>, baseSelector?: string): CSSRule;
67
- addAttribute(attr: string, styles: Record<string, string | number>, baseSelector?: string): CSSRule;
68
- attrEquals(attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string): CSSRule;
69
- attrContainsWord(attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string): CSSRule;
70
- attrStartsWith(attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string): CSSRule;
71
- attrEndsWith(attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string): CSSRule;
72
- attrContains(attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string): CSSRule;
73
- descendant(ancestor: string, descendant: string, styles: Record<string, string | number>): CSSRule;
74
- child(parent: string, childSel: string, styles: Record<string, string | number>): CSSRule;
75
- adjacentSibling(element: string, sibling: string, styles: Record<string, string | number>): CSSRule;
76
- generalSibling(element: string, sibling: string, styles: Record<string, string | number>): CSSRule;
77
- multiple(selectors: string[], styles: Record<string, string | number>): CSSRule;
78
- addName(name: string, styles: Record<string, string | number>): CSSRule;
79
- nesting(parentRule: CSSRule, ...childRules: CSSRule[]): CSSRule;
80
- keyframe(name: string, steps: Record<string | number, Record<string, string | number>>): Keyframes;
81
- keyframeFromTo(name: string, from: Record<string, string | number>, to: Record<string, string | number>): Keyframes;
82
- fontFace(options: FontFace): FontFace;
83
- import(url: string, mediaQuery?: string): string;
84
- media(type: string, condition: string, rules: Record<string, Record<string, string | number>>): MediaRule;
85
- mediaScreen(condition: string, rules: Record<string, Record<string, string | number>>): MediaRule;
86
- mediaPrint(rules: Record<string, Record<string, string | number>>): MediaRule;
87
- mediaMinWidth(minWidth: string, rules: Record<string, Record<string, string | number>>): MediaRule;
88
- mediaMaxWidth(maxWidth: string, rules: Record<string, Record<string, string | number>>): MediaRule;
89
- mediaDark(rules: Record<string, Record<string, string | number>>): MediaRule;
90
- mediaLight(rules: Record<string, Record<string, string | number>>): MediaRule;
91
- mediaReducedMotion(rules: Record<string, Record<string, string | number>>): MediaRule;
92
- container(condition: string, rules: Record<string, Record<string, string | number>>, name?: string): ContainerRule;
93
- addContainer(name: string, styles: Record<string, string | number>): CSSRule;
94
- supports(condition: string, rules: Record<string, Record<string, string | number>>): SupportsRule;
95
- layerOrder(...layers: string[]): void;
96
- layer(name: string, rules: Record<string, Record<string, string | number>>): LayerRule;
97
- add(rules: Record<string, Record<string, string | number>>): CSSRule[];
98
- important(value: string | number): string;
99
- private toKebabCase;
100
- private createAndAddRule;
101
- private rulesToCSSRules;
102
- private renderRulesWithIndent;
103
- private stylesToString;
104
- private renderRule;
105
- private renderMediaRule;
106
- private renderKeyframes;
107
- private renderFontFace;
108
- private renderContainerRule;
109
- private renderSupportsRule;
110
- private renderLayerRule;
111
- render(...additionalRules: (CSSRule | CSSRule[] | MediaRule | Keyframes | ContainerRule | SupportsRule | LayerRule | undefined | null)[]): string;
112
- inject(styleId?: string): HTMLStyleElement;
113
- clear(): void;
114
- }
115
- declare const styles: CreateStyle;
116
- declare const addVar: (name: string, value: string) => CSSVariable;
117
- declare const getVar: (variable: CSSVariable | string, fallback?: string) => string;
118
- declare const addTag: (tag: string, styles: Record<string, string | number>) => CSSRule;
119
- declare const addClass: (name: string, styles: Record<string, string | number>) => CSSRule;
120
- declare const addId: (name: string, styles: Record<string, string | number>) => CSSRule;
121
- declare const addPseudoClass: (pseudo: string, styles: Record<string, string | number>, baseSelector?: string) => CSSRule;
122
- declare const addPseudoElement: (pseudo: string, styles: Record<string, string | number>, baseSelector?: string) => CSSRule;
123
- declare const addAttribute: (attr: string, styles: Record<string, string | number>, baseSelector?: string) => CSSRule;
124
- declare const attrEquals: (attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string) => CSSRule;
125
- declare const attrContainsWord: (attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string) => CSSRule;
126
- declare const attrStartsWith: (attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string) => CSSRule;
127
- declare const attrEndsWith: (attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string) => CSSRule;
128
- declare const attrContains: (attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string) => CSSRule;
129
- declare const descendant: (ancestor: string, descendant: string, styles: Record<string, string | number>) => CSSRule;
130
- declare const childStyle: (parent: string, childSel: string, styles: Record<string, string | number>) => CSSRule;
131
- declare const adjacentSibling: (element: string, sibling: string, styles: Record<string, string | number>) => CSSRule;
132
- declare const generalSibling: (element: string, sibling: string, styles: Record<string, string | number>) => CSSRule;
133
- declare const multipleStyle: (selectors: string[], styles: Record<string, string | number>) => CSSRule;
134
- declare const addName: (name: string, styles: Record<string, string | number>) => CSSRule;
135
- declare const nesting: (parentRule: CSSRule, ...childRules: CSSRule[]) => CSSRule;
136
- declare const keyframe: (name: string, steps: Record<string | number, Record<string, string | number>>) => Keyframes;
137
- declare const keyframeFromTo: (name: string, from: Record<string, string | number>, to: Record<string, string | number>) => Keyframes;
138
- declare const fontFace: (options: FontFace) => FontFace;
139
- declare const importStyle: (url: string, mediaQuery?: string) => string;
140
- declare const mediaStyle: (type: string, condition: string, rules: Record<string, Record<string, string | number>>) => MediaRule;
141
- declare const mediaScreen: (condition: string, rules: Record<string, Record<string, string | number>>) => MediaRule;
142
- declare const mediaPrint: (rules: Record<string, Record<string, string | number>>) => MediaRule;
143
- declare const mediaMinWidth: (minWidth: string, rules: Record<string, Record<string, string | number>>) => MediaRule;
144
- declare const mediaMaxWidth: (maxWidth: string, rules: Record<string, Record<string, string | number>>) => MediaRule;
145
- declare const mediaDark: (rules: Record<string, Record<string, string | number>>) => MediaRule;
146
- declare const mediaLight: (rules: Record<string, Record<string, string | number>>) => MediaRule;
147
- declare const mediaReducedMotion: (rules: Record<string, Record<string, string | number>>) => MediaRule;
148
- declare const container: (condition: string, rules: Record<string, Record<string, string | number>>, name?: string) => ContainerRule;
149
- declare const addContainer: (name: string, styles: Record<string, string | number>) => CSSRule;
150
- declare const supportsStyle: (condition: string, rules: Record<string, Record<string, string | number>>) => SupportsRule;
151
- declare const layerOrder: (...layers: string[]) => void;
152
- declare const layer: (name: string, rules: Record<string, Record<string, string | number>>) => LayerRule;
153
- declare const addStyle: (rules: Record<string, Record<string, string | number>>) => CSSRule[];
154
- declare const important: (value: string | number) => string;
155
- declare const renderStyle: (...additionalRules: (CSSRule | CSSRule[] | MediaRule | Keyframes | ContainerRule | SupportsRule | LayerRule | undefined | null)[]) => string;
156
- declare const injectStyle: (styleId?: string) => HTMLStyleElement;
157
- declare const clearStyle: () => void;
158
-
159
- export { type CSSRule, type CSSVariable, type ContainerRule, CreateStyle, type FontFace, type KeyframeStep, type Keyframes, type LayerRule, type MediaRule, type SupportsRule, addAttribute, addClass, addContainer, addId, addName, addPseudoClass, addPseudoElement, addStyle, addTag, addVar, adjacentSibling, attrContains, attrContainsWord, attrEndsWith, attrEquals, attrStartsWith, childStyle, clearStyle, container, styles as default, descendant, fontFace, generalSibling, getVar, importStyle, important, injectStyle, keyframe, keyframeFromTo, layer, layerOrder, mediaDark, mediaLight, mediaMaxWidth, mediaMinWidth, mediaPrint, mediaReducedMotion, mediaScreen, mediaStyle, multipleStyle, nesting, renderStyle, styles, supportsStyle };