@vueuse/integrations 10.2.1 → 10.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.cts +437 -0
- package/index.d.mts +437 -0
- package/package.json +7 -23
- package/useAsyncValidator/component.d.cts +27 -0
- package/useAsyncValidator/component.d.mts +27 -0
- package/useAsyncValidator.d.cts +48 -0
- package/useAsyncValidator.d.mts +48 -0
- package/useAxios.d.cts +94 -0
- package/useAxios.d.mts +94 -0
- package/useChangeCase.d.cts +36 -0
- package/useChangeCase.d.mts +36 -0
- package/useCookies.d.cts +54 -0
- package/useCookies.d.mts +54 -0
- package/useDrauu.d.cts +32 -0
- package/useDrauu.d.mts +32 -0
- package/useFocusTrap/component.d.cts +17 -0
- package/useFocusTrap/component.d.mts +17 -0
- package/useFocusTrap.d.cts +57 -0
- package/useFocusTrap.d.mts +57 -0
- package/useFuse.d.cts +25 -0
- package/useFuse.d.mts +25 -0
- package/useIDBKeyval.d.cts +41 -0
- package/useIDBKeyval.d.mts +41 -0
- package/useJwt.d.cts +29 -0
- package/useJwt.d.mts +29 -0
- package/useNProgress.d.cts +20 -0
- package/useNProgress.d.mts +20 -0
- package/useQRCode.d.cts +14 -0
- package/useQRCode.d.mts +14 -0
- package/useSortable/component.d.cts +40 -0
- package/useSortable/component.d.mts +40 -0
- package/useSortable.d.cts +26 -0
- package/useSortable.d.mts +26 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { MaybeRefOrGetter } from '@vueuse/shared';
|
|
2
|
+
import { ValidateError, ValidateOption, Rules } from 'async-validator';
|
|
3
|
+
import { Ref } from 'vue-demi';
|
|
4
|
+
|
|
5
|
+
type AsyncValidatorError = Error & {
|
|
6
|
+
errors: ValidateError[];
|
|
7
|
+
fields: Record<string, ValidateError[]>;
|
|
8
|
+
};
|
|
9
|
+
interface UseAsyncValidatorExecuteReturn {
|
|
10
|
+
pass: boolean;
|
|
11
|
+
errors: AsyncValidatorError['errors'] | undefined;
|
|
12
|
+
errorInfo: AsyncValidatorError | null;
|
|
13
|
+
errorFields: AsyncValidatorError['fields'] | undefined;
|
|
14
|
+
}
|
|
15
|
+
interface UseAsyncValidatorReturn {
|
|
16
|
+
pass: Ref<boolean>;
|
|
17
|
+
isFinished: Ref<boolean>;
|
|
18
|
+
errors: Ref<AsyncValidatorError['errors'] | undefined>;
|
|
19
|
+
errorInfo: Ref<AsyncValidatorError | null>;
|
|
20
|
+
errorFields: Ref<AsyncValidatorError['fields'] | undefined>;
|
|
21
|
+
execute: () => Promise<UseAsyncValidatorExecuteReturn>;
|
|
22
|
+
}
|
|
23
|
+
interface UseAsyncValidatorOptions {
|
|
24
|
+
/**
|
|
25
|
+
* @see https://github.com/yiminghe/async-validator#options
|
|
26
|
+
*/
|
|
27
|
+
validateOption?: ValidateOption;
|
|
28
|
+
/**
|
|
29
|
+
* The validation will be triggered right away for the first time.
|
|
30
|
+
* Only works when `manual` is not set to true.
|
|
31
|
+
*
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
immediate?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* If set to true, the validation will not be triggered automatically.
|
|
37
|
+
*/
|
|
38
|
+
manual?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Wrapper for async-validator.
|
|
42
|
+
*
|
|
43
|
+
* @see https://vueuse.org/useAsyncValidator
|
|
44
|
+
* @see https://github.com/yiminghe/async-validator
|
|
45
|
+
*/
|
|
46
|
+
declare function useAsyncValidator(value: MaybeRefOrGetter<Record<string, any>>, rules: MaybeRefOrGetter<Rules>, options?: UseAsyncValidatorOptions): UseAsyncValidatorReturn & PromiseLike<UseAsyncValidatorReturn>;
|
|
47
|
+
|
|
48
|
+
export { AsyncValidatorError, UseAsyncValidatorExecuteReturn, UseAsyncValidatorOptions, UseAsyncValidatorReturn, useAsyncValidator };
|
package/useAxios.d.cts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ShallowRef, Ref } from 'vue-demi';
|
|
2
|
+
import { AxiosResponse, AxiosRequestConfig, AxiosInstance } from 'axios';
|
|
3
|
+
|
|
4
|
+
interface UseAxiosReturn<T, R = AxiosResponse<T>, _D = any> {
|
|
5
|
+
/**
|
|
6
|
+
* Axios Response
|
|
7
|
+
*/
|
|
8
|
+
response: ShallowRef<R | undefined>;
|
|
9
|
+
/**
|
|
10
|
+
* Axios response data
|
|
11
|
+
*/
|
|
12
|
+
data: Ref<T | undefined>;
|
|
13
|
+
/**
|
|
14
|
+
* Indicates if the request has finished
|
|
15
|
+
*/
|
|
16
|
+
isFinished: Ref<boolean>;
|
|
17
|
+
/**
|
|
18
|
+
* Indicates if the request is currently loading
|
|
19
|
+
*/
|
|
20
|
+
isLoading: Ref<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* Indicates if the request was canceled
|
|
23
|
+
*/
|
|
24
|
+
isAborted: Ref<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* Any errors that may have occurred
|
|
27
|
+
*/
|
|
28
|
+
error: ShallowRef<unknown | undefined>;
|
|
29
|
+
/**
|
|
30
|
+
* Aborts the current request
|
|
31
|
+
*/
|
|
32
|
+
abort: (message?: string | undefined) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Alias to `abort`
|
|
35
|
+
*/
|
|
36
|
+
cancel: (message?: string | undefined) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Alias to `isAborted`
|
|
39
|
+
*/
|
|
40
|
+
isCanceled: Ref<boolean>;
|
|
41
|
+
}
|
|
42
|
+
interface StrictUseAxiosReturn<T, R, D> extends UseAxiosReturn<T, R, D> {
|
|
43
|
+
/**
|
|
44
|
+
* Manually call the axios request
|
|
45
|
+
*/
|
|
46
|
+
execute: (url?: string | AxiosRequestConfig<D>, config?: AxiosRequestConfig<D>) => Promise<StrictUseAxiosReturn<T, R, D>>;
|
|
47
|
+
}
|
|
48
|
+
interface EasyUseAxiosReturn<T, R, D> extends UseAxiosReturn<T, R, D> {
|
|
49
|
+
/**
|
|
50
|
+
* Manually call the axios request
|
|
51
|
+
*/
|
|
52
|
+
execute: (url: string, config?: AxiosRequestConfig<D>) => Promise<EasyUseAxiosReturn<T, R, D>>;
|
|
53
|
+
}
|
|
54
|
+
interface UseAxiosOptions<T = any> {
|
|
55
|
+
/**
|
|
56
|
+
* Will automatically run axios request when `useAxios` is used
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
immediate?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Use shallowRef.
|
|
62
|
+
*
|
|
63
|
+
* @default true
|
|
64
|
+
*/
|
|
65
|
+
shallow?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Callback when error is caught.
|
|
68
|
+
*/
|
|
69
|
+
onError?: (e: unknown) => void;
|
|
70
|
+
/**
|
|
71
|
+
* Callback when success is caught.
|
|
72
|
+
*/
|
|
73
|
+
onSuccess?: (data: T) => void;
|
|
74
|
+
/**
|
|
75
|
+
* Initial data to use
|
|
76
|
+
*/
|
|
77
|
+
initialData?: T;
|
|
78
|
+
/**
|
|
79
|
+
* Sets the state to initialState before executing the promise.
|
|
80
|
+
*/
|
|
81
|
+
resetOnExecute?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Callback when request is finished.
|
|
84
|
+
*/
|
|
85
|
+
onFinish?: () => void;
|
|
86
|
+
}
|
|
87
|
+
declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>, options?: UseAxiosOptions): StrictUseAxiosReturn<T, R, D> & Promise<StrictUseAxiosReturn<T, R, D>>;
|
|
88
|
+
declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(url: string, instance?: AxiosInstance, options?: UseAxiosOptions): StrictUseAxiosReturn<T, R, D> & Promise<StrictUseAxiosReturn<T, R, D>>;
|
|
89
|
+
declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(url: string, config: AxiosRequestConfig<D>, instance: AxiosInstance, options?: UseAxiosOptions): StrictUseAxiosReturn<T, R, D> & Promise<StrictUseAxiosReturn<T, R, D>>;
|
|
90
|
+
declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(config?: AxiosRequestConfig<D>): EasyUseAxiosReturn<T, R, D> & Promise<EasyUseAxiosReturn<T, R, D>>;
|
|
91
|
+
declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(instance?: AxiosInstance): EasyUseAxiosReturn<T, R, D> & Promise<EasyUseAxiosReturn<T, R, D>>;
|
|
92
|
+
declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(config?: AxiosRequestConfig<D>, instance?: AxiosInstance): EasyUseAxiosReturn<T, R, D> & Promise<EasyUseAxiosReturn<T, R, D>>;
|
|
93
|
+
|
|
94
|
+
export { EasyUseAxiosReturn, StrictUseAxiosReturn, UseAxiosOptions, UseAxiosReturn, useAxios };
|
package/useAxios.d.mts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ShallowRef, Ref } from 'vue-demi';
|
|
2
|
+
import { AxiosResponse, AxiosRequestConfig, AxiosInstance } from 'axios';
|
|
3
|
+
|
|
4
|
+
interface UseAxiosReturn<T, R = AxiosResponse<T>, _D = any> {
|
|
5
|
+
/**
|
|
6
|
+
* Axios Response
|
|
7
|
+
*/
|
|
8
|
+
response: ShallowRef<R | undefined>;
|
|
9
|
+
/**
|
|
10
|
+
* Axios response data
|
|
11
|
+
*/
|
|
12
|
+
data: Ref<T | undefined>;
|
|
13
|
+
/**
|
|
14
|
+
* Indicates if the request has finished
|
|
15
|
+
*/
|
|
16
|
+
isFinished: Ref<boolean>;
|
|
17
|
+
/**
|
|
18
|
+
* Indicates if the request is currently loading
|
|
19
|
+
*/
|
|
20
|
+
isLoading: Ref<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* Indicates if the request was canceled
|
|
23
|
+
*/
|
|
24
|
+
isAborted: Ref<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* Any errors that may have occurred
|
|
27
|
+
*/
|
|
28
|
+
error: ShallowRef<unknown | undefined>;
|
|
29
|
+
/**
|
|
30
|
+
* Aborts the current request
|
|
31
|
+
*/
|
|
32
|
+
abort: (message?: string | undefined) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Alias to `abort`
|
|
35
|
+
*/
|
|
36
|
+
cancel: (message?: string | undefined) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Alias to `isAborted`
|
|
39
|
+
*/
|
|
40
|
+
isCanceled: Ref<boolean>;
|
|
41
|
+
}
|
|
42
|
+
interface StrictUseAxiosReturn<T, R, D> extends UseAxiosReturn<T, R, D> {
|
|
43
|
+
/**
|
|
44
|
+
* Manually call the axios request
|
|
45
|
+
*/
|
|
46
|
+
execute: (url?: string | AxiosRequestConfig<D>, config?: AxiosRequestConfig<D>) => Promise<StrictUseAxiosReturn<T, R, D>>;
|
|
47
|
+
}
|
|
48
|
+
interface EasyUseAxiosReturn<T, R, D> extends UseAxiosReturn<T, R, D> {
|
|
49
|
+
/**
|
|
50
|
+
* Manually call the axios request
|
|
51
|
+
*/
|
|
52
|
+
execute: (url: string, config?: AxiosRequestConfig<D>) => Promise<EasyUseAxiosReturn<T, R, D>>;
|
|
53
|
+
}
|
|
54
|
+
interface UseAxiosOptions<T = any> {
|
|
55
|
+
/**
|
|
56
|
+
* Will automatically run axios request when `useAxios` is used
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
immediate?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Use shallowRef.
|
|
62
|
+
*
|
|
63
|
+
* @default true
|
|
64
|
+
*/
|
|
65
|
+
shallow?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Callback when error is caught.
|
|
68
|
+
*/
|
|
69
|
+
onError?: (e: unknown) => void;
|
|
70
|
+
/**
|
|
71
|
+
* Callback when success is caught.
|
|
72
|
+
*/
|
|
73
|
+
onSuccess?: (data: T) => void;
|
|
74
|
+
/**
|
|
75
|
+
* Initial data to use
|
|
76
|
+
*/
|
|
77
|
+
initialData?: T;
|
|
78
|
+
/**
|
|
79
|
+
* Sets the state to initialState before executing the promise.
|
|
80
|
+
*/
|
|
81
|
+
resetOnExecute?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Callback when request is finished.
|
|
84
|
+
*/
|
|
85
|
+
onFinish?: () => void;
|
|
86
|
+
}
|
|
87
|
+
declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>, options?: UseAxiosOptions): StrictUseAxiosReturn<T, R, D> & Promise<StrictUseAxiosReturn<T, R, D>>;
|
|
88
|
+
declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(url: string, instance?: AxiosInstance, options?: UseAxiosOptions): StrictUseAxiosReturn<T, R, D> & Promise<StrictUseAxiosReturn<T, R, D>>;
|
|
89
|
+
declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(url: string, config: AxiosRequestConfig<D>, instance: AxiosInstance, options?: UseAxiosOptions): StrictUseAxiosReturn<T, R, D> & Promise<StrictUseAxiosReturn<T, R, D>>;
|
|
90
|
+
declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(config?: AxiosRequestConfig<D>): EasyUseAxiosReturn<T, R, D> & Promise<EasyUseAxiosReturn<T, R, D>>;
|
|
91
|
+
declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(instance?: AxiosInstance): EasyUseAxiosReturn<T, R, D> & Promise<EasyUseAxiosReturn<T, R, D>>;
|
|
92
|
+
declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(config?: AxiosRequestConfig<D>, instance?: AxiosInstance): EasyUseAxiosReturn<T, R, D> & Promise<EasyUseAxiosReturn<T, R, D>>;
|
|
93
|
+
|
|
94
|
+
export { EasyUseAxiosReturn, StrictUseAxiosReturn, UseAxiosOptions, UseAxiosReturn, useAxios };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { camelCase, capitalCase, constantCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase, snakeCase, Options } from 'change-case';
|
|
2
|
+
import { MaybeRef, MaybeRefOrGetter } from '@vueuse/shared';
|
|
3
|
+
import { WritableComputedRef, ComputedRef } from 'vue-demi';
|
|
4
|
+
|
|
5
|
+
declare const changeCase_camelCase: typeof camelCase;
|
|
6
|
+
declare const changeCase_capitalCase: typeof capitalCase;
|
|
7
|
+
declare const changeCase_constantCase: typeof constantCase;
|
|
8
|
+
declare const changeCase_dotCase: typeof dotCase;
|
|
9
|
+
declare const changeCase_headerCase: typeof headerCase;
|
|
10
|
+
declare const changeCase_noCase: typeof noCase;
|
|
11
|
+
declare const changeCase_paramCase: typeof paramCase;
|
|
12
|
+
declare const changeCase_pascalCase: typeof pascalCase;
|
|
13
|
+
declare const changeCase_pathCase: typeof pathCase;
|
|
14
|
+
declare const changeCase_sentenceCase: typeof sentenceCase;
|
|
15
|
+
declare const changeCase_snakeCase: typeof snakeCase;
|
|
16
|
+
declare namespace changeCase {
|
|
17
|
+
export {
|
|
18
|
+
changeCase_camelCase as camelCase,
|
|
19
|
+
changeCase_capitalCase as capitalCase,
|
|
20
|
+
changeCase_constantCase as constantCase,
|
|
21
|
+
changeCase_dotCase as dotCase,
|
|
22
|
+
changeCase_headerCase as headerCase,
|
|
23
|
+
changeCase_noCase as noCase,
|
|
24
|
+
changeCase_paramCase as paramCase,
|
|
25
|
+
changeCase_pascalCase as pascalCase,
|
|
26
|
+
changeCase_pathCase as pathCase,
|
|
27
|
+
changeCase_sentenceCase as sentenceCase,
|
|
28
|
+
changeCase_snakeCase as snakeCase,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
type ChangeCaseType = keyof typeof changeCase;
|
|
33
|
+
declare function useChangeCase(input: MaybeRef<string>, type: ChangeCaseType, options?: Options | undefined): WritableComputedRef<string>;
|
|
34
|
+
declare function useChangeCase(input: MaybeRefOrGetter<string>, type: ChangeCaseType, options?: Options | undefined): ComputedRef<string>;
|
|
35
|
+
|
|
36
|
+
export { ChangeCaseType, useChangeCase };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { camelCase, capitalCase, constantCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase, snakeCase, Options } from 'change-case';
|
|
2
|
+
import { MaybeRef, MaybeRefOrGetter } from '@vueuse/shared';
|
|
3
|
+
import { WritableComputedRef, ComputedRef } from 'vue-demi';
|
|
4
|
+
|
|
5
|
+
declare const changeCase_camelCase: typeof camelCase;
|
|
6
|
+
declare const changeCase_capitalCase: typeof capitalCase;
|
|
7
|
+
declare const changeCase_constantCase: typeof constantCase;
|
|
8
|
+
declare const changeCase_dotCase: typeof dotCase;
|
|
9
|
+
declare const changeCase_headerCase: typeof headerCase;
|
|
10
|
+
declare const changeCase_noCase: typeof noCase;
|
|
11
|
+
declare const changeCase_paramCase: typeof paramCase;
|
|
12
|
+
declare const changeCase_pascalCase: typeof pascalCase;
|
|
13
|
+
declare const changeCase_pathCase: typeof pathCase;
|
|
14
|
+
declare const changeCase_sentenceCase: typeof sentenceCase;
|
|
15
|
+
declare const changeCase_snakeCase: typeof snakeCase;
|
|
16
|
+
declare namespace changeCase {
|
|
17
|
+
export {
|
|
18
|
+
changeCase_camelCase as camelCase,
|
|
19
|
+
changeCase_capitalCase as capitalCase,
|
|
20
|
+
changeCase_constantCase as constantCase,
|
|
21
|
+
changeCase_dotCase as dotCase,
|
|
22
|
+
changeCase_headerCase as headerCase,
|
|
23
|
+
changeCase_noCase as noCase,
|
|
24
|
+
changeCase_paramCase as paramCase,
|
|
25
|
+
changeCase_pascalCase as pascalCase,
|
|
26
|
+
changeCase_pathCase as pathCase,
|
|
27
|
+
changeCase_sentenceCase as sentenceCase,
|
|
28
|
+
changeCase_snakeCase as snakeCase,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
type ChangeCaseType = keyof typeof changeCase;
|
|
33
|
+
declare function useChangeCase(input: MaybeRef<string>, type: ChangeCaseType, options?: Options | undefined): WritableComputedRef<string>;
|
|
34
|
+
declare function useChangeCase(input: MaybeRefOrGetter<string>, type: ChangeCaseType, options?: Options | undefined): ComputedRef<string>;
|
|
35
|
+
|
|
36
|
+
export { ChangeCaseType, useChangeCase };
|
package/useCookies.d.cts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as universal_cookie from 'universal-cookie';
|
|
2
|
+
import universal_cookie__default from 'universal-cookie';
|
|
3
|
+
import { IncomingMessage } from 'node:http';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new {@link useCookies} function
|
|
7
|
+
* @param {Object} req - incoming http request (for SSR)
|
|
8
|
+
* @see https://github.com/reactivestack/cookies/tree/master/packages/universal-cookie universal-cookie
|
|
9
|
+
* @description Creates universal-cookie instance using request (default is window.document.cookie) and returns {@link useCookies} function with provided universal-cookie instance
|
|
10
|
+
*/
|
|
11
|
+
declare function createCookies(req?: IncomingMessage): (dependencies?: string[] | null, { doNotParse, autoUpdateDependencies }?: {
|
|
12
|
+
doNotParse?: boolean | undefined;
|
|
13
|
+
autoUpdateDependencies?: boolean | undefined;
|
|
14
|
+
}) => {
|
|
15
|
+
/**
|
|
16
|
+
* Reactive get cookie by name. If **autoUpdateDependencies = true** then it will update watching dependencies
|
|
17
|
+
*/
|
|
18
|
+
get: <T = any>(name: string, options?: universal_cookie.CookieGetOptions | undefined) => T;
|
|
19
|
+
/**
|
|
20
|
+
* Reactive get all cookies
|
|
21
|
+
*/
|
|
22
|
+
getAll: <T_1 = any>(options?: universal_cookie.CookieGetOptions | undefined) => T_1;
|
|
23
|
+
set: (name: string, value: any, options?: universal_cookie.CookieSetOptions | undefined) => void;
|
|
24
|
+
remove: (name: string, options?: universal_cookie.CookieSetOptions | undefined) => void;
|
|
25
|
+
addChangeListener: (callback: universal_cookie.CookieChangeListener) => void;
|
|
26
|
+
removeChangeListener: (callback: universal_cookie.CookieChangeListener) => void;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Reactive methods to work with cookies (use {@link createCookies} method instead if you are using SSR)
|
|
30
|
+
* @param {string[]|null|undefined} dependencies - array of watching cookie's names. Pass empty array if don't want to watch cookies changes.
|
|
31
|
+
* @param {Object} options
|
|
32
|
+
* @param {boolean} options.doNotParse - don't try parse value as JSON
|
|
33
|
+
* @param {boolean} options.autoUpdateDependencies - automatically update watching dependencies
|
|
34
|
+
* @param {Object} cookies - universal-cookie instance
|
|
35
|
+
*/
|
|
36
|
+
declare function useCookies(dependencies?: string[] | null, { doNotParse, autoUpdateDependencies }?: {
|
|
37
|
+
doNotParse?: boolean | undefined;
|
|
38
|
+
autoUpdateDependencies?: boolean | undefined;
|
|
39
|
+
}, cookies?: universal_cookie__default): {
|
|
40
|
+
/**
|
|
41
|
+
* Reactive get cookie by name. If **autoUpdateDependencies = true** then it will update watching dependencies
|
|
42
|
+
*/
|
|
43
|
+
get: <T = any>(name: string, options?: universal_cookie.CookieGetOptions | undefined) => T;
|
|
44
|
+
/**
|
|
45
|
+
* Reactive get all cookies
|
|
46
|
+
*/
|
|
47
|
+
getAll: <T_1 = any>(options?: universal_cookie.CookieGetOptions | undefined) => T_1;
|
|
48
|
+
set: (name: string, value: any, options?: universal_cookie.CookieSetOptions | undefined) => void;
|
|
49
|
+
remove: (name: string, options?: universal_cookie.CookieSetOptions | undefined) => void;
|
|
50
|
+
addChangeListener: (callback: universal_cookie.CookieChangeListener) => void;
|
|
51
|
+
removeChangeListener: (callback: universal_cookie.CookieChangeListener) => void;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { createCookies, useCookies };
|
package/useCookies.d.mts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as universal_cookie from 'universal-cookie';
|
|
2
|
+
import universal_cookie__default from 'universal-cookie';
|
|
3
|
+
import { IncomingMessage } from 'node:http';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new {@link useCookies} function
|
|
7
|
+
* @param {Object} req - incoming http request (for SSR)
|
|
8
|
+
* @see https://github.com/reactivestack/cookies/tree/master/packages/universal-cookie universal-cookie
|
|
9
|
+
* @description Creates universal-cookie instance using request (default is window.document.cookie) and returns {@link useCookies} function with provided universal-cookie instance
|
|
10
|
+
*/
|
|
11
|
+
declare function createCookies(req?: IncomingMessage): (dependencies?: string[] | null, { doNotParse, autoUpdateDependencies }?: {
|
|
12
|
+
doNotParse?: boolean | undefined;
|
|
13
|
+
autoUpdateDependencies?: boolean | undefined;
|
|
14
|
+
}) => {
|
|
15
|
+
/**
|
|
16
|
+
* Reactive get cookie by name. If **autoUpdateDependencies = true** then it will update watching dependencies
|
|
17
|
+
*/
|
|
18
|
+
get: <T = any>(name: string, options?: universal_cookie.CookieGetOptions | undefined) => T;
|
|
19
|
+
/**
|
|
20
|
+
* Reactive get all cookies
|
|
21
|
+
*/
|
|
22
|
+
getAll: <T_1 = any>(options?: universal_cookie.CookieGetOptions | undefined) => T_1;
|
|
23
|
+
set: (name: string, value: any, options?: universal_cookie.CookieSetOptions | undefined) => void;
|
|
24
|
+
remove: (name: string, options?: universal_cookie.CookieSetOptions | undefined) => void;
|
|
25
|
+
addChangeListener: (callback: universal_cookie.CookieChangeListener) => void;
|
|
26
|
+
removeChangeListener: (callback: universal_cookie.CookieChangeListener) => void;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Reactive methods to work with cookies (use {@link createCookies} method instead if you are using SSR)
|
|
30
|
+
* @param {string[]|null|undefined} dependencies - array of watching cookie's names. Pass empty array if don't want to watch cookies changes.
|
|
31
|
+
* @param {Object} options
|
|
32
|
+
* @param {boolean} options.doNotParse - don't try parse value as JSON
|
|
33
|
+
* @param {boolean} options.autoUpdateDependencies - automatically update watching dependencies
|
|
34
|
+
* @param {Object} cookies - universal-cookie instance
|
|
35
|
+
*/
|
|
36
|
+
declare function useCookies(dependencies?: string[] | null, { doNotParse, autoUpdateDependencies }?: {
|
|
37
|
+
doNotParse?: boolean | undefined;
|
|
38
|
+
autoUpdateDependencies?: boolean | undefined;
|
|
39
|
+
}, cookies?: universal_cookie__default): {
|
|
40
|
+
/**
|
|
41
|
+
* Reactive get cookie by name. If **autoUpdateDependencies = true** then it will update watching dependencies
|
|
42
|
+
*/
|
|
43
|
+
get: <T = any>(name: string, options?: universal_cookie.CookieGetOptions | undefined) => T;
|
|
44
|
+
/**
|
|
45
|
+
* Reactive get all cookies
|
|
46
|
+
*/
|
|
47
|
+
getAll: <T_1 = any>(options?: universal_cookie.CookieGetOptions | undefined) => T_1;
|
|
48
|
+
set: (name: string, value: any, options?: universal_cookie.CookieSetOptions | undefined) => void;
|
|
49
|
+
remove: (name: string, options?: universal_cookie.CookieSetOptions | undefined) => void;
|
|
50
|
+
addChangeListener: (callback: universal_cookie.CookieChangeListener) => void;
|
|
51
|
+
removeChangeListener: (callback: universal_cookie.CookieChangeListener) => void;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { createCookies, useCookies };
|
package/useDrauu.d.cts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Ref } from 'vue-demi';
|
|
2
|
+
import { Options, Drauu, Brush } from 'drauu';
|
|
3
|
+
import { EventHookOn, MaybeComputedElementRef } from '@vueuse/core';
|
|
4
|
+
|
|
5
|
+
type UseDrauuOptions = Omit<Options, 'el'>;
|
|
6
|
+
interface UseDrauuReturn {
|
|
7
|
+
drauuInstance: Ref<Drauu | undefined>;
|
|
8
|
+
load: (svg: string) => void;
|
|
9
|
+
dump: () => string | undefined;
|
|
10
|
+
clear: () => void;
|
|
11
|
+
cancel: () => void;
|
|
12
|
+
undo: () => boolean | undefined;
|
|
13
|
+
redo: () => boolean | undefined;
|
|
14
|
+
canUndo: Ref<boolean>;
|
|
15
|
+
canRedo: Ref<boolean>;
|
|
16
|
+
brush: Ref<Brush>;
|
|
17
|
+
onChanged: EventHookOn;
|
|
18
|
+
onCommitted: EventHookOn;
|
|
19
|
+
onStart: EventHookOn;
|
|
20
|
+
onEnd: EventHookOn;
|
|
21
|
+
onCanceled: EventHookOn;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Reactive drauu
|
|
25
|
+
*
|
|
26
|
+
* @see https://vueuse.org/useDrauu
|
|
27
|
+
* @param target The target svg element
|
|
28
|
+
* @param options Drauu Options
|
|
29
|
+
*/
|
|
30
|
+
declare function useDrauu(target: MaybeComputedElementRef, options?: UseDrauuOptions): UseDrauuReturn;
|
|
31
|
+
|
|
32
|
+
export { UseDrauuOptions, UseDrauuReturn, useDrauu };
|
package/useDrauu.d.mts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Ref } from 'vue-demi';
|
|
2
|
+
import { Options, Drauu, Brush } from 'drauu';
|
|
3
|
+
import { EventHookOn, MaybeComputedElementRef } from '@vueuse/core';
|
|
4
|
+
|
|
5
|
+
type UseDrauuOptions = Omit<Options, 'el'>;
|
|
6
|
+
interface UseDrauuReturn {
|
|
7
|
+
drauuInstance: Ref<Drauu | undefined>;
|
|
8
|
+
load: (svg: string) => void;
|
|
9
|
+
dump: () => string | undefined;
|
|
10
|
+
clear: () => void;
|
|
11
|
+
cancel: () => void;
|
|
12
|
+
undo: () => boolean | undefined;
|
|
13
|
+
redo: () => boolean | undefined;
|
|
14
|
+
canUndo: Ref<boolean>;
|
|
15
|
+
canRedo: Ref<boolean>;
|
|
16
|
+
brush: Ref<Brush>;
|
|
17
|
+
onChanged: EventHookOn;
|
|
18
|
+
onCommitted: EventHookOn;
|
|
19
|
+
onStart: EventHookOn;
|
|
20
|
+
onEnd: EventHookOn;
|
|
21
|
+
onCanceled: EventHookOn;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Reactive drauu
|
|
25
|
+
*
|
|
26
|
+
* @see https://vueuse.org/useDrauu
|
|
27
|
+
* @param target The target svg element
|
|
28
|
+
* @param options Drauu Options
|
|
29
|
+
*/
|
|
30
|
+
declare function useDrauu(target: MaybeComputedElementRef, options?: UseDrauuOptions): UseDrauuReturn;
|
|
31
|
+
|
|
32
|
+
export { UseDrauuOptions, UseDrauuReturn, useDrauu };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as vue_demi from 'vue-demi';
|
|
2
|
+
import { RenderableComponent } from '@vueuse/core';
|
|
3
|
+
import { Options } from 'focus-trap';
|
|
4
|
+
|
|
5
|
+
interface UseFocusTrapOptions extends Options {
|
|
6
|
+
/**
|
|
7
|
+
* Immediately activate the trap
|
|
8
|
+
*/
|
|
9
|
+
immediate?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface ComponentUseFocusTrapOptions extends RenderableComponent {
|
|
13
|
+
options?: UseFocusTrapOptions;
|
|
14
|
+
}
|
|
15
|
+
declare const UseFocusTrap: vue_demi.DefineComponent<ComponentUseFocusTrapOptions, {}, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<ComponentUseFocusTrapOptions>, {}, {}>;
|
|
16
|
+
|
|
17
|
+
export { ComponentUseFocusTrapOptions, UseFocusTrap };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as vue_demi from 'vue-demi';
|
|
2
|
+
import { RenderableComponent } from '@vueuse/core';
|
|
3
|
+
import { Options } from 'focus-trap';
|
|
4
|
+
|
|
5
|
+
interface UseFocusTrapOptions extends Options {
|
|
6
|
+
/**
|
|
7
|
+
* Immediately activate the trap
|
|
8
|
+
*/
|
|
9
|
+
immediate?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface ComponentUseFocusTrapOptions extends RenderableComponent {
|
|
13
|
+
options?: UseFocusTrapOptions;
|
|
14
|
+
}
|
|
15
|
+
declare const UseFocusTrap: vue_demi.DefineComponent<ComponentUseFocusTrapOptions, {}, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<ComponentUseFocusTrapOptions>, {}, {}>;
|
|
16
|
+
|
|
17
|
+
export { ComponentUseFocusTrapOptions, UseFocusTrap };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Fn, MaybeElementRef } from '@vueuse/core';
|
|
2
|
+
import { Ref } from 'vue-demi';
|
|
3
|
+
import { Options, ActivateOptions, DeactivateOptions } from 'focus-trap';
|
|
4
|
+
|
|
5
|
+
interface UseFocusTrapOptions extends Options {
|
|
6
|
+
/**
|
|
7
|
+
* Immediately activate the trap
|
|
8
|
+
*/
|
|
9
|
+
immediate?: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface UseFocusTrapReturn {
|
|
12
|
+
/**
|
|
13
|
+
* Indicates if the focus trap is currently active
|
|
14
|
+
*/
|
|
15
|
+
hasFocus: Ref<boolean>;
|
|
16
|
+
/**
|
|
17
|
+
* Indicates if the focus trap is currently paused
|
|
18
|
+
*/
|
|
19
|
+
isPaused: Ref<boolean>;
|
|
20
|
+
/**
|
|
21
|
+
* Activate the focus trap
|
|
22
|
+
*
|
|
23
|
+
* @see https://github.com/focus-trap/focus-trap#trapactivateactivateoptions
|
|
24
|
+
* @param opts Activate focus trap options
|
|
25
|
+
*/
|
|
26
|
+
activate: (opts?: ActivateOptions) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Deactivate the focus trap
|
|
29
|
+
*
|
|
30
|
+
* @see https://github.com/focus-trap/focus-trap#trapdeactivatedeactivateoptions
|
|
31
|
+
* @param opts Deactivate focus trap options
|
|
32
|
+
*/
|
|
33
|
+
deactivate: (opts?: DeactivateOptions) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Pause the focus trap
|
|
36
|
+
*
|
|
37
|
+
* @see https://github.com/focus-trap/focus-trap#trappause
|
|
38
|
+
*/
|
|
39
|
+
pause: Fn;
|
|
40
|
+
/**
|
|
41
|
+
* Unpauses the focus trap
|
|
42
|
+
*
|
|
43
|
+
* @see https://github.com/focus-trap/focus-trap#trapunpause
|
|
44
|
+
*/
|
|
45
|
+
unpause: Fn;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Reactive focus-trap
|
|
49
|
+
*
|
|
50
|
+
* @see https://vueuse.org/useFocusTrap
|
|
51
|
+
* @param target The target element to trap focus within
|
|
52
|
+
* @param options Focus trap options
|
|
53
|
+
* @param autoFocus Focus trap automatically when mounted
|
|
54
|
+
*/
|
|
55
|
+
declare function useFocusTrap(target: MaybeElementRef, options?: UseFocusTrapOptions): UseFocusTrapReturn;
|
|
56
|
+
|
|
57
|
+
export { UseFocusTrapOptions, UseFocusTrapReturn, useFocusTrap };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Fn, MaybeElementRef } from '@vueuse/core';
|
|
2
|
+
import { Ref } from 'vue-demi';
|
|
3
|
+
import { Options, ActivateOptions, DeactivateOptions } from 'focus-trap';
|
|
4
|
+
|
|
5
|
+
interface UseFocusTrapOptions extends Options {
|
|
6
|
+
/**
|
|
7
|
+
* Immediately activate the trap
|
|
8
|
+
*/
|
|
9
|
+
immediate?: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface UseFocusTrapReturn {
|
|
12
|
+
/**
|
|
13
|
+
* Indicates if the focus trap is currently active
|
|
14
|
+
*/
|
|
15
|
+
hasFocus: Ref<boolean>;
|
|
16
|
+
/**
|
|
17
|
+
* Indicates if the focus trap is currently paused
|
|
18
|
+
*/
|
|
19
|
+
isPaused: Ref<boolean>;
|
|
20
|
+
/**
|
|
21
|
+
* Activate the focus trap
|
|
22
|
+
*
|
|
23
|
+
* @see https://github.com/focus-trap/focus-trap#trapactivateactivateoptions
|
|
24
|
+
* @param opts Activate focus trap options
|
|
25
|
+
*/
|
|
26
|
+
activate: (opts?: ActivateOptions) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Deactivate the focus trap
|
|
29
|
+
*
|
|
30
|
+
* @see https://github.com/focus-trap/focus-trap#trapdeactivatedeactivateoptions
|
|
31
|
+
* @param opts Deactivate focus trap options
|
|
32
|
+
*/
|
|
33
|
+
deactivate: (opts?: DeactivateOptions) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Pause the focus trap
|
|
36
|
+
*
|
|
37
|
+
* @see https://github.com/focus-trap/focus-trap#trappause
|
|
38
|
+
*/
|
|
39
|
+
pause: Fn;
|
|
40
|
+
/**
|
|
41
|
+
* Unpauses the focus trap
|
|
42
|
+
*
|
|
43
|
+
* @see https://github.com/focus-trap/focus-trap#trapunpause
|
|
44
|
+
*/
|
|
45
|
+
unpause: Fn;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Reactive focus-trap
|
|
49
|
+
*
|
|
50
|
+
* @see https://vueuse.org/useFocusTrap
|
|
51
|
+
* @param target The target element to trap focus within
|
|
52
|
+
* @param options Focus trap options
|
|
53
|
+
* @param autoFocus Focus trap automatically when mounted
|
|
54
|
+
*/
|
|
55
|
+
declare function useFocusTrap(target: MaybeElementRef, options?: UseFocusTrapOptions): UseFocusTrapReturn;
|
|
56
|
+
|
|
57
|
+
export { UseFocusTrapOptions, UseFocusTrapReturn, useFocusTrap };
|
package/useFuse.d.cts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as vue_demi from 'vue-demi';
|
|
2
|
+
import { ComputedRef } from 'vue-demi';
|
|
3
|
+
import Fuse from 'fuse.js';
|
|
4
|
+
import { MaybeRefOrGetter } from '@vueuse/shared';
|
|
5
|
+
|
|
6
|
+
type FuseOptions<T> = Fuse.IFuseOptions<T>;
|
|
7
|
+
interface UseFuseOptions<T> {
|
|
8
|
+
fuseOptions?: FuseOptions<T>;
|
|
9
|
+
resultLimit?: number;
|
|
10
|
+
matchAllWhenSearchEmpty?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare function useFuse<DataItem>(search: MaybeRefOrGetter<string>, data: MaybeRefOrGetter<DataItem[]>, options?: MaybeRefOrGetter<UseFuseOptions<DataItem>>): {
|
|
13
|
+
fuse: vue_demi.Ref<{
|
|
14
|
+
search: <R = DataItem>(pattern: string | Fuse.Expression, options?: Fuse.FuseSearchOptions | undefined) => Fuse.FuseResult<R>[];
|
|
15
|
+
setCollection: (docs: readonly DataItem[], index?: Fuse.FuseIndex<DataItem> | undefined) => void;
|
|
16
|
+
add: (doc: DataItem) => void;
|
|
17
|
+
remove: (predicate: (doc: DataItem, idx: number) => boolean) => DataItem[];
|
|
18
|
+
removeAt: (idx: number) => void;
|
|
19
|
+
getIndex: () => Fuse.FuseIndex<DataItem>;
|
|
20
|
+
}>;
|
|
21
|
+
results: ComputedRef<Fuse.FuseResult<DataItem>[]>;
|
|
22
|
+
};
|
|
23
|
+
type UseFuseReturn = ReturnType<typeof useFuse>;
|
|
24
|
+
|
|
25
|
+
export { FuseOptions, UseFuseOptions, UseFuseReturn, useFuse };
|