import { CancellablePromiseResult } from '@vue-composable/core'; import { PromiseResultFactory } from '@vue-composable/core'; import { Ref } from '@vue/composition-api'; import { RefElement } from '@vue-composable/core'; import { RefTyped } from '@vue-composable/core'; export declare type BreakpointObject = Record; export declare type BreakpointReturn = Record> & BreakpointReturnObject; export declare interface BreakpointReturnObject { remove: RemoveEventFunction; current: Ref; } export declare interface BroadcastMessageEvent extends MessageEvent { readonly data: T; } declare type ChromeBreakpoint = { mobileS: 320; mobileM: 375; mobileL: 425; tablet: 768; laptop: 1024; laptopL: 1440; desktop4K: 2560; }; /** * Possible configuration */ export declare type CssVarDef = CssVarDefinition | string; /** * API to assign a value to the css variable */ export declare interface CssVarDefinition { name: string; value: RefTyped; } /** * The values a CSS variable can contain. */ export declare type CssVariable = string | null; /** * A CSS Variable configuration object. Each value must be a CSS variable without the leading dashes. */ export declare type CssVariableConfigurationObject = Record; /** * The CSS variable return object. Each value is a `Ref` of a CSS variable's contents. */ export declare type CssVariableObject = Record>; /** * Additional methods. */ export declare interface CssVariablesMethods { /** * Stops the observation. */ stop: () => void; /** * Resumes the observation. */ resume: () => void; /** * current observing state */ observing: Ref; supported: boolean; } export declare type CurrencyCodes = "AFA" | "ALL" | "DZD" | "AOR" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BSD" | "BHD" | "BDT" | "BBD" | "BYN" | "BZD" | "BMD" | "BTN" | "BOB" | "BWP" | "BRL" | "GBP" | "BND" | "BGN" | "BIF" | "KHR" | "CAD" | "CVE" | "KYD" | "XOF" | "XAF" | "XPF" | "CLP" | "CNY" | "COP" | "KMF" | "CDF" | "CRC" | "HRK" | "CUP" | "CZK" | "DKK" | "DJF" | "DOP" | "XCD" | "EGP" | "SVC" | "ERN" | "EEK" | "ETB" | "EUR" | "FKP" | "FJD" | "GMD" | "GEL" | "GHS" | "GIP" | "XAU" | "XFO" | "GTQ" | "GNF" | "GYD" | "HTG" | "HNL" | "HKD" | "HUF" | "ISK" | "XDR" | "INR" | "IDR" | "IRR" | "IQD" | "ILS" | "JMD" | "JPY" | "JOD" | "KZT" | "KES" | "KWD" | "KGS" | "LAK" | "LVL" | "LBP" | "LSL" | "LRD" | "LYD" | "LTL" | "MOP" | "MKD" | "MGA" | "MWK" | "MYR" | "MVR" | "MRO" | "MUR" | "MXN" | "MDL" | "MNT" | "MAD" | "MZN" | "MMK" | "NAD" | "NPR" | "ANG" | "NZD" | "NIO" | "NGN" | "KPW" | "NOK" | "OMR" | "PKR" | "XPD" | "PAB" | "PGK" | "PYG" | "PEN" | "PHP" | "XPT" | "PLN" | "QAR" | "RON" | "RUB" | "RWF" | "SHP" | "WST" | "STD" | "SAR" | "RSD" | "SCR" | "SLL" | "XAG" | "SGD" | "SBD" | "SOS" | "ZAR" | "KRW" | "LKR" | "SDG" | "SRD" | "SZL" | "SEK" | "CHF" | "SYP" | "TWD" | "TJS" | "TZS" | "THB" | "TOP" | "TTD" | "TND" | "TRY" | "TMT" | "AED" | "UGX" | "XFU" | "UAH" | "UYU" | "USD" | "UZS" | "VUV" | "VEF" | "VND" | "YER" | "ZMK" | "ZWL"; export declare type CurrencyDisplay = "none" | "symbol" | "code"; export declare interface CurrencyFormatReturn { format: (amount: RefTyped, currency?: Readonly>>, display?: RefTyped, overrideOptions?: RefTyped, overrideLocale?: RefTyped) => Ref>; formatString: (amount: RefTyped, currency?: Readonly>>, display?: RefTyped, overrideOptions?: RefTyped, overrideLocale?: RefTyped) => string; } declare interface DefaultTailwindBreakpoints { sm: 640; md: 768; lg: 1024; xl: 1280; } export declare function exposeWorker(this: Worker, func: (...args: any[]) => any): void; declare type ExtractArguments = T extends (...args: infer TArgs) => void ? TArgs : never; declare type ExtractTailwindScreens = keyof T["theme"]["screens"] extends never ? DefaultTailwindBreakpoints : T["theme"]["screens"]; declare interface FetchReturn extends PromiseResultFactory, ExtractArguments<(request: RequestInfo, init?: RequestInit) => void>> { cancel(message?: string): void; isCancelled: Ref>; cancelledMessage: Ref>; text: Ref>; blob: Ref>; json: Ref; jsonError: Ref; status: Ref; statusText: Ref; } export declare interface GeolocationOptions { /** * @description Executes request location immediately * @default true */ immediate?: boolean; } /** * Gets the current value of the given CSS variable name for the given element. * * @param element The element to get the variable for. * @param name The CSS variable name. */ export declare function getCssVariableFor(element: HTMLElement, name: string): CssVariable; export declare interface IntersectionObserverOptions { root?: RefTyped | null; rootMargin?: RefTyped | string; threshold?: RefTyped | number | number[]; } export declare interface IntersectionObserverResult { supported: boolean; elements: Ref; observe: (el: RefTyped) => void; unobserve: (el: RefTyped) => void; disconnect: () => void; readonly isIntersecting: Ref; } export declare type IntlNumberFormatLocales = RefTyped | RefTyped | undefined; export declare type IntlNumberFormatOptions = Intl.NumberFormatOptions & { style?: IntNumberFormatOptionStyle & string; currency?: CurrencyCodes & string; currencyDisplay?: CurrencyDisplay & string; }; export declare type IntNumberFormatOptionStyle = /** * A decimal style format */ "decimal" /** * A percent style format. */ | "percent" /** * A currency style format that uses the currency symbol defined by the number formatter locale. */ | "currency" /** * A unit format */ | "unit"; export declare type IntNumberFormatterFormat = (value: Readonly>>, overrideOpts?: RefTyped, overrideLocale?: RefTyped) => T; export declare interface LocalStorageReturn { supported: boolean; storage: Ref; /** * @description Removes current item from the store */ remove: () => void; /** * @description Clears all tracked localStorage items */ clear: () => void; /** * @description Enable cross tab syncing */ setSync: (sync: boolean) => void; } export declare type LocalStorageTyped = string; export declare interface MouseMoveResult { mouseX: Ref; mouseY: Ref; remove: RemoveEventFunction; } export declare interface NetworkInformation { readonly downlink: number; readonly downlinkMax: number; readonly effectiveType: NetworkInformationEffectiveType; readonly rtt: number; readonly saveData: Boolean; readonly type: NetworkInformationType; onchange: (this: NetworkInformation, ev: Event) => void; addEventListener(type: K, listener: (this: NetworkInformation, ev: NetworkInformationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: NetworkInformation, ev: NetworkInformationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare type NetworkInformationEffectiveType = "slow-2g" | "2g" | "3g" | "4g"; declare interface NetworkInformationEventMap { change: Event; } declare interface NetworkInformationReturn { readonly supported: boolean; /** * @description Returns the effective bandwidth estimate in megabits per second, rounded to the nearest multiple of 25 kilobits per seconds */ readonly downlink: Ref; /** * @description Returns the maximum downlink speed, in megabits per second (Mbps), for the underlying connection technology. */ readonly downlinkMax: Ref; /** * @description Returns the effective type of the connection meaning one of 'slow-2g', '2g', '3g', or '4g'. This value is determined using a combination of recently observed round-trip time and downlink values. */ readonly effectiveType: Ref; /** * @description Returns the estimated effective round-trip time of the current connection, rounded to the nearest multiple of 25 milliseconds. */ readonly rtt: Ref; /** * @description Returns true if the user has set a reduced data usage option on the user agent. */ readonly saveData: Ref; /** * @description Returns the type of connection a device is using to communicate with the network. It will be one of the following values: * @enum { NetworkInformationType} */ readonly type: Ref; remove: RemoveEventFunction; } declare type NetworkInformationType = "bluetooth" | "cellular" | "ethernet" | "mixed" | "none" | "other" | "unknown" | "wifi" | "wimax"; export declare interface NumberFormatReturn { formatter: Ref>; format: IntNumberFormatterFormat>>; formatString: IntNumberFormatterFormat; } export declare function refShared(defaultValue?: RefTyped, id?: string): Ref>; export declare type RefSharedMessage = RefSharedMessageInit | RefSharedMessageSync | RefSharedMessageLeave | RefSharedMessageUpdate | RefSharedMessageSetMind | RefSharedMessagePing | RefSharedMessagePong; export declare type RefSharedMessageInit = { type: RefSharedMessageType.INIT; }; export declare type RefSharedMessageLeave = { type: RefSharedMessageType.LEAVE; id: number; }; export declare type RefSharedMessagePing = { type: RefSharedMessageType.PING; id: number; }; export declare type RefSharedMessagePong = { type: RefSharedMessageType.PONG; id: number; }; export declare type RefSharedMessageSetMind = { type: RefSharedMessageType.SET_MIND; mind: SharedRefMind; id: number; }; export declare type RefSharedMessageSync = { type: RefSharedMessageType.SYNC; value: T; mind: SharedRefMind; }; export declare const enum RefSharedMessageType { INIT = 0, SYNC = 1, UPDATE = 2, SET_MIND = 3, LEAVE = 4, PING = 5, PONG = 6 } export declare type RefSharedMessageUpdate = { type: RefSharedMessageType.UPDATE; value: T; mind: SharedRefMind; }; export declare type RemoveEventFunction = () => void; export declare interface ResizeResult { height: Ref; width: Ref; remove: RemoveEventFunction; } export declare interface ScrollResult { scrollTop: Ref; scrollLeft: Ref; remove: RemoveEventFunction; scrollTo: Element["scrollTo"]; scrollTopTo: (y: number) => void; scrollLeftTo: (x: number) => void; } export declare function setBreakpointTailwindCSS(tailwindConfig: T): BreakpointReturn>; export declare function setBreakpointTailwindCSS(breakpoints: T): BreakpointReturn; /** * Sets the value of the given CSS variable for the given element. * * @param element The element to set the variable for. * @param name The CSS variable name without dashes. * @param value The CSS variable value. */ export declare function setCssVariableFor(element: HTMLElement, name: string, value: CssVariable): void; export declare const enum SharedRefMind { HIVE = 0, MASTER = 1 } export declare function storageAvailable(storage?: Storage): boolean; export declare interface StorageSerializer { stringify(item: T): string; parse(data: string): T; } declare interface TailwindConfigEmpty { theme: { screens: Record | undefined | null>; }; } declare type TailwindScreen = TailwindScreenBreakpointRaw | TailwindScreenBreakpointRange | number | string | Array; declare interface TailwindScreenBreakpointRange { min?: string | number; max?: string | number; } declare interface TailwindScreenBreakpointRaw { raw: string; } export declare function useBreakpoint(breakpoints: Record): BreakpointReturn; export declare function useBreakpointChrome(): BreakpointReturn; export declare function useBreakpointTailwindCSS(tailwindConfig: T): BreakpointReturn>; export declare function useBreakpointTailwindCSS(): BreakpointReturn>; export declare function useBreakpointTailwindCSS(): BreakpointReturn; export declare function useBreakpointTailwindCSS(): BreakpointReturn; export declare 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; }; /** * Returns object. Consists of multiple pairs of key/CSS variable value references and the additional methods. */ export declare type UseCssVariables = CssVariableObject & CssVariablesMethods; /** * * @param variables * @param element */ export declare function useCssVariables(variables: T): UseCssVariables; export declare function useCssVariables(variables: T, options?: MutationObserverInit): UseCssVariables; export declare function useCssVariables(variables: T, element: RefTyped, options?: MutationObserverInit): UseCssVariables; export declare function useCurrencyFormat(): CurrencyFormatReturn; export declare function useCurrencyFormat(options: RefTyped, locales?: IntlNumberFormatLocales): CurrencyFormatReturn; export declare function useCurrencyFormat(currencyCode: Readonly>>): CurrencyFormatReturn; export declare function useCurrencyFormat(currencyCode: Ref | string): CurrencyFormatReturn; export declare function useCurrencyFormat(currencyCode: Readonly>>, locales: IntlNumberFormatLocales, options?: RefTyped): CurrencyFormatReturn; export declare function useCurrencyFormat(currencyCode: Ref | string, locales: IntlNumberFormatLocales, options?: RefTyped): CurrencyFormatReturn; export declare function useCurrencyFormat(currencyCode: Readonly>>, options: RefTyped): CurrencyFormatReturn; export declare function useCurrencyFormat(currencyCode: Ref | string, options: RefTyped): CurrencyFormatReturn; export declare function useEvent any; removeEventListener: Function; }, M, K extends keyof M>(el: T | Ref, name: K, listener: (this: T, ev: M[K]) => any): RemoveEventFunction; export declare function useEvent any; removeEventListener: Function; }, M, K extends keyof M>(el: T | Ref, name: K, listener: (this: T, ev: M[K]) => any, options?: boolean | AddEventListenerOptions): RemoveEventFunction; export declare function useEvent(el: RefTyped, name: K, listener: (this: Document, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): RemoveEventFunction; export declare function useEvent(el: Element | Ref, name: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): RemoveEventFunction; export declare function useFetch(request?: Partial, init?: RequestInit & UseFetchOptions): FetchReturn; export declare function useFetch(init?: RequestInit & UseFetchOptions): FetchReturn; export declare interface UseFetchOptions { /** * @description if the value is `true` it will parse the response automatically `json` * @default true */ isJson?: boolean; /** * @description if the value is `true` it will parse the `json` before resolving the promise * @default true */ parseImmediate?: boolean; } export declare 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 declare function useIntersectionObserver(el: RefElement, options?: RefTyped): IntersectionObserverResult; export declare function useIntersectionObserver(options: RefTyped): IntersectionObserverResult; export declare function useIntlNumberFormat(): NumberFormatReturn; export declare function useIntlNumberFormat(locales: IntlNumberFormatLocales): NumberFormatReturn; export declare function useIntlNumberFormat(options: RefTyped): NumberFormatReturn; export declare function useIntlNumberFormat(options: RefTyped): NumberFormatReturn; export declare function useIntlNumberFormat(locales: IntlNumberFormatLocales, options?: RefTyped): NumberFormatReturn; export declare function useIntlNumberFormat(locales: IntlNumberFormatLocales, options: RefTyped): NumberFormatReturn; export declare function useLanguage(): { language: Ref; languages: Ref; }; export declare function useLocalStorage(key: string, defaultValue?: RefTyped, sync?: boolean): LocalStorageReturn; export declare function useLocalStorage(key: LocalStorageTyped | string, defaultValue?: RefTyped, sync?: boolean): LocalStorageReturn; export declare function useMatchMedia(query: string): { supported: boolean; mediaQueryList: Ref; matches: Ref; remove: () => void; }; export declare function useNetworkInformation(): NetworkInformationReturn; export declare function useOnline(): { supported: boolean; online: Ref; }; export declare function useOnMouseMove(el: RefTyped, wait: number): MouseMoveResult; export declare function useOnMouseMove(el: RefTyped, options?: boolean | AddEventListenerOptions, wait?: number): MouseMoveResult; export declare function useOnMouseMove(el: RefElement, wait: number): MouseMoveResult; export declare function useOnMouseMove(el: RefElement, options?: boolean | AddEventListenerOptions, wait?: number): MouseMoveResult; export declare function useOnResize(el: RefTyped, wait: number): ResizeResult; export declare function useOnResize(el: RefTyped, options?: boolean | AddEventListenerOptions, wait?: number): ResizeResult; export declare function useOnResize(el: RefElement, wait: number): ResizeResult; export declare function useOnResize(el: RefElement, options?: boolean | AddEventListenerOptions, wait?: number): ResizeResult; export declare function useOnScroll(): ScrollResult; export declare function useOnScroll(wait: number): ScrollResult; export declare function useOnScroll(options: boolean | AddEventListenerOptions, wait?: number): ScrollResult; export declare function useOnScroll(el: RefTyped, wait: number): ScrollResult; export declare function useOnScroll(el: RefTyped, options?: boolean | AddEventListenerOptions, wait?: number): ScrollResult; export declare function useOnScroll(el: RefElement, wait: number): ScrollResult; export declare function useOnScroll(el: RefElement, options?: boolean | AddEventListenerOptions, wait?: number): ScrollResult; export declare function usePageVisibility(): { visibility: Ref; hidden: Ref; }; export declare function useSessionStorage(key: string, defaultValue?: RefTyped, sync?: boolean): LocalStorageReturn; export declare function useSessionStorage(key: LocalStorageTyped | string, defaultValue?: RefTyped, sync?: boolean): LocalStorageReturn; export declare 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 declare function useStorage(key: string, defaultValue?: RefTyped, sync?: boolean): LocalStorageReturn; export declare function useStorage(key: LocalStorageTyped | string, defaultValue?: RefTyped, sync?: boolean): LocalStorageReturn; export declare 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 declare function useWebStorage(type: WebStorageType, serializer?: StorageSerializer, ms?: number): { supported: boolean; quotaError: Ref; store: WebStorage; remove: () => boolean; }; export declare function useWorker(stringUrl: string | URL, args?: TArgs, options?: WorkerOptions): { worker: undefined; data: import("@vue/composition-api").Ref; postMessage: () => void; terminate: () => void; errorEvent: import("@vue/composition-api").Ref; errored: import("@vue/composition-api").Ref; terminated: import("@vue/composition-api").Ref; } | { worker: Worker; data: import("@vue/composition-api").Ref; postMessage: (data: TArgs) => void; terminate: () => void; errorEvent: import("@vue/composition-api").Ref; errored: import("@vue/composition-api").Ref; terminated: import("@vue/composition-api").Ref; }; export declare function useWorkerFunction>(fn: (...args: TArgs) => T, options?: WebWorkerFunctionOptions): PromiseResultFactory, TArgs> & CancellablePromiseResult; export declare interface WebStorage { $refMap: Map>; $watchHandlers: Map; $syncKeys: Record; $quotaError: Ref; updateItem(key: string, value: string): void; setSync(key: string, sync: boolean): void; /** * Returns the number of key/value pairs currently present in the list associated with the object. */ readonly length: number; /** * Empties the list associated with the object of all key/value pairs, if there are any. */ clear(): void; /** * Returns the current value associated with the given key, or null if the given key does not exist in the list associated with the object. */ getItem(key: string): Ref | null; /** * Returns the name of the nth key in the list, or null if n is greater than or equal to the number of key/value pairs in the object. */ key(index: number): string | null; /** * Removes the key/value pair with the given key from the list associated with the object, if a key/value pair with the given key exists. */ removeItem(key: string): void; /** * Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously. * * Throws a "QuotaExceededError" DOMException exception if the new value couldn't be set. (Setting could fail if, e.g., the user has disabled storage for the site, or if the quota has been exceeded.) */ setItem(key: string, value: T): Ref; } declare type WebStorageType = "localStorage" | "sessionStorage"; export declare interface WebWorkerFunctionOptions { dependencies?: RefTyped; timeout?: RefTyped; } export { }