diff --git a/docs/.vuepress/components/CssVariablesExample.vue b/docs/.vuepress/components/CssVariablesExample.vue new file mode 100644 index 000000000..62a58183c --- /dev/null +++ b/docs/.vuepress/components/CssVariablesExample.vue @@ -0,0 +1,78 @@ + + + + Override the value for --color-foreground: + + + + + + I am a text with the following color: + + + My color will be updated but not my label: + + {{ foreground }} + + + + + Stop listening + + + Resume listening + + + Manual label update + + + + + + + + diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index e195aff18..e68d9eeb1 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -166,7 +166,8 @@ module.exports = { ["composable/web/pageVisibility", "PageVisibilityAPI"], ["composable/web/language", "Language"], ["composable/web/broadcastChannel", "BroadcastChannel API"], - ["composable/web/geolocation", "Geolocation API"] + ["composable/web/geolocation", "Geolocation API"], + ["composable/web/cssVariables", "CSS variables"] ] }, { diff --git a/docs/README.md b/docs/README.md index 4c67382a0..44d1ef1f3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -102,6 +102,7 @@ Check out the [examples folder](examples) or start hacking on [codesandbox](http - [Language](composable/web/language) - reactive `NavigatorLanguage` - [BroadcastChannel](composable/web/broadcastChannel) - reactive `BroadcastChannel API` - [Geolocation](composable/web/geolocation) - reactive `Geolocation API` +- [CSS variables](composable/web/cssVariables) - reactive `CSS variables` ### Validation diff --git a/docs/api/web.api.md b/docs/api/web.api.md index b047b898c..a1b4c0e41 100644 --- a/docs/api/web.api.md +++ b/docs/api/web.api.md @@ -3,88 +3,115 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - -import { Ref } from '@vue/composition-api'; -import { RefElement } from '@vue-composable/core'; -import { RefTyped } from '@vue-composable/core'; +import { Ref } from "@vue/composition-api"; +import { RefElement } from "@vue-composable/core"; +import { RefTyped } from "@vue-composable/core"; // @public (undocumented) export type BreakpointObject = Record; // @public (undocumented) -export type BreakpointReturn = Record> & BreakpointReturnObject; +export type BreakpointReturn = Record> & + BreakpointReturnObject; // @public (undocumented) export interface BreakpointReturnObject { - // (undocumented) - current: Ref; - // (undocumented) - remove: RemoveEventFunction; + // (undocumented) + current: Ref; + // (undocumented) + remove: RemoveEventFunction; } // @public (undocumented) export interface BroadcastMessageEvent extends MessageEvent { - // (undocumented) - readonly data: T; + // (undocumented) + readonly data: T; +} + +// @public +export type CssVariable = string | null; + +// @public +export type CssVariableConfigurationObject = Record; + +// @public +export type CssVariableObject = Record>; + +// @public +export interface CssVariablesMethods { + get: (name: string, element: HTMLElement) => CssVariable; + resume: () => void; + set: (name: string, value: CssVariable, element: HTMLElement) => void; + stop: () => void; } // @public (undocumented) export interface DefaultTailwindBreakpoints { - // (undocumented) - lg: 1024; - // (undocumented) - md: 768; - // (undocumented) - sm: 640; - // (undocumented) - xl: 1280; + // (undocumented) + lg: 1024; + // (undocumented) + md: 768; + // (undocumented) + sm: 640; + // (undocumented) + xl: 1280; } // Warning: (ae-forgotten-export) The symbol "TailwindConfigEmpty" needs to be exported by the entry point index.d.ts // // @public (undocumented) -export type ExtractTailwindScreens = keyof T["theme"]["screens"] extends never ? DefaultTailwindBreakpoints : T["theme"]["screens"]; +export type ExtractTailwindScreens< + T extends TailwindConfigEmpty +> = keyof T["theme"]["screens"] extends never + ? DefaultTailwindBreakpoints + : T["theme"]["screens"]; // @public (undocumented) export interface GeolocationOptions { - immediate?: boolean; + immediate?: boolean; } +// @public +export function getVariableFor( + name: string, + element?: HTMLElement +): CssVariable; + // @public (undocumented) export interface IntersectionObserverOptions { - // (undocumented) - root?: RefTyped | null; - // (undocumented) - rootMargin?: RefTyped | string; - // (undocumented) - threshold?: RefTyped | number | number[]; + // (undocumented) + root?: RefTyped | null; + // (undocumented) + rootMargin?: RefTyped | string; + // (undocumented) + threshold?: RefTyped | number | number[]; } // @public (undocumented) export interface IntersectionObserverResult { - // (undocumented) - disconnect: () => void; - // (undocumented) - elements: Ref; - // (undocumented) - readonly isIntersecting: Ref; - // (undocumented) - observe: (el: RefTyped) => void; - // (undocumented) - supported: boolean; - // (undocumented) - unobserve: (el: RefTyped) => void; + // (undocumented) + disconnect: () => void; + // (undocumented) + elements: Ref; + // (undocumented) + readonly isIntersecting: Ref; + // (undocumented) + observe: (el: RefTyped) => void; + // (undocumented) + supported: boolean; + // (undocumented) + unobserve: (el: RefTyped) => void; } // @public (undocumented) export interface LocalStorageReturn { - clear: () => void; - remove: () => void; - setSync: (sync: boolean) => void; - // (undocumented) - storage: Ref; - // (undocumented) - supported: boolean; + clear: () => void; + remove: () => void; + setSync: (sync: boolean) => void; + // (undocumented) + storage: Ref; + // (undocumented) + supported: boolean; } // @public (undocumented) @@ -92,112 +119,144 @@ export type LocalStorageTyped = string; // @public (undocumented) export interface MouseMoveResult { - // (undocumented) - mouseX: Ref; - // (undocumented) - mouseY: Ref; - // (undocumented) - remove: RemoveEventFunction; + // (undocumented) + mouseX: Ref; + // (undocumented) + mouseY: Ref; + // (undocumented) + remove: RemoveEventFunction; } // @public (undocumented) export interface NetworkInformation { - // Warning: (ae-forgotten-export) The symbol "NetworkInformationEventMap" needs to be exported by the entry point index.d.ts - // - // (undocumented) - addEventListener(type: K, listener: (this: NetworkInformation, ev: NetworkInformationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - // (undocumented) - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - // (undocumented) - readonly downlink: number; - // (undocumented) - readonly downlinkMax: number; - // Warning: (ae-forgotten-export) The symbol "NetworkInformationEffectiveType" needs to be exported by the entry point index.d.ts - // - // (undocumented) - readonly effectiveType: NetworkInformationEffectiveType; - // (undocumented) - onchange: (this: NetworkInformation, ev: Event) => void; - // (undocumented) - removeEventListener(type: K, listener: (this: NetworkInformation, ev: NetworkInformationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - // (undocumented) - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; - // (undocumented) - readonly rtt: number; - // (undocumented) - readonly saveData: Boolean; - // Warning: (ae-forgotten-export) The symbol "NetworkInformationType" needs to be exported by the entry point index.d.ts - // - // (undocumented) - readonly type: NetworkInformationType; + // Warning: (ae-forgotten-export) The symbol "NetworkInformationEventMap" needs to be exported by the entry point index.d.ts + // + // (undocumented) + addEventListener( + type: K, + listener: ( + this: NetworkInformation, + ev: NetworkInformationEventMap[K] + ) => any, + options?: boolean | AddEventListenerOptions + ): void; + // (undocumented) + addEventListener( + type: string, + listener: EventListenerOrEventListenerObject, + options?: boolean | AddEventListenerOptions + ): void; + // (undocumented) + readonly downlink: number; + // (undocumented) + readonly downlinkMax: number; + // Warning: (ae-forgotten-export) The symbol "NetworkInformationEffectiveType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + readonly effectiveType: NetworkInformationEffectiveType; + // (undocumented) + onchange: (this: NetworkInformation, ev: Event) => void; + // (undocumented) + removeEventListener( + type: K, + listener: ( + this: NetworkInformation, + ev: NetworkInformationEventMap[K] + ) => any, + options?: boolean | EventListenerOptions + ): void; + // (undocumented) + removeEventListener( + type: string, + listener: EventListenerOrEventListenerObject, + options?: boolean | EventListenerOptions + ): void; + // (undocumented) + readonly rtt: number; + // (undocumented) + readonly saveData: Boolean; + // Warning: (ae-forgotten-export) The symbol "NetworkInformationType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + readonly type: NetworkInformationType; } // @public (undocumented) -export function refShared(defaultValue?: RefTyped, id?: string): Ref>; +export function refShared( + defaultValue?: RefTyped, + id?: string +): Ref>; // @public (undocumented) -export type RefSharedMessage = RefSharedMessageInit | RefSharedMessageSync | RefSharedMessageLeave | RefSharedMessageUpdate | RefSharedMessageSetMind | RefSharedMessagePing | RefSharedMessagePong; +export type RefSharedMessage = + | RefSharedMessageInit + | RefSharedMessageSync + | RefSharedMessageLeave + | RefSharedMessageUpdate + | RefSharedMessageSetMind + | RefSharedMessagePing + | RefSharedMessagePong; // @public (undocumented) export type RefSharedMessageInit = { - type: RefSharedMessageType.INIT; + type: RefSharedMessageType.INIT; }; // @public (undocumented) export type RefSharedMessageLeave = { - type: RefSharedMessageType.LEAVE; - id: number; + type: RefSharedMessageType.LEAVE; + id: number; }; // @public (undocumented) export type RefSharedMessagePing = { - type: RefSharedMessageType.PING; - id: number; + type: RefSharedMessageType.PING; + id: number; }; // @public (undocumented) export type RefSharedMessagePong = { - type: RefSharedMessageType.PONG; - id: number; + type: RefSharedMessageType.PONG; + id: number; }; // @public (undocumented) export type RefSharedMessageSetMind = { - type: RefSharedMessageType.SET_MIND; - mind: SharedRefMind; - id: number; + type: RefSharedMessageType.SET_MIND; + mind: SharedRefMind; + id: number; }; // @public (undocumented) export type RefSharedMessageSync = { - type: RefSharedMessageType.SYNC; - value: T; - mind: SharedRefMind; + type: RefSharedMessageType.SYNC; + value: T; + mind: SharedRefMind; }; // @public (undocumented) export const enum RefSharedMessageType { - // (undocumented) - INIT = 0, - // (undocumented) - LEAVE = 4, - // (undocumented) - PING = 5, - // (undocumented) - PONG = 6, - // (undocumented) - SET_MIND = 3, - // (undocumented) - SYNC = 1, - // (undocumented) - UPDATE = 2 + // (undocumented) + INIT = 0, + // (undocumented) + LEAVE = 4, + // (undocumented) + PING = 5, + // (undocumented) + PONG = 6, + // (undocumented) + SET_MIND = 3, + // (undocumented) + SYNC = 1, + // (undocumented) + UPDATE = 2 } // @public (undocumented) export type RefSharedMessageUpdate = { - type: RefSharedMessageType.UPDATE; - value: T; - mind: SharedRefMind; + type: RefSharedMessageType.UPDATE; + value: T; + mind: SharedRefMind; }; // @public (undocumented) @@ -205,42 +264,53 @@ export type RemoveEventFunction = () => void; // @public (undocumented) export interface ResizeResult { - // (undocumented) - height: Ref; - // (undocumented) - remove: RemoveEventFunction; - // (undocumented) - width: Ref; + // (undocumented) + height: Ref; + // (undocumented) + remove: RemoveEventFunction; + // (undocumented) + width: Ref; } // @public (undocumented) export interface ScrollResult { - // (undocumented) - remove: RemoveEventFunction; - // (undocumented) - scrollLeft: Ref; - // (undocumented) - scrollLeftTo: (x: number) => void; - // (undocumented) - scrollTo: Element["scrollTo"]; - // (undocumented) - scrollTop: Ref; - // (undocumented) - scrollTopTo: (y: number) => void; + // (undocumented) + remove: RemoveEventFunction; + // (undocumented) + scrollLeft: Ref; + // (undocumented) + scrollLeftTo: (x: number) => void; + // (undocumented) + scrollTo: Element["scrollTo"]; + // (undocumented) + scrollTop: Ref; + // (undocumented) + scrollTopTo: (y: number) => void; } // @public (undocumented) -export function setBreakpointTailwindCSS(tailwindConfig: T): BreakpointReturn>; +export function setBreakpointTailwindCSS( + tailwindConfig: T +): BreakpointReturn>; // @public (undocumented) -export function setBreakpointTailwindCSS(breakpoints: T): BreakpointReturn; +export function setBreakpointTailwindCSS( + breakpoints: T +): BreakpointReturn; + +// @public +export function setVariableFor( + name: string, + value: CssVariable, + element?: HTMLElement +): void; // @public (undocumented) export const enum SharedRefMind { - // (undocumented) - HIVE = 0, - // (undocumented) - MASTER = 1 + // (undocumented) + HIVE = 0, + // (undocumented) + MASTER = 1 } // @public (undocumented) @@ -248,14 +318,16 @@ export function storageAvailable(storage?: Storage): boolean; // @public (undocumented) export interface StorageSerializer { - // (undocumented) - parse(data: string): T; - // (undocumented) - stringify(item: T): string; + // (undocumented) + parse(data: string): T; + // (undocumented) + stringify(item: T): string; } // @public (undocumented) -export function useBreakpoint(breakpoints: Record): BreakpointReturn; +export function useBreakpoint( + breakpoints: Record +): BreakpointReturn; // Warning: (ae-forgotten-export) The symbol "ChromeBreakpoint" needs to be exported by the entry point index.d.ts // @@ -263,109 +335,190 @@ export function useBreakpoint(breakpoints: Record; // @public (undocumented) -export function useBreakpointTailwindCSS(tailwindConfig: T): BreakpointReturn>; +export function useBreakpointTailwindCSS( + tailwindConfig: T +): BreakpointReturn>; // @public (undocumented) -export function useBreakpointTailwindCSS(): BreakpointReturn>; +export function useBreakpointTailwindCSS< + T extends TailwindConfigEmpty +>(): BreakpointReturn>; // @public (undocumented) -export function useBreakpointTailwindCSS(): BreakpointReturn; +export function useBreakpointTailwindCSS(): BreakpointReturn< + DefaultTailwindBreakpoints +>; // @public (undocumented) -export function useBreakpointTailwindCSS(): BreakpointReturn; +export function useBreakpointTailwindCSS< + T extends BreakpointObject +>(): BreakpointReturn; // @public (undocumented) -export function useBroadcastChannel(name: string, onBeforeClose?: Function): { - supported: boolean; - data: import("@vue/composition-api").Ref; - messageEvent: import("@vue/composition-api").Ref; - errorEvent: import("@vue/composition-api").Ref; - errored: import("@vue/composition-api").Ref; - isClosed: import("@vue/composition-api").Ref; - send: (data: T) => void; - close: Function; - addListener: (cb: (ev: BroadcastMessageEvent) => void, options?: boolean | AddEventListenerOptions | undefined) => void; +export function useBroadcastChannel( + name: string, + onBeforeClose?: Function +): { + supported: boolean; + data: import("@vue/composition-api").Ref; + messageEvent: import("@vue/composition-api").Ref; + errorEvent: import("@vue/composition-api").Ref; + errored: import("@vue/composition-api").Ref; + isClosed: import("@vue/composition-api").Ref; + send: (data: T) => void; + close: Function; + addListener: ( + cb: (ev: BroadcastMessageEvent) => void, + options?: boolean | AddEventListenerOptions | undefined + ) => void; }; -// @public (undocumented) -export function useEvent any; - removeEventListener: Function; -}, M, K extends keyof M>(el: RefTyped, name: K, listener: (this: T, ev: M[K]) => any): RemoveEventFunction; +// @public +export type UseCssVariables = CssVariableObject & CssVariablesMethods; // @public (undocumented) -export function useEvent any; - removeEventListener: Function; -}, M, K extends keyof M>(el: RefTyped, name: K, listener: (this: T, ev: M[K]) => any, options?: boolean | AddEventListenerOptions): RemoveEventFunction; +export function useCssVariables( + variables: Record, + element?: HTMLElement +): UseCssVariables; // @public (undocumented) -export function useEvent(el: RefTyped, name: K, listener: (this: Document, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): RemoveEventFunction; - -// @public (undocumented) -export function useEvent(el: RefTyped, name: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): RemoveEventFunction; - -// @public (undocumented) -export function useFetch(options?: UseFetchOptions & Partial, requestInit?: RequestInit): { - cancel: (message?: string | undefined) => void; - isCancelled: import("@vue/composition-api").Ref; - cancelledMessage: import("@vue/composition-api").Ref; - text: import("@vue/composition-api").Ref; - blob: import("@vue/composition-api").Ref; - json: import("@vue/composition-api").Ref; - jsonError: import("@vue/composition-api").Ref; - status: Readonly>; - statusText: Readonly>; - exec: (request: RequestInfo, init?: RequestInit | undefined) => Promise; - promise: import("@vue/composition-api").Ref | undefined>; /** - * @description if the value is `true` it will parse the `json` before resolving the promise - * @default true - */ - result: import("@vue/composition-api").Ref; - loading: import("@vue/composition-api").Ref; - error: import("@vue/composition-api").Ref; +export function useEvent< + T extends { + addEventListener: ( + name: string, + listener: EventListenerOrEventListenerObject + ) => any; + removeEventListener: Function; + }, + M, + K extends keyof M +>( + el: RefTyped, + name: K, + listener: (this: T, ev: M[K]) => any +): RemoveEventFunction; + +// @public (undocumented) +export function useEvent< + T extends { + addEventListener: ( + name: string, + listener: EventListenerOrEventListenerObject, + options?: boolean | AddEventListenerOptions + ) => any; + removeEventListener: Function; + }, + M, + K extends keyof M +>( + el: RefTyped, + name: K, + listener: (this: T, ev: M[K]) => any, + options?: boolean | AddEventListenerOptions +): RemoveEventFunction; + +// @public (undocumented) +export function useEvent( + el: RefTyped, + name: K, + listener: (this: Document, ev: WindowEventMap[K]) => any, + options?: boolean | AddEventListenerOptions +): RemoveEventFunction; + +// @public (undocumented) +export function useEvent( + el: RefTyped, + name: K, + listener: (this: Document, ev: DocumentEventMap[K]) => any, + options?: boolean | AddEventListenerOptions +): RemoveEventFunction; + +// @public (undocumented) +export function useFetch( + options?: UseFetchOptions & Partial, + requestInit?: RequestInit +): { + cancel: (message?: string | undefined) => void; + isCancelled: import("@vue/composition-api").Ref; + cancelledMessage: import("@vue/composition-api").Ref; + text: import("@vue/composition-api").Ref; + blob: import("@vue/composition-api").Ref; + json: import("@vue/composition-api").Ref; + jsonError: import("@vue/composition-api").Ref; + status: Readonly>; + statusText: Readonly>; + exec: ( + request: RequestInfo, + init?: RequestInit | undefined + ) => Promise; + promise: import("@vue/composition-api").Ref | undefined> + /** + * @description if the value is `true` it will parse the `json` before resolving the promise + * @default true + */; + result: import("@vue/composition-api").Ref; + loading: import("@vue/composition-api").Ref; + error: import("@vue/composition-api").Ref; }; // @public (undocumented) export interface UseFetchOptions { - isJson?: boolean; - parseImmediate?: boolean; + isJson?: boolean; + parseImmediate?: boolean; } // @public (undocumented) -export function useGeolocation(options?: PositionOptions & GeolocationOptions): { - supported: boolean; - refresh: () => void; - error: import("@vue/composition-api").Ref; - timestamp: import("@vue/composition-api").Ref; - coords: import("@vue/composition-api").Ref; - highAccuracy: import("@vue/composition-api").Ref; +export function useGeolocation( + options?: PositionOptions & GeolocationOptions +): { + supported: boolean; + refresh: () => void; + error: import("@vue/composition-api").Ref; + timestamp: import("@vue/composition-api").Ref; + coords: import("@vue/composition-api").Ref; + highAccuracy: import("@vue/composition-api").Ref; }; // @public (undocumented) -export function useIntersectionObserver(el: RefElement, options?: RefTyped): IntersectionObserverResult; +export function useIntersectionObserver( + el: RefElement, + options?: RefTyped +): IntersectionObserverResult; // @public (undocumented) -export function useIntersectionObserver(options: RefTyped): IntersectionObserverResult; +export function useIntersectionObserver( + options: RefTyped +): IntersectionObserverResult; // @public (undocumented) export function useLanguage(): { - language: Ref; - languages: Ref; + language: Ref; + languages: Ref; }; // @public (undocumented) -export function useLocalStorage(key: string, defaultValue?: RefTyped, sync?: boolean): LocalStorageReturn; +export function useLocalStorage( + key: string, + defaultValue?: RefTyped, + sync?: boolean +): LocalStorageReturn; // @public (undocumented) -export function useLocalStorage(key: LocalStorageTyped | string, defaultValue?: RefTyped, sync?: boolean): LocalStorageReturn; +export function useLocalStorage( + key: LocalStorageTyped | string, + defaultValue?: RefTyped, + sync?: boolean +): LocalStorageReturn; // @public (undocumented) -export function useMatchMedia(query: string): { - supported: boolean; - mediaQueryList: Ref; - matches: Ref; - remove: () => void; +export function useMatchMedia( + query: string +): { + supported: boolean; + mediaQueryList: Ref; + matches: Ref; + remove: () => void; }; // Warning: (ae-forgotten-export) The symbol "NetworkInformationReturn" needs to be exported by the entry point index.d.ts @@ -375,33 +528,52 @@ export function useNetworkInformation(): NetworkInformationReturn; // @public (undocumented) export function useOnline(): { - supported: boolean; - online: Ref; + supported: boolean; + online: Ref; }; // @public (undocumented) -export function useOnMouseMove(el: RefTyped, wait: number): MouseMoveResult; +export function useOnMouseMove( + el: RefTyped, + wait: number +): MouseMoveResult; // @public (undocumented) -export function useOnMouseMove(el: RefTyped, options?: boolean | AddEventListenerOptions, wait?: number): MouseMoveResult; +export function useOnMouseMove( + el: RefTyped, + options?: boolean | AddEventListenerOptions, + wait?: number +): MouseMoveResult; // @public (undocumented) export function useOnMouseMove(el: RefElement, wait: number): MouseMoveResult; // @public (undocumented) -export function useOnMouseMove(el: RefElement, options?: boolean | AddEventListenerOptions, wait?: number): MouseMoveResult; +export function useOnMouseMove( + el: RefElement, + options?: boolean | AddEventListenerOptions, + wait?: number +): MouseMoveResult; // @public (undocumented) export function useOnResize(el: RefTyped, wait: number): ResizeResult; // @public (undocumented) -export function useOnResize(el: RefTyped, options?: boolean | AddEventListenerOptions, wait?: number): ResizeResult; +export function useOnResize( + el: RefTyped, + options?: boolean | AddEventListenerOptions, + wait?: number +): ResizeResult; // @public (undocumented) export function useOnResize(el: RefElement, wait: number): ResizeResult; // @public (undocumented) -export function useOnResize(el: RefElement, options?: boolean | AddEventListenerOptions, wait?: number): ResizeResult; +export function useOnResize( + el: RefElement, + options?: boolean | AddEventListenerOptions, + wait?: number +): ResizeResult; // @public (undocumented) export function useOnScroll(): ScrollResult; @@ -410,99 +582,139 @@ export function useOnScroll(): ScrollResult; export function useOnScroll(wait: number): ScrollResult; // @public (undocumented) -export function useOnScroll(options: boolean | AddEventListenerOptions, wait?: number): ScrollResult; +export function useOnScroll( + options: boolean | AddEventListenerOptions, + wait?: number +): ScrollResult; // @public (undocumented) export function useOnScroll(el: RefTyped, wait: number): ScrollResult; // @public (undocumented) -export function useOnScroll(el: RefTyped, options?: boolean | AddEventListenerOptions, wait?: number): ScrollResult; +export function useOnScroll( + el: RefTyped, + options?: boolean | AddEventListenerOptions, + wait?: number +): ScrollResult; // @public (undocumented) export function useOnScroll(el: RefElement, wait: number): ScrollResult; // @public (undocumented) -export function useOnScroll(el: RefElement, options?: boolean | AddEventListenerOptions, wait?: number): ScrollResult; +export function useOnScroll( + el: RefElement, + options?: boolean | AddEventListenerOptions, + wait?: number +): ScrollResult; // @public (undocumented) export function usePageVisibility(): { - visibility: Ref; - hidden: Ref; + visibility: Ref; + hidden: Ref; }; // @public (undocumented) -export function useSessionStorage(key: string, defaultValue?: RefTyped, sync?: boolean): LocalStorageReturn; - -// @public (undocumented) -export function useSessionStorage(key: LocalStorageTyped | string, defaultValue?: RefTyped, sync?: boolean): LocalStorageReturn; - -// @public (undocumented) -export function useSharedRef(name: string, defaultValue?: T): { - supported: boolean; - id: number; - data: Ref; - master: Ref; - mind: Ref; - editable: Readonly>; - targets: Ref; - ping: () => void; - setMind: (t: SharedRefMind) => void; - addListener: (cb: (ev: BroadcastMessageEvent>) => void, options?: boolean | AddEventListenerOptions | undefined) => void; +export function useSessionStorage( + key: string, + defaultValue?: RefTyped, + sync?: boolean +): LocalStorageReturn; + +// @public (undocumented) +export function useSessionStorage( + key: LocalStorageTyped | string, + defaultValue?: RefTyped, + sync?: boolean +): LocalStorageReturn; + +// @public (undocumented) +export function useSharedRef( + name: string, + defaultValue?: T +): { + supported: boolean; + id: number; + data: Ref; + master: Ref; + mind: Ref; + editable: Readonly>; + targets: Ref; + ping: () => void; + setMind: (t: SharedRefMind) => void; + addListener: ( + cb: (ev: BroadcastMessageEvent>) => void, + options?: boolean | AddEventListenerOptions | undefined + ) => void; }; // @public (undocumented) -export function useStorage(key: string, defaultValue?: RefTyped, sync?: boolean): LocalStorageReturn; - -// @public (undocumented) -export function useStorage(key: LocalStorageTyped | string, defaultValue?: RefTyped, sync?: boolean): LocalStorageReturn; - -// @public (undocumented) -export function useWebSocket(url: string, protocols?: string | string[]): { - supported: boolean; - ws: WebSocket | null; - send: (data: string | ArrayBuffer | SharedArrayBuffer | Blob | ArrayBufferView) => void; - close: (code?: number | undefined, reason?: string | undefined) => void; - messageEvent: import("@vue/composition-api").Ref; - errorEvent: import("@vue/composition-api").Ref; - data: import("@vue/composition-api").Ref; - isOpen: import("@vue/composition-api").Ref; - isClosed: import("@vue/composition-api").Ref; - errored: import("@vue/composition-api").Ref; +export function useStorage( + key: string, + defaultValue?: RefTyped, + sync?: boolean +): LocalStorageReturn; + +// @public (undocumented) +export function useStorage( + key: LocalStorageTyped | string, + defaultValue?: RefTyped, + sync?: boolean +): LocalStorageReturn; + +// @public (undocumented) +export function useWebSocket( + url: string, + protocols?: string | string[] +): { + supported: boolean; + ws: WebSocket | null; + send: ( + data: string | ArrayBuffer | SharedArrayBuffer | Blob | ArrayBufferView + ) => void; + close: (code?: number | undefined, reason?: string | undefined) => void; + messageEvent: import("@vue/composition-api").Ref; + errorEvent: import("@vue/composition-api").Ref; + data: import("@vue/composition-api").Ref; + isOpen: import("@vue/composition-api").Ref; + isClosed: import("@vue/composition-api").Ref; + errored: import("@vue/composition-api").Ref; }; // Warning: (ae-forgotten-export) The symbol "WebStorageType" needs to be exported by the entry point index.d.ts // // @public (undocumented) -export function useWebStorage(type: WebStorageType, serializer?: StorageSerializer, ms?: number): { - supported: boolean; - quotaError: Ref; - store: WebStorage; - remove: () => boolean; +export function useWebStorage( + type: WebStorageType, + serializer?: StorageSerializer, + ms?: number +): { + supported: boolean; + quotaError: Ref; + store: WebStorage; + remove: () => boolean; }; // @public (undocumented) export interface WebStorage { - // (undocumented) - $quotaError: Ref
--color-foreground