@@ -8,14 +8,14 @@ export type ModeWatcherProps = {
88 * Whether to automatically track operating system preferences
99 * and update the mode accordingly.
1010 *
11- * @defaultValue `true`
11+ * @default `true`
1212 */
1313 track ?: boolean ;
1414
1515 /**
1616 * The default mode to use instead of the user's preference.
1717 *
18- * @defaultValue `"system"`
18+ * @default `"system"`
1919 */
2020 defaultMode ?: Mode ;
2121
@@ -28,7 +28,7 @@ export type ModeWatcherProps = {
2828 * <html data-theme="your-custom-theme"></html>
2929 * ```
3030 *
31- * @defaultValue `undefined`
31+ * @default `undefined`
3232 */
3333 defaultTheme ?: string ;
3434
@@ -45,44 +45,55 @@ export type ModeWatcherProps = {
4545 /**
4646 * The classname to add to the root `html` element when the mode is dark.
4747 *
48- * @defaultValue `["dark"]`
48+ * @default `["dark"]`
4949 */
5050 darkClassNames ?: string [ ] ;
5151
5252 /**
5353 * The classname to add to the root `html` element when the mode is light.
5454 *
55- * @defaultValue `[]`
55+ * @default `[]`
5656 */
5757 lightClassNames ?: string [ ] ;
5858
5959 /**
6060 * Optionally provide a custom local storage key to use for storing the mode.
6161 *
62- * @defaultValue `'mode-watcher-mode'`
62+ * @default `'mode-watcher-mode'`
6363 */
6464 modeStorageKey ?: string ;
6565
6666 /**
6767 * Optionally provide a custom local storage key to use for storing the theme.
6868 *
69- * @defaultValue `'mode-watcher-theme'`
69+ * @default `'mode-watcher-theme'`
7070 */
7171 themeStorageKey ?: string ;
7272
7373 /**
7474 * An optional nonce to use for the injected script tag to allow-list mode-watcher
7575 * if you are using a Content Security Policy.
7676 *
77- * @defaultValue `undefined`
77+ * @default `undefined`
7878 */
7979 nonce ?: string ;
8080
8181 /**
8282 * Whether to disable the injected script tag that sets the initial mode.
8383 * Set this if you are manually injecting the script using a hook.
8484 *
85- * @defaultValue `false`
85+ * @default `false`
8686 */
8787 disableHeadScriptInjection ?: boolean ;
88+
89+ /**
90+ * Whether to run the mode changes synchronously instead of using
91+ * an animation frame. If true, will have an impact on blocking performance
92+ * due to blocking the main thread.
93+ *
94+ * Only applicable if `disableTransitions` is set to `true`.
95+ *
96+ * @default `false`
97+ */
98+ synchronousModeChanges ?: boolean ;
8899} ;
0 commit comments