@stacksjs/stx 0.2.4 → 0.2.6

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 (293) hide show
  1. package/dist/a11y.d.ts +2 -6
  2. package/dist/analytics.d.ts +1 -1
  3. package/dist/analyzer.d.ts +1 -1
  4. package/dist/animation.d.ts +10 -86
  5. package/dist/app.d.ts +2 -4
  6. package/dist/assets.d.ts +1 -1
  7. package/dist/ast.d.ts +3 -24
  8. package/dist/async-components.d.ts +1 -1
  9. package/dist/auth.d.ts +1 -1
  10. package/dist/browser-composables.d.ts +6 -4
  11. package/dist/build-optimizer.d.ts +4 -29
  12. package/dist/build-views.d.ts +20 -1
  13. package/dist/bundle-analyzer/collector.d.ts +1 -1
  14. package/dist/bundle-analyzer/index.d.ts +40 -4
  15. package/dist/bundle-analyzer/report.d.ts +1 -1
  16. package/dist/bundle-analyzer/treemap.d.ts +1 -1
  17. package/dist/caching.d.ts +1 -1
  18. package/dist/cli.js +1323 -511
  19. package/dist/client/directive.d.ts +1 -1
  20. package/dist/client/index.d.ts +6 -1
  21. package/dist/client/router.d.ts +3 -11
  22. package/dist/client/stx-router.browser.d.ts +1 -0
  23. package/dist/client-script.d.ts +2 -1
  24. package/dist/client.d.ts +2 -2
  25. package/dist/component-hmr.d.ts +4 -18
  26. package/dist/components.d.ts +1 -1
  27. package/dist/composables/index.d.ts +114 -1
  28. package/dist/composables/use-battery.d.ts +1 -1
  29. package/dist/composables/use-broadcast-channel.d.ts +2 -2
  30. package/dist/composables/use-clipboard.d.ts +1 -1
  31. package/dist/composables/use-color-mode.d.ts +52 -0
  32. package/dist/composables/use-cookie.d.ts +1 -1
  33. package/dist/composables/use-device-orientation.d.ts +1 -1
  34. package/dist/composables/use-event-listener.d.ts +35 -0
  35. package/dist/composables/use-event-source.d.ts +1 -1
  36. package/dist/composables/use-eye-dropper.d.ts +3 -2
  37. package/dist/composables/use-fetch.d.ts +1 -1
  38. package/dist/composables/use-fullscreen.d.ts +1 -1
  39. package/dist/composables/use-geolocation.d.ts +1 -1
  40. package/dist/composables/use-idle.d.ts +2 -2
  41. package/dist/composables/use-intersection-observer.d.ts +1 -1
  42. package/dist/composables/use-keyboard.d.ts +1 -2
  43. package/dist/composables/use-media-query.d.ts +1 -1
  44. package/dist/composables/use-meta.d.ts +35 -0
  45. package/dist/composables/use-mouse.d.ts +1 -1
  46. package/dist/composables/use-mutation-observer.d.ts +1 -1
  47. package/dist/composables/use-network.d.ts +1 -1
  48. package/dist/composables/use-notification.d.ts +10 -1
  49. package/dist/composables/use-permissions.d.ts +17 -7
  50. package/dist/composables/use-query.d.ts +43 -0
  51. package/dist/composables/use-resize-observer.d.ts +1 -1
  52. package/dist/composables/use-router.d.ts +59 -0
  53. package/dist/composables/use-share.d.ts +1 -1
  54. package/dist/composables/use-speech.d.ts +1 -1
  55. package/dist/composables/use-storage.d.ts +1 -1
  56. package/dist/composables/use-text-selection.d.ts +1 -1
  57. package/dist/composables/use-timer.d.ts +92 -0
  58. package/dist/composables/use-utilities.d.ts +103 -0
  59. package/dist/composables/use-wake-lock.d.ts +1 -1
  60. package/dist/composables/use-websocket.d.ts +3 -3
  61. package/dist/composables/use-window.d.ts +1 -1
  62. package/dist/composables.d.ts +10 -7
  63. package/dist/composition-api.d.ts +1 -14
  64. package/dist/computed.d.ts +10 -4
  65. package/dist/conditionals.d.ts +1 -1
  66. package/dist/config.d.ts +1 -1
  67. package/dist/craft-bridge.d.ts +1 -1
  68. package/dist/craft-compiler.d.ts +6 -3
  69. package/dist/craft-components.d.ts +1 -8
  70. package/dist/craft-entry.d.ts +1 -1
  71. package/dist/craft-ssr.d.ts +1 -1
  72. package/dist/csp.d.ts +2 -2
  73. package/dist/csrf.d.ts +1 -1
  74. package/dist/custom-directives.d.ts +1 -1
  75. package/dist/database.d.ts +8 -26
  76. package/dist/defer.d.ts +1 -1
  77. package/dist/deploy/config-generators.d.ts +1 -1
  78. package/dist/deploy/index.d.ts +6 -3
  79. package/dist/deploy/netlify.d.ts +1 -1
  80. package/dist/dev-server/crosswind.d.ts +11 -1
  81. package/dist/dev-server/index.d.ts +16 -1
  82. package/dist/dev-server/keyboard-shortcuts.d.ts +1 -1
  83. package/dist/dev-server/native-window.d.ts +1 -1
  84. package/dist/dev-server/port-utils.d.ts +2 -2
  85. package/dist/dev-server/terminal-colors.d.ts +1 -5
  86. package/dist/dev-server/theme-selector.d.ts +1 -1
  87. package/dist/dev-server/types.d.ts +3 -8
  88. package/dist/dev-server.d.ts +1 -4
  89. package/dist/devtools.d.ts +4 -1
  90. package/dist/directive-api.d.ts +3 -3
  91. package/dist/docs.d.ts +2 -2
  92. package/dist/dynamic-components.d.ts +1 -1
  93. package/dist/edge-runtime.d.ts +3 -3
  94. package/dist/env.d.ts +1 -1
  95. package/dist/error-boundaries.d.ts +1 -1
  96. package/dist/error-handling.d.ts +14 -1
  97. package/dist/errors/codes.d.ts +2 -17
  98. package/dist/errors/formatter.d.ts +1 -1
  99. package/dist/errors/index.d.ts +13 -1
  100. package/dist/errors/logger.d.ts +2 -15
  101. package/dist/errors/sanitizer.d.ts +1 -1
  102. package/dist/errors/types.d.ts +1 -1
  103. package/dist/events.d.ts +1 -1
  104. package/dist/expressions.d.ts +64 -90
  105. package/dist/formatter.d.ts +1 -1
  106. package/dist/forms-validation.d.ts +23 -24
  107. package/dist/forms.d.ts +5 -22
  108. package/dist/head.d.ts +5 -1
  109. package/dist/heatmap.d.ts +4 -7
  110. package/dist/hot-reload.d.ts +3 -8
  111. package/dist/hydration-runtime.d.ts +1 -1
  112. package/dist/hydration.d.ts +5 -32
  113. package/dist/i18n.d.ts +1 -9
  114. package/dist/image-optimization/build-plugin.d.ts +2 -2
  115. package/dist/image-optimization/component.d.ts +2 -2
  116. package/dist/image-optimization/directive.d.ts +2 -2
  117. package/dist/image-optimization/index.d.ts +55 -1
  118. package/dist/image-optimization/processor.d.ts +9 -4
  119. package/dist/includes.d.ts +1 -1
  120. package/dist/index.d.ts +29 -1
  121. package/dist/index.js +1387 -542
  122. package/dist/init.d.ts +1 -1
  123. package/dist/interactive.d.ts +1 -1
  124. package/dist/internal-markdown.d.ts +1 -1
  125. package/dist/js-ts.d.ts +1 -1
  126. package/dist/jsx-runtime.d.ts +1 -20
  127. package/dist/keep-alive.d.ts +1 -1
  128. package/dist/lazy-loader.d.ts +3 -35
  129. package/dist/loading-indicator.d.ts +2 -1
  130. package/dist/loops.d.ts +1 -1
  131. package/dist/markdown.d.ts +1 -1
  132. package/dist/media/client/blur-up.d.ts +1 -1
  133. package/dist/media/client/index.d.ts +17 -1
  134. package/dist/media/client/lazy-load.d.ts +1 -1
  135. package/dist/media/client/upload-handler.d.ts +1 -1
  136. package/dist/media/image/component.d.ts +2 -4
  137. package/dist/media/image/directive.d.ts +1 -1
  138. package/dist/media/image/editing.d.ts +1 -1
  139. package/dist/media/image/index.d.ts +25 -1
  140. package/dist/media/image/placeholder.d.ts +1 -1
  141. package/dist/media/image/processor/cache.d.ts +3 -4
  142. package/dist/media/image/processor/index.d.ts +9 -1
  143. package/dist/media/image/processor/optimizer.d.ts +2 -2
  144. package/dist/media/image/processor/responsive.d.ts +3 -2
  145. package/dist/media/image/srcset.d.ts +6 -4
  146. package/dist/media/index.d.ts +37 -1
  147. package/dist/media/manager/embed.d.ts +1 -1
  148. package/dist/media/protected/component.d.ts +2 -3
  149. package/dist/media/protected/index.d.ts +14 -1
  150. package/dist/media/protected/signature.d.ts +2 -2
  151. package/dist/media/shared/cache.d.ts +1 -1
  152. package/dist/media/shared/hash.d.ts +1 -1
  153. package/dist/media/shared/index.d.ts +6 -1
  154. package/dist/media/types.d.ts +16 -72
  155. package/dist/media/upload/component.d.ts +2 -16
  156. package/dist/media/upload/index.d.ts +8 -1
  157. package/dist/media/video/directive.d.ts +1 -1
  158. package/dist/media/video/index.d.ts +11 -2
  159. package/dist/media/video/processor/cache.d.ts +3 -4
  160. package/dist/media/video/processor/index.d.ts +9 -1
  161. package/dist/media/video/processor/streaming.d.ts +2 -2
  162. package/dist/media/video/processor/thumbnail.d.ts +2 -2
  163. package/dist/media/video/processor/transcoder.d.ts +2 -2
  164. package/dist/method-spoofing.d.ts +1 -1
  165. package/dist/middleware.d.ts +1 -1
  166. package/dist/native-build.d.ts +3 -6
  167. package/dist/parser/directive-parser.d.ts +1 -1
  168. package/dist/parser/expression-parser.d.ts +2 -1
  169. package/dist/parser/index.d.ts +14 -1
  170. package/dist/parser/tokenizer.d.ts +2 -18
  171. package/dist/partial-hydration.d.ts +5 -6
  172. package/dist/performance-utils.d.ts +5 -18
  173. package/dist/plugin-system.d.ts +2 -8
  174. package/dist/plugin.d.ts +1 -1
  175. package/dist/precompiler.d.ts +2 -67
  176. package/dist/process.d.ts +12 -2
  177. package/dist/production-build.d.ts +1 -37
  178. package/dist/props.d.ts +3 -30
  179. package/dist/pwa/audit.d.ts +1 -1
  180. package/dist/pwa/directives.d.ts +1 -1
  181. package/dist/pwa/icons.d.ts +7 -4
  182. package/dist/pwa/index.d.ts +46 -1
  183. package/dist/pwa/inject.d.ts +1 -1
  184. package/dist/pwa/manifest.d.ts +1 -1
  185. package/dist/pwa/offline.d.ts +1 -1
  186. package/dist/pwa/precache.d.ts +1 -1
  187. package/dist/pwa/service-worker.d.ts +1 -1
  188. package/dist/pwa/workbox-strategies.d.ts +1 -1
  189. package/dist/pwa/workbox.d.ts +1 -10
  190. package/dist/pwa.d.ts +1 -1
  191. package/dist/pwa.js +1242 -430
  192. package/dist/reactive-bindings.d.ts +1 -1
  193. package/dist/reactive.d.ts +1 -1
  194. package/dist/reactivity.d.ts +6 -50
  195. package/dist/release.d.ts +1 -1
  196. package/dist/route-middleware.d.ts +3 -3
  197. package/dist/router.d.ts +1 -1
  198. package/dist/routes.d.ts +2 -2
  199. package/dist/runtime.d.ts +4 -4
  200. package/dist/safe-evaluator.d.ts +1 -4
  201. package/dist/scaffolding.d.ts +1 -1
  202. package/dist/seo.d.ts +1 -5
  203. package/dist/serve.d.ts +1 -1
  204. package/dist/server-components.d.ts +1 -1
  205. package/dist/signals.d.ts +8 -168
  206. package/dist/slots.d.ts +2 -2
  207. package/dist/source-maps.d.ts +3 -22
  208. package/dist/spa-shell.d.ts +20 -0
  209. package/dist/ssg.d.ts +4 -6
  210. package/dist/ssg.js +1242 -430
  211. package/dist/ssr.d.ts +6 -14
  212. package/dist/state-management.d.ts +5 -45
  213. package/dist/stores-client.d.ts +3 -3
  214. package/dist/story/addons.d.ts +1 -1
  215. package/dist/story/analytics.d.ts +4 -11
  216. package/dist/story/auto-stories.d.ts +1 -1
  217. package/dist/story/bookmarks.d.ts +2 -6
  218. package/dist/story/bun-test.d.ts +1 -1
  219. package/dist/story/cli.d.ts +0 -25
  220. package/dist/story/collect/analyzer.d.ts +1 -1
  221. package/dist/story/collect/index.d.ts +5 -1
  222. package/dist/story/collect/parser.d.ts +1 -1
  223. package/dist/story/collect/scanner.d.ts +1 -1
  224. package/dist/story/collect/tree.d.ts +2 -2
  225. package/dist/story/commands/build.d.ts +1 -1
  226. package/dist/story/commands/dev.d.ts +1 -1
  227. package/dist/story/commands/index.d.ts +4 -1
  228. package/dist/story/commands/preview.d.ts +1 -1
  229. package/dist/story/compiled-output.d.ts +1 -1
  230. package/dist/story/composition.d.ts +1 -1
  231. package/dist/story/config-watcher.d.ts +1 -1
  232. package/dist/story/config.d.ts +2 -2
  233. package/dist/story/context.d.ts +1 -1
  234. package/dist/story/controls/index.d.ts +1 -1
  235. package/dist/story/crosswind.d.ts +1 -1
  236. package/dist/story/desktop-preview.d.ts +1 -1
  237. package/dist/story/docs-generator.d.ts +1 -1
  238. package/dist/story/errors.d.ts +1 -1
  239. package/dist/story/figma-export.d.ts +2 -2
  240. package/dist/story/generator.d.ts +1 -1
  241. package/dist/story/hmr.d.ts +1 -1
  242. package/dist/story/hot-swap.d.ts +1 -1
  243. package/dist/story/index.d.ts +49 -1
  244. package/dist/story/interactions.d.ts +1 -1
  245. package/dist/story/keyboard-shortcuts.d.ts +1 -1
  246. package/dist/story/output.d.ts +1 -1
  247. package/dist/story/performance.d.ts +3 -12
  248. package/dist/story/presets.d.ts +3 -8
  249. package/dist/story/props-validation.d.ts +11 -1
  250. package/dist/story/renderer.d.ts +1 -1
  251. package/dist/story/search-index.d.ts +2 -2
  252. package/dist/story/search.d.ts +2 -2
  253. package/dist/story/server.d.ts +1 -1
  254. package/dist/story/setup.d.ts +1 -1
  255. package/dist/story/snapshots.d.ts +1 -1
  256. package/dist/story/testing.d.ts +1 -1
  257. package/dist/story/theme.d.ts +1 -1
  258. package/dist/story/types.d.ts +3 -12
  259. package/dist/story/ui/code-panel.d.ts +1 -1
  260. package/dist/story/ui/controls-panel.d.ts +1 -1
  261. package/dist/story/ui/index.d.ts +5 -1
  262. package/dist/story/ui/navigation.d.ts +1 -1
  263. package/dist/story/ui/preview.d.ts +1 -1
  264. package/dist/story/visual-testing.d.ts +1 -1
  265. package/dist/streaming.d.ts +0 -59
  266. package/dist/suspense.d.ts +1 -1
  267. package/dist/teleport.d.ts +1 -1
  268. package/dist/testing.d.ts +62 -80
  269. package/dist/transitions.d.ts +1 -1
  270. package/dist/type-checker.d.ts +2 -26
  271. package/dist/types/component-types.d.ts +3 -3
  272. package/dist/types/config-types.d.ts +15 -30
  273. package/dist/types/context-types.d.ts +6 -5
  274. package/dist/types/csp-types.d.ts +2 -2
  275. package/dist/types/directive-types.d.ts +5 -5
  276. package/dist/types/index.d.ts +21 -1
  277. package/dist/types/pwa-types.d.ts +1 -6
  278. package/dist/types.d.ts +28 -1
  279. package/dist/typescript-templates.d.ts +1 -34
  280. package/dist/utils.d.ts +2 -1
  281. package/dist/validator.d.ts +1 -1
  282. package/dist/variable-extractor.d.ts +1 -1
  283. package/dist/view-composers.d.ts +1 -1
  284. package/dist/virtual-scrolling.d.ts +4 -1
  285. package/dist/visual-editor.d.ts +2 -30
  286. package/dist/visual-testing.d.ts +4 -1
  287. package/dist/vue-template.d.ts +1 -1
  288. package/dist/web-components/css-scoping.d.ts +1 -1
  289. package/dist/web-components/index.d.ts +10 -1
  290. package/dist/web-components/reactive-generator.d.ts +1 -1
  291. package/dist/web-components.d.ts +1 -1
  292. package/dist/x-element.d.ts +13 -6
  293. package/package.json +4 -4
@@ -7,4 +7,4 @@ export declare function stxRouterHandler(_content: string, params: string[], _co
7
7
  /**
8
8
  * Custom directive for @stxRouter
9
9
  */
10
- export declare const stxRouterDirective: CustomDirective;
10
+ export declare const stxRouterDirective: CustomDirective;
@@ -3,5 +3,10 @@
3
3
  * This can be injected into pages or served as a static file
4
4
  */
5
5
  export declare function getRouterScript(): string;
6
+ /**
7
+ * STX Client-Side Modules
8
+ *
9
+ * Browser-side functionality for STX applications.
10
+ */
6
11
  export * from './router';
7
- export * from './directive';
12
+ export * from './directive';
@@ -18,19 +18,11 @@ export declare interface RouterOptions {
18
18
  onError?: (error: Error, url: string) => void
19
19
  }
20
20
  declare class STXRouter {
21
- private options: Required<RouterOptions>;
22
- private cache: Map<string, CacheEntry>;
23
- private isNavigating: any;
24
- private currentUrl: string;
25
21
  constructor(options?: RouterOptions);
26
22
  init(): void;
27
- navigate(url: string, pushState?: any): Promise<void>;
23
+ navigate(url: string, pushState?: boolean): Promise<void>;
28
24
  prefetch(url: string): Promise<void>;
29
25
  clearCache(): void;
30
- private handleClick(event: MouseEvent): void;
31
- private handlePopState(event: PopStateEvent): void;
32
- private fetchPage(url: string): Promise<{ html: string; title: string } | null>;
33
- private swapContent(content: { html: string; title: string }): Promise<void>;
34
- private cacheCurrentPage(): void;
35
26
  }
36
- export { STXRouter };
27
+ // Export for manual use
28
+ export { STXRouter };
@@ -0,0 +1 @@
1
+
@@ -19,4 +19,5 @@ export declare interface ClientScriptOptions {
19
19
  eventBindings?: ParsedEvent[]
20
20
  autoImports?: boolean
21
21
  attrs?: string
22
- }
22
+ hasColonDirectives?: boolean
23
+ }
package/dist/client.d.ts CHANGED
@@ -13,8 +13,8 @@ export declare function preloadIslandHandlers(handlers: IslandHandlers): void;
13
13
  /**
14
14
  * Island handler registry
15
15
  */
16
- declare type IslandHandlers = Record<string, () => Promise<any>>
16
+ declare type IslandHandlers = Record<string, () => Promise<any>>;
17
17
  /**
18
18
  * Island hydration function
19
19
  */
20
- declare type IslandHydrationFn = (element: any, props: any) => void | Promise<void>
20
+ declare type IslandHydrationFn = (element: any, props: any) => void | Promise<void>;
@@ -73,10 +73,6 @@ export declare interface ComponentHMRConfig {
73
73
  * Global registry of component instances for HMR
74
74
  */
75
75
  declare class ComponentRegistry {
76
- private instances: Map<string, ComponentInstance>;
77
- private componentsByFile: Map<string, Set<string>>;
78
- private stateSnapshots: Map<string, ComponentState>;
79
- private config: Required<ComponentHMRConfig>;
80
76
  constructor(config?: ComponentHMRConfig);
81
77
  register(instance: ComponentInstance): void;
82
78
  unregister(instanceId: string): void;
@@ -84,8 +80,6 @@ declare class ComponentRegistry {
84
80
  getInstance(id: string): ComponentInstance | undefined;
85
81
  captureState(instanceId: string): void;
86
82
  restoreState(instanceId: string): boolean;
87
- private defaultSerializeState(instance: ComponentInstance): ComponentState;
88
- private defaultDeserializeState(state: ComponentState, instance: ComponentInstance): void;
89
83
  getAllInstances(): ComponentInstance[];
90
84
  clear(): void;
91
85
  }
@@ -93,28 +87,20 @@ declare class ComponentRegistry {
93
87
  * HMR Handler - processes component updates
94
88
  */
95
89
  export declare class ComponentHMRHandler {
96
- private registry: ComponentRegistry;
97
- private config: Required<ComponentHMRConfig>;
98
- private pendingUpdates: Map<string, HMRUpdate>;
99
- private updateQueue: Promise<void>;
100
90
  constructor(config?: ComponentHMRConfig);
101
91
  register(instance: ComponentInstance): void;
102
92
  unregister(instanceId: string): void;
103
93
  handleUpdate(update: HMRUpdate): Promise<void>;
104
- private processUpdate(update: HMRUpdate): Promise<void>;
105
- private updateInstance(instance: ComponentInstance, update: HMRUpdate): Promise<void>;
106
- private updateComponent(instance: ComponentInstance, update: HMRUpdate): Promise<void>;
107
- private updateStyles(instance: ComponentInstance, update: HMRUpdate): Promise<void>;
108
- private parseComponentCode(code: string): { html: string; script: string; style: string };
109
- private executeScript(script: string, instance: ComponentInstance): Promise<void>;
110
- private reinitializeInteractivity(instance: ComponentInstance): void;
111
94
  getRegistry(): ComponentRegistry;
112
95
  refresh(componentName: string): Promise<void>;
113
96
  }
97
+ // =============================================================================
98
+ // Exports
99
+ // =============================================================================
114
100
  export default {
115
101
  ComponentHMRHandler,
116
102
  getHMRHandler,
117
103
  resetHMRHandler,
118
104
  generateHMRClientScript,
119
105
  wrapComponentForHMR,
120
- };
106
+ };
@@ -25,4 +25,4 @@ export declare function applyPropDefaults(props: Record<string, any>, schema: Co
25
25
  * Register component directives
26
26
  */
27
27
  export declare function registerComponentDirectives(): CustomDirective[];
28
- export declare const componentDirective: CustomDirective;
28
+ export declare const componentDirective: CustomDirective;
@@ -1,3 +1,22 @@
1
+ /**
2
+ * STX Composables
3
+ *
4
+ * Nuxt-style reactive utilities for browser APIs.
5
+ * These composables provide a streamlined, reactive interface to common browser features.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import {
10
+ * useStorage,
11
+ * useCookie,
12
+ * useClipboard,
13
+ * useMediaQuery,
14
+ * useNetwork,
15
+ * useWindowSize,
16
+ * } from '@stacksjs/stx/composables'
17
+ * ```
18
+ */
19
+ // Storage
1
20
  export {
2
21
  useStorage,
3
22
  useLocalStorage,
@@ -9,6 +28,7 @@ export {
9
28
  type UseStorageOptions,
10
29
  type StorageRef,
11
30
  } from './use-storage';
31
+ // Cookies
12
32
  export {
13
33
  useCookie,
14
34
  useCookies,
@@ -20,11 +40,13 @@ export {
20
40
  type CookieOptions,
21
41
  type CookieRef,
22
42
  } from './use-cookie';
43
+ // Clipboard
23
44
  export {
24
45
  useClipboard,
25
46
  copyToClipboard,
26
47
  type ClipboardRef,
27
48
  } from './use-clipboard';
49
+ // Media Queries
28
50
  export {
29
51
  useMediaQuery,
30
52
  usePreferredDark,
@@ -38,12 +60,14 @@ export {
38
60
  breakpoints,
39
61
  type MediaQueryRef,
40
62
  } from './use-media-query';
63
+ // Network
41
64
  export {
42
65
  useNetwork,
43
66
  useOnline,
44
67
  type NetworkState,
45
68
  type NetworkRef,
46
69
  } from './use-network';
70
+ // Window
47
71
  export {
48
72
  useWindowSize,
49
73
  useScroll,
@@ -56,6 +80,7 @@ export {
56
80
  type ScrollRef,
57
81
  type VisibilityRef,
58
82
  } from './use-window';
83
+ // Geolocation
59
84
  export {
60
85
  useGeolocation,
61
86
  useGeolocationWatch,
@@ -66,6 +91,7 @@ export {
66
91
  type GeolocationOptions,
67
92
  type GeolocationRef,
68
93
  } from './use-geolocation';
94
+ // Mouse & Pointer
69
95
  export {
70
96
  useMouse,
71
97
  useMouseInElement,
@@ -76,6 +102,7 @@ export {
76
102
  type ElementMouseState,
77
103
  type ElementMouseRef,
78
104
  } from './use-mouse';
105
+ // Keyboard
79
106
  export {
80
107
  useKeyboard,
81
108
  useHotkey,
@@ -87,6 +114,7 @@ export {
87
114
  type KeyboardRef,
88
115
  type HotkeyOptions,
89
116
  } from './use-keyboard';
117
+ // Intersection Observer
90
118
  export {
91
119
  useIntersectionObserver,
92
120
  useElementVisibility,
@@ -97,6 +125,7 @@ export {
97
125
  type IntersectionState,
98
126
  type IntersectionObserverRef,
99
127
  } from './use-intersection-observer';
128
+ // Fetch & Async Data
100
129
  export {
101
130
  useFetch,
102
131
  useAsyncData,
@@ -107,6 +136,7 @@ export {
107
136
  type FetchState,
108
137
  type FetchRef,
109
138
  } from './use-fetch';
139
+ // Fullscreen
110
140
  export {
111
141
  useFullscreen,
112
142
  toggleFullscreen,
@@ -115,6 +145,7 @@ export {
115
145
  type FullscreenOptions,
116
146
  type FullscreenRef,
117
147
  } from './use-fullscreen';
148
+ // Notifications
118
149
  export {
119
150
  useNotification,
120
151
  notify,
@@ -126,6 +157,7 @@ export {
126
157
  type NotificationOptions,
127
158
  type NotificationRef,
128
159
  } from './use-notification';
160
+ // Share
129
161
  export {
130
162
  useShare,
131
163
  share,
@@ -139,6 +171,7 @@ export {
139
171
  type ShareResult,
140
172
  type ShareRef,
141
173
  } from './use-share';
174
+ // Permissions
142
175
  export {
143
176
  usePermission,
144
177
  usePermissions,
@@ -155,6 +188,7 @@ export {
155
188
  type PermissionRef,
156
189
  type MultiPermissionRef,
157
190
  } from './use-permissions';
191
+ // Resize Observer
158
192
  export {
159
193
  useResizeObserver,
160
194
  useResizeObserverMultiple,
@@ -165,6 +199,7 @@ export {
165
199
  type ResizeObserverOptions,
166
200
  type ResizeObserverRef,
167
201
  } from './use-resize-observer';
202
+ // Battery
168
203
  export {
169
204
  useBattery,
170
205
  getBatteryLevel,
@@ -173,6 +208,7 @@ export {
173
208
  type BatteryState,
174
209
  type BatteryRef,
175
210
  } from './use-battery';
211
+ // Speech Recognition & Synthesis
176
212
  export {
177
213
  useSpeechRecognition,
178
214
  useSpeechSynthesis,
@@ -189,6 +225,7 @@ export {
189
225
  type SpeechSynthesisState,
190
226
  type SpeechSynthesisRef,
191
227
  } from './use-speech';
228
+ // Broadcast Channel
192
229
  export {
193
230
  useBroadcastChannel,
194
231
  broadcast,
@@ -197,6 +234,7 @@ export {
197
234
  type BroadcastChannelOptions,
198
235
  type BroadcastChannelRef,
199
236
  } from './use-broadcast-channel';
237
+ // WebSocket
200
238
  export {
201
239
  useWebSocket,
202
240
  isWebSocketSupported,
@@ -205,6 +243,7 @@ export {
205
243
  type WebSocketOptions,
206
244
  type WebSocketRef,
207
245
  } from './use-websocket';
246
+ // Device Orientation & Motion
208
247
  export {
209
248
  useDeviceOrientation,
210
249
  useDeviceMotion,
@@ -218,6 +257,7 @@ export {
218
257
  type DeviceOrientationRef,
219
258
  type DeviceMotionRef,
220
259
  } from './use-device-orientation';
260
+ // Mutation Observer
221
261
  export {
222
262
  useMutationObserver,
223
263
  useAttributeObserver,
@@ -228,6 +268,7 @@ export {
228
268
  type MutationObserverOptions,
229
269
  type MutationObserverRef,
230
270
  } from './use-mutation-observer';
271
+ // Event Source (SSE)
231
272
  export {
232
273
  useEventSource,
233
274
  useSSE,
@@ -237,6 +278,7 @@ export {
237
278
  type EventSourceOptions,
238
279
  type EventSourceRef,
239
280
  } from './use-event-source';
281
+ // Idle Detection
240
282
  export {
241
283
  useIdle,
242
284
  useIdleState,
@@ -246,6 +288,7 @@ export {
246
288
  type IdleOptions,
247
289
  type IdleRef,
248
290
  } from './use-idle';
291
+ // Text Selection
249
292
  export {
250
293
  useTextSelection,
251
294
  useElementTextSelection,
@@ -255,6 +298,7 @@ export {
255
298
  type TextSelectionOptions,
256
299
  type TextSelectionRef,
257
300
  } from './use-text-selection';
301
+ // Wake Lock
258
302
  export {
259
303
  useWakeLock,
260
304
  useAutoWakeLock,
@@ -263,6 +307,7 @@ export {
263
307
  type WakeLockState,
264
308
  type WakeLockRef,
265
309
  } from './use-wake-lock';
310
+ // Eye Dropper (Color Picker)
266
311
  export {
267
312
  useEyeDropper,
268
313
  useColorHistory,
@@ -274,4 +319,72 @@ export {
274
319
  type EyeDropperResult,
275
320
  type EyeDropperOptions,
276
321
  type EyeDropperRef,
277
- } from './use-eye-dropper';
322
+ } from './use-eye-dropper';
323
+ // Router / Navigation
324
+ export {
325
+ navigate,
326
+ goBack,
327
+ goForward,
328
+ useRoute,
329
+ useSearchParams,
330
+ type RouteInfo,
331
+ type SearchParamsRef,
332
+ } from './use-router';
333
+ // Data Fetching (Query / Mutation)
334
+ export {
335
+ type UseQueryOptions,
336
+ type UseQueryResult,
337
+ type UseMutationOptions,
338
+ type UseMutationResult,
339
+ } from './use-query';
340
+ // Event Listener
341
+ export {
342
+ useEventListener,
343
+ type UseEventListenerOptions,
344
+ type EventListenerRef,
345
+ } from './use-event-listener';
346
+ // Meta Tags
347
+ export {
348
+ useMeta,
349
+ type UseMetaOptions,
350
+ type MetaRef,
351
+ } from './use-meta';
352
+ // Timers
353
+ export {
354
+ useDebounce,
355
+ useDebouncedValue,
356
+ useThrottle,
357
+ useInterval,
358
+ useTimeout,
359
+ type DebouncedFn,
360
+ type ThrottledFn,
361
+ type DebouncedValueRef,
362
+ type IntervalOptions,
363
+ type IntervalRef,
364
+ type TimeoutRef,
365
+ } from './use-timer';
366
+ // Utilities
367
+ export {
368
+ useToggle,
369
+ useCounter,
370
+ useClickOutside,
371
+ useFocus,
372
+ useAsync,
373
+ type ToggleRef,
374
+ type CounterOptions,
375
+ type CounterRef,
376
+ type ClickOutsideRef,
377
+ type FocusRef,
378
+ type AsyncState,
379
+ type AsyncRef,
380
+ type AsyncOptions,
381
+ } from './use-utilities';
382
+ // Color Mode
383
+ export {
384
+ useColorMode,
385
+ useDark,
386
+ type ColorMode,
387
+ type ColorModeOptions,
388
+ type ColorModeRef,
389
+ type DarkRef,
390
+ } from './use-color-mode';
@@ -43,4 +43,4 @@ export declare interface BatteryRef {
43
43
  getPercentage: () => number
44
44
  isLow: (threshold?: number) => boolean
45
45
  isCritical: () => boolean
46
- }
46
+ }
@@ -54,5 +54,5 @@ export declare interface BroadcastChannelRef<T = unknown> {
54
54
  close: () => void
55
55
  isSupported: () => boolean
56
56
  }
57
- declare type BroadcastEventType = 'message' | 'error'
58
- declare type BroadcastEventCallback = (data: MessageEvent) => void
57
+ declare type BroadcastEventType = 'message' | 'error';
58
+ declare type BroadcastEventCallback = (data: MessageEvent) => void;
@@ -31,4 +31,4 @@ export declare interface ClipboardRef {
31
31
  copy: (text: string) => Promise<boolean>
32
32
  read: () => Promise<string>
33
33
  subscribe: (callback: (text: string) => void) => () => void
34
- }
34
+ }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Full-featured color-mode manager.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * const { mode, isDark, toggle, set } = useColorMode()
7
+ * toggle() // switch light↔dark
8
+ * set('auto') // follow system preference
9
+ * ```
10
+ */
11
+ export declare function useColorMode(options?: ColorModeOptions): ColorModeRef;
12
+ /**
13
+ * Convenience wrapper — just isDark, toggle, set.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const { isDark, toggle } = useDark()
18
+ * toggle()
19
+ * ```
20
+ */
21
+ export declare function useDark(options?: ColorModeOptions): DarkRef;
22
+ export declare interface ColorModeOptions {
23
+ storageKey?: string
24
+ initialMode?: ColorMode
25
+ darkClass?: string
26
+ attribute?: string
27
+ disableTransitions?: boolean
28
+ }
29
+ export declare interface ColorModeRef {
30
+ readonly mode: 'light' | 'dark'
31
+ readonly preference: ColorMode
32
+ readonly isDark: boolean
33
+ set: (mode: ColorMode) => void
34
+ toggle: () => void
35
+ subscribe: (fn: (mode: 'light' | 'dark', preference: ColorMode) => void) => () => void
36
+ }
37
+ export declare interface DarkRef {
38
+ readonly isDark: boolean
39
+ toggle: () => void
40
+ set: (dark: boolean) => void
41
+ subscribe: (fn: (isDark: boolean) => void) => () => void
42
+ }
43
+ /**
44
+ * useColorMode / useDark — Theme management composables
45
+ *
46
+ * Detect system preference, persist user choice, toggle dark/light mode,
47
+ * and sync across tabs — all with auto-cleanup.
48
+ */
49
+ // =============================================================================
50
+ // Types
51
+ // =============================================================================
52
+ export type ColorMode = 'light' | 'dark' | 'auto';
@@ -67,4 +67,4 @@ export declare interface CookieRef<T> {
67
67
  set: (value: T, options?: CookieOptions) => void
68
68
  remove: () => void
69
69
  subscribe: (callback: (value: T | null, prev: T | null) => void) => () => void
70
- }
70
+ }
@@ -106,4 +106,4 @@ export declare interface DeviceMotionRef {
106
106
  subscribe: (fn: (state: DeviceMotionState) => void) => () => void
107
107
  isSupported: () => boolean
108
108
  requestPermission: () => Promise<boolean>
109
- }
109
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Attach an event listener with auto-cleanup.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * // Listen on window (default)
7
+ * useEventListener('resize', () => console.log('resized'))
8
+ *
9
+ * // Listen on document
10
+ * useEventListener('click', handler, { target: document })
11
+ *
12
+ * // Listen on a specific element by selector
13
+ * useEventListener('click', handler, { target: '#my-button' })
14
+ *
15
+ * // Manual removal
16
+ * const { remove } = useEventListener('scroll', handler)
17
+ * remove()
18
+ * ```
19
+ */
20
+ export declare function useEventListener(event: string, handler: EventListenerOrEventListenerObject, options?: UseEventListenerOptions): EventListenerRef;
21
+ /**
22
+ * useEventListener - Event listener composable with auto-cleanup
23
+ *
24
+ * Attaches event listeners and automatically removes them on component destroy.
25
+ * Replaces raw `window.addEventListener` / `document.addEventListener` usage.
26
+ */
27
+ export declare interface UseEventListenerOptions {
28
+ target?: EventTarget | string
29
+ capture?: boolean
30
+ passive?: boolean
31
+ once?: boolean
32
+ }
33
+ export declare interface EventListenerRef {
34
+ remove: () => void
35
+ }
@@ -74,4 +74,4 @@ export declare interface EventSourceRef<T = unknown> {
74
74
  *
75
75
  * Reactive utilities for Server-Sent Events.
76
76
  */
77
- export type EventSourceStatus = 'connecting' | 'open' | 'closed' | 'error'
77
+ export type EventSourceStatus = 'connecting' | 'open' | 'closed' | 'error';
@@ -95,13 +95,14 @@ export declare interface EyeDropperRef {
95
95
  open: () => Promise<string | null>
96
96
  isSupported: () => boolean
97
97
  }
98
+ // Extend Window for EyeDropper
98
99
  declare interface EyeDropperConstructor {
99
100
  new (): {
100
101
  open: (options?: { signal?: AbortSignal }) => Promise<EyeDropperResult>
101
102
  }
102
103
  }
103
- declare namespace global {
104
+ declare global {
104
105
  interface Window {
105
106
  EyeDropper?: EyeDropperConstructor
106
107
  }
107
- }
108
+ }
@@ -81,4 +81,4 @@ export declare interface FetchRef<T> {
81
81
  execute: () => Promise<void>
82
82
  abort: () => void
83
83
  isLoading: () => boolean
84
- }
84
+ }
@@ -44,4 +44,4 @@ export declare interface FullscreenRef {
44
44
  enter: () => Promise<void>
45
45
  exit: () => Promise<void>
46
46
  toggle: () => Promise<void>
47
- }
47
+ }
@@ -59,4 +59,4 @@ export declare interface GeolocationRef {
59
59
  refresh: () => void
60
60
  pause: () => void
61
61
  resume: () => void
62
- }
62
+ }
@@ -32,7 +32,7 @@ export declare function useIdle(options?: IdleOptions): IdleRef;
32
32
  * })
33
33
  * ```
34
34
  */
35
- export declare function useIdleState(timeout?: any): void;
35
+ export declare function useIdleState(timeout?: number): void;
36
36
  /**
37
37
  * Track user's last active timestamp
38
38
  *
@@ -81,4 +81,4 @@ export declare interface IdleRef {
81
81
  subscribe: (fn: (state: IdleState) => void) => () => void
82
82
  reset: () => void
83
83
  isIdle: () => boolean
84
- }
84
+ }
@@ -78,4 +78,4 @@ export declare interface IntersectionObserverRef {
78
78
  stop: () => void
79
79
  start: () => void
80
80
  }
81
- declare type IntersectionCallback = (entry: IntersectionObserverEntry, observer: IntersectionObserver) => void
81
+ declare type IntersectionCallback = (entry: IntersectionObserverEntry, observer: IntersectionObserver) => void;
@@ -35,7 +35,6 @@ export declare const shortcuts: {
35
35
  refresh: 'ctrl+r';
36
36
  escape: 'escape';
37
37
  enter: 'enter';
38
- // Mac alternatives
39
38
  saveMac: 'meta+s';
40
39
  undoMac: 'meta+z';
41
40
  redoMac: 'meta+shift+z';
@@ -97,4 +96,4 @@ export declare interface HotkeyOptions {
97
96
  keyup?: boolean
98
97
  ignoreInputs?: boolean
99
98
  }
100
- declare type HotkeyCallback = (event: KeyboardEvent) => void
99
+ declare type HotkeyCallback = (event: KeyboardEvent) => void;
@@ -53,4 +53,4 @@ export declare const breakpoints: {
53
53
  export declare interface MediaQueryRef {
54
54
  matches: boolean
55
55
  subscribe: (callback: (matches: boolean) => void) => () => void
56
- }
56
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Reactive meta tag management.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * const meta = useMeta({
7
+ * title: 'My Page',
8
+ * description: 'A page description',
9
+ * og: { image: 'https://example.com/og.png' }
10
+ * })
11
+ *
12
+ * // Dynamic updates
13
+ * meta.setTitle('New Title')
14
+ * meta.setMeta('description', 'Updated description')
15
+ * meta.setOgMeta('image', 'https://example.com/new.png')
16
+ * ```
17
+ */
18
+ export declare function useMeta(options?: UseMetaOptions): MetaRef;
19
+ /**
20
+ * useMeta - Reactive meta tag management composable
21
+ *
22
+ * Provides clean APIs for managing `<meta>` tags without raw `document.querySelector`.
23
+ */
24
+ export declare interface UseMetaOptions {
25
+ title?: string
26
+ description?: string
27
+ meta?: Record<string, string>
28
+ og?: Record<string, string>
29
+ }
30
+ export declare interface MetaRef {
31
+ setMeta: (name: string, content: string) => void
32
+ setOgMeta: (property: string, content: string) => void
33
+ removeMeta: (name: string) => void
34
+ setTitle: (title: string) => void
35
+ }
@@ -61,4 +61,4 @@ export declare interface ElementMouseRef {
61
61
  get: () => ElementMouseState
62
62
  subscribe: (fn: (state: ElementMouseState) => void) => () => void
63
63
  stop: () => void
64
- }
64
+ }
@@ -98,4 +98,4 @@ export declare interface MutationObserverRef {
98
98
  disconnect: () => void
99
99
  takeRecords: () => MutationRecord[]
100
100
  isSupported: () => boolean
101
- }
101
+ }