ngx-theme-stack 1.0.1 → 2.1.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 +117 -33
- package/fesm2022/ngx-theme-stack.mjs +228 -50
- package/fesm2022/ngx-theme-stack.mjs.map +1 -1
- package/package.json +1 -1
- package/schematics/collection.json +6 -1
- package/schematics/ng-add/anti-flash.d.ts +26 -0
- package/schematics/ng-add/anti-flash.js +135 -0
- package/schematics/ng-add/anti-flash.js.map +1 -0
- package/schematics/ng-add/app-config.d.ts +3 -3
- package/schematics/ng-add/app-config.js +9 -7
- package/schematics/ng-add/app-config.js.map +1 -1
- package/schematics/ng-add/constants.d.ts +5 -5
- package/schematics/ng-add/constants.js +5 -5
- package/schematics/ng-add/constants.js.map +1 -1
- package/schematics/ng-add/index.js +115 -15
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/schema.d.ts +2 -0
- package/schematics/ng-add/schema.json +7 -2
- package/schematics/ng-add/utils.d.ts +1 -6
- package/schematics/ng-add/utils.js +10 -27
- package/schematics/ng-add/utils.js.map +1 -1
- package/schematics/sync/index.d.ts +3 -0
- package/schematics/sync/index.js +314 -0
- package/schematics/sync/index.js.map +1 -0
- package/schematics/sync/schema.d.ts +6 -0
- package/schematics/sync/schema.js +3 -0
- package/schematics/sync/schema.js.map +1 -0
- package/schematics/sync/schema.json +21 -0
- package/types/ngx-theme-stack.d.ts +217 -43
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/ngx-theme-stack/schematics/sync/index.ts"],"names":[],"mappings":";;AA6WA,oBAiCC;AA7YD,mDAA+C;AAG/C,iFAAiF;AAEjF;;;;;;;;;;;GAWG;AACH,MAAM,eAAe,GAAG,oCAAoC,CAAC;AAE7D,8DAA8D;AAC9D,MAAM,cAAc,GAAG,6BAA6B,CAAC;AAErD,oEAAoE;AACpE,MAAM,aAAa,GAAG,mCAAmC,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AO,CAAC,IAAI,mCAAI,EAAE,MAAM,CAAC;QAC7E,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QACxD,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,IAAI,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,CAA4B,CAAC;QAEtH,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,sCAAsC,WAAW,eAAe,QAAQ,GAAG,CAAC,CAAC;QACjG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAExB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC3D,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;QAEtD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;QAC/F,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;YAC5B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC;QACnG,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../projects/ngx-theme-stack/schematics/sync/schema.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "NgxThemeStackSync",
|
|
4
|
+
"title": "ngx-theme-stack sync",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"project": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The name of the Angular project to sync.",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "projectName"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"strategy": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "The strategy to use (critters or blocking). Auto-detected if not provided.",
|
|
17
|
+
"enum": ["blocking", "critters"]
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"required": ["project"]
|
|
21
|
+
}
|
|
@@ -2,17 +2,78 @@ import * as _angular_core from '@angular/core';
|
|
|
2
2
|
import { InjectionToken } from '@angular/core';
|
|
3
3
|
import * as ngx_theme_stack from 'ngx-theme-stack';
|
|
4
4
|
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Runtime list of built-in themes.
|
|
7
|
+
*
|
|
8
|
+
* Lives here (and not in config/index.ts) because it defines a type:
|
|
9
|
+
* config/index.ts already imports from types.ts, so placing DEFAULT_THEMES
|
|
10
|
+
* here avoids any circular dependency.
|
|
11
|
+
*
|
|
12
|
+
* ⚠ KEEP IN SYNC with the duplicate in:
|
|
13
|
+
* projects/ngx-theme-stack/schematics/ng-add/constants.ts → DEFAULT_THEMES
|
|
14
|
+
*
|
|
15
|
+
* Schematics compile to CommonJS and cannot import from this ESM file,
|
|
16
|
+
* so the values are intentionally duplicated. Change both at the same time.
|
|
17
|
+
*/
|
|
6
18
|
declare const DEFAULT_THEMES: readonly ["system", "light", "dark"];
|
|
7
|
-
/**
|
|
8
|
-
type
|
|
9
|
-
|
|
19
|
+
/** Literal union of built-in themes: `'system' | 'light' | 'dark'`. */
|
|
20
|
+
type DefaultNgTheme = (typeof DEFAULT_THEMES)[number];
|
|
21
|
+
/**
|
|
22
|
+
* Theme type.
|
|
23
|
+
*
|
|
24
|
+
* - **Without** `T`: open union — accepts any `string` with IDE autocomplete
|
|
25
|
+
* hints for the built-in themes (`'system' | 'light' | 'dark'`).
|
|
26
|
+
* - **With** `T`: closed union — exactly `DefaultNgTheme | T`, enabling
|
|
27
|
+
* full type-safety for custom theme sets.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* NgTheme // 'system' | 'light' | 'dark' | (string & {})
|
|
31
|
+
* NgTheme<'sepia'> // 'system' | 'light' | 'dark' | 'sepia'
|
|
32
|
+
*/
|
|
33
|
+
type NgTheme<T extends string = string & {}> = DefaultNgTheme | T;
|
|
34
|
+
/**
|
|
35
|
+
* Resolved theme — always `'light'` or `'dark'`, never `'system'`.
|
|
36
|
+
* Represents the value that comes from `matchMedia`, not user selection.
|
|
37
|
+
*/
|
|
38
|
+
type NgSystemTheme = Exclude<DefaultNgTheme, 'system'>;
|
|
39
|
+
/**
|
|
40
|
+
* Theme application mode.
|
|
41
|
+
* - `'attribute'`: sets `data-theme` attribute on `<html>`
|
|
42
|
+
* - `'class'`: adds theme class to `<html>`
|
|
43
|
+
* - `'both'`: uses both attribute and class
|
|
44
|
+
*/
|
|
10
45
|
type NgMode = 'attribute' | 'class' | 'both';
|
|
11
|
-
|
|
12
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Theme application strategy.
|
|
48
|
+
* - `'blocking'`: theme CSS is loaded synchronously before rendering
|
|
49
|
+
* - `'critters'`: theme CSS is inlined using Critters for SSR/SSG
|
|
50
|
+
*/
|
|
51
|
+
type NgStrategy = 'blocking' | 'critters';
|
|
52
|
+
/**
|
|
53
|
+
* Library configuration.
|
|
54
|
+
*
|
|
55
|
+
* @typeParam T - Custom theme literals. Defaults to open `string`, preserving
|
|
56
|
+
* backwards compatibility. Pass specific literals (e.g. `'sepia' | 'ocean'`)
|
|
57
|
+
* via {@link provideThemeStack} to get a closed, type-safe theme union.
|
|
58
|
+
*/
|
|
59
|
+
interface NgConfig<T extends string = string & {}> {
|
|
60
|
+
/** The theme to use on first visit or when no preference is saved. Default: 'system'. */
|
|
61
|
+
defaultTheme: NgTheme<T>;
|
|
62
|
+
/** Key used to persist theme preference in localStorage. Default: 'ngx-theme-stack-theme'. */
|
|
13
63
|
storageKey: string;
|
|
64
|
+
/**
|
|
65
|
+
* How the theme should be applied to the document (via class, attribute or both).
|
|
66
|
+
* Default: 'class'.
|
|
67
|
+
*/
|
|
14
68
|
mode: NgMode;
|
|
15
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Performance strategy for anti-flash.
|
|
71
|
+
* Use 'critters' for SSG/SSR builds with inlined CSS, 'blocking' for standard CSS files.
|
|
72
|
+
* Default: 'critters'.
|
|
73
|
+
*/
|
|
74
|
+
strategy: NgStrategy;
|
|
75
|
+
/** List of supported theme identifiers. Default: ['light', 'dark', 'system']. */
|
|
76
|
+
themes: NgTheme<T>[];
|
|
16
77
|
}
|
|
17
78
|
|
|
18
79
|
/**
|
|
@@ -23,22 +84,41 @@ interface NgConfig {
|
|
|
23
84
|
*/
|
|
24
85
|
declare class CoreThemeService {
|
|
25
86
|
#private;
|
|
26
|
-
/** List of available themes for Select/Cycle services. Defaults to ['
|
|
27
|
-
readonly availableThemes:
|
|
87
|
+
/** List of available themes for Select/Cycle services. Defaults to ['system', 'light', 'dark']. */
|
|
88
|
+
readonly availableThemes: string[];
|
|
28
89
|
/** The theme explicitly selected by the user. May be `'system'`. */
|
|
29
90
|
readonly selectedTheme: _angular_core.Signal<NgTheme>;
|
|
30
91
|
/** Resolved theme applied to the DOM. Always `'dark'` or `'light'` (or custom) — never `'system'`. */
|
|
31
|
-
readonly
|
|
92
|
+
readonly resolvedTheme: _angular_core.Signal<(string & {}) | NgSystemTheme>;
|
|
32
93
|
/** Whether the currently applied theme is dark. */
|
|
33
94
|
readonly isDark: _angular_core.Signal<boolean>;
|
|
34
95
|
/** Whether the currently applied theme is light. */
|
|
35
96
|
readonly isLight: _angular_core.Signal<boolean>;
|
|
97
|
+
/** Whether the currently applied theme is system. */
|
|
98
|
+
readonly isSystem: _angular_core.Signal<boolean>;
|
|
99
|
+
/**
|
|
100
|
+
* Whether the service has completed client-side initialization.
|
|
101
|
+
*
|
|
102
|
+
* `false` during SSR and on the very first render pass before the initial theme
|
|
103
|
+
* is resolved from `localStorage`. Becomes `true` immediately after the
|
|
104
|
+
* first browser render pass.
|
|
105
|
+
*
|
|
106
|
+
* **Important:** Guard template elements that display `selectedTheme()` or
|
|
107
|
+
* `resolvedTheme()` behind this signal to prevent hydration-mismatch flashes
|
|
108
|
+
* (e.g. if the server renders the default 'system' but the user has 'dark' stored).
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```html
|
|
112
|
+
* {{ theme.isHydrated() ? theme.selectedTheme() : '...' }}
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
readonly isHydrated: _angular_core.WritableSignal<boolean>;
|
|
36
116
|
constructor();
|
|
37
117
|
/**
|
|
38
118
|
* Changes the active theme.
|
|
39
119
|
*
|
|
40
120
|
* Persists the choice explicitly so that switching e.g. from `'system'` to
|
|
41
|
-
* `'light'` is saved even when the resolved
|
|
121
|
+
* `'light'` is saved even when the resolved theme did not change
|
|
42
122
|
* (system preference was already `'light'`).
|
|
43
123
|
*
|
|
44
124
|
* @param theme - The theme to apply: `'dark'`, `'light'`, `'system'`, or a custom theme name.
|
|
@@ -53,6 +133,7 @@ declare class CoreThemeService {
|
|
|
53
133
|
private applyThemeAttribute;
|
|
54
134
|
private applyThemeClasses;
|
|
55
135
|
private applyColorSchemeHint;
|
|
136
|
+
private captureAntiFlashClass;
|
|
56
137
|
private readStoredTheme;
|
|
57
138
|
private saveTheme;
|
|
58
139
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CoreThemeService, never>;
|
|
@@ -62,36 +143,85 @@ declare class CoreThemeService {
|
|
|
62
143
|
/**
|
|
63
144
|
* ⚠ ATTENTION: SHARED CONFIGURATION VALUES
|
|
64
145
|
*
|
|
65
|
-
* These
|
|
66
|
-
* projects/ngx-theme-stack/schematics/ng-add/
|
|
146
|
+
* These defaults MUST match the schematic defaults in:
|
|
147
|
+
* projects/ngx-theme-stack/schematics/ng-add/constants.ts → DEFAULTS
|
|
67
148
|
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
149
|
+
* Schematics compile to CommonJS and cannot import from this ESM file,
|
|
150
|
+
* so the values are intentionally duplicated. Change both at the same time.
|
|
151
|
+
*
|
|
152
|
+
* If you change defaults here, also update:
|
|
153
|
+
* schematics/ng-add/constants.ts → DEFAULTS + DEFAULT_THEMES
|
|
70
154
|
*/
|
|
71
155
|
declare const DEFAULT_NG_CONFIG: {
|
|
72
|
-
|
|
156
|
+
defaultTheme: "system";
|
|
73
157
|
storageKey: string;
|
|
74
158
|
mode: "class";
|
|
159
|
+
strategy: "critters";
|
|
75
160
|
themes: ("system" | "light" | "dark")[];
|
|
76
161
|
};
|
|
77
|
-
declare const NGX_THEME_STACK_CONFIG: InjectionToken<NgConfig
|
|
162
|
+
declare const NGX_THEME_STACK_CONFIG: InjectionToken<NgConfig<string>>;
|
|
78
163
|
/**
|
|
79
|
-
*
|
|
164
|
+
* Provides Theme Stack configuration to Angular's DI system.
|
|
165
|
+
*
|
|
166
|
+
* Custom `themes` are **merged** with the built-in defaults
|
|
167
|
+
* (`'light'`, `'dark'`, `'system'`), so you never lose the base themes.
|
|
168
|
+
*
|
|
169
|
+
* **Defaults:**
|
|
170
|
+
* - `themes`: `['light', 'dark', 'system']`
|
|
171
|
+
* - `defaultTheme`: `'system'`
|
|
172
|
+
* - `storageKey`: `'ngx-theme-stack-theme'`
|
|
173
|
+
* - `mode`: `'class'`
|
|
174
|
+
* - `strategy`: `'critters'`
|
|
175
|
+
|
|
176
|
+
*
|
|
177
|
+
* The type parameter `T` is **inferred automatically** from the `themes` array
|
|
178
|
+
* when passed as a `const` — no need to specify it manually.
|
|
179
|
+
*
|
|
180
|
+
* @typeParam T - Custom theme string literals, inferred from the `themes` option.
|
|
181
|
+
*
|
|
182
|
+
* @param config - Optional partial configuration. Omitted fields fall back to
|
|
183
|
+
* {@link DEFAULT_NG_CONFIG}.
|
|
184
|
+
*
|
|
185
|
+
* @throws {@link NgxThemeStackError}
|
|
186
|
+
* - If any entry in `themes` is an empty or whitespace-only string.
|
|
187
|
+
* - If `defaultTheme` is not present in the resolved (merged) themes array.
|
|
188
|
+
* - If `storageKey` is an empty or whitespace-only string.
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* // Default — uses built-in themes and sensible defaults
|
|
192
|
+
* provideThemeStack()
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* // SSR/SSG Optimization — uses Critters inlining strategy
|
|
196
|
+
* provideThemeStack({
|
|
197
|
+
* strategy: 'critters',
|
|
198
|
+
* mode: 'class',
|
|
199
|
+
* })
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* // Closed union: TypeScript infers 'sepia' | 'ocean' from the array
|
|
203
|
+
* provideThemeStack({
|
|
204
|
+
* themes: ['sepia', 'ocean'] as const,
|
|
205
|
+
* defaultTheme: 'sepia', // ✅ in resolved themes
|
|
206
|
+
* // defaultTheme: 'nope', // ❌ throws NgxThemeStackError at runtime
|
|
207
|
+
* })
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* // Custom storage key and mode
|
|
211
|
+
* provideThemeStack({
|
|
212
|
+
* storageKey: 'my-app-theme',
|
|
213
|
+
* mode: 'attribute',
|
|
214
|
+
* })
|
|
80
215
|
*/
|
|
81
|
-
declare function provideThemeStack(config?: Partial<NgConfig
|
|
82
|
-
provide: InjectionToken<NgConfig
|
|
83
|
-
useValue:
|
|
84
|
-
themes: ngx_theme_stack.NgTheme[];
|
|
85
|
-
theme: ngx_theme_stack.NgTheme;
|
|
86
|
-
storageKey: string;
|
|
87
|
-
mode: ngx_theme_stack.NgMode;
|
|
88
|
-
};
|
|
216
|
+
declare function provideThemeStack<const T extends string = DefaultNgTheme>(config?: Partial<NgConfig<T>>): {
|
|
217
|
+
provide: InjectionToken<NgConfig<string>>;
|
|
218
|
+
useValue: NgConfig<string>;
|
|
89
219
|
};
|
|
90
220
|
|
|
91
221
|
/**
|
|
92
222
|
* Convenience service for cycling through themes in a fixed order.
|
|
93
223
|
*
|
|
94
|
-
* Default cycle: `'
|
|
224
|
+
* Default cycle: `'system'` → `'light'` → `'dark'` → `'system'` → ...
|
|
95
225
|
*
|
|
96
226
|
* Use this when you want to offer users a single button that rotates
|
|
97
227
|
* through all available theme options.
|
|
@@ -100,12 +230,19 @@ declare class ThemeCycleService {
|
|
|
100
230
|
#private;
|
|
101
231
|
/** The theme explicitly selected by the user. May be `'system'`. */
|
|
102
232
|
readonly selectedTheme: _angular_core.Signal<ngx_theme_stack.NgTheme>;
|
|
103
|
-
/** Resolved theme applied to the DOM. Always concrete — never `'system'`. */
|
|
104
|
-
readonly
|
|
105
|
-
/** Whether the currently applied theme is dark
|
|
233
|
+
/** Resolved theme currently applied to the DOM. Always concrete — never `'system'`. */
|
|
234
|
+
readonly resolvedTheme: _angular_core.Signal<(string & {}) | ngx_theme_stack.NgSystemTheme>;
|
|
235
|
+
/** Whether the currently applied theme is `'dark'`. */
|
|
106
236
|
readonly isDark: _angular_core.Signal<boolean>;
|
|
107
|
-
/** Whether the currently applied theme is light
|
|
237
|
+
/** Whether the currently applied theme is `'light'`. */
|
|
108
238
|
readonly isLight: _angular_core.Signal<boolean>;
|
|
239
|
+
/** Whether the user has explicitly selected `'system'` preference. */
|
|
240
|
+
readonly isSystem: _angular_core.Signal<boolean>;
|
|
241
|
+
/**
|
|
242
|
+
* Whether the service has completed client-side initialization and
|
|
243
|
+
* resolved the real persisted theme. Use to prevent hydration flashes.
|
|
244
|
+
*/
|
|
245
|
+
readonly isHydrated: _angular_core.Signal<boolean>;
|
|
109
246
|
/**
|
|
110
247
|
* Advances to the next theme in the cycle.
|
|
111
248
|
*
|
|
@@ -127,16 +264,23 @@ declare class ThemeCycleService {
|
|
|
127
264
|
*/
|
|
128
265
|
declare class ThemeSelectService {
|
|
129
266
|
#private;
|
|
130
|
-
/** List of all configured themes. Defaults to ['light', 'dark', 'system']
|
|
131
|
-
readonly availableThemes:
|
|
267
|
+
/** List of all configured themes. Defaults to `['light', 'dark', 'system']`. */
|
|
268
|
+
readonly availableThemes: string[];
|
|
132
269
|
/** The theme explicitly selected by the user. May be `'system'`. */
|
|
133
270
|
readonly selectedTheme: _angular_core.Signal<NgTheme>;
|
|
134
|
-
/** Resolved theme applied to the DOM. Always concrete — never `'system'`. */
|
|
135
|
-
readonly
|
|
136
|
-
/** Whether the currently applied theme is dark
|
|
271
|
+
/** Resolved theme currently applied to the DOM. Always concrete — never `'system'`. */
|
|
272
|
+
readonly resolvedTheme: _angular_core.Signal<(string & {}) | ngx_theme_stack.NgSystemTheme>;
|
|
273
|
+
/** Whether the currently applied theme is `'dark'`. */
|
|
137
274
|
readonly isDark: _angular_core.Signal<boolean>;
|
|
138
|
-
/** Whether the currently applied theme is light
|
|
275
|
+
/** Whether the currently applied theme is `'light'`. */
|
|
139
276
|
readonly isLight: _angular_core.Signal<boolean>;
|
|
277
|
+
/** Whether the user has explicitly selected `'system'` preference. */
|
|
278
|
+
readonly isSystem: _angular_core.Signal<boolean>;
|
|
279
|
+
/**
|
|
280
|
+
* Whether the service has completed client-side initialization and
|
|
281
|
+
* resolved the real persisted theme. Use to prevent hydration flashes.
|
|
282
|
+
*/
|
|
283
|
+
readonly isHydrated: _angular_core.Signal<boolean>;
|
|
140
284
|
/**
|
|
141
285
|
* Applies the given theme.
|
|
142
286
|
*
|
|
@@ -156,12 +300,21 @@ declare class ThemeSelectService {
|
|
|
156
300
|
*/
|
|
157
301
|
declare class ThemeToggleService {
|
|
158
302
|
#private;
|
|
159
|
-
/** Resolved theme applied to the DOM. Always concrete — never `'system'`. */
|
|
160
|
-
readonly
|
|
161
|
-
/**
|
|
303
|
+
/** Resolved theme currently applied to the DOM. Always concrete — never `'system'`. */
|
|
304
|
+
readonly resolvedTheme: _angular_core.Signal<(string & {}) | ngx_theme_stack.NgSystemTheme>;
|
|
305
|
+
/** The theme explicitly selected by the user. May be `'system'`. */
|
|
306
|
+
readonly selectedTheme: _angular_core.Signal<ngx_theme_stack.NgTheme>;
|
|
307
|
+
/** Whether the currently applied theme is `'dark'`. */
|
|
162
308
|
readonly isDark: _angular_core.Signal<boolean>;
|
|
163
|
-
/** Whether the currently applied theme is light
|
|
309
|
+
/** Whether the currently applied theme is `'light'`. */
|
|
164
310
|
readonly isLight: _angular_core.Signal<boolean>;
|
|
311
|
+
/** Whether the user has explicitly selected `'system'` preference. */
|
|
312
|
+
readonly isSystem: _angular_core.Signal<boolean>;
|
|
313
|
+
/**
|
|
314
|
+
* Whether the service has completed client-side initialization and
|
|
315
|
+
* resolved the real persisted theme. Use to prevent hydration flashes.
|
|
316
|
+
*/
|
|
317
|
+
readonly isHydrated: _angular_core.Signal<boolean>;
|
|
165
318
|
/**
|
|
166
319
|
* Toggles between `'dark'` and `'light'`.
|
|
167
320
|
*
|
|
@@ -173,5 +326,26 @@ declare class ThemeToggleService {
|
|
|
173
326
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ThemeToggleService>;
|
|
174
327
|
}
|
|
175
328
|
|
|
176
|
-
|
|
177
|
-
|
|
329
|
+
/**
|
|
330
|
+
* Base error class for `ngx-theme-stack`.
|
|
331
|
+
*
|
|
332
|
+
* Thrown when the library configuration is invalid.
|
|
333
|
+
* Consumers can use `instanceof NgxThemeStackError` to catch only
|
|
334
|
+
* errors originating from this library.
|
|
335
|
+
*
|
|
336
|
+
* @example
|
|
337
|
+
* try {
|
|
338
|
+
* bootstrapApplication(AppComponent, appConfig);
|
|
339
|
+
* } catch (e) {
|
|
340
|
+
* if (e instanceof NgxThemeStackError) {
|
|
341
|
+
* console.error('Bad ngx-theme-stack config:', e.message);
|
|
342
|
+
* }
|
|
343
|
+
* }
|
|
344
|
+
*/
|
|
345
|
+
declare class NgxThemeStackError extends Error {
|
|
346
|
+
readonly name = "NgxThemeStackError";
|
|
347
|
+
constructor(message: string);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export { CoreThemeService, DEFAULT_NG_CONFIG, DEFAULT_THEMES, NGX_THEME_STACK_CONFIG, NgxThemeStackError, ThemeCycleService, ThemeSelectService, ThemeToggleService, provideThemeStack };
|
|
351
|
+
export type { DefaultNgTheme, NgConfig, NgMode, NgStrategy, NgSystemTheme, NgTheme };
|