New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-composable

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-composable - npm Package Compare versions

Comparing version 1.0.0-dev.21 to 1.0.0-dev.22

1303

dist/vue-composable.d.ts

@@ -0,5 +1,1304 @@

import { Ref } from '@vue/composition-api';
import { Ref as Ref_2 } from 'vue3';
export * from "@vue-composable/core";
export * from "@vue-composable/web";
export declare interface ArrayPaginationResult<T extends Array<any>> extends PaginationResult {
result: ComputedRef<T>;
}
export declare type BreakpointObject = Record<string, string | number>;
export declare type BreakpointReturn<T> = Record<keyof T, Ref<boolean>> & BreakpointReturnObject<T>;
export declare interface BreakpointReturnObject<T> {
remove: RemoveEventFunction;
current: Ref<keyof T | undefined>;
}
export declare interface BroadcastMessageEvent<T> extends MessageEvent {
readonly data: T;
}
/**
* Builds i18n object based on the definition
* @param definition - i18n definition
*/
export declare function buildI18n<T extends i18nDefinition<TMessage>, TMessage extends Record<keyof T["messages"], i18n | (() => Promise<any>)>>(definition: T): i18nResult<keyof T["messages"], I18nExtractLocale<T["messages"][T["locale"]]>>;
export declare interface CancellablePromiseResult<TCancel = any> {
cancel: (result?: TCancel) => void;
cancelled: Ref<boolean>;
}
declare const CancellationToken: unique symbol;
declare type ChromeBreakpoint = {
mobileS: 320;
mobileM: 375;
mobileL: 425;
tablet: 768;
laptop: 1024;
laptopL: 1440;
desktop4K: 2560;
};
declare type ComputedRef<T> = Readonly<Ref<Readonly<T>>>;
/**
* 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<string>;
}
/**
* 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<string, CssVarDef>;
/**
* The CSS variable return object. Each value is a `Ref` of a CSS variable's contents.
*/
export declare type CssVariableObject<T> = Record<keyof T, Ref<CssVariable>>;
/**
* Additional methods.
*/
export declare interface CssVariablesMethods {
/**
* Stops the observation.
*/
stop: () => void;
/**
* Resumes the observation.
*/
resume: () => void;
/**
* current observing state
*/
observing: Ref<boolean>;
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<number>, currency?: Readonly<RefTyped<Readonly<CurrencyCodes>>>, display?: RefTyped<CurrencyDisplay>, overrideOptions?: RefTyped<IntlNumberFormatOptions>, overrideLocale?: RefTyped<IntlNumberFormatLocales>) => Ref<Readonly<string>>;
formatString: (amount: RefTyped<number>, currency?: Readonly<RefTyped<Readonly<CurrencyCodes>>>, display?: RefTyped<CurrencyDisplay>, overrideOptions?: RefTyped<IntlNumberFormatOptions>, overrideLocale?: RefTyped<IntlNumberFormatLocales>) => string;
}
export declare function debounce<F extends Procedure>(func: F, waitMilliseconds?: number, options?: Options): F;
export declare function deepClone<T extends object = object>(result: T, ...sources: T[]): T;
declare interface DefaultTailwindBreakpoints {
sm: 640;
md: 768;
lg: 1024;
xl: 1280;
}
declare const ExecutionId: unique symbol;
export declare const exponentialDelay: RetryDelayFactory;
export declare function exposeWorker(this: Worker, func: (...args: any[]) => any): void;
declare type ExtractArguments<T = any> = T extends (...args: infer TArgs) => void ? TArgs : never;
declare type ExtractTailwindScreens<T extends TailwindConfigEmpty> = keyof T["theme"]["screens"] extends never ? DefaultTailwindBreakpoints : T["theme"]["screens"];
declare type Factory<T, TArgs extends Array<any>, TReturn = T> = (...args: TArgs) => TReturn;
export declare const FALSE_OP: () => boolean;
declare interface FetchReturn<T> extends PromiseResultFactory<Promise<Response>, ExtractArguments<(request: RequestInfo, init?: RequestInit) => void>> {
cancel(message?: string): void;
isCancelled: Ref<Readonly<boolean>>;
cancelledMessage: Ref<Readonly<string | undefined>>;
text: Ref<Readonly<string>>;
blob: Ref<Readonly<Blob | undefined>>;
json: Ref<T | null>;
jsonError: Ref<string>;
status: Ref<number | null>;
statusText: Ref<string | null>;
}
export declare interface FormatObject {
[id: string]: FormatValue;
}
export declare type FormatValue = RefTyped<object> | RefTyped<string> | RefTyped<number>;
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;
/**
* i18n interface
* * check [typescript documentation](https://pikax.me/vue-composable/composable/i18n/i18n.html#global-definition)
* * @example
* ```ts
* // types.d.ts
* declare module "@vue-composable/core" {
* interface i18n {
* hello: string;
* }
* }
* ```
*/
export declare interface i18n extends Record<string, i18nMessageValue> {
}
/**
* i18n definition
*/
export declare interface i18nDefinition<TMessage> {
/**
* Default and current locale
* If locale and fallback are different, you may need to wait until next tick to
* get the correct i18n values
*/
locale: keyof TMessage;
/**
* Fallback locale, it will be used if the current locale doesn't
* have value for the key.
* Only used if `notFoundFallback !== false`
*/
fallback?: keyof TMessage;
/**
* Object containing locale and messages for locale
*/
messages: {
[K in keyof TMessage]: i18n | (() => Promise<i18n>) | (() => i18n);
};
/**
* Resolves the translation for i18n
* @param i18n - i18n messages
* @param path - desired path
* @param args - arguments
*/
resolve?: i18nResolver;
/**
* falls back to the fallback locale if key not found
* @default true
*/
notFoundFallback?: boolean;
}
declare type I18nExtractLocale<T> = T extends (...args: any[]) => any ? PromiseResult_2<ReturnType<T>> : PromiseResult_2<T>;
/**
* Locale based key/value dictionary
*/
export declare type i18nLocale<T> = {
[K in keyof T]: i18nMessage<T[K]>;
};
/**
* Extracts i18n configuration type to the correct output
*/
export declare type i18nMessage<T> = T extends Ref<string> ? string : T extends () => Promise<infer P> ? i18nLocale<P> : T extends (...args: infer TArgs) => RefTyped<string> ? (...args: TArgs) => string : T extends object ? i18nLocale<T> : T extends Ref<infer V> ? V : T;
/**
* i18n key and message value
*/
export declare type i18nMessageValue = i18nLocale<any> | RefTyped<string>;
/**
* i18n Message value resolver */
export declare type i18nResolver = (i18n: i18n, path: Readonly<RefTyped<string>>, args: RefTyped<FormatObject> | Array<FormatValue> | undefined) => RefTyped<string>;
/**
* i18n Object
*/
export declare interface i18nResult<TLocales, TMessages extends any = i18n> {
/**
* Current locale
* You can assign a new locale
*/
locale: Ref<TLocales>;
/**
* @readonly List of available locales
*/
locales: Readonly<Ref<Readonly<Array<TLocales>>>>;
/**
* @readonly Object based locale messages
*/
i18n: Readonly<Ref<Readonly<TMessages>>>;
/**
* Function based message locale with support to format and arguments
* Inspired by [vue-i18n](https://github.com/kazupon/vue-i18n)
* @param path - Current message path
* @param args - Argument passed to format value
*/
$t(path: string, args?: object | Array<object>): Readonly<Ref<string>>;
/**
* Function based message locale with support to format and arguments
* Inspired by [vue-i18n](https://github.com/kazupon/vue-i18n)
* @param path - Current message path
* @param args - Argument passed to format value
*/
$ts(path: string, args?: object | Array<object>): string;
addLocale(locale: string, messages: TMessages): void;
/**
* Removes locale from the locale list
* @param locale - Locale key
*/
removeLocale(locale: TLocales): void;
}
export declare interface IntersectionObserverOptions {
root?: RefTyped<Element> | null;
rootMargin?: RefTyped<string> | string;
threshold?: RefTyped<number | number[]> | number | number[];
}
export declare interface IntersectionObserverResult {
supported: boolean;
elements: Ref<IntersectionObserverEntry[]>;
observe: (el: RefTyped<Element>) => void;
unobserve: (el: RefTyped<Element>) => void;
disconnect: () => void;
readonly isIntersecting: Ref<boolean>;
}
export declare type IntlNumberFormatLocales = RefTyped<string> | RefTyped<string[]> | 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<T> = (value: Readonly<RefTyped<Readonly<number>>>, overrideOpts?: RefTyped<Intl.NumberFormatOptions>, overrideLocale?: RefTyped<IntlNumberFormatLocales>) => T;
export declare const isArray: (arg: any) => arg is any[];
export declare const isBoolean: (val: unknown) => val is Boolean;
export declare const isClient: boolean;
export declare const isDate: (val: unknown) => val is Date;
export declare const isElement: (val: unknown) => val is Element;
export declare const isFunction: (val: unknown) => val is Function;
export declare const isNumber: (val: unknown) => val is number;
export declare const isObject: (val: unknown) => val is Record<any, any>;
export declare function isPromise<T = any>(val: unknown): val is Promise<T>;
export declare const isString: (val: unknown) => val is string;
export declare const isSymbol: (val: unknown) => val is symbol;
export declare interface LocalStorageReturn<T> {
supported: boolean;
storage: Ref<T>;
/**
* @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<T extends object> = string;
export declare function minMax(val: number, min: number, max: number): number;
export declare interface MouseMoveResult {
mouseX: Ref<number>;
mouseY: Ref<number>;
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<K extends keyof NetworkInformationEventMap>(type: K, listener: (this: NetworkInformation, ev: NetworkInformationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof NetworkInformationEventMap>(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" | "none";
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<number>;
/**
* @description Returns the maximum downlink speed, in megabits per second (Mbps), for the underlying connection technology.
*/
readonly downlinkMax: Ref<number>;
/**
* @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<NetworkInformationEffectiveType>;
/**
* @description Returns the estimated effective round-trip time of the current connection, rounded to the nearest multiple of 25 milliseconds.
*/
readonly rtt: Ref<number>;
/**
* @description Returns true if the user has set a reduced data usage option on the user agent.
*/
readonly saveData: Ref<Boolean>;
/**
* @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<NetworkInformationType>;
remove: RemoveEventFunction;
}
declare type NetworkInformationType = "bluetooth" | "cellular" | "ethernet" | "mixed" | "none" | "other" | "unknown" | "wifi" | "wimax";
export declare const NO_OP: () => void;
export declare const noDelay: RetryDelayFactory;
export declare interface NowOptions {
/**
* Refresh rate in milliseconds that the now gets updated
* @default 1000
*/
refreshMs?: number;
/**
* Sync with the clock by the second
* @default true
*/
sync?: boolean;
}
export declare interface NumberFormatReturn {
formatter: Ref<Readonly<Intl.NumberFormat>>;
format: IntNumberFormatterFormat<Ref<Readonly<string>>>;
formatString: IntNumberFormatterFormat<string>;
}
export declare type Options = {
/**
* calls debounce immediately
*/
isImmediate: boolean;
};
/**
* Pagination control
*/
export declare type PaginationControl = () => void;
/**
* Pagination Options
*/
export declare interface PaginationOptions {
/**
* @reactive
* Page size
*/
pageSize: RefTyped<number>;
/**
* @reactive
* Total number of pages
*/
total: RefTyped<number>;
/**
* @reactive
* Starting page
*/
currentPage: RefTyped<number>;
}
/**
* Pagination result object
*/
export declare interface PaginationResult {
/**
* @reactive
* Current page size
*/
pageSize: Ref<number>;
/**
* Total number of items
*/
total: Ref<number>;
/**
* @reactive
* Current page
*/
currentPage: Ref<number>;
/**
* @reactive
* Current offset
*/
offset: Ref<number>;
/**
* @readonly
* Last page number
*/
lastPage: Readonly<Ref<number>>;
/**
* go next page
*/
next: PaginationControl;
/**
* go prev page
*/
prev: PaginationControl;
/**
* go first page
*/
first: PaginationControl;
/**
* go last page
*/
last: PaginationControl;
}
export declare const PASSIVE_EV: AddEventListenerOptions;
/**
* A function that emits a side effect and does not return anything.
* https://github.com/chodorowicz/ts-debounce/blob/master/src/index.ts
*/
export declare type Procedure = (...args: any[]) => void;
export declare function promisedTimeout(timeout: number): Promise<void>;
export declare interface PromiseOptions {
/**
* if `true` allows to catch exception when `exec()`
*/
throwException?: boolean;
/**
* Only executes on `exec`
*/
lazy?: boolean;
}
declare interface PromiseResult<T extends Promise<any>, TR = PromiseType<T>, TError = any> {
promise: Ref<T | undefined>;
result: Ref<TR | null>;
loading: Ref<boolean>;
error: Ref<TError>;
}
declare type PromiseResult_2<T> = T extends Promise<infer R> ? R : T;
export declare interface PromiseResultFactory<T extends Promise<any>, TArgs extends Array<any> = Array<any>> extends PromiseResult<T> {
exec: (...args: TArgs) => Promise<PromiseType<T> | undefined>;
}
declare type PromiseType<T extends Promise<any>> = T extends Promise<infer R> ? R : never;
export declare type RefElement = Element | Ref<Element | undefined>;
export declare function refShared<T = any>(defaultValue?: RefTyped<T>, id?: string): import("@vue/composition-api/dist/reactivity/ref").Ref<T | (T extends import("@vue/composition-api/dist/reactivity/ref").Ref<infer V> ? V : import("@vue/composition-api/dist/reactivity").UnwrapRef<T>) | undefined> | Ref_2<RefTyped<T>>;
export declare type RefSharedMessage<T = any> = RefSharedMessageInit | RefSharedMessageSync<T> | RefSharedMessageLeave | RefSharedMessageUpdate<T> | 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<T> = {
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<T> = {
type: RefSharedMessageType.UPDATE;
value: T;
mind: SharedRefMind;
};
export declare type RefTyped<T> = T | Ref<T>;
export declare type RemoveEventFunction = () => void;
export declare interface ResizeResult {
height: Ref<number>;
width: Ref<number>;
remove: RemoveEventFunction;
}
declare interface RetryContext {
/**
* @description Current attempt number
*/
retryCount: Ref<number>;
/**
* @description When it should retry
* @example new Date(nextRetry.value)
*/
nextRetry: Ref<number | undefined>;
/**
* @description Get the current state, set to true after the first failure
*/
isRetrying: Ref<boolean>;
/**
* @description List of all the errors occurred in since the last `exec` call
*/
retryErrors: Ref<object[]>;
/**
* @description **INTERNAL** incremented every time `exec` is called
*/
[ExecutionId]: {
value: number;
};
/**
* @description **INTERNAL** Used to cancel last retry
*/
[CancellationToken]: {
value: boolean;
};
}
/**
* @description How long should it delay or what time it should execute, it also supports Promises
* @param {number} retry - Current retry number
* @returns {number | Date | Promise<void> | Promise<number> | Promise<Date>} - Should wait until `Date`, wait until `Promise` finish or wait `number` ms
*/
declare type RetryDelayFactory = (retry: number) => number | Date | Promise<void> | Promise<number> | Promise<Date>;
declare interface RetryOptions {
/**
* @description Maximum of times it should retry
*/
maxRetries?: number;
/**
* @description How long should it delay or what time it should execute, it also supports Promises
*/
retryDelay?: RetryDelayFactory;
}
declare interface RetryReturn extends RetryContext {
/**
* @description Cancels last retry
*/
cancel: () => void;
}
export declare interface RetryReturnFactory<T, TArgs extends Array<any>> extends RetryReturn {
/**
* Executes factory with the arguments passed
* @param args - Arguments for the execution of the factory function passed at `useRetry`
*/
exec(...args: TArgs): T;
}
export declare interface RetryReturnNoFactory extends RetryReturn {
/**
* Executes factory until success
* @param fn - Factory function
*/
exec<T>(fn: () => T): T;
}
export declare interface ScrollResult {
scrollTop: Ref<number>;
scrollLeft: Ref<number>;
remove: RemoveEventFunction;
scrollTo: Element["scrollTo"];
scrollTopTo: (y: number) => void;
scrollLeftTo: (x: number) => void;
}
export declare function setBreakpointTailwindCSS<T extends TailwindConfigEmpty>(tailwindConfig: T): BreakpointReturn<ExtractTailwindScreens<T>>;
export declare function setBreakpointTailwindCSS<T extends BreakpointObject>(breakpoints: T): BreakpointReturn<T>;
/**
* 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;
/**
* Build and provide i18n definition
* @param definition - I18N definition
*/
export declare function setI18n<T extends i18nDefinition<TMessage>, TMessage extends Record<keyof T["messages"], i18n | (() => Promise<any>)>>(definition: T): i18nResult<keyof T["messages"], I18nExtractLocale<T["messages"][T["locale"]]>>;
export declare const enum SharedRefMind {
HIVE = 0,
MASTER = 1
}
export declare function storageAvailable(storage?: Storage): boolean;
export declare interface StorageSerializer<T = any> {
stringify(item: T): string;
parse(data: string): T;
}
declare interface TailwindConfigEmpty {
theme: {
screens: Record<string, TailwindScreen | Array<TailwindScreen> | undefined | null>;
};
}
declare type TailwindScreen = TailwindScreenBreakpointRaw | TailwindScreenBreakpointRange | number | string | Array<TailwindScreenBreakpointRange>;
declare interface TailwindScreenBreakpointRange {
min?: string | number;
max?: string | number;
}
declare interface TailwindScreenBreakpointRaw {
raw: string;
}
export declare function unwrap<T>(o: RefTyped<T>): T;
declare type UnwrapRef<T> = T extends Ref<infer R> ? R : T;
export declare function useArrayPagination<T extends Array<TR>, TR>(array: RefTyped<T>, options?: Partial<Omit<PaginationOptions, "total">>): ArrayPaginationResult<T>;
export declare function useBreakpoint<T extends BreakpointObject>(breakpoints: Record<keyof T, number | string>): BreakpointReturn<T>;
export declare function useBreakpointChrome(): BreakpointReturn<ChromeBreakpoint>;
export declare function useBreakpointTailwindCSS<T extends TailwindConfigEmpty>(tailwindConfig: T): BreakpointReturn<ExtractTailwindScreens<T>>;
export declare function useBreakpointTailwindCSS<T extends TailwindConfigEmpty>(): BreakpointReturn<ExtractTailwindScreens<T>>;
export declare function useBreakpointTailwindCSS(): BreakpointReturn<DefaultTailwindBreakpoints>;
export declare function useBreakpointTailwindCSS<T extends BreakpointObject>(): BreakpointReturn<T>;
export declare function useBroadcastChannel<T = any>(name: string, onBeforeClose?: Function): {
supported: boolean;
data: import("@vue/composition-api/dist/reactivity/ref").Ref<T | null>;
messageEvent: import("@vue/composition-api/dist/reactivity/ref").Ref<MessageEvent | null>;
errorEvent: import("@vue/composition-api/dist/reactivity/ref").Ref<MessageEvent | null>;
errored: import("@vue/composition-api/dist/reactivity/ref").Ref<boolean>;
isClosed: import("@vue/composition-api/dist/reactivity/ref").Ref<boolean>;
send: (data: T) => void;
close: Function;
addListener: (cb: (ev: BroadcastMessageEvent<T>) => void, options?: boolean | AddEventListenerOptions | undefined) => void;
};
export declare function useCancellablePromise<T extends any, TArgs extends Array<any>>(fn: (...args: TArgs) => Promise<T>): PromiseResultFactory<Promise<T>, TArgs> & CancellablePromiseResult;
export declare function useCancellablePromise<T extends any, TArgs extends Array<any>>(fn: (...args: TArgs) => Promise<T>, lazy: boolean): PromiseResultFactory<Promise<T>, TArgs> & CancellablePromiseResult;
export declare function useCancellablePromise<T extends any, TArgs extends Array<any>>(fn: (...args: TArgs) => Promise<T>, options: PromiseOptions): PromiseResultFactory<Promise<T>, TArgs> & CancellablePromiseResult;
export declare function useCancellablePromise<T extends any>(fn: () => T): PromiseResultFactory<Promise<T>> & CancellablePromiseResult;
export declare function useCancellablePromise<T extends any>(fn: () => T, lazy: boolean): PromiseResultFactory<Promise<T>> & CancellablePromiseResult;
export declare function useCancellablePromise<T extends any>(fn: () => T, options: PromiseOptions): PromiseResultFactory<Promise<T>> & CancellablePromiseResult;
export declare function useCancellablePromise<T extends Promise<TR>, TR, TArgs extends Array<any>>(fn: (...args: TArgs) => T): PromiseResultFactory<T, TArgs> & CancellablePromiseResult;
export declare function useCancellablePromise<T extends Promise<TR>, TR, TArgs extends Array<any>>(fn: (...args: TArgs) => T, lazy: boolean): PromiseResultFactory<T, TArgs> & CancellablePromiseResult;
export declare function useCancellablePromise<T extends Promise<TR>, TR, TArgs extends Array<any>>(fn: (...args: TArgs) => T, options: PromiseOptions): PromiseResultFactory<T, TArgs> & CancellablePromiseResult;
export declare function useCancellablePromise<T = any>(fn: () => T): PromiseResultFactory<Promise<T>> & CancellablePromiseResult;
export declare function useCancellablePromise<T = any>(fn: () => T, lazy: boolean): PromiseResultFactory<Promise<T>> & CancellablePromiseResult;
export declare function useCancellablePromise<T = any>(fn: () => T, options: PromiseOptions): PromiseResultFactory<Promise<T>> & CancellablePromiseResult;
export declare function useCancellablePromise<T extends Promise<TR>, TR>(fn: () => T): PromiseResultFactory<T> & CancellablePromiseResult;
/**
* Returns object. Consists of multiple pairs of key/CSS variable value references and the additional methods.
*/
export declare type UseCssVariables<T> = CssVariableObject<T> & CssVariablesMethods;
/**
*
* @param variables
* @param element
*/
export declare function useCssVariables<T extends CssVariableConfigurationObject>(variables: T): UseCssVariables<T>;
export declare function useCssVariables<T extends CssVariableConfigurationObject>(variables: T, options?: MutationObserverInit): UseCssVariables<T>;
export declare function useCssVariables<T extends CssVariableConfigurationObject>(variables: T, element: RefTyped<HTMLElement>, options?: MutationObserverInit): UseCssVariables<T>;
export declare function useCurrencyFormat(): CurrencyFormatReturn;
export declare function useCurrencyFormat(options: RefTyped<IntlNumberFormatOptions>, locales?: IntlNumberFormatLocales): CurrencyFormatReturn;
export declare function useCurrencyFormat(currencyCode: Readonly<RefTyped<Readonly<CurrencyCodes>>>): CurrencyFormatReturn;
export declare function useCurrencyFormat(currencyCode: Ref<string> | string): CurrencyFormatReturn;
export declare function useCurrencyFormat(currencyCode: Readonly<RefTyped<Readonly<CurrencyCodes>>>, locales: IntlNumberFormatLocales, options?: RefTyped<IntlNumberFormatOptions>): CurrencyFormatReturn;
export declare function useCurrencyFormat(currencyCode: Ref<string> | string, locales: IntlNumberFormatLocales, options?: RefTyped<IntlNumberFormatOptions>): CurrencyFormatReturn;
export declare function useCurrencyFormat(currencyCode: Readonly<RefTyped<Readonly<CurrencyCodes>>>, options: RefTyped<IntlNumberFormatOptions>): CurrencyFormatReturn;
export declare function useCurrencyFormat(currencyCode: Ref<string> | string, options: RefTyped<IntlNumberFormatOptions>): CurrencyFormatReturn;
/**
* Reactive `Date.now()` with specified refresh rate
* @param options - Configuration
*/
export declare function useDateNow(options?: NowOptions): {
now: import("@vue/composition-api").Ref<number>;
remove: () => void;
};
/**
* Create `debounced` function, options object can be changed after creation to update behaviour
* @param handler - function to be debounced
* @param wait - debounce ms
* @param options - debounce options
*/
export declare function useDebounce<T extends Procedure>(handler: T, wait?: number, options?: Options): T;
export declare function useEvent<T extends {
addEventListener: (name: string, listener: EventListenerOrEventListenerObject) => any;
removeEventListener: Function;
}, M, K extends keyof M>(el: T | Ref<T | undefined>, name: K, listener: (this: T, ev: M[K]) => any): RemoveEventFunction;
export declare function useEvent<T extends {
addEventListener: (name: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => any;
removeEventListener: Function;
}, M, K extends keyof M>(el: T | Ref<T | undefined>, name: K, listener: (this: T, ev: M[K]) => any, options?: boolean | AddEventListenerOptions): RemoveEventFunction;
export declare function useEvent<K extends keyof WindowEventMap>(el: RefTyped<Window>, name: K, listener: (this: Document, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): RemoveEventFunction;
export declare function useEvent<K extends keyof DocumentEventMap>(el: Element | Ref<Element | undefined>, name: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): RemoveEventFunction;
export declare function useFetch<T = any>(request?: Partial<RequestInfo>, init?: RequestInit & UseFetchOptions): FetchReturn<T>;
export declare function useFetch<T = any>(init?: RequestInit & UseFetchOptions): FetchReturn<T>;
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;
}
/**
* format string based on object: [format](https://pikax.me/vue-composable/composable/format/format)
* * @example
* ```ts
* useFormat('Today is {{ day }}', { day: new Date().getDay() })
* ```
* @param format - string format
* @param obj - object to get values from
*/
export declare function useFormat(format: RefTyped<Readonly<string>>, obj?: RefTyped<FormatObject>): Readonly<Ref<string>>;
export declare function useFormat(format: Readonly<RefTyped<string>>, obj?: RefTyped<FormatObject>): Readonly<Ref<string>>;
/**
* format string based on object: [format](https://pikax.me/vue-composable/composable/format/format)
* * @example
* ```ts
* useFormat('Today is {{ 0 }}', new Date().getDay())
* ```
* @param format - string format
* @param args - array based format
*
*/
export declare function useFormat(format: Readonly<RefTyped<string>>, ...args: Array<FormatValue>): Readonly<Ref<string>>;
export declare function useFormat(format: Readonly<RefTyped<string>>, obj?: RefTyped<FormatObject> | Array<FormatValue>): Readonly<Ref<string>>;
export declare function useFormat(format: RefTyped<string>, args: any): Readonly<Ref<string>>;
export declare function useGeolocation(options?: PositionOptions & GeolocationOptions): {
supported: boolean;
refresh: () => void;
error: Ref<PositionError | null>;
timestamp: Ref<number | null>;
coords: Ref<Coordinates | null>;
highAccuracy: Ref<boolean | null>;
};
/**
* Calls setI18n
* @param definition - Locale definition
*/
export declare function useI18n<T extends i18nDefinition<TMessage>, TMessage extends Record<keyof T["messages"], i18n | (() => Promise<any>)>>(definition: T): i18nResult<keyof T["messages"], T["messages"][T["locale"]]>;
/**
* Inject i18n
*/
export declare function useI18n<T = i18n>(): i18nResult<string[], T>;
export declare function useIntersectionObserver(el: RefElement, options?: RefTyped<IntersectionObserverOptions>): IntersectionObserverResult;
export declare function useIntersectionObserver(options: RefTyped<IntersectionObserverOptions>): IntersectionObserverResult;
export declare function useIntlNumberFormat(): NumberFormatReturn;
export declare function useIntlNumberFormat(locales: IntlNumberFormatLocales): NumberFormatReturn;
export declare function useIntlNumberFormat(options: RefTyped<IntlNumberFormatOptions>): NumberFormatReturn;
export declare function useIntlNumberFormat(options: RefTyped<Intl.NumberFormatOptions>): NumberFormatReturn;
export declare function useIntlNumberFormat(locales: IntlNumberFormatLocales, options?: RefTyped<IntlNumberFormatOptions | undefined>): NumberFormatReturn;
export declare function useIntlNumberFormat(locales: IntlNumberFormatLocales, options: RefTyped<Intl.NumberFormatOptions | undefined>): NumberFormatReturn;
export declare function useLanguage(): {
language: Ref<String>;
languages: Ref<readonly String[]>;
};
export declare function useLocalStorage(key: string, defaultValue?: RefTyped<string>, sync?: boolean): LocalStorageReturn<string>;
export declare function useLocalStorage<T extends object = any>(key: LocalStorageTyped<T> | string, defaultValue?: RefTyped<T>, sync?: boolean): LocalStorageReturn<T>;
export declare function useMatchMedia(query: string): {
supported: boolean;
mediaQueryList: Ref<MediaQueryList>;
matches: Ref<boolean>;
remove: () => void;
};
export declare function useNetworkInformation(): NetworkInformationReturn;
/**
* Reactive custom timer with specified refresh rate
* @param options - Configuration
*/
export declare function useNow(options?: NowOptions & UseNowOptions): {
now: import("@vue/composition-api/dist/reactivity/ref").Ref<number>;
remove: () => void;
};
export declare interface UseNowOptions {
/**
* Function called when refresh the date
* * @example
* ```ts
* () => Date.now()
* // or
* () => performance.now()
* ```
*/
timeFn?: () => number;
}
export declare function useOnline(): {
supported: boolean;
online: Ref<boolean>;
};
export declare function useOnMouseMove(el: RefTyped<Window>, wait: number): MouseMoveResult;
export declare function useOnMouseMove(el: RefTyped<Window>, 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<Window>, wait: number): ResizeResult;
export declare function useOnResize(el: RefTyped<Window>, 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<Window>, wait: number): ScrollResult;
export declare function useOnScroll(el: RefTyped<Window>, 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<VisibilityState>;
hidden: Ref<boolean>;
};
/**
* Create a pagination controller based on the arguments
* @param options -
*/
export declare function usePagination(options: PaginationOptions): PaginationResult;
/**
* Retrieve object value based on string path
* @param source - Source object to retrieve path
* @param path - string path to value
* @param separator - path separator, default '.'
* @param notFoundReturn - not found handler
*/
export declare function usePath<T = any, TSource = any>(source: RefTyped<TSource>, path: RefTyped<string>, separator?: string, notFoundReturn?: UsePathNotFoundReturn<TSource>): Ref<Readonly<T>>;
export declare type UsePathNotFoundReturn<TSource> = (
/**
* Current path
*/
path: string,
/**
* last source found
*/
source: any,
/**
* Full path requested
*/
fullPath: string,
/**
* Original source
*/
originalSource: TSource) => any;
/**
* Reactive `performance.now()` with specified refresh rate
* @param options - Configuration
*/
export declare function usePerformanceNow(options?: NowOptions): {
now: import("@vue/composition-api").Ref<number>;
remove: () => void;
};
/**
*
* @param fn - factory function
* @param lazy - Delays execution until `exec` is called
*/
export declare function usePromise<T = any, TArgs extends Array<any> = Array<any>>(fn: (...args: TArgs) => Promise<T>, lazy?: boolean): PromiseResultFactory<Promise<T>, TArgs>;
export declare function usePromise<T = any, TArgs extends Array<any> = Array<any>>(fn: (...args: TArgs) => Promise<T>, options: PromiseOptions): PromiseResultFactory<Promise<T>, TArgs>;
export declare function usePromise<T = any, TArgs extends Array<any> = Array<any>>(fn: (...args: TArgs) => Promise<T>): PromiseResultFactory<Promise<T>, TArgs>;
export declare function usePromise<T = any, TArgs extends Array<any> = Array<any>>(fn: (...args: TArgs) => T, lazy: boolean): PromiseResultFactory<Promise<T>, TArgs>;
export declare function usePromise<T = any, TArgs extends Array<any> = Array<any>>(fn: (...args: TArgs) => T, options: PromiseOptions): PromiseResultFactory<Promise<T>, TArgs>;
export declare function usePromise<T = any, TArgs extends Array<any> = Array<any>>(fn: (...args: TArgs) => T): PromiseResultFactory<Promise<T>, TArgs>;
export declare function usePromise<T = any>(fn: () => Promise<T>, lazy: boolean): PromiseResultFactory<Promise<T>>;
export declare function usePromise<T = any>(fn: () => Promise<T>, options: PromiseOptions): PromiseResultFactory<Promise<T>>;
export declare function usePromise<T = any>(fn: () => Promise<T>): PromiseResultFactory<Promise<T>>;
export declare function usePromise<T = any>(fn: () => T, lazy: boolean): PromiseResultFactory<Promise<T>>;
export declare function usePromise<T = any>(fn: () => T, options: PromiseOptions): PromiseResultFactory<Promise<T>>;
export declare function usePromise<T = any>(fn: () => T): PromiseResultFactory<Promise<T>>;
/**
* Promise only created on `exec()`
* @param fn - factory function
* @param throwException - if `true` allows to catch exception when `exec()`
*/
export declare function usePromiseLazy<T = any, TArgs extends Array<any> = Array<any>>(fn: (...args: TArgs) => Promise<T>, throwException?: boolean): PromiseResultFactory<Promise<T>, TArgs>;
export declare function usePromiseLazy<T = any, TArgs extends Array<any> = Array<any>>(fn: (...args: TArgs) => Promise<T>): PromiseResultFactory<Promise<T>, TArgs>;
export declare function usePromiseLazy<T = any, TArgs extends Array<any> = Array<any>>(fn: (...args: TArgs) => T, throwException: boolean): PromiseResultFactory<Promise<T>, TArgs>;
export declare function usePromiseLazy<T = any, TArgs extends Array<any> = Array<any>>(fn: (...args: TArgs) => T): PromiseResultFactory<Promise<T>, TArgs>;
export declare function usePromiseLazy<T = any>(fn: () => Promise<T>, throwException: boolean): PromiseResultFactory<Promise<T>>;
export declare function usePromiseLazy<T = any>(fn: () => Promise<T>): PromiseResultFactory<Promise<T>>;
export declare function usePromiseLazy<T = any>(fn: () => T, throwException: boolean): PromiseResultFactory<Promise<T>>;
export declare function usePromiseLazy<T = any>(fn: () => T): PromiseResultFactory<Promise<T>>;
export declare function useRetry(options?: RetryOptions): RetryReturnNoFactory;
export declare function useRetry<T, TArgs extends Array<any>>(factory: Factory<T, TArgs>): RetryReturnFactory<T, TArgs>;
export declare function useRetry<T, TArgs extends Array<any>>(options: RetryOptions, factory: Factory<T, TArgs>): RetryReturnFactory<T, TArgs>;
export declare function useSessionStorage(key: string, defaultValue?: RefTyped<string>, sync?: boolean): LocalStorageReturn<string>;
export declare function useSessionStorage<T extends object = object>(key: LocalStorageTyped<T> | string, defaultValue?: RefTyped<T>, sync?: boolean): LocalStorageReturn<T>;
export declare function useSharedRef<T = any>(name: string, defaultValue?: T): {
supported: boolean;
id: number;
data: Ref_2<T>;
master: import("@vue/composition-api/dist/reactivity/ref").Ref<boolean>;
mind: import("@vue/composition-api/dist/reactivity/ref").Ref<SharedRefMind>;
editable: Readonly<import("@vue/composition-api/dist/reactivity/ref").Ref<boolean>>;
targets: import("@vue/composition-api/dist/reactivity/ref").Ref<number[]>;
ping: () => void;
setMind: (t: SharedRefMind) => void;
addListener: (cb: (ev: BroadcastMessageEvent<RefSharedMessage<T>>) => void, options?: boolean | AddEventListenerOptions | undefined) => void;
};
export declare function useStorage(key: string, defaultValue?: RefTyped<string>, sync?: boolean): LocalStorageReturn<string>;
export declare function useStorage<T extends object = any>(key: LocalStorageTyped<T> | string, defaultValue?: RefTyped<T>, sync?: boolean): LocalStorageReturn<T>;
declare type UseValidation<T> = {
[K in keyof T]: ValidationInput<T[K]>;
};
export declare function useValidation<T extends UseValidation<E>, E = any>(input: E): ValidationOutput<E> & ValidationGroupResult;
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/dist/reactivity/ref").Ref<MessageEvent | undefined>;
errorEvent: import("@vue/composition-api/dist/reactivity/ref").Ref<Event | undefined>;
data: import("@vue/composition-api/dist/reactivity/ref").Ref<any>;
isOpen: import("@vue/composition-api/dist/reactivity/ref").Ref<boolean>;
isClosed: import("@vue/composition-api/dist/reactivity/ref").Ref<boolean>;
errored: import("@vue/composition-api/dist/reactivity/ref").Ref<boolean>;
};
export declare function useWebStorage(type: WebStorageType, serializer?: StorageSerializer, ms?: number): {
supported: boolean;
quotaError: Ref<boolean>;
store: WebStorage;
remove: () => boolean;
};
export declare function useWorker<TData = any, TArgs = any | any[]>(stringUrl: string | URL, args?: TArgs, options?: WorkerOptions): {
worker: undefined;
data: import("@vue/composition-api/dist/reactivity/ref").Ref<TData | undefined>;
postMessage: () => void;
terminate: () => void;
errorEvent: import("@vue/composition-api/dist/reactivity/ref").Ref<Event | undefined>;
errored: import("@vue/composition-api/dist/reactivity/ref").Ref<boolean>;
terminated: import("@vue/composition-api/dist/reactivity/ref").Ref<boolean>;
} | {
worker: Worker;
data: import("@vue/composition-api/dist/reactivity/ref").Ref<TData | undefined>;
postMessage: (data: TArgs) => void;
terminate: () => void;
errorEvent: import("@vue/composition-api/dist/reactivity/ref").Ref<Event | undefined>;
errored: import("@vue/composition-api/dist/reactivity/ref").Ref<boolean>;
terminated: import("@vue/composition-api/dist/reactivity/ref").Ref<boolean>;
};
export declare function useWorkerFunction<T, TArgs extends Array<any>>(fn: (...args: TArgs) => T, options?: WebWorkerFunctionOptions): PromiseResultFactory<Promise<T>, TArgs> & CancellablePromiseResult;
declare interface ValidationGroupResult {
$anyDirty: boolean;
$errors: Array<any>;
$anyInvalid: boolean;
}
declare type ValidationInput<T> = T extends {
$value: infer TValue;
} ? ValidationInputType<T, TValue> : {
[K in keyof T]: ValidationInput<T[K]>;
};
declare type ValidationInputType<T, TValue> = Record<Exclude<keyof T, "$value">, Validator<UnwrapRef<TValue>>> & {
$value: TValue;
};
declare type ValidationOutput<T extends Record<string, any>> = T extends {
$value: any;
} ? ValidationValue<T["$value"]> & ValidatorObjectOutput<T, Exclude<keyof T, "$value">> : {
[K in keyof T]: ValidationOutput<T[K]>;
};
declare interface ValidationValue<T> {
$value: UnwrapRef<T>;
$dirty: boolean;
$errors: Array<any>;
$anyInvalid: boolean;
}
declare type Validator<T> = ValidatorFunc<T> | ValidatorObject<ValidatorFunc<T>>;
declare type ValidatorFunc<T, TContext = any> = (model: T, ctx: TContext) => boolean | Promise<boolean>;
declare type ValidatorObject<TValidator extends ValidatorFunc<any>> = {
$validator: TValidator;
$message: RefTyped<string>;
};
declare type ValidatorObjectOutput<T, TK extends keyof T> = {
[K in TK]: T[K] extends Validator<infer V> ? ValidatorOutput<T[K], V> : never;
};
declare type ValidatorOutput<T extends Validator<E>, E = any> = T extends ValidatorFunc<any> ? ValidatorOutputFunc<T> : T extends ValidatorObject<any> ? ValidatorOutputFunc<T["$validator"]> & ValidatorResultMessage : never;
declare type ValidatorOutputFunc<T extends ValidatorFunc<T>> = ReturnType<T> extends Promise<boolean> ? ValidatorResult & ValidatorResultPromise : ValidatorResult;
declare interface ValidatorResult {
$error: any;
$invalid: boolean;
}
declare interface ValidatorResultMessage {
$message: string;
}
declare interface ValidatorResultPromise {
$pending: boolean;
$promise: Promise<boolean> | null;
}
export declare interface WebStorage {
$refMap: Map<string, Ref<any>>;
$watchHandlers: Map<string, Function>;
$syncKeys: Record<string, boolean>;
$quotaError: Ref<boolean>;
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<T = any>(key: string): Ref<T> | 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<T>(key: string, value: T): Ref<T>;
}
declare type WebStorageType = "localStorage" | "sessionStorage";
export declare interface WebWorkerFunctionOptions {
dependencies?: RefTyped<string[]>;
timeout?: RefTyped<number>;
}
export declare function wrap(o: RefElement): Ref<Element>;
export declare function wrap<T>(o: RefTyped<T>): Ref<T>;
export declare type WrapRef<T> = T extends Ref<any> ? T : Ref<T>;
export { }

2

dist/vue-composable.global.prod.js

@@ -1,1 +0,1 @@

var vueComposable=function(e,t,n){"use strict";function r(e){return t.isRef(e)?e.value:e}function o(e){return t.isRef(e)?e:t.ref(e)}n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;const a=Array.isArray,l=e=>"function"==typeof e,s=e=>"string"==typeof e,u=e=>"boolean"==typeof e,i=e=>v(e)&&l(e.getTime),c=e=>"number"==typeof e,v=e=>null!==e&&"object"==typeof e,d=e=>v(e)&&!!e.tagName;function f(e){return v(e)&&l(e.then)&&l(e.catch)}const m=()=>{},p=()=>!1,g={passive:!0};function h(e){return new Promise(t=>{setTimeout(t,e)})}function y(e,t,n){return e<t?t:e>n?n:e}const w="undefined"!=typeof window;function b(e,...t){for(let n=0;n<t.length;n++){const o=t[n];if(void 0===o||!v(o))continue;const a=Object.keys(o);for(let t=0;t<a.length;t++){const n=a[t],l=r(o[n]),s=typeof l,u=typeof e[n];void 0!==e[n]&&s!==u||(e[n]=v(l)?b(e[n]||{},l):o[n])}}return e}function $(e){const n=o(e.currentPage),r=o(e.pageSize),a=t.ref(0),l=o(e.total),s=t.computed({get:()=>a.value,set(e){c(e)&&(a.value=Math.min(e,l.value))}}),u=t.computed({get:()=>n.value,set(e){c(e)&&(n.value=y(e,1,v.value),s.value=(n.value-1)*i.value)}}),i=t.computed({get:()=>r.value,set(e){c(e)&&(r.value=e)}}),v=t.computed(()=>Math.ceil(l.value/i.value));u.value=n.value;return t.watch([l,i],()=>{u.value>v.value&&(u.value=v.value)},{lazy:!0}),{pageSize:i,total:l,currentPage:u,offset:s,lastPage:v,next:()=>++u.value,prev:()=>--u.value,first:()=>u.value=1,last:()=>u.value=v.value}}function E(e,n){if(!e)throw new Error(`[usePromise] argument can't be '${e}'`);if("function"!=typeof e)throw new Error(`[usePromise] expects function, but received ${typeof e}`);const[r,o]=u(n)?[n,!1]:v(n)?[n.lazy,n.throwException]:[!1,!1],a=t.ref(!1),l=t.ref(null),s=t.ref(null),i=t.ref(),c=async(...t)=>{a.value=!0,l.value=null;const n=t&&e.length!==t.length&&t.length>0&&u(t[t.length-1])?t[t.length-1]:o,r=i.value=e(...t);try{const e=await r;return i.value===r&&(s.value=e),e}catch(e){return i.value===r&&(l.value=e,s.value=null),n?r:void 0}finally{i.value===r&&(a.value=!1)}};return r||c(),{exec:c,result:s,promise:i,loading:a,error:l}}function M(e,n){const r=t.ref(!1);let o=void 0;return{...E((...t)=>{return n=e(...t),new Promise((e,t)=>{o=e=>{r.value=!0,t(e)},n.then(e).catch(t)});var n},n),cancel:e=>{o&&o(e)},cancelled:r}}const S=Symbol(""),k=Symbol(""),L=async(e,t,n,r)=>{const o=t[S].value;let a=-1;const l=e.maxRetries||9001,s=e.retryDelay||x;t.retryErrors.value=[],t.isRetrying.value=!1,t.nextRetry.value=void 0;let u=void 0;do{let e=!1,v=null;try{if(++a,v=r?n(...r):n(),f(v)&&(v=await v),t[k].value)return null;e=!0}catch(e){v=null,t.retryErrors.value.push(e)}if(o!==t[S].value)return v;if(e)return t.isRetrying.value=!1,t.nextRetry.value=void 0,v;if(a>=l)return t.isRetrying.value=!1,t.nextRetry.value=void 0,Promise.reject(new Error(`[useRetry] max retries reached ${l}`));t.isRetrying.value=!0;const d=Date.now(),m=s(a),p=f(m)?await m:m;if(!f(m)||p){if(c(p))u=p;else{if(!i(p))throw new Error(`[useRetry] invalid value received from options.retryDelay '${typeof p}'`);u=p.getTime()}u<d?t.nextRetry.value=d+u:(t.nextRetry.value=u,u-=d),u>0&&await h(u)}if(t[k].value)return null;if(o!==t[S].value)return v}while(a<9e3);return null};const x=()=>0;function I(e,t,n){return R(e,t,n)}function R(e,t=50,n={isImmediate:!1}){let r;return function(...o){const a=this,l=n.isImmediate&&void 0===r;void 0!==r&&clearTimeout(r),r=setTimeout((function(){r=void 0,n.isImmediate||e.apply(a,o)}),t),l&&e.apply(a,o)}}function O(e){const n=e&&e.refreshMs||1e3,r=!e||!u(e.sync)||e.sync,o=e&&l(e.timeFn)&&e.timeFn||Date.now;let a=void 0,s=void 0;const i=t.ref(o()),c=()=>{clearInterval(a),clearTimeout(s)},v=w?()=>a=setInterval(()=>i.value=o(),n):m;if(r){const e=1e3-(i.value-1e3*Math.floor(i.value/1e3));s=setTimeout(v,e)}else v();return t.onUnmounted(c),{now:i,remove:c}}function P(e,n){return t.computed(()=>{const o=r(e);if(!n)return o;const l=t.isRef(n)?t.reactive(n.value):t.reactive(n);return o.replace(/({?{[\w\s]*}?})/g,e=>{const t=e.replace("{","").replace("}","").trim();if(e[0]===e[1]&&"{"===e[0])return`${t}`;const n=a(l)?l[+t]:l[t];return void 0===n?e:`${r(n)}`})})}function j(e,n,o=".",a=m){return t.computed(()=>{const t=r(e),l=r(n);if(void 0===t)return a(l,t,l,t);if(!l)return t;const s=l.split(o);let u=t;for(let e=0;e<s.length;e++){let n=s[e];if("]"===n[n.length-1]){const t=/\[[`'"]?([^`'"\]]*)[`'"]?\]/g;let r=n,o=t.exec(r);if(o){let a=o[0].length,l=o.index-a,u=1;do{o.index,l=o.index,a=o[0].length,n=n.slice(0,-o[0].length),s.splice(e+u,0,o[1]),++u}while(o=t.exec(r));if(!n&&"["===r[0]&&r.length>2)continue}else n="",console.warn(`[usePath] invalid path provided "${r}"`)}if(!v(u))return a(s.slice(0,e+1).join(o),u,l,t);if(!n)return a(s.slice(0,e+1).join(o),u,l,t);if(u=u[n],!u)return a(s.slice(0,e+1).join(o),u,l,t)}return u})}function C(e){return void 0!==e.$value}const T=(e,n,r)=>{const{$message:o,$validator:a,...l}=function(e){return v(e)}(n)?n:{$validator:n,$message:""},{$pending:s,$promise:u,$invalid:i,$error:c}=((e,n,r)=>{const o=t.ref(null),a=t.ref(!1),l=t.ref(),s=t.ref(!1);let u=void 0;const i=e=>{o.value=(async()=>{try{a.value=!0;const t=n(e,u);f(t)?s.value=!await t:s.value=!t}catch(e){throw s.value=!0,e}finally{a.value=!1}})().catch(e=>(l.value=e,s.value=!0,e))};return r.push(r=>{u=r,t.watch(()=>{try{n(e.value,u)}catch(e){}return e.value},i,{deep:!0})}),{$promise:o,$pending:a,$invalid:s,$error:l}})(e,a,r);return{$pending:s,$error:c,$promise:u,$invalid:i,$message:o,...l}},z=(e,n)=>{const r={},a=C(e)?o(e.$value):void 0;for(const o of Object.keys(e))if("$"!==o[0])if(a){const t=T(a,e[o],n);r[o]={...t,$value:a}}else{const a=z(e[o],n);let l,s,i=void 0;if(C(a)){const e=Object.keys(a).filter(e=>"$"!==e[0]).map(e=>a[e]);l=t.computed(()=>e.map(e=>e.$error).filter(Boolean)),s=t.computed(()=>e.some(e=>!!e.$invalid))}else{const e=Object.keys(a).map(e=>a[e]);l=t.computed(()=>e.map(e=>e.$errors).filter(Boolean).filter(e=>e.some(Boolean))),i=t.computed(()=>e.some(e=>e.$anyDirty||u(e.$dirty)&&e.$dirty)),s=t.computed(()=>e.some(e=>!!e.$anyInvalid))}r[o]={...a,$errors:l,$anyInvalid:s},i&&(r[o].$anyDirty=i)}else{if("$value"===o){r[o]=a;const e=t.ref(!1),n=t.watch(a,()=>{e.value=!0,n()},{lazy:!0,deep:!0});r.$dirty=e;continue}r[o]=e[o]}return r};const D=Symbol("");function A(e){const r=t.ref(Object.keys(e.messages)),a=t.ref(e.messages),s=t.ref(e.locale),i=t.ref({});let c=t.ref();const v={},d=(e,n)=>{if(v[e])return v[e];const r=n.value[e];if(!r)return t.ref({});let a=l(r)?r():r;return f(a)?a.then(t=>v[e]=o(t)):l(r)?o(a):v[e]=t.computed(()=>n.value[e])},m=!!e.fallback&&(!u(e.notFoundFallback)||e.notFoundFallback);let p=!1;if(m){const t=d(e.fallback,a);f(t)?(t.then(e=>{c.value=e.value}),p=!0):c.value=t.value}else c.value={};const g=t.ref(0);t.watch(a,()=>g.value++,{deep:!0,lazy:!0}),t.watch([s,c,g],async([t,n,r])=>{if(t===e.fallback&&m)i.value=n;else{const e=await d(t,a);i.value=b({},n,e.value)}},{lazy:p});const h=(t,n)=>e.resolve?o(e.resolve(i.value,t,n)):P(j(i,t,".",(e,t,n,r)=>n),n);return{locale:s,locales:r,i18n:i,$t:h,$ts:(e,t)=>h(e,t).value,addLocale:(e,t)=>{r.value.indexOf(e)>=0||r.value.push(e),delete v[e],a.value={...a.value,[e]:t}},removeLocale:t=>{const o=r.value.indexOf(t);if(o>=0){const n=[s.value,c.value&&e.fallback,...r.value].find(e=>e&&e!==t);n&&(t===e.fallback&&(c.value=void 0),t===s.value&&(s.value=n)),r.value.splice(o,1)}n.delete(a.value,t),delete v[t]}}}function F(e,n,r,a){let l=m;if(e){const s=o(e),u=e=>e.removeEventListener(n,r),i=e=>e.addEventListener(n,r,a);l=()=>{u(s.value)},t.onUnmounted(l),t.onMounted(()=>{t.watch(s,(e,t)=>{t&&u(t),e&&i(e)})})}return l}function W(e){return e&&(u(e.isJson)||u(e.parseImmediate))}let U=void 0;let V=void 0,B=void 0;let N=void 0,H=void 0;function K(e,n){const r=w&&"BroadcastChannel"in self,o=t.ref(null),a=t.ref(null),l=t.ref(null),s=t.ref(!1),u=t.ref(!1);let i=m,c=m,v=m;if(r){const r=new BroadcastChannel(e);r.addEventListener("messageerror",e=>{l.value=e,s.value=!0},g),r.addEventListener("message",e=>{a.value=e,o.value=e.data},g),i=e=>r.postMessage(e),c=()=>{r.close(),u.value=!0},v=(e,n)=>{r.addEventListener("message",e,n),t.onUnmounted(()=>r.removeEventListener("message",e))},t.onUnmounted(()=>{n&&n(),c()})}return{supported:r,data:o,messageEvent:a,errorEvent:l,errored:s,isClosed:u,send:i,close:c,addListener:v}}function _(e,t){const n=getComputedStyle(e).getPropertyValue(t);return n?n.trim():null}function J(e,t,n){e.style.setProperty(t,n)}const q={attributes:!0,childList:!0,subtree:!0},Q=e=>e.length<=2||"-"!==e[0]||"-"!==e[1]?`--${e}`:e;const G=e=>function(t){const n=t.data||[];return new Promise(t=>{try{Promise.resolve(e.apply(e,n)).then(e=>t(postMessage([!0,e]))).catch(e=>t(postMessage([!1,e])))}catch(e){t(postMessage([!1,e]))}})};function X(e){const n=!!w&&"matchMedia"in window;let r=void 0,o=void 0,a=m;if(n){r=t.ref(matchMedia(e)),o=t.ref(r.value.matches);const n=e=>{o.value=e.matches};r.value.addEventListener("change",n,g);const a=()=>r.value.removeEventListener("change",n);t.onUnmounted(a)}else r=t.ref({}),o=t.ref(!1);return{supported:n,mediaQueryList:r,matches:o,remove:a}}function Y(e,n){const{addListener:r,send:o,close:a,supported:l}=K(e,()=>y()),s=Date.now(),u=t.ref(!1),i=t.ref(0),c=t.computed(()=>1!==i.value||u.value),d=t.ref([]),f=t.ref(n);let m=!1,p=void 0;o({type:0});const h=()=>o({type:5,id:s}),y=()=>{0!==d.value.length&&(u.value&&o({type:3,mind:1,id:Math.min(...d.value)}),o({type:4,id:s}))};return r(e=>{switch(e.data.type){case 0:o({type:2,value:f.value,mind:i.value});break;case 4:{const t=d.value.indexOf(e.data.id);t>=0&&d.value.splice(t,1),p===e.data.id&&d.value.length>0&&o({type:3,mind:1,id:Math.min(s,...d.value)});break}case 2:m=!0,f.value=e.data.value,i.value=e.data.mind;break;case 3:i.value=e.data.mind,p=1===e.data.mind&&e.data.id||void 0,u.value=p===s,u.value&&(d.value=[],h());break;case 5:d.value=[e.data.id],o({type:6,id:s});break;case 6:d.value.push(e.data.id)}},g),h(),t.watch(f,(e,t)=>{if(m)m=!1;else{if(1===i.value&&!1===u.value)return m=!0,void(f.value=t);o({type:2,mind:i.value,value:v(e)?{...e}:e}),m=!1}},{deep:!0,lazy:!0}),w&&window.addEventListener("unload",y,g),t.onUnmounted(()=>{y(),a()}),{supported:l,id:s,data:f,master:u,mind:i,editable:c,targets:d,ping:h,setMind:e=>{switch(e){case 1:u.value=!0;break;case 0:u.value=!1}i.value=e,o({type:3,id:s,mind:i.value})},addListener:r}}function Z(e,n){const r=o(n),l=o(e);return v(r.value)||t.isRef(n)?[void 0!==l.value?l:void 0,r]:!v(l.value)||a(l.value)||s(l.value)?[l.value?l:void 0,void 0]:[void 0,l]}function ee(e,n){const[o,a]=Z(e,n),l=t.computed(()=>new Intl.NumberFormat(r(o),r(a))),s=(e,t,n)=>(t||n?new Intl.NumberFormat(r(n)||r(o),{...r(a),...r(t)}):l.value).format(r(e));return{format:(e,n,r)=>t.computed(()=>s(e,n,r)),formatString:s,formatter:l}}function te(e){if(e)return c(e)?e:ne(e)}const ne=e=>{const t=e.match(/^(\d+)px$/);if(t)return+t[1]};function re(e){const n={},r=new Map,o=t.ref();let a=[];const l=[];for(const o in e){const s=e[o],u=te(s);if(void 0!==u){const e=t.ref(!1);n[o]=e,r.set(u,{name:o,valid:e}),a.push(u)}else{const{matches:e,remove:t}=X(s);n[o]=e,l.push(t)}}a=a.sort((e,t)=>t-e);const s=w?()=>{const e=window.innerWidth;let t=void 0;for(let n=0;n<a.length;n++){const o=a[n],l=r.get(o);l.valid.value=e>=o,e>=o&&void 0===t&&(t=l.name)}o.value=t}:m,u=I(s,10),i=w?()=>window.removeEventListener("resize",u):m;return w&&(t.onMounted(()=>{s(),window.addEventListener("resize",u,g)}),t.onUnmounted(()=>{i(),l.forEach(e=>e())})),{...n,remove:i,current:o}}const oe=Symbol(""),ae={sm:640,md:768,lg:1024,xl:1280};function le(e){return v(e)&&v(e.theme)&&v(e.theme.screens)}function se(e){return!!v(e)&&(s(e.min)||s(e.max)||c(e.min)||c(e.max))}function ue(e){const t=[];if(a(e)){const n=e.map(ue);for(let e=0;e<n.length;e++){const r=n[e];t.push(...r)}}else v(n=e)&&s(n.raw)?t.push(e.raw):se(e)?t.push(function(e){return se(e)?`(${[e.max&&`max-width: ${e.max}`,e.min&&`min-width: ${e.min}`].filter(Boolean).join(" and ")})`:""}(e)):(s(e)||c(e))&&t.push(`min-width: ${e}`);var n;return t}function ie(e){const n=le(e)?e.theme.screens:e;if(le(e))for(const e in n)n.hasOwnProperty(e)&&(n[e]=ue(n[e]).join(" or "));const r=re(n);return t.provide(oe,r),r}function ce(e,t){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&(t&&0!==t.length||!1)}function ve(e){try{if(!e)return!1;const t=":$";return e.setItem(t,t),e.removeItem(t),!0}catch(t){return ce(t,e)}}function de(e,t){try{return e.parse(t)}catch{return t}}let fe=void 0;function me(e,n=JSON,r=10){const a=w?window[e]:void 0,l=ve(a);fe||(fe=new Map,w&&window.addEventListener("storage",e=>{if(e.newValue===e.oldValue)return;let t=fe.get("localStorage");t=e.storageArea===window.localStorage?fe.get("localStorage"):fe.get("sessionStorage"),t&&Object.keys(t.$syncKeys).length>0&&(null===e.key?t.clear():t.$syncKeys[e.key]&&(null===e.newValue?t.removeItem(e.key):t.updateItem(e.key,e.newValue)))}));let u,i=fe.get(e);return l&&a?i?u=i.$quotaError:(u=t.ref(!1),i={$refMap:new Map,$watchHandlers:new Map,$syncKeys:{},$quotaError:u,key:a.key,length:a.length,setSync(e,t){t?this.$syncKeys[e]=!0:delete this.$syncKeys[e]},clear(){this.$refMap.forEach((e,t)=>this.removeItem(t))},removeItem(e){const t=this.$refMap.get(e);t&&(t.value=void 0);const n=this.$watchHandlers.get(e);n&&n(),delete this.$syncKeys[e],this.$refMap.delete(e),a.removeItem(e)},getItem(e){const t=a.getItem(e);return t?this.setItem(e,de(n,t)):null},setItem(e,l){const i=o(l);this.$refMap.set(e,i);const c=(e,t)=>{try{const r=a.getItem(e),o=s(t)?t:n.stringify(t);a.setItem(e,o),r!==o&&w&&this.$syncKeys[e]&&window.dispatchEvent(new StorageEvent(e,{newValue:o,oldValue:r,storageArea:a}))}catch(e){u.value=ce(e,a)}};c(e,l);const v=t.watch(i,R(t=>{c(e,t)},r),{lazy:!0,deep:!0});return this.$watchHandlers.set(e,v),i},updateItem(e,t){let r=this.$refMap.get(e);r&&(r.value=de(n,t))}},fe.set(e,i)):(u=t.ref(!1),i={}),{supported:l,quotaError:u,store:i,remove:()=>fe.delete(e)}}function pe(e,n,r){const{supported:o,store:a}=me("localStorage");let l=m,s=m,u=m,i=void 0;return o&&a?(u=t=>a.setSync(e,t),l=()=>a.removeItem(e),s=()=>a.clear(),i=a.getItem(e),i||(i=a.setItem(e,n)),!1!==r&&u(!0)):i=t.ref(n),{supported:o,storage:i,clear:s,remove:l,setSync:u}}function ge(e,n,r){const{supported:o,store:a}=me("sessionStorage");let l=m,s=m,u=p,i=void 0;return o&&a?(l=()=>a.removeItem(e),s=()=>a.clear(),i=a.getItem(e),i||(i=a.setItem(e,n))):i=t.ref(n),{supported:o,storage:i,clear:s,remove:l,setSync:u}}let he=void 0;return e.FALSE_OP=p,e.NO_OP=m,e.PASSIVE_EV=g,e.buildI18n=A,e.debounce=R,e.deepClone=b,e.exponentialDelay=e=>{const t=100*Math.pow(2,e);return t+.2*t*Math.random()},e.exposeWorker=function(e){this.onmessage=async t=>{const n=e(t.data);if(void 0===n)this.postMessage(n);else if(null===n)this.postMessage(n);else if(a(n))this.postMessage(n);else if(n[Symbol.asyncIterator])for await(const e of n)this.postMessage(e);else if(n[Symbol.iterator])for(const e of n)this.postMessage(e);else this.postMessage(await n)}},e.getCssVariableFor=_,e.isArray=a,e.isBoolean=u,e.isClient=w,e.isDate=i,e.isElement=d,e.isFunction=l,e.isNumber=c,e.isObject=v,e.isPromise=f,e.isString=s,e.isSymbol=e=>"symbol"==typeof e,e.minMax=y,e.noDelay=x,e.promisedTimeout=h,e.refShared=function(e,n){const r=t.getCurrentInstance(),o=n||r.$vnode.tag,{data:a,supported:l}=Y(o,e);return a},e.setBreakpointTailwindCSS=ie,e.setCssVariableFor=J,e.setI18n=function(e){const n=A(e);return t.provide(D,n),n},e.storageAvailable=ve,e.unwrap=r,e.useArrayPagination=function(e,n){const r=o(e),a=$({currentPage:1,pageSize:10,...n,total:t.computed(()=>r.value.length)}),l=t.computed(()=>{const e=r.value;return Array.isArray(e)?e.slice(a.offset.value,a.offset.value+a.pageSize.value):[]});return{...a,result:l}},e.useBreakpoint=re,e.useBreakpointChrome=function(){return re({mobileS:320,mobileM:375,mobileL:425,tablet:768,laptop:1024,laptopL:1440,desktop4K:2560})},e.useBreakpointTailwindCSS=function(e){const n=t.inject(oe);return n||ie(e||ae)},e.useBroadcastChannel=K,e.useCancellablePromise=M,e.useCssVariables=function(e,n,a){const l=w&&"MutationObserver"in self,[u,i]=t.isRef(n)||d(n)?[n,a||q]:[l&&document.documentElement||{},n||q],c=t.ref(!0),v={},f=[],p=Object.entries(e).map(e=>{const[t,n]=s(e[1])?[e[1]]:[e[1].name,e[1].value];return n&&(f.push(()=>J(r(u),t,r(n))),v[e[0]]=o(n)),[e[0],Q(t)]});for(let e=0;e<p.length;e++){const[n,a]=p[e];v[n]||(v[n]=t.ref(t.isRef(u)&&!u.value||!l?null:_(r(u),a))),l&&t.watch([v[n],o(u)],e=>{c&&e[1]&&e[0]!==_(e[1],a)&&J(e[1],a,e[0])},{lazy:t.isRef(u)})}if(!l)return{...v,stop:m,resume:m,supported:l,observing:c};const g=()=>{for(let e=0;e<p.length;e++){const[t,n]=p[e];v[t].value=_(r(u),n)}},h=new MutationObserver(g),y=()=>{h.disconnect(),c.value=!1},b=()=>{c.value||g(),h.observe(r(u),i),c.value=!0};return t.onUnmounted(y),t.isRef(u)?t.onMounted(()=>{f.forEach(e=>e()),t.watch(u,(e,t)=>{t&&y(),e&&b()})}):(w||u)&&(f.forEach(e=>e()),b()),{...v,supported:l,resume:b,stop:y,observing:c}},e.useCurrencyFormat=function(e,n,o){const a=r(e),l=!v(a),s=l?e:t.computed(()=>r(e).currency),[u,i]=Z(n,l?o:e),c=t.computed(()=>{const e=r(i)||{},t=r(s)||e.currency;return{style:"currency",...e,currency:t}}),d=ee(u),f=(e,t,n,o,a)=>{const l={...c.value,...r(o)},s=r(t)||l.currency,u=r(n)||l.currencyDisplay;return d.formatString(e,{...l,currency:s,currencyDisplay:u},a)};return{format:(e,n,r,o,a)=>t.computed(()=>f(e,n,r,o,a)),formatString:f}},e.useDateNow=function(e){return O({refreshMs:e&&e.refreshMs||1e3,sync:!e||!u(e.sync)||e.sync,timeFn:Date.now})},e.useDebounce=I,e.useEvent=F,e.useFetch=function(e,n){const r=t.ref(null),o=t.ref(""),a=t.ref(),l=t.ref(null),[u,i]=W(e)?[!1!==e.isJson,!1!==e.parseImmediate]:W(n)?[!1!==n.isJson,!1!==n.parseImmediate]:[!0,!0],c=e?s(e)?n:W(e)?e:s(e.url)?n:e:void 0,v=t.ref(!1),d=t.ref();let f=void 0;const m=E(async(e,t)=>{f=new AbortController;const n=await fetch(e,{signal:f.signal,...c,...t});if(n){const e=[u?n.clone().json().then(e=>r.value=e).catch(e=>{r.value=null,l.value=e}):Promise.resolve(),n.clone().blob().then(e=>{a.value=e}),n.clone().text().then(e=>{o.value=e})];i&&await Promise.all(e)}return n},!0),p=t.computed(()=>m.result.value&&m.result.value.status||null),g=t.computed(()=>m.result.value&&m.result.value.statusText||null);return e&&(s(e)||s(e.url))&&m.exec(e,void 0,!1),{...m,cancel:e=>{f&&(f.abort(),v.value=!0,d.value=e)},isCancelled:v,cancelledMessage:d,text:o,blob:a,json:r,jsonError:l,status:p,statusText:g}},e.useFormat=P,e.useGeolocation=function(e){const n=w&&!!navigator.geolocation,r=t.ref(e?!1===e.immediate:void 0),o=t.ref(null),a=t.ref(null),l=t.ref(null),s=t.ref(e&&e.enableHighAccuracy||null);let i=m;if(n){const n=e=>{a.value=e.timestamp,l.value=e.coords,o.value=null},c=e=>{a.value=Date.now(),l.value=null,o.value=e},v=()=>!0!==r.value&&f&&navigator.geolocation.clearWatch(f);let d=()=>navigator.geolocation.getCurrentPosition(n,c,e);i=r.value?()=>{r.value?r.value=!1:d()}:d;let f=0;t.onMounted(()=>t.watch([s,r],t=>{v();const r=u(t[0])?t[0]:e?e.enableHighAccuracy:void 0;f=navigator.geolocation.watchPosition(n,c,e?{...e,enableHighAccuracy:r}:{enableHighAccuracy:r})},{lazy:r.value})),t.onUnmounted(v)}return{supported:n,refresh:i,error:o,timestamp:a,coords:l,highAccuracy:s}},e.useI18n=function(e){return e?A(e):t.inject(D)},e.useIntersectionObserver=function(e,n){const a=w&&"IntersectionObserver"in window,l=e?o(e):void 0,s=!l||!d(l.value)&&l.value?void 0:l,u=t.computed(()=>n?r(n):s?void 0:r(e)),i=t.ref(s&&s.value?[s.value]:[]),c=t.computed(()=>i.value.length>0&&i.value.every(e=>e.isIntersecting)),v=e=>{i.value=e};let f=t.ref();a&&t.watch(u,e=>{f.value&&f.value.disconnect();const t=e&&e&&{root:r(e.root),rootMargin:r(e.rootMargin),threshold:r(e.threshold)}||void 0;f.value=new IntersectionObserver(v,t),i.value.map(e=>e.target).forEach(f.value.observe)},{deep:!0});const p=a?e=>{const t=r(e);f.value.observe(t)}:m,g=a?e=>{const t=r(e);f.value.unobserve(t)}:m,h=()=>f.value.disconnect();return s&&(s.value||t.onMounted(()=>{s.value&&p(s)}),t.onUnmounted(()=>{h()})),{supported:a,elements:i,observe:p,unobserve:g,disconnect:h,isIntersecting:c}},e.useIntlNumberFormat=ee,e.useLanguage=function(){if(N||(N=w?t.ref(navigator.language):t.ref("")),!H)if(w){H=t.ref(navigator.languages);const e=()=>{N.value=navigator.language,H.value=navigator.languages};window.addEventListener("languagechange",e,g)}else H=t.ref([]);return{language:N,languages:H}},e.useLocalStorage=pe,e.useMatchMedia=X,e.useNetworkInformation=function(){const e=!!w&&(navigator.connection||navigator.mozConnection||navigator.webkitConnection),n=!!e,r=t.ref(0),o=t.ref(0),a=t.ref("unknown"),l=t.ref(0),s=t.ref(!1),u=t.ref("none");let i=m,c=m;return e&&(i=()=>{r.value=e.downlink,o.value=e.downlinkMax,a.value=e.effectiveType,l.value=e.rtt,s.value=e.saveData,u.value=e.type},c=F(e,"change",i,g),i()),{supported:n,downlink:r,downlinkMax:o,effectiveType:a,rtt:l,saveData:s,type:u,remove:c}},e.useNow=O,e.useOnMouseMove=function(e,n,r){const o=t.ref(0),a=t.ref(0);let l=e=>{o.value=e.x,a.value=e.y};const[s,u]=c(n)?[void 0,n]:[n,r];u&&(l=I(l,r));const i=F(e,"mousemove",l,s);return{mouseX:o,mouseY:a,remove:i}},e.useOnResize=function(e,n,r){const a=o(e),l=t.ref(a.value&&a.value.clientHeight),s=t.ref(a.value&&a.value.clientWidth);let u=()=>{l.value=a.value.clientHeight,s.value=a.value.clientWidth};const[i,v]=c(n)?[void 0,n]:[n,r];v&&(u=I(u,r));const d=w?F(window,"resize",u,i||g):m;return{height:l,width:s,remove:d}},e.useOnScroll=function(e,n,r){const a=e=>!(c(e)||u(e)||!d(e)&&!t.isRef(e)||!e),l=a(e)?o(e):t.ref(w&&window||void 0),s=a(e)?l:t.ref(w&&window.document.scrollingElement||void 0),i=t.ref(s.value&&s.value.scrollTop||0),v=t.ref(s.value&&s.value.scrollLeft||0);let f=()=>{i.value=s.value.scrollTop,v.value=s.value.scrollLeft};const m=(...e)=>s.value&&s.value.scrollTo&&s.value.scrollTo.apply(s.value,e),p=e=>m({top:e}),h=e=>m({left:e}),[y,b]=c(e)||!e?[g,e]:c(n)?[g,n]:[n,r];b&&(f=I(f,r));const $=F(l,"scroll",f,y),E=t.watch(i,p,{lazy:!0}),M=t.watch(v,h,{lazy:!0});return{scrollTop:i,scrollLeft:v,scrollTo:m,remove:()=>{$(),M(),E()},scrollTopTo:p,scrollLeftTo:h}},e.useOnline=function(){const e=w&&"onLine"in navigator;return e||(U=t.ref(!1)),U||(U=t.ref(navigator.onLine),window.addEventListener("offline",()=>U.value=!1,g),window.addEventListener("online",()=>U.value=!0,g)),{supported:e,online:U}},e.usePageVisibility=function(){return B||(B=t.ref(w&&document.hidden)),V||(w?(V=t.ref(document.visibilityState),document.addEventListener("visibilitychange",()=>{V.value=document.visibilityState,B.value=document.hidden},g)):V=t.ref(!1)),{visibility:V,hidden:B}},e.usePagination=$,e.usePath=j,e.usePerformanceNow=function(e){return O({refreshMs:e&&e.refreshMs||1e3,sync:!e||!u(e.sync)||e.sync,timeFn:()=>performance.now()})},e.usePromise=E,e.usePromiseLazy=function(e,t=!1){return E(e,{lazy:!0,throwException:t})},e.useRetry=function(e,n){const r=!e||l(e)?{}:e,o=l(e)?e:n;if(!l(e)&&!v(e))throw new Error("[useRetry] options needs to be 'object'");if(o&&!l(o))throw new Error("[useRetry] factory needs to be 'function'");const a=t.ref(!1),s=t.ref(),u=t.ref([]),i={value:!1},c={isRetrying:a,retryCount:t.computed(()=>u.value.length),nextRetry:s,retryErrors:u,[S]:{value:0},[k]:i},d=o?(...e)=>(++c[S].value,L(r,c,o,e)):e=>(++c[S].value,L(r,c,e,void 0));return{...c,cancel:()=>{c.isRetrying.value=!1,c.retryErrors.value.push(new Error("[useRetry] cancelled")),c.nextRetry.value=void 0,i.value=!0},exec:d}},e.useSessionStorage=ge,e.useSharedRef=Y,e.useStorage=function(e,t,n){return void 0===he&&(he=me("localStorage").supported),he?pe(e,t,n):ge(e,t)},e.useValidation=function(e){const n=[],r=z({input:e},n),o=t.reactive(r.input);return n.forEach(e=>e(o)),o},e.useWebSocket=function(e,n){const r=w&&"WebSocket"in window;let o=null;const a=t.ref(null),l=t.ref(),s=t.ref(null),u=t.ref(!1),i=t.ref(!1),c=t.ref(!1);let v=m,d=m;return r&&(o=new WebSocket(e,n),o.addEventListener("message",e=>{a.value=e,s.value=e.data}),o.addEventListener("error",e=>{l.value=e,c.value=!0}),o.addEventListener("close",()=>{u.value=!1,i.value=!0}),o.addEventListener("open",()=>{u.value=!0,i.value=!1}),v=e=>o.send(e),d=(e,t)=>{o.close(e,t)}),{supported:r,ws:o,send:v,close:d,messageEvent:a,errorEvent:l,data:s,isOpen:u,isClosed:i,errored:c}},e.useWebStorage=me,e.useWorker=function(e,n,r){const o=w&&"Worker"in self,a=t.ref(),l=t.ref(),s=t.ref(!o),u=t.ref(!o);if(!o)return s.value=!0,{worker:void 0,data:l,postMessage:m,terminate:m,errorEvent:a,errored:u,terminated:s};const i=new Worker(e,r),c=e=>i.postMessage(e);function v(){i.terminate(),s.value=!0}return i.addEventListener("message",e=>{l.value=e.data},g),i.addEventListener("error",e=>{a.value=e,u.value=!0},g),t.onUnmounted(v),n&&c(n),{worker:i,data:l,postMessage:c,terminate:v,errorEvent:a,errored:u,terminated:s}},e.useWorkerFunction=function(e,n){const o=w&&"Worker"in self,a=t.computed(()=>n&&r(n.dependencies)||[]),l=t.computed(()=>n&&r(n.timeout));if(!o)return M(e,{lazy:!0,throwException:!0});const s=M((...n)=>new Promise((r,o)=>{const u=function(e,t){const n=[t.length>0?`importScripts("${t.join('","')}");`:"","onmessage=",`(${G.toString()})(${e.toString()})`],r=new Blob(n,{type:"text/javascript"});return URL.createObjectURL(r)}(e,a.value),i=new Worker(u);let c=-1;const v=l.value,d=()=>{i.terminate(),URL.revokeObjectURL(u),clearTimeout(c),p()},f=n.length===e.length+1&&t.isRef(n[n.length-1])&&!1===n[n.length-1].value?t.computed(()=>s.cancelled.value||n[n.length-1].value):s.cancelled,p=f?t.watch(f,()=>{d(),r(void 0)},{lazy:!0}):m;i.addEventListener("message",e=>{e.data[0]?r(e.data[1]):o(e.data[1]),d()},g),i.addEventListener("error",e=>{d(),o(e)},g),i.postMessage([...n]),v&&(c=setTimeout(()=>{s.cancel(`[WebWorker] timeout after ${v}ms`)},v))}),{lazy:!0,throwException:!0});return s},e.wrap=o,e}({},vueCompositionApi,Vue);
var vueComposable=function(e,t,n){"use strict";n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;const r=t.set;function o(e,n,r){return t.watch(e,n,{...r,lazy:"boolean"==typeof r.immediate?!r.immediate:void 0})}function a(e){return t.isRef(e)?e.value:e}function s(e){return t.isRef(e)?e:t.ref(e)}const l=Array.isArray,u=e=>"function"==typeof e,i=e=>"string"==typeof e,c=e=>"boolean"==typeof e,v=e=>f(e)&&u(e.getTime),d=e=>"number"==typeof e,f=e=>null!==e&&"object"==typeof e,m=e=>f(e)&&!!e.tagName;function p(e){return f(e)&&u(e.then)&&u(e.catch)}const g=()=>{},h=()=>!1,y={passive:!0};function w(e){return new Promise(t=>{setTimeout(t,e)})}function b(e,t,n){return e<t?t:e>n?n:e}const E="undefined"!=typeof window;function $(e,...t){for(let n=0;n<t.length;n++){const r=t[n];if(void 0===r||!f(r))continue;const o=Object.keys(r);for(let t=0;t<o.length;t++){const n=o[t],s=a(r[n]),l=typeof s,u=typeof e[n];void 0!==e[n]&&l!==u||(e[n]=f(s)?$(e[n]||{},s):r[n])}}return e}function M(e,n,r,a){let l=g;if(e){const u=s(e),i=e=>e.removeEventListener(n,r),c=e=>e.addEventListener(n,r,a);l=()=>{i(u.value)},t.onUnmounted(l),t.onMounted(()=>{o(u,(e,t)=>{t&&i(t),e&&c(e)},{immediate:!0})})}return l}function S(e,t,n){return k(e,t,n)}function k(e,t=50,n={isImmediate:!1}){let r;return function(...o){const a=this,s=n.isImmediate&&void 0===r;void 0!==r&&clearTimeout(r),r=setTimeout((function(){r=void 0,n.isImmediate||e.apply(a,o)}),t),s&&e.apply(a,o)}}function L(e,n){if(!e)throw new Error(`[usePromise] argument can't be '${e}'`);if("function"!=typeof e)throw new Error(`[usePromise] expects function, but received ${typeof e}`);const[r,o]=c(n)?[n,!1]:f(n)?[n.lazy,n.throwException]:[!1,!1],a=t.ref(!1),s=t.ref(null),l=t.ref(null),u=t.ref(),i=async(...t)=>{a.value=!0,s.value=null;const n=t&&e.length!==t.length&&t.length>0&&c(t[t.length-1])?t[t.length-1]:o,r=u.value=e(...t);try{const e=await r;return u.value===r&&(l.value=e),e}catch(e){return u.value===r&&(s.value=e,l.value=null),n?r:void 0}finally{u.value===r&&(a.value=!1)}};return r||i(),{exec:i,result:l,promise:u,loading:a,error:s}}function x(e,n){const r=t.ref(!1);let o=void 0;return{...L((...t)=>{return n=e(...t),new Promise((e,t)=>{o=e=>{r.value=!0,t(e)},n.then(e).catch(t)});var n},n),cancel:e=>{o&&o(e)},cancelled:r}}const I=Symbol(""),R=Symbol(""),O=async(e,t,n,r)=>{const o=t[I].value;let a=-1;const s=e.maxRetries||9001,l=e.retryDelay||P;t.retryErrors.value=[],t.isRetrying.value=!1,t.nextRetry.value=void 0;let u=void 0;do{let e=!1,i=null;try{if(++a,i=r?n(...r):n(),p(i)&&(i=await i),t[R].value)return null;e=!0}catch(e){i=null,t.retryErrors.value.push(e)}if(o!==t[I].value)return i;if(e)return t.isRetrying.value=!1,t.nextRetry.value=void 0,i;if(a>=s)return t.isRetrying.value=!1,t.nextRetry.value=void 0,Promise.reject(new Error(`[useRetry] max retries reached ${s}`));t.isRetrying.value=!0;const c=Date.now(),f=l(a),m=p(f)?await f:f;if(!p(f)||m){if(d(m))u=m;else{if(!v(m))throw new Error(`[useRetry] invalid value received from options.retryDelay '${typeof m}'`);u=m.getTime()}u<c?t.nextRetry.value=c+u:(t.nextRetry.value=u,u-=c),u>0&&await w(u)}if(t[R].value)return null;if(o!==t[I].value)return i}while(a<9e3);return null};const P=()=>0;function j(e){return e&&(c(e.isJson)||c(e.parseImmediate))}let C=void 0;let T=void 0,_=void 0;let D=void 0,A=void 0;function F(e,n){const r=E&&"BroadcastChannel"in self,o=t.ref(null),a=t.ref(null),s=t.ref(null),l=t.ref(!1),u=t.ref(!1);let i=g,c=g,v=g;if(r){const r=new BroadcastChannel(e);r.addEventListener("messageerror",e=>{s.value=e,l.value=!0},y),r.addEventListener("message",e=>{a.value=e,o.value=e.data},y),i=e=>r.postMessage(e),c=()=>{r.close(),u.value=!0},v=(e,n)=>{r.addEventListener("message",e,n),t.onUnmounted(()=>r.removeEventListener("message",e))},t.onUnmounted(()=>{n&&n(),c()})}return{supported:r,data:o,messageEvent:a,errorEvent:s,errored:l,isClosed:u,send:i,close:c,addListener:v}}function U(e,t){const n=getComputedStyle(e).getPropertyValue(t);return n?n.trim():null}function V(e,t,n){e.style.setProperty(t,n)}const W={attributes:!0,childList:!0,subtree:!0},z=e=>e.length<=2||"-"!==e[0]||"-"!==e[1]?`--${e}`:e;const B=e=>function(t){const n=t.data||[];return new Promise(t=>{try{Promise.resolve(e.apply(e,n)).then(e=>t(postMessage([!0,e]))).catch(e=>t(postMessage([!1,e])))}catch(e){t(postMessage([!1,e]))}})};function N(e){const n=!!E&&"matchMedia"in window;let r=void 0,o=void 0,a=g;if(n){r=t.ref(matchMedia(e)),o=t.ref(r.value.matches);const n=e=>{o.value=e.matches};r.value.addEventListener("change",n,y);const a=()=>r.value.removeEventListener("change",n);t.onUnmounted(a)}else r=t.ref({}),o=t.ref(!1);return{supported:n,mediaQueryList:r,matches:o,remove:a}}function H(e,n){const{addListener:r,send:a,close:s,supported:l}=F(e,()=>w()),u=Date.now(),i=t.ref(!1),c=t.ref(0),v=t.computed(()=>1!==c.value||i.value),d=t.ref([]),m=t.ref(n);let p=!1,g=void 0;a({type:0});const h=()=>a({type:5,id:u}),w=()=>{0!==d.value.length&&(i.value&&a({type:3,mind:1,id:Math.min(...d.value)}),a({type:4,id:u}))};return r(e=>{switch(e.data.type){case 0:a({type:2,value:m.value,mind:c.value});break;case 4:{const t=d.value.indexOf(e.data.id);t>=0&&d.value.splice(t,1),g===e.data.id&&d.value.length>0&&a({type:3,mind:1,id:Math.min(u,...d.value)});break}case 2:p=!0,m.value=e.data.value,c.value=e.data.mind;break;case 3:c.value=e.data.mind,g=1===e.data.mind&&e.data.id||void 0,i.value=g===u,i.value&&(d.value=[],h());break;case 5:d.value=[e.data.id],a({type:6,id:u});break;case 6:d.value.push(e.data.id)}},y),h(),o(m,(e,t)=>{if(p)p=!1;else{if(1===c.value&&!1===i.value)return p=!0,void(m.value=t);a({type:2,mind:c.value,value:f(e)?{...e}:e}),p=!1}},{deep:!0,immediate:!1}),E&&window.addEventListener("unload",w,y),t.onUnmounted(()=>{w(),s()}),{supported:l,id:u,data:m,master:i,mind:c,editable:v,targets:d,ping:h,setMind:e=>{switch(e){case 1:i.value=!0;break;case 0:i.value=!1}c.value=e,a({type:3,id:u,mind:c.value})},addListener:r}}function K(e,n){const r=s(n),o=s(e);return f(r.value)||t.isRef(n)?[void 0!==o.value?o:void 0,r]:!f(o.value)||l(o.value)||i(o.value)?[o.value?o:void 0,void 0]:[void 0,o]}function J(e,n){const[r,o]=K(e,n),s=t.computed(()=>new Intl.NumberFormat(a(r),a(o))),l=(e,t,n)=>(t||n?new Intl.NumberFormat(a(n)||a(r),{...a(o),...a(t)}):s.value).format(a(e));return{format:(e,n,r)=>t.computed(()=>l(e,n,r)),formatString:l,formatter:s}}function q(e){if(e)return d(e)?e:Q(e)}const Q=e=>{const t=e.match(/^(\d+)px$/);if(t)return+t[1]};function G(e){const n={},r=new Map,o=t.ref();let a=[];const s=[];for(const o in e){const l=e[o],u=q(l);if(void 0!==u){const e=t.ref(!1);n[o]=e,r.set(u,{name:o,valid:e}),a.push(u)}else{const{matches:e,remove:t}=N(l);n[o]=e,s.push(t)}}a=a.sort((e,t)=>t-e);const l=E?()=>{const e=window.innerWidth;let t=void 0;for(let n=0;n<a.length;n++){const o=a[n],s=r.get(o);s.valid.value=e>=o,e>=o&&void 0===t&&(t=s.name)}o.value=t}:g,u=S(l,10),i=E?()=>window.removeEventListener("resize",u):g;return E&&(t.onMounted(()=>{l(),window.addEventListener("resize",u,y)}),t.onUnmounted(()=>{i(),s.forEach(e=>e())})),{...n,remove:i,current:o}}const X=Symbol(""),Y={sm:640,md:768,lg:1024,xl:1280};function Z(e){return f(e)&&f(e.theme)&&f(e.theme.screens)}function ee(e){return!!f(e)&&(i(e.min)||i(e.max)||d(e.min)||d(e.max))}function te(e){const t=[];if(l(e)){const n=e.map(te);for(let e=0;e<n.length;e++){const r=n[e];t.push(...r)}}else f(n=e)&&i(n.raw)?t.push(e.raw):ee(e)?t.push(function(e){return ee(e)?`(${[e.max&&`max-width: ${e.max}`,e.min&&`min-width: ${e.min}`].filter(Boolean).join(" and ")})`:""}(e)):(i(e)||d(e))&&t.push(`min-width: ${e}`);var n;return t}function ne(e){const n=Z(e)?e.theme.screens:e;if(Z(e))for(const e in n)n.hasOwnProperty(e)&&(n[e]=te(n[e]).join(" or "));const r=G(n);return t.provide(X,r),r}function re(e,t){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&(t&&0!==t.length||!1)}function oe(e){try{if(!e)return!1;const t=":$";return e.setItem(t,t),e.removeItem(t),!0}catch(t){return re(t,e)}}function ae(e,t){try{return e.parse(t)}catch{return t}}let se=void 0;function le(e,n=JSON,r=10){const a=E?window[e]:void 0,l=oe(a);se||(se=new Map,E&&window.addEventListener("storage",e=>{if(e.newValue===e.oldValue)return;let t=se.get("localStorage");t=e.storageArea===window.localStorage?se.get("localStorage"):se.get("sessionStorage"),t&&Object.keys(t.$syncKeys).length>0&&(null===e.key?t.clear():t.$syncKeys[e.key]&&(null===e.newValue?t.removeItem(e.key):t.updateItem(e.key,e.newValue)))}));let u,c=se.get(e);return l&&a?c?u=c.$quotaError:(u=t.ref(!1),c={$refMap:new Map,$watchHandlers:new Map,$syncKeys:{},$quotaError:u,key:a.key,length:a.length,setSync(e,t){t?this.$syncKeys[e]=!0:delete this.$syncKeys[e]},clear(){this.$refMap.forEach((e,t)=>this.removeItem(t))},removeItem(e){const t=this.$refMap.get(e);t&&(t.value=void 0);const n=this.$watchHandlers.get(e);n&&n(),delete this.$syncKeys[e],this.$refMap.delete(e),a.removeItem(e)},getItem(e){const t=a.getItem(e);return t?this.setItem(e,ae(n,t)):null},setItem(e,t){const l=s(t);this.$refMap.set(e,l);const c=(e,t)=>{try{const r=a.getItem(e),o=i(t)?t:n.stringify(t);a.setItem(e,o),r!==o&&E&&this.$syncKeys[e]&&window.dispatchEvent(new StorageEvent(e,{newValue:o,oldValue:r,storageArea:a}))}catch(e){u.value=re(e,a)}};c(e,t);const v=o(l,k(t=>{c(e,t)},r),{immediate:!1,deep:!0});return this.$watchHandlers.set(e,v),l},updateItem(e,t){let r=this.$refMap.get(e);r&&(r.value=ae(n,t))}},se.set(e,c)):(u=t.ref(!1),c={}),{supported:l,quotaError:u,store:c,remove:()=>se.delete(e)}}function ue(e,n,r){const{supported:o,store:a}=le("localStorage");let s=g,l=g,u=g,i=void 0;return o&&a?(u=t=>a.setSync(e,t),s=()=>a.removeItem(e),l=()=>a.clear(),i=a.getItem(e),i||(i=a.setItem(e,n)),!1!==r&&u(!0)):i=t.ref(n),{supported:o,storage:i,clear:l,remove:s,setSync:u}}function ie(e,n,r){const{supported:o,store:a}=le("sessionStorage");let s=g,l=g,u=h,i=void 0;return o&&a?(s=()=>a.removeItem(e),l=()=>a.clear(),i=a.getItem(e),i||(i=a.setItem(e,n))):i=t.ref(n),{supported:o,storage:i,clear:l,remove:s,setSync:u}}let ce=void 0;function ve(e){const n=s(e.currentPage),r=s(e.pageSize),a=t.ref(0),l=s(e.total),u=t.computed({get:()=>a.value,set(e){d(e)&&(a.value=Math.min(e,l.value))}}),i=t.computed({get:()=>n.value,set(e){d(e)&&(n.value=b(e,1,v.value),u.value=(n.value-1)*c.value)}}),c=t.computed({get:()=>r.value,set(e){d(e)&&(r.value=e)}}),v=t.computed(()=>Math.ceil(l.value/c.value));i.value=n.value;return o([l,c],e=>{i.value>v.value&&(i.value=v.value)},{immediate:!1}),{pageSize:c,total:l,currentPage:i,offset:u,lastPage:v,next:()=>++i.value,prev:()=>--i.value,first:()=>i.value=1,last:()=>i.value=v.value}}function de(e){const n=e&&e.refreshMs||1e3,r=!e||!c(e.sync)||e.sync,o=e&&u(e.timeFn)&&e.timeFn||Date.now;let a=void 0,s=void 0;const l=t.ref(o()),i=()=>{clearInterval(a),clearTimeout(s)},v=E?()=>a=setInterval(()=>l.value=o(),n):g;if(r){const e=1e3-(l.value-1e3*Math.floor(l.value/1e3));s=setTimeout(v,e)}else v();return t.onUnmounted(i),{now:l,remove:i}}function fe(e,n){return t.computed(()=>{const r=a(e);if(!n)return r;const o=t.isRef(n)?t.reactive(n.value):t.reactive(n);return r.replace(/({?{[\w\s]*}?})/g,e=>{const t=e.replace("{","").replace("}","").trim();if(e[0]===e[1]&&"{"===e[0])return`${t}`;const n=l(o)?o[+t]:o[t];return void 0===n?e:`${a(n)}`})})}function me(e,n,r=".",o=g){return t.computed(()=>{const t=a(e),s=a(n);if(void 0===t)return o(s,t,s,t);if(!s)return t;const l=s.split(r);let u=t;for(let e=0;e<l.length;e++){let n=l[e];if("]"===n[n.length-1]){const t=/\[[`'"]?([^`'"\]]*)[`'"]?\]/g;let r=n,o=t.exec(r);if(o){let a=o[0].length,s=o.index-a,u=1;do{o.index,s=o.index,a=o[0].length,n=n.slice(0,-o[0].length),l.splice(e+u,0,o[1]),++u}while(o=t.exec(r));if(!n&&"["===r[0]&&r.length>2)continue}else n="",console.warn(`[usePath] invalid path provided "${r}"`)}if(!f(u))return o(l.slice(0,e+1).join(r),u,s,t);if(!n)return o(l.slice(0,e+1).join(r),u,s,t);if(u=u[n],!u)return o(l.slice(0,e+1).join(r),u,s,t)}return u})}function pe(e){return void 0!==e.$value}const ge=(e,n,r)=>{const{$message:s,$validator:l,...u}=function(e){return f(e)}(n)?n:{$validator:n,$message:""},{$pending:i,$promise:c,$invalid:v,$error:d}=((e,n,r)=>{const s=t.ref(null),l=t.ref(!1),u=t.ref(),i=t.ref(!1);let c=void 0;const v=e=>{s.value=(async()=>{try{l.value=!0;const t=n(e,c);p(t)?i.value=!await t:i.value=!t}catch(e){throw i.value=!0,e}finally{l.value=!1}})().catch(e=>(u.value=a(e),i.value=!0,e))};return r.push(t=>{c=t,o(()=>{try{n(e.value,c)}catch(e){}return e.value},v,{deep:!0,immediate:!0})}),{$promise:s,$pending:l,$invalid:i,$error:u}})(e,l,r);return{$pending:i,$error:d,$promise:c,$invalid:v,$message:s,...u}},he=(e,n)=>{const r={},l=pe(e)?s(e.$value):void 0;for(const s of Object.keys(e))if("$"!==s[0])if(l){const t=ge(l,e[s],n);r[s]={...t,$value:l}}else{const o=he(e[s],n);let l,u,i=void 0;if(pe(o)){const e=Object.keys(o).filter(e=>"$"!==e[0]).map(e=>o[e]);l=t.computed(()=>e.map(e=>e.$error).filter(Boolean).map(e=>a(e))),u=t.computed(()=>e.some(e=>!!a(e.$invalid)))}else{const e=Object.keys(o).map(e=>o[e]);l=t.computed(()=>e.map(e=>a(e.$errors)).filter(Boolean).filter(e=>e.some(Boolean))),i=t.computed(()=>e.some(e=>e.$anyDirty||c(a(e.$dirty))&&a(e.$dirty))),u=t.computed(()=>e.some(e=>!!a(e.$anyInvalid)))}r[s]={...o,$errors:l,$anyInvalid:u},i&&(r[s].$anyDirty=i)}else{if("$value"===s){r[s]=l;const e=t.ref(!1),n=o(l,()=>{e.value=!0,n()},{immediate:!1,deep:!0});r.$dirty=e;continue}r[s]=e[s]}return r};const ye=Symbol("");function we(e){const l=t.ref(Object.keys(e.messages)),i=t.ref(e.messages),v=t.ref(e.locale),d=t.ref({});let f=t.ref();const m={},g=(e,n)=>{if(m[e])return m[e];const r=n.value[e];if(!r)return t.ref({});let o=u(r)?r():r;return p(o)?o.then(t=>m[e]=s(t)):u(r)?s(o):m[e]=t.computed(()=>n.value[e])},h=!!e.fallback&&(!c(e.notFoundFallback)||e.notFoundFallback);let y=!1;if(h){const t=g(e.fallback,i);p(t)?(t.then(e=>{f.value=e.value}),y=!0):f.value=t.value}else f.value={};const w=t.ref(0);o(i,()=>w.value++,{deep:!0,immediate:!1}),o([v,f,w],([t,n,r])=>{if(t===e.fallback&&h)d.value=n;else{const e=e=>d.value=$({},n,a(e)),r=g(t,i);p(r)?r.then(e):e(r)}},{immediate:!y});const b=(t,n)=>e.resolve?s(e.resolve(d.value,t,n)):fe(me(d,t,".",(e,t,n,r)=>n),n);return{locale:v,locales:l,i18n:d,$t:b,$ts:(e,t)=>b(e,t).value,addLocale:(e,t)=>{l.value.indexOf(e)>=0||l.value.push(e),delete m[e],__VUE_2__?r(i.value,e,t):i.value[e]=t},removeLocale:t=>{const r=l.value.indexOf(t);if(r>=0){const n=[v.value,f.value&&e.fallback,...l.value].find(e=>e&&e!==t);n&&(t===e.fallback&&(f.value=void 0),t===v.value&&(v.value=n)),l.value.splice(r,1)}var o,a;__VUE_2__?(o=i.value,a=t,n.delete(o,a)):delete i.value[t],delete m[t]}}}function be(e){const n=we(e);return t.provide(ye,n),n}return e.FALSE_OP=h,e.NO_OP=g,e.PASSIVE_EV=y,e.buildI18n=we,e.debounce=k,e.deepClone=$,e.exponentialDelay=e=>{const t=100*Math.pow(2,e);return t+.2*t*Math.random()},e.exposeWorker=function(e){this.onmessage=async t=>{const n=e(t.data);if(void 0===n)this.postMessage(n);else if(null===n)this.postMessage(n);else if(l(n))this.postMessage(n);else if(n[Symbol.asyncIterator])for await(const e of n)this.postMessage(e);else if(n[Symbol.iterator])for(const e of n)this.postMessage(e);else this.postMessage(await n)}},e.getCssVariableFor=U,e.isArray=l,e.isBoolean=c,e.isClient=E,e.isDate=v,e.isElement=m,e.isFunction=u,e.isNumber=d,e.isObject=f,e.isPromise=p,e.isString=i,e.isSymbol=e=>"symbol"==typeof e,e.minMax=b,e.noDelay=P,e.promisedTimeout=w,e.refShared=function(e,n){const r=t.getCurrentInstance(),o=n||(__VUE_2__?r.$vnode.tag:r.vnode.scopeId);if(!o)return t.ref(e);const{data:a,supported:s}=H(o,e);return a},e.setBreakpointTailwindCSS=ne,e.setCssVariableFor=V,e.setI18n=be,e.storageAvailable=oe,e.unwrap=a,e.useArrayPagination=function(e,n){const r=s(e),o=ve({currentPage:1,pageSize:10,...n,total:t.computed(()=>r.value.length)}),a=t.computed(()=>{const e=r.value;return Array.isArray(e)?e.slice(o.offset.value,o.offset.value+o.pageSize.value):[]});return{...o,result:a}},e.useBreakpoint=G,e.useBreakpointChrome=function(){return G({mobileS:320,mobileM:375,mobileL:425,tablet:768,laptop:1024,laptopL:1440,desktop4K:2560})},e.useBreakpointTailwindCSS=function(e){const n=t.inject(X);return n||ne(e||Y)},e.useBroadcastChannel=F,e.useCancellablePromise=x,e.useCssVariables=function(e,n,r){const l=E&&"MutationObserver"in self,[u,c]=t.isRef(n)||m(n)?[n,r||W]:[l&&document.documentElement||{},n||W],v=t.ref(!0),d={},f=[],p=Object.entries(e).map(e=>{const[t,n]=i(e[1])?[e[1]]:[e[1].name,e[1].value];return n&&(f.push(()=>V(a(u),t,a(n))),d[e[0]]=s(n)),[e[0],z(t)]});for(let e=0;e<p.length;e++){const[n,r]=p[e];d[n]||(d[n]=t.ref(t.isRef(u)&&!u.value||!l?null:U(a(u),r))),l&&o([d[n],s(u)],e=>{v&&e[1]&&e[0]!==U(e[1],r)&&V(e[1],r,e[0])},{immediate:!t.isRef(u)})}if(!l)return{...d,stop:g,resume:g,supported:l,observing:v};const h=()=>{for(let e=0;e<p.length;e++){const[t,n]=p[e];d[t].value=U(a(u),n)}},y=new MutationObserver(h),w=()=>{y.disconnect(),v.value=!1},b=()=>{v.value||h(),y.observe(a(u),c),v.value=!0};return t.onUnmounted(w),t.isRef(u)?t.onMounted(()=>{f.forEach(e=>e()),o(u,(e,t)=>{t&&w(),e&&b()})}):(E||u)&&(f.forEach(e=>e()),b()),{...d,supported:l,resume:b,stop:w,observing:v}},e.useCurrencyFormat=function(e,n,r){const o=a(e),s=!f(o),l=s?e:t.computed(()=>a(e).currency),[u,i]=K(n,s?r:e),c=t.computed(()=>{const e=a(i)||{},t=a(l)||e.currency;return{style:"currency",...e,currency:t}}),v=J(u),d=(e,t,n,r,o)=>{const s={...c.value,...a(r)},l=a(t)||s.currency,u=a(n)||s.currencyDisplay;return v.formatString(e,{...s,currency:l,currencyDisplay:u},o)};return{format:(e,n,r,o,a)=>t.computed(()=>d(e,n,r,o,a)),formatString:d}},e.useDateNow=function(e){return de({refreshMs:e&&e.refreshMs||1e3,sync:!e||!c(e.sync)||e.sync,timeFn:Date.now})},e.useDebounce=S,e.useEvent=M,e.useFetch=function(e,n){const r=t.ref(null),o=t.ref(""),a=t.ref(),s=t.ref(null),[l,u]=j(e)?[!1!==e.isJson,!1!==e.parseImmediate]:j(n)?[!1!==n.isJson,!1!==n.parseImmediate]:[!0,!0],c=e?i(e)?n:j(e)?e:i(e.url)?n:e:void 0,v=t.ref(!1),d=t.ref();let f=void 0;const m=L(async(e,t)=>{f=new AbortController;const n=await fetch(e,{signal:f.signal,...c,...t});if(n){const e=[l?n.clone().json().then(e=>r.value=e).catch(e=>{r.value=null,s.value=e}):Promise.resolve(),n.clone().blob().then(e=>{a.value=e}),n.clone().text().then(e=>{o.value=e})];u&&await Promise.all(e)}return n},!0),p=t.computed(()=>m.result.value&&m.result.value.status||null),g=t.computed(()=>m.result.value&&m.result.value.statusText||null);return e&&(i(e)||i(e.url))&&m.exec(e,void 0,!1),{...m,cancel:e=>{f&&(f.abort(),v.value=!0,d.value=e)},isCancelled:v,cancelledMessage:d,text:o,blob:a,json:r,jsonError:s,status:p,statusText:g}},e.useFormat=fe,e.useGeolocation=function(e){const n=E&&!!navigator.geolocation,r=t.ref(e?!1===e.immediate:void 0),a=t.ref(null),s=t.ref(null),l=t.ref(null),u=t.ref(e&&e.enableHighAccuracy||null);let i=g;if(n){const n=e=>{s.value=e.timestamp,l.value=e.coords,a.value=null},v=e=>{s.value=Date.now(),l.value=null,a.value=e},d=()=>!0!==r.value&&m&&navigator.geolocation.clearWatch(m);let f=()=>navigator.geolocation.getCurrentPosition(n,v,e);i=r.value?()=>{r.value?r.value=!1:f()}:f;let m=0;t.onMounted(()=>o([u,r],t=>{d();const r=c(t[0])?t[0]:e?e.enableHighAccuracy:void 0;m=navigator.geolocation.watchPosition(n,v,e?{...e,enableHighAccuracy:r}:{enableHighAccuracy:r})},{immediate:!r.value})),t.onUnmounted(d)}return{supported:n,refresh:i,error:a,timestamp:s,coords:l,highAccuracy:u}},e.useI18n=function(e){return e?be(e):t.inject(ye)},e.useIntersectionObserver=function(e,n){const r=E&&"IntersectionObserver"in window,l=e?s(e):void 0,u=!l||!m(l.value)&&l.value?void 0:l,i=t.computed(()=>n?a(n):u?void 0:a(e)),c=t.ref([]),v=t.computed(()=>c.value.length>0&&c.value.every(e=>e.isIntersecting)),d=e=>{c.value=e};let f=t.ref();r&&o(i,e=>{f.value&&f.value.disconnect();const t=e&&e&&{root:a(e.root),rootMargin:a(e.rootMargin),threshold:a(e.threshold)}||void 0;f.value=new IntersectionObserver(d,t),c.value.map(e=>e.target).forEach(f.value.observe)},{deep:!0,immediate:!0});const p=r?e=>{const t=a(e);f.value.observe(t)}:g,h=r?e=>{const t=a(e);f.value.unobserve(t)}:g,y=()=>f.value.disconnect();return u&&(t.onMounted(()=>{u.value&&p(u)}),t.onUnmounted(()=>{y()})),{supported:r,elements:c,observe:p,unobserve:h,disconnect:y,isIntersecting:v}},e.useIntlNumberFormat=J,e.useLanguage=function(){if(D||(D=E?t.ref(navigator.language):t.ref("")),!A)if(E){A=t.ref(navigator.languages);const e=()=>{D.value=navigator.language,A.value=navigator.languages};window.addEventListener("languagechange",e,y)}else A=t.ref([]);return{language:D,languages:A}},e.useLocalStorage=ue,e.useMatchMedia=N,e.useNetworkInformation=function(){const e=!!E&&(navigator.connection||navigator.mozConnection||navigator.webkitConnection),n=!!e,r=t.ref(0),o=t.ref(0),a=t.ref("none"),s=t.ref(0),l=t.ref(!1),u=t.ref("none");let i=g,c=g;return e&&(i=()=>{r.value=e.downlink,o.value=e.downlinkMax,a.value=e.effectiveType,s.value=e.rtt,l.value=e.saveData,u.value=e.type},c=M(e,"change",i,y),i()),{supported:n,downlink:r,downlinkMax:o,effectiveType:a,rtt:s,saveData:l,type:u,remove:c}},e.useNow=de,e.useOnMouseMove=function(e,n,r){const o=t.ref(0),a=t.ref(0);let s=e=>{o.value=e.x,a.value=e.y};const[l,u]=d(n)?[void 0,n]:[n,r];u&&(s=S(s,r));const i=M(e,"mousemove",s,l);return{mouseX:o,mouseY:a,remove:i}},e.useOnResize=function(e,n,r){const o=s(e),a=t.ref(o.value&&o.value.clientHeight),l=t.ref(o.value&&o.value.clientWidth);let u=()=>{a.value=o.value.clientHeight,l.value=o.value.clientWidth};const[i,c]=d(n)?[void 0,n]:[n,r];c&&(u=S(u,r));const v=E?M(window,"resize",u,i||y):g;return{height:a,width:l,remove:v}},e.useOnScroll=function(e,n,r){const a=e=>!(d(e)||c(e)||!m(e)&&!t.isRef(e)||!e),l=a(e)?s(e):t.ref(E&&window||void 0),u=a(e)?l:t.ref(E&&window.document.scrollingElement||void 0),i=t.ref(u.value&&u.value.scrollTop||0),v=t.ref(u.value&&u.value.scrollLeft||0);let f=()=>{i.value=u.value.scrollTop,v.value=u.value.scrollLeft};const p=(...e)=>u.value&&u.value.scrollTo&&u.value.scrollTo.apply(u.value,e),g=e=>p({top:e}),h=e=>p({left:e}),[w,b]=d(e)||!e?[y,e]:d(n)?[y,n]:[n,r];b&&(f=S(f,r));const $=M(l,"scroll",f,w),k=o(i,g,{immediate:!1}),L=o(v,h,{immediate:!1});return{scrollTop:i,scrollLeft:v,scrollTo:p,remove:()=>{$(),L(),k()},scrollTopTo:g,scrollLeftTo:h}},e.useOnline=function(){const e=E&&"onLine"in navigator;return e||(C=t.ref(!1)),C||(C=t.ref(navigator.onLine),window.addEventListener("offline",()=>C.value=!1,y),window.addEventListener("online",()=>C.value=!0,y)),{supported:e,online:C}},e.usePageVisibility=function(){return _||(_=t.ref(E&&document.hidden)),T||(E?(T=t.ref(document.visibilityState),document.addEventListener("visibilitychange",()=>{T.value=document.visibilityState,_.value=document.hidden},y)):T=t.ref("visible")),{visibility:T,hidden:_}},e.usePagination=ve,e.usePath=me,e.usePerformanceNow=function(e){return de({refreshMs:e&&e.refreshMs||1e3,sync:!e||!c(e.sync)||e.sync,timeFn:()=>performance.now()})},e.usePromise=L,e.usePromiseLazy=function(e,t=!1){return L(e,{lazy:!0,throwException:t})},e.useRetry=function(e,n){const r=!e||u(e)?{}:e,o=u(e)?e:n;if(!u(e)&&!f(e))throw new Error("[useRetry] options needs to be 'object'");if(o&&!u(o))throw new Error("[useRetry] factory needs to be 'function'");const a=t.ref(!1),s=t.ref(),l=t.ref([]),i={value:!1},c={isRetrying:a,retryCount:t.computed(()=>l.value.length),nextRetry:s,retryErrors:l,[I]:{value:0},[R]:i},v=o?(...e)=>(++c[I].value,O(r,c,o,e)):e=>(++c[I].value,O(r,c,e,void 0));return{...c,cancel:()=>{c.isRetrying.value=!1,c.retryErrors.value.push(new Error("[useRetry] cancelled")),c.nextRetry.value=void 0,i.value=!0},exec:v}},e.useSessionStorage=ie,e.useSharedRef=H,e.useStorage=function(e,t,n){return void 0===ce&&(ce=le("localStorage").supported),ce?ue(e,t,n):ie(e,t)},e.useValidation=function(e){const n=[],r=he({input:e},n),o=t.reactive(r.input);return n.forEach(e=>e(o)),o},e.useWebSocket=function(e,n){const r=E&&"WebSocket"in window;let o=null;const a=t.ref(),s=t.ref(),l=t.ref(null),u=t.ref(!1),i=t.ref(!1),c=t.ref(!1);let v=g,d=g;return r&&(o=new WebSocket(e,n),o.addEventListener("message",e=>{a.value=e,l.value=e.data}),o.addEventListener("error",e=>{s.value=e,c.value=!0}),o.addEventListener("close",()=>{u.value=!1,i.value=!0}),o.addEventListener("open",()=>{u.value=!0,i.value=!1}),v=e=>o.send(e),d=(e,t)=>{o.close(e,t)}),{supported:r,ws:o,send:v,close:d,messageEvent:a,errorEvent:s,data:l,isOpen:u,isClosed:i,errored:c}},e.useWebStorage=le,e.useWorker=function(e,n,r){const o=E&&"Worker"in self,a=t.ref(),s=t.ref(),l=t.ref(!o),u=t.ref(!o);if(!o)return l.value=!0,{worker:void 0,data:s,postMessage:g,terminate:g,errorEvent:a,errored:u,terminated:l};const i=new Worker(e,r),c=e=>i.postMessage(e);function v(){i.terminate(),l.value=!0}return i.addEventListener("message",e=>{s.value=e.data},y),i.addEventListener("error",e=>{a.value=e,u.value=!0},y),t.onUnmounted(v),n&&c(n),{worker:i,data:s,postMessage:c,terminate:v,errorEvent:a,errored:u,terminated:l}},e.useWorkerFunction=function(e,n){const r=E&&"Worker"in self,s=t.computed(()=>n&&a(n.dependencies)||[]),l=t.computed(()=>n&&a(n.timeout));if(!r)return x(e,{lazy:!0,throwException:!0});const u=x((...n)=>new Promise((r,a)=>{const i=function(e,t){const n=[t.length>0?`importScripts("${t.join('","')}");`:"","onmessage=",`(${B.toString()})(${e.toString()})`],r=new Blob(n,{type:"text/javascript"});return URL.createObjectURL(r)}(e,s.value),c=new Worker(i);let v=-1;const d=l.value,f=()=>{c.terminate(),URL.revokeObjectURL(i),clearTimeout(v),p()},m=n.length===e.length+1&&t.isRef(n[n.length-1])&&!1===n[n.length-1].value?t.computed(()=>u.cancelled.value||n[n.length-1].value):u.cancelled,p=m?o(m,()=>{f(),r(void 0)},{immediate:!1}):g;c.addEventListener("message",e=>{e.data[0]?r(e.data[1]):a(e.data[1]),f()},y),c.addEventListener("error",e=>{f(),a(e)},y),c.postMessage([...n]),d&&(v=setTimeout(()=>{u.cancel(`[WebWorker] timeout after ${d}ms`)},d))}),{lazy:!0,throwException:!0});return u},e.wrap=s,e}({},vueCompositionApi,Vue);
{
"name": "vue-composable",
"version": "1.0.0-dev.21",
"version": "1.0.0-dev.22",
"description": "vue-composable",

@@ -14,3 +14,3 @@ "main": "index.js",

"buildOptions": {
"priority": 100,
"priority": 1,
"name": "vueComposable",

@@ -38,15 +38,14 @@ "formats": [

},
"homepage": "https://github.com/pikax/vue-composable",
"homepage": "https://pikax.me/vue-composable/composable",
"sideEffects": false,
"peerDependencies": {
"@vue/runtime-core": "^3.0.0-beta.1"
},
"peerDependencies3": {
"@vue/runtime-core": "^3.0.0-beta.1"
},
"peerDependencies2": {
"@vue/composition-api": "^0.5.0",
"vue": "^2.6.10"
},
"devDependencies": {
"vue": "^2.6.10"
},
"dependencies": {
"@vue-composable/core": "1.0.0-dev.21",
"@vue-composable/web": "1.0.0-dev.21"
}
}
}

@@ -5,14 +5,19 @@ # vue-composable

[![CircleCI](https://circleci.com/gh/pikax/vue-composable.svg?style=svg)](https://circleci.com/gh/pikax/vue-composable)
[![Coverage Status](https://coveralls.io/repos/github/pikax/vue-composable/badge.svg?branch=master)](https://coveralls.io/github/pikax/vue-composable?branch=master)
[![npm version](https://badge.fury.io/js/vue-composable.svg)](https://badge.fury.io/js/vue-composable)
[![bundle size](https://badgen.net/bundlephobia/minzip/vue-composable)](https://bundlephobia.com/result?p=vue-composable)
<!-- [![CircleCI](https://circleci.com/gh/pikax/vue-composable.svg?style=svg)](https://circleci.com/gh/pikax/vue-composable) -->
# vue-next
[![Coverage Status](https://coveralls.io/repos/github/pikax/vue-composable/badge.svg?branch=vue3)](https://coveralls.io/github/pikax/vue-composable?branch=vue3)
> For [vue-next](https://github.com/vuejs/vue-next) support please check [@next](https://www.npmjs.com/package/vue-composable/v/next)
<!-- [![npm version](https://badge.fury.io/js/vue-composable.svg)](https://badge.fury.io/js/vue-composable) -->
[![bundle size](https://badgen.net/bundlephobia/minzip/vue-composable@next)](https://bundlephobia.com/result?p=vue-composable@next)
# Vue 3
This version is `alpha` with support for the vue3 ([vue-next](https://github.com/vuejs/vue-next))
> Check webpack [vue3 example](https://github.com/pikax/vue-composable/tree/vue3/examples/vue-next-webpack-preview-master) or [CodeSandbox](https://codesandbox.io/s/vue-composable-next-6m5et)
## Introduction
`vue-composable` is out-of-box ready to use [composition-api](https://github.com/vuejs/composition-api) generic components, eg: [useFetch](examples/fetch.html)
`vue-composable` is out-of-box ready to use the brand new [Vue 3](https://github.com/vuejs/vue-next) [composition-api](https://vue-composition-api-rfc.netlify.com/) generic components.

@@ -32,6 +37,6 @@ 100% typescript based composable components and full type support out-of-box.

# install with yarn
yarn add @vue/composition-api vue-composable
yarn add @vue/runtime-core vue-composable
# install with npm
npm install @vue/composition-api vue-composable
npm install @vue/runtime-core vue-composable
```

@@ -41,2 +46,4 @@

> NOTE documentation might be slightly wrong, because it was built for the v2
Check our [documentation](https://pikax.me/vue-composable/)

@@ -43,0 +50,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc