@vueuse/shared
Advanced tools
+53
-0
@@ -169,2 +169,4 @@ import * as vue from 'vue'; | ||
| * @see https://vueuse.org/createEventHook | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -331,2 +333,4 @@ declare function createEventHook<T = any>(): EventHookReturn<T>; | ||
| * @param stateFactory A factory function to create the state | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -350,2 +354,3 @@ declare function createGlobalState<Fn extends AnyFn>(stateFactory: Fn): CreateGlobalStateReturn<Fn>; | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -368,2 +373,4 @@ declare function createInjectionState<Arguments extends Array<any>, Return>(composable: (...args: Arguments) => Return, options?: CreateInjectionStateOptions<Return>): readonly [useProvidingState: (...args: Arguments) => Return, useInjectedState: () => Return | undefined]; | ||
| * @returns the `deepRef` or `shallowRef` | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -377,2 +384,4 @@ declare function createRef<T = any, D extends boolean = false>(value: T, deep?: D): CreateRefReturn<T, D>; | ||
| * @see https://vueuse.org/createSharedComposable | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -419,2 +428,4 @@ declare function createSharedComposable<Fn extends AnyFn>(composable: Fn): SharedComposableReturn<Fn>; | ||
| * ``` | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -461,2 +472,4 @@ declare const injectLocal: typeof inject; | ||
| * @param options - Options | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -479,2 +492,4 @@ declare function reactify<T extends AnyFn, K extends boolean = true>(fn: T, options?: ReactifyOptions<K>): ReactifyReturn<T, K>; | ||
| * Apply `reactify` to an object | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -522,2 +537,4 @@ declare function reactifyObject<T extends object, Keys extends keyof T>(obj: T, keys?: (keyof T)[]): ReactifyObjectReturn<T, Keys, true>; | ||
| * Apply default value to a ref. | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -554,2 +571,4 @@ declare function refDefault<T>(source: Ref<T | undefined | null>, defaultValue: T): Ref<T>; | ||
| * Fine-grained controls over ref and its reactivity. | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -839,2 +858,4 @@ declare function refWithControl<T>(initial: T, options?: ControlledRefOptions<T>): vue.ShallowUnwrapRef<{ | ||
| * @returns **true** if the `fn` function returns a **truthy** value for every element from the array. Otherwise, **false**. | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -852,2 +873,4 @@ declare function useArrayEvery<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: MaybeRefOrGetter<T>[]) => unknown): UseArrayEveryReturn; | ||
| * @returns a shallow copy of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -866,2 +889,4 @@ declare function useArrayFilter<T, S extends T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: T[]) => element is S): UseArrayFilterReturn<S>; | ||
| * @returns the first element in the array that satisfies the provided testing function. Otherwise, undefined is returned. | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -879,2 +904,4 @@ declare function useArrayFind<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: MaybeRefOrGetter<T>[]) => boolean): UseArrayFindReturn<T>; | ||
| * @returns the index of the first element in the array that passes the test. Otherwise, "-1". | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -892,2 +919,4 @@ declare function useArrayFindIndex<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: MaybeRefOrGetter<T>[]) => unknown): UseArrayFindIndexReturn; | ||
| * @returns the last element in the array that satisfies the provided testing function. Otherwise, undefined is returned. | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -908,2 +937,4 @@ declare function useArrayFindLast<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: MaybeRefOrGetter<T>[]) => boolean): UseArrayFindLastReturn<T>; | ||
| * @returns true if the `value` is found in the array. Otherwise, false. | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -923,2 +954,4 @@ declare function useArrayIncludes<T, V = any>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, value: MaybeRefOrGetter<V>, comparator?: UseArrayIncludesComparatorFn<T, V>): UseArrayIncludesReturn; | ||
| * @returns a string with all array elements joined. If arr.length is 0, the empty string is returned. | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -936,2 +969,4 @@ declare function useArrayJoin(list: MaybeRefOrGetter<MaybeRefOrGetter<any>[]>, separator?: MaybeRefOrGetter<string>): UseArrayJoinReturn; | ||
| * @returns a new array with each element being the result of the callback function. | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -949,2 +984,4 @@ declare function useArrayMap<T, U = T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: T[]) => U): UseArrayMapReturn<U>; | ||
| * @returns the value that results from running the "reducer" callback function to completion over the entire array. | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -961,2 +998,4 @@ declare function useArrayReduce<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, reducer: UseArrayReducer<T, T, T>): ComputedRef<T>; | ||
| * @returns the value that results from running the "reducer" callback function to completion over the entire array. | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -974,2 +1013,4 @@ declare function useArrayReduce<T, U>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, reducer: UseArrayReducer<U, T, U>, initialValue: MaybeRefOrGetter<U>): ComputedRef<U>; | ||
| * @returns **true** if the `fn` function returns a **truthy** value for any element from the array. Otherwise, **false**. | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -985,2 +1026,4 @@ declare function useArraySome<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: MaybeRefOrGetter<T>[]) => unknown): UseArraySomeReturn; | ||
| * @returns A computed ref that returns a unique array of items. | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -1065,2 +1108,4 @@ declare function useArrayUnique<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, compareFn?: (a: T, b: T, array: T[]) => boolean): UseArrayUniqueReturn<T>; | ||
| * @param options - UseDateFormatOptions | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -1079,2 +1124,4 @@ declare function useDateFormat(date: MaybeRefOrGetter<DateLike>, formatStr?: MaybeRefOrGetter<string>, options?: UseDateFormatOptions): UseDateFormatReturn; | ||
| * @return A new, debounce, function. | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -1169,2 +1216,4 @@ declare function useDebounceFn<T extends FunctionArgs>(fn: T, ms?: MaybeRefOrGetter<number>, options?: DebounceFilterOptions): UseDebounceFnReturn<T>; | ||
| * @return A new, throttled, function. | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -1247,2 +1296,4 @@ declare function useThrottleFn<T extends FunctionArgs>(fn: T, ms?: MaybeRefOrGetter<number>, trailing?: boolean, leading?: boolean, rejectOnCancel?: boolean): PromisifyFn<T>; | ||
| * Reactively convert a string ref to number. | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -1255,2 +1306,4 @@ declare function useToNumber(value: MaybeRefOrGetter<number | string>, options?: UseToNumberOptions): ComputedRef<number>; | ||
| * @see https://vueuse.org/useToString | ||
| * | ||
| * @__NO_SIDE_EFFECTS__ | ||
| */ | ||
@@ -1257,0 +1310,0 @@ declare function useToString(value: MaybeRefOrGetter<unknown>): ComputedRef<string>; |
+29
-1
@@ -57,2 +57,3 @@ (function (exports, vue) { | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function createEventHook() { | ||
@@ -85,2 +86,3 @@ const fns = /* @__PURE__ */ new Set(); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function createGlobalState(stateFactory) { | ||
@@ -101,3 +103,3 @@ let initialized = false; | ||
| const injectLocal = (...args) => { | ||
| const injectLocal = /* @__NO_SIDE_EFFECTS__ */ (...args) => { | ||
| var _a; | ||
@@ -125,2 +127,3 @@ const key = args[0]; | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function createInjectionState(composable, options) { | ||
@@ -138,2 +141,3 @@ const key = (options == null ? void 0 : options.injectionKey) || Symbol(composable.name || "InjectionState"); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function createRef(value, deep) { | ||
@@ -147,2 +151,3 @@ if (deep === true) { | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function createSharedComposable(composable) { | ||
@@ -202,2 +207,3 @@ let subscribers = 0; | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function makeDestructurable(obj, arr) { | ||
@@ -224,2 +230,3 @@ if (typeof Symbol !== "undefined") { | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function reactify(fn, options) { | ||
@@ -232,2 +239,3 @@ const unrefFn = (options == null ? void 0 : options.computedGetter) === false ? vue.unref : vue.toValue; | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function reactifyObject(obj, optionsOrKeys = {}) { | ||
@@ -577,2 +585,3 @@ let keys = []; | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useDebounceFn(fn, ms = 200, options = {}) { | ||
@@ -594,2 +603,3 @@ return createFilterWrapper( | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function refDefault(source, defaultValue) { | ||
@@ -607,2 +617,3 @@ return vue.computed({ | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) { | ||
@@ -626,2 +637,3 @@ return createFilterWrapper( | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function refWithControl(initial, options = {}) { | ||
@@ -970,2 +982,3 @@ let source = initial; | ||
| } | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayDifference(...args) { | ||
@@ -992,2 +1005,3 @@ var _a, _b; | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayEvery(list, fn) { | ||
@@ -997,2 +1011,3 @@ return vue.computed(() => vue.toValue(list).every((element, index, array) => fn(vue.toValue(element), index, array))); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayFilter(list, fn) { | ||
@@ -1002,2 +1017,3 @@ return vue.computed(() => vue.toValue(list).map((i) => vue.toValue(i)).filter(fn)); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayFind(list, fn) { | ||
@@ -1009,2 +1025,3 @@ return vue.computed(() => vue.toValue( | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayFindIndex(list, fn) { | ||
@@ -1022,2 +1039,3 @@ return vue.computed(() => vue.toValue(list).findIndex((element, index, array) => fn(vue.toValue(element), index, array))); | ||
| } | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayFindLast(list, fn) { | ||
@@ -1032,2 +1050,3 @@ return vue.computed(() => vue.toValue( | ||
| } | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayIncludes(...args) { | ||
@@ -1056,2 +1075,3 @@ var _a; | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayJoin(list, separator) { | ||
@@ -1061,2 +1081,3 @@ return vue.computed(() => vue.toValue(list).map((i) => vue.toValue(i)).join(vue.toValue(separator))); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayMap(list, fn) { | ||
@@ -1066,2 +1087,3 @@ return vue.computed(() => vue.toValue(list).map((i) => vue.toValue(i)).map(fn)); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayReduce(list, reducer, ...args) { | ||
@@ -1075,2 +1097,3 @@ const reduceCallback = (sum, value, index) => reducer(vue.toValue(sum), vue.toValue(value), index); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArraySome(list, fn) { | ||
@@ -1090,2 +1113,3 @@ return vue.computed(() => vue.toValue(list).some((element, index, array) => fn(vue.toValue(element), index, array))); | ||
| } | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayUnique(list, compareFn) { | ||
@@ -1204,2 +1228,3 @@ return vue.computed(() => { | ||
| } | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useDateFormat(date, formatStr = "HH:mm:ss", options = {}) { | ||
@@ -1357,2 +1382,3 @@ return vue.computed(() => formatDate(normalizeDate(vue.toValue(date)), vue.toValue(formatStr), options)); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useToNumber(value, options = {}) { | ||
@@ -1376,2 +1402,3 @@ const { | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useToString(value) { | ||
@@ -1381,2 +1408,3 @@ return vue.computed(() => `${vue.toValue(value)}`); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useToggle(initialValue = false, options = {}) { | ||
@@ -1383,0 +1411,0 @@ const { |
+29
-1
@@ -56,2 +56,3 @@ import { shallowRef, watchEffect, readonly, watch, customRef, getCurrentScope, onScopeDispose, effectScope, getCurrentInstance, hasInjectionContext, inject, provide, ref, isRef, unref, toValue as toValue$1, computed, reactive, toRefs as toRefs$1, toRef as toRef$1, shallowReadonly, onBeforeMount, nextTick, onBeforeUnmount, onMounted, onUnmounted, isReactive } from 'vue'; | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function createEventHook() { | ||
@@ -84,2 +85,3 @@ const fns = /* @__PURE__ */ new Set(); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function createGlobalState(stateFactory) { | ||
@@ -100,3 +102,3 @@ let initialized = false; | ||
| const injectLocal = (...args) => { | ||
| const injectLocal = /* @__NO_SIDE_EFFECTS__ */ (...args) => { | ||
| var _a; | ||
@@ -124,2 +126,3 @@ const key = args[0]; | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function createInjectionState(composable, options) { | ||
@@ -137,2 +140,3 @@ const key = (options == null ? void 0 : options.injectionKey) || Symbol(composable.name || "InjectionState"); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function createRef(value, deep) { | ||
@@ -146,2 +150,3 @@ if (deep === true) { | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function createSharedComposable(composable) { | ||
@@ -201,2 +206,3 @@ let subscribers = 0; | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function makeDestructurable(obj, arr) { | ||
@@ -223,2 +229,3 @@ if (typeof Symbol !== "undefined") { | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function reactify(fn, options) { | ||
@@ -231,2 +238,3 @@ const unrefFn = (options == null ? void 0 : options.computedGetter) === false ? unref : toValue$1; | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function reactifyObject(obj, optionsOrKeys = {}) { | ||
@@ -576,2 +584,3 @@ let keys = []; | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useDebounceFn(fn, ms = 200, options = {}) { | ||
@@ -593,2 +602,3 @@ return createFilterWrapper( | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function refDefault(source, defaultValue) { | ||
@@ -606,2 +616,3 @@ return computed({ | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) { | ||
@@ -625,2 +636,3 @@ return createFilterWrapper( | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function refWithControl(initial, options = {}) { | ||
@@ -969,2 +981,3 @@ let source = initial; | ||
| } | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayDifference(...args) { | ||
@@ -991,2 +1004,3 @@ var _a, _b; | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayEvery(list, fn) { | ||
@@ -996,2 +1010,3 @@ return computed(() => toValue$1(list).every((element, index, array) => fn(toValue$1(element), index, array))); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayFilter(list, fn) { | ||
@@ -1001,2 +1016,3 @@ return computed(() => toValue$1(list).map((i) => toValue$1(i)).filter(fn)); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayFind(list, fn) { | ||
@@ -1008,2 +1024,3 @@ return computed(() => toValue$1( | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayFindIndex(list, fn) { | ||
@@ -1021,2 +1038,3 @@ return computed(() => toValue$1(list).findIndex((element, index, array) => fn(toValue$1(element), index, array))); | ||
| } | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayFindLast(list, fn) { | ||
@@ -1031,2 +1049,3 @@ return computed(() => toValue$1( | ||
| } | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayIncludes(...args) { | ||
@@ -1055,2 +1074,3 @@ var _a; | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayJoin(list, separator) { | ||
@@ -1060,2 +1080,3 @@ return computed(() => toValue$1(list).map((i) => toValue$1(i)).join(toValue$1(separator))); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayMap(list, fn) { | ||
@@ -1065,2 +1086,3 @@ return computed(() => toValue$1(list).map((i) => toValue$1(i)).map(fn)); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayReduce(list, reducer, ...args) { | ||
@@ -1074,2 +1096,3 @@ const reduceCallback = (sum, value, index) => reducer(toValue$1(sum), toValue$1(value), index); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArraySome(list, fn) { | ||
@@ -1089,2 +1112,3 @@ return computed(() => toValue$1(list).some((element, index, array) => fn(toValue$1(element), index, array))); | ||
| } | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useArrayUnique(list, compareFn) { | ||
@@ -1203,2 +1227,3 @@ return computed(() => { | ||
| } | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useDateFormat(date, formatStr = "HH:mm:ss", options = {}) { | ||
@@ -1356,2 +1381,3 @@ return computed(() => formatDate(normalizeDate(toValue$1(date)), toValue$1(formatStr), options)); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useToNumber(value, options = {}) { | ||
@@ -1375,2 +1401,3 @@ const { | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useToString(value) { | ||
@@ -1380,2 +1407,3 @@ return computed(() => `${toValue$1(value)}`); | ||
| // @__NO_SIDE_EFFECTS__ | ||
| function useToggle(initialValue = false, options = {}) { | ||
@@ -1382,0 +1410,0 @@ const { |
+1
-1
| { | ||
| "name": "@vueuse/shared", | ||
| "type": "module", | ||
| "version": "13.5.0", | ||
| "version": "13.6.0", | ||
| "author": "Anthony Fu <https://github.com/antfu>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
180787
1.22%3338
1.71%