wevu 2.0.0 → 2.0.2
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/dist/index.d.mts +153 -139
- package/dist/index.mjs +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/weappIntrinsicElements-Dqg7yMEv.d.mts +1216 -0
- package/package.json +1 -1
- package/dist/weappIntrinsicElements-zTAqU5H3.d.mts +0 -567
package/dist/index.d.mts
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { t as WeappIntrinsicElements } from "./weappIntrinsicElements-
|
|
1
|
+
import { t as WeappIntrinsicElements } from "./weappIntrinsicElements-Dqg7yMEv.mjs";
|
|
2
2
|
import { AllowedComponentProps as AllowedComponentProps$1, ComponentCustomProps as ComponentCustomProps$1, ComponentOptionsMixin as ComponentOptionsMixin$1, ComputedOptions, DefineComponent as DefineComponent$1, EmitsOptions as EmitsOptions$1, MethodOptions, ObjectDirective as ObjectDirective$1, PublicProps as PublicProps$1, Ref as Ref$1, ShallowRef as ShallowRef$1, ShallowUnwrapRef as ShallowUnwrapRef$1, SlotsType, VNode as VNode$1, VNodeProps as VNodeProps$1 } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/reactivity/ref.d.ts
|
|
5
|
-
type Ref<T
|
|
6
|
-
type ShallowRef<T
|
|
7
|
-
type MaybeRef<T
|
|
8
|
-
type MaybeRefOrGetter<T
|
|
5
|
+
type Ref<T = any, S = T> = Ref$2<T, S>;
|
|
6
|
+
type ShallowRef<T = any> = ShallowRef$2<T>;
|
|
7
|
+
type MaybeRef<T = any> = T | Ref<T> | ShallowRef<T> | WritableComputedRef<T>;
|
|
8
|
+
type MaybeRefOrGetter<T = any> = MaybeRef<T> | ComputedRef<T> | (() => T);
|
|
9
9
|
declare function isRef(value: unknown): value is Ref<any>;
|
|
10
|
-
declare function ref<T
|
|
11
|
-
declare function unref<T
|
|
12
|
-
declare function toValue<T
|
|
10
|
+
declare function ref<T>(value: T): Ref<T>;
|
|
11
|
+
declare function unref<T>(value: MaybeRef<T> | ComputedRef<T>): T;
|
|
12
|
+
declare function toValue<T>(source: MaybeRefOrGetter<T>): T;
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/reactivity/computed.d.ts
|
|
15
|
-
type ComputedGetter<T
|
|
16
|
-
type ComputedSetter<T
|
|
17
|
-
interface BaseComputedRef<T
|
|
15
|
+
type ComputedGetter<T> = () => T;
|
|
16
|
+
type ComputedSetter<T> = (value: T) => void;
|
|
17
|
+
interface BaseComputedRef<T, S = T> extends Ref<T, S> {
|
|
18
18
|
[key: symbol]: any;
|
|
19
19
|
}
|
|
20
|
-
interface ComputedRef<T
|
|
21
|
-
readonly value: T
|
|
20
|
+
interface ComputedRef<T = any> extends BaseComputedRef<T> {
|
|
21
|
+
readonly value: T;
|
|
22
22
|
}
|
|
23
|
-
interface WritableComputedRef<T
|
|
24
|
-
value: T
|
|
23
|
+
interface WritableComputedRef<T, S = T> extends BaseComputedRef<T, S> {
|
|
24
|
+
value: T;
|
|
25
25
|
}
|
|
26
|
-
interface WritableComputedOptions<T
|
|
27
|
-
get: ComputedGetter<T
|
|
28
|
-
set: ComputedSetter<T
|
|
26
|
+
interface WritableComputedOptions<T> {
|
|
27
|
+
get: ComputedGetter<T>;
|
|
28
|
+
set: ComputedSetter<T>;
|
|
29
29
|
}
|
|
30
|
-
declare function computed<T
|
|
31
|
-
declare function computed<T
|
|
30
|
+
declare function computed<T>(getter: ComputedGetter<T>): ComputedRef<T>;
|
|
31
|
+
declare function computed<T>(options: WritableComputedOptions<T>): WritableComputedRef<T>;
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/scheduler.d.ts
|
|
34
|
-
declare function nextTick<T
|
|
34
|
+
declare function nextTick<T>(fn?: () => T): Promise<T>;
|
|
35
35
|
//#endregion
|
|
36
36
|
//#region src/reactivity/core.d.ts
|
|
37
37
|
type EffectScheduler = () => void;
|
|
38
38
|
type Dep = Set<ReactiveEffect>;
|
|
39
|
-
interface ReactiveEffect<T
|
|
40
|
-
(): T
|
|
39
|
+
interface ReactiveEffect<T = any> {
|
|
40
|
+
(): T;
|
|
41
41
|
deps: Dep[];
|
|
42
42
|
scheduler?: EffectScheduler;
|
|
43
43
|
active: boolean;
|
|
44
44
|
_running: boolean;
|
|
45
|
-
_fn: () => T
|
|
45
|
+
_fn: () => T;
|
|
46
46
|
onStop?: () => void;
|
|
47
47
|
}
|
|
48
48
|
declare function startBatch(): void;
|
|
49
49
|
declare function endBatch(): void;
|
|
50
|
-
declare function batch<T
|
|
50
|
+
declare function batch<T>(fn: () => T): T;
|
|
51
51
|
declare function stop(runner: ReactiveEffect): void;
|
|
52
52
|
interface EffectScope {
|
|
53
53
|
active: boolean;
|
|
54
54
|
effects: ReactiveEffect[];
|
|
55
55
|
cleanups: (() => void)[];
|
|
56
|
-
run: <T
|
|
56
|
+
run: <T>(fn: () => T) => T | undefined;
|
|
57
57
|
stop: () => void;
|
|
58
58
|
}
|
|
59
59
|
declare function effectScope(detached?: boolean): EffectScope;
|
|
@@ -64,7 +64,7 @@ interface EffectOptions {
|
|
|
64
64
|
lazy?: boolean;
|
|
65
65
|
onStop?: () => void;
|
|
66
66
|
}
|
|
67
|
-
declare function effect<T
|
|
67
|
+
declare function effect<T = any>(fn: () => T, options?: EffectOptions): ReactiveEffect<T>;
|
|
68
68
|
//#endregion
|
|
69
69
|
//#region src/reactivity/reactive/mutation.d.ts
|
|
70
70
|
type MutationOp = 'set' | 'delete';
|
|
@@ -113,18 +113,18 @@ declare function touchReactive(target: object): void;
|
|
|
113
113
|
* state.nested = { count: 1 } // 会触发 effect(顶层属性变更)
|
|
114
114
|
* ```
|
|
115
115
|
*/
|
|
116
|
-
declare function shallowReactive<T
|
|
116
|
+
declare function shallowReactive<T extends object>(target: T): T;
|
|
117
117
|
/**
|
|
118
118
|
* 判断一个值是否为 shallowReactive 创建的浅层响应式对象
|
|
119
119
|
*/
|
|
120
120
|
declare function isShallowReactive(value: unknown): boolean;
|
|
121
121
|
//#endregion
|
|
122
122
|
//#region src/reactivity/reactive/shared.d.ts
|
|
123
|
-
declare function toRaw<T
|
|
123
|
+
declare function toRaw<T>(observed: T): T;
|
|
124
124
|
//#endregion
|
|
125
125
|
//#region src/reactivity/reactive.d.ts
|
|
126
126
|
declare function getReactiveVersion(target: object): number;
|
|
127
|
-
declare function reactive<T
|
|
127
|
+
declare function reactive<T extends object>(target: T): T;
|
|
128
128
|
declare function isReactive(value: unknown): boolean;
|
|
129
129
|
/**
|
|
130
130
|
* 标记对象为“原始”状态,后续不会被转换为响应式,返回原对象本身。
|
|
@@ -145,7 +145,7 @@ declare function isReactive(value: unknown): boolean;
|
|
|
145
145
|
* state.foo // 不是响应式对象
|
|
146
146
|
* ```
|
|
147
147
|
*/
|
|
148
|
-
declare function markRaw<T
|
|
148
|
+
declare function markRaw<T extends object>(value: T): T;
|
|
149
149
|
/**
|
|
150
150
|
* 判断某个值是否被标记为原始(即不应转换为响应式)。
|
|
151
151
|
*
|
|
@@ -160,12 +160,12 @@ declare function isRaw(value: unknown): boolean;
|
|
|
160
160
|
* 选择浅层而非深层递归,是为了在小程序环境中保持实现和运行时开销最小,
|
|
161
161
|
* 仅阻止直接属性写入/删除,嵌套对象仍按原样透传。
|
|
162
162
|
*/
|
|
163
|
-
declare function readonly<T
|
|
164
|
-
declare function readonly<T
|
|
163
|
+
declare function readonly<T extends object>(target: T): T;
|
|
164
|
+
declare function readonly<T>(target: Ref<T>): Readonly<Ref<T>>;
|
|
165
165
|
//#endregion
|
|
166
166
|
//#region src/reactivity/shallowRef.d.ts
|
|
167
|
-
declare function shallowRef<T
|
|
168
|
-
declare function shallowRef<T
|
|
167
|
+
declare function shallowRef<T>(value: T): Ref<T>;
|
|
168
|
+
declare function shallowRef<T>(value: T, defaultValue: T): Ref<T>;
|
|
169
169
|
/**
|
|
170
170
|
* 判断传入值是否为浅层 ref。
|
|
171
171
|
*
|
|
@@ -178,7 +178,7 @@ declare function isShallowRef(r: any): r is Ref<any>;
|
|
|
178
178
|
*
|
|
179
179
|
* @param ref 需要触发的 ref
|
|
180
180
|
*/
|
|
181
|
-
declare function triggerRef<T
|
|
181
|
+
declare function triggerRef<T>(ref: Ref<T>): void;
|
|
182
182
|
//#endregion
|
|
183
183
|
//#region src/reactivity/toRefs.d.ts
|
|
184
184
|
/**
|
|
@@ -197,8 +197,8 @@ declare function triggerRef<T$1>(ref: Ref<T$1>): void;
|
|
|
197
197
|
* console.log(state.foo) // 2
|
|
198
198
|
* ```
|
|
199
199
|
*/
|
|
200
|
-
declare function toRef<T
|
|
201
|
-
declare function toRef<T
|
|
200
|
+
declare function toRef<T extends object, K extends keyof T>(object: T, key: K): ToRef<T[K]>;
|
|
201
|
+
declare function toRef<T extends object, K extends keyof T>(object: T, key: K, defaultValue: T[K]): ToRef<T[K]>;
|
|
202
202
|
/**
|
|
203
203
|
* 将一个响应式对象转换成“同结构的普通对象”,其中每个字段都是指向原对象对应属性的 ref。
|
|
204
204
|
*
|
|
@@ -214,37 +214,51 @@ declare function toRef<T$1 extends object, K$1 extends keyof T$1>(object: T$1, k
|
|
|
214
214
|
* state.foo // 2
|
|
215
215
|
* ```
|
|
216
216
|
*/
|
|
217
|
-
declare function toRefs<T
|
|
217
|
+
declare function toRefs<T extends object>(object: T): ToRefs<T>;
|
|
218
218
|
/**
|
|
219
219
|
* toRefs 返回值的类型辅助
|
|
220
220
|
*/
|
|
221
|
-
type ToRef<T
|
|
222
|
-
type ToRefs<T
|
|
221
|
+
type ToRef<T> = T extends Ref<any> ? T : Ref<T>;
|
|
222
|
+
type ToRefs<T extends object> = { [K in keyof T]: ToRef<T[K]> };
|
|
223
223
|
//#endregion
|
|
224
224
|
//#region src/reactivity/traverse.d.ts
|
|
225
|
-
declare function traverse(value: any, seen?:
|
|
225
|
+
declare function traverse(value: any, depth?: number, seen?: Map<object, number>): any;
|
|
226
226
|
//#endregion
|
|
227
227
|
//#region src/reactivity/watch.d.ts
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
type OnCleanup = (cleanupFn: () => void) => void;
|
|
229
|
+
type WatchEffect = (onCleanup: OnCleanup) => void;
|
|
230
|
+
type WatchSource<T = any> = Ref<T> | ComputedRef<T> | (() => T);
|
|
231
|
+
type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onCleanup: OnCleanup) => void;
|
|
232
|
+
type WatchScheduler = (job: () => void, isFirstRun: boolean) => void;
|
|
233
|
+
type MaybeUndefined<T, Immediate> = Immediate extends true ? T | undefined : T;
|
|
234
|
+
type MultiWatchSources = (WatchSource<unknown> | object)[];
|
|
235
|
+
type MapSources<T, Immediate> = { [K in keyof T]: T[K] extends WatchSource<infer V> ? MaybeUndefined<V, Immediate> : T[K] extends object ? MaybeUndefined<T[K], Immediate> : never };
|
|
236
|
+
type WatchSourceValue<S> = S extends WatchSource<infer V> ? V : S extends object ? S : never;
|
|
237
|
+
type WatchSources<T = any> = WatchSource<T> | ReadonlyArray<WatchSource<unknown> | object> | (T extends object ? T : never);
|
|
238
|
+
type IsTuple<T extends ReadonlyArray<any>> = number extends T['length'] ? false : true;
|
|
239
|
+
type WatchMultiSources<T extends ReadonlyArray<WatchSource<unknown> | object>> = IsTuple<T> extends true ? { [K in keyof T]: WatchSourceValue<T[K]> } : Array<WatchSourceValue<T[number]>>;
|
|
240
|
+
interface WatchEffectOptions {
|
|
241
|
+
flush?: 'pre' | 'post' | 'sync';
|
|
242
|
+
}
|
|
243
|
+
interface WatchOptions<Immediate extends boolean = false> extends WatchEffectOptions {
|
|
244
|
+
immediate?: Immediate;
|
|
245
|
+
deep?: boolean | number;
|
|
246
|
+
once?: boolean;
|
|
247
|
+
scheduler?: WatchScheduler;
|
|
231
248
|
}
|
|
232
|
-
type WatchSource<T$1 = any> = (() => T$1) | Ref<T$1>;
|
|
233
|
-
type WatchSourceValue<S> = S extends Ref<infer V> ? V : S extends (() => infer V) ? V : S extends object ? S : never;
|
|
234
|
-
type IsTuple<T$1 extends ReadonlyArray<any>> = number extends T$1['length'] ? false : true;
|
|
235
|
-
type WatchMultiSources<T$1 extends ReadonlyArray<WatchSource<any>>> = IsTuple<T$1> extends true ? { [K in keyof T$1]: WatchSourceValue<T$1[K]> } : Array<WatchSourceValue<T$1[number]>>;
|
|
236
249
|
type WatchStopHandle = () => void;
|
|
237
250
|
type DeepWatchStrategy = 'version' | 'traverse';
|
|
238
251
|
declare function setDeepWatchStrategy(strategy: DeepWatchStrategy): void;
|
|
239
252
|
declare function getDeepWatchStrategy(): DeepWatchStrategy;
|
|
240
|
-
declare function watch<T
|
|
241
|
-
declare function watch<T
|
|
242
|
-
declare function watch<T
|
|
253
|
+
declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
254
|
+
declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T extends ReadonlyArray<any> ? never : T, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
255
|
+
declare function watch<T extends Readonly<MultiWatchSources>, Immediate extends Readonly<boolean> = false>(source: readonly [...T] | T, cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
256
|
+
declare function watch<T extends MultiWatchSources, Immediate extends Readonly<boolean> = false>(source: [...T], cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
243
257
|
/**
|
|
244
258
|
* watchEffect 注册一个响应式副作用,可选清理函数。
|
|
245
259
|
* 副作用会立即执行,并在依赖变化时重新运行。
|
|
246
260
|
*/
|
|
247
|
-
declare function watchEffect(effectFn:
|
|
261
|
+
declare function watchEffect(effectFn: WatchEffect, options?: WatchEffectOptions): WatchStopHandle;
|
|
248
262
|
//#endregion
|
|
249
263
|
//#region src/runtime/types/miniprogram.d.ts
|
|
250
264
|
interface MiniProgramAdapter {
|
|
@@ -316,7 +330,7 @@ interface MiniProgramComponentOptions {
|
|
|
316
330
|
detached?: MpComponentOptions['detached'];
|
|
317
331
|
error?: MpComponentOptions['error'];
|
|
318
332
|
}
|
|
319
|
-
type MiniProgramAppOptions<T
|
|
333
|
+
type MiniProgramAppOptions<T extends Record<string, any> = Record<string, any>> = WechatMiniprogram.App.Options<T>;
|
|
320
334
|
type TriggerEventOptions = WechatMiniprogram.Component.TriggerEventOption;
|
|
321
335
|
type MiniProgramInstance = WechatMiniprogram.Component.TrivialInstance | WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.App.TrivialInstance;
|
|
322
336
|
type MiniProgramPageLifetimes = Partial<WechatMiniprogram.Page.ILifetime>;
|
|
@@ -329,23 +343,23 @@ type ComputedDefinitions = Record<string, ComputedGetter<any> | WritableComputed
|
|
|
329
343
|
type MethodDefinitions = Record<string, (...args: any[]) => any>;
|
|
330
344
|
type ExtractComputed<C extends ComputedDefinitions> = { [K in keyof C]: C[K] extends ComputedGetter<infer R> ? R : C[K] extends WritableComputedOptions<infer R> ? R : never };
|
|
331
345
|
type ExtractMethods<M extends MethodDefinitions> = { [K in keyof M]: M[K] extends ((...args: infer P) => infer R) ? (...args: P) => R : never };
|
|
332
|
-
type ComponentPublicInstance<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions, P
|
|
346
|
+
type ComponentPublicInstance<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions, P = Record<string, any>, S = Record<string, any>> = D & ExtractComputed<C> & ExtractMethods<M> & {
|
|
333
347
|
$attrs: Record<string, any>;
|
|
334
|
-
$props: P
|
|
348
|
+
$props: P;
|
|
335
349
|
$slots: S;
|
|
336
350
|
$emit: (event: string, detail?: any, options?: TriggerEventOptions) => void;
|
|
337
351
|
};
|
|
338
|
-
interface ModelBindingOptions<T
|
|
352
|
+
interface ModelBindingOptions<T = any, Event extends string = string, ValueProp extends string = string, Formatted = T> {
|
|
339
353
|
event?: Event;
|
|
340
354
|
valueProp?: ValueProp;
|
|
341
|
-
parser?: (payload: any) => T
|
|
342
|
-
formatter?: (value: T
|
|
355
|
+
parser?: (payload: any) => T;
|
|
356
|
+
formatter?: (value: T) => Formatted;
|
|
343
357
|
}
|
|
344
|
-
type ModelBindingPayload<T
|
|
345
|
-
interface ModelBinding<T
|
|
346
|
-
value: T
|
|
347
|
-
update: (value: T
|
|
348
|
-
model: <Event extends string = 'input', ValueProp extends string = 'value', Formatted = T
|
|
358
|
+
type ModelBindingPayload<T = any, Event extends string = 'input', ValueProp extends string = 'value', Formatted = T> = { [K in ValueProp]: Formatted } & { [K in `on${Capitalize<Event>}`]: (event: any) => void };
|
|
359
|
+
interface ModelBinding<T = any> {
|
|
360
|
+
value: T;
|
|
361
|
+
update: (value: T) => void;
|
|
362
|
+
model: <Event extends string = 'input', ValueProp extends string = 'value', Formatted = T>(options?: ModelBindingOptions<T, Event, ValueProp, Formatted>) => ModelBindingPayload<T, Event, ValueProp, Formatted>;
|
|
349
363
|
}
|
|
350
364
|
//#endregion
|
|
351
365
|
//#region src/runtime/types/runtime.d.ts
|
|
@@ -366,8 +380,8 @@ interface RuntimeInstance<D extends object, C extends ComputedDefinitions, M ext
|
|
|
366
380
|
readonly methods: ExtractMethods<M>;
|
|
367
381
|
readonly computed: Readonly<ExtractComputed<C>>;
|
|
368
382
|
readonly adapter?: MiniProgramAdapter;
|
|
369
|
-
bindModel: <T
|
|
370
|
-
watch: <T
|
|
383
|
+
bindModel: <T = any>(path: string, options?: ModelBindingOptions<T>) => ModelBinding<T>;
|
|
384
|
+
watch: <T>(source: (() => T) | Record<string, any>, cb: (value: T, oldValue: T) => void, options?: WatchOptions) => WatchStopHandle;
|
|
371
385
|
snapshot: () => Record<string, any>;
|
|
372
386
|
unmount: () => void;
|
|
373
387
|
}
|
|
@@ -384,57 +398,57 @@ interface InternalRuntimeStateFields {
|
|
|
384
398
|
type InternalRuntimeState = InternalRuntimeStateFields & Partial<MiniProgramInstance>;
|
|
385
399
|
//#endregion
|
|
386
400
|
//#region src/runtime/types/props.d.ts
|
|
387
|
-
type PropMethod<T
|
|
401
|
+
type PropMethod<T, TConstructor = any> = [T] extends [((...args: any) => any) | undefined] ? {
|
|
388
402
|
new (): TConstructor;
|
|
389
|
-
(): T
|
|
403
|
+
(): T;
|
|
390
404
|
readonly prototype: TConstructor;
|
|
391
405
|
} : never;
|
|
392
|
-
type PropConstructor<T
|
|
393
|
-
new (...args: any[]): T
|
|
406
|
+
type PropConstructor<T = any> = {
|
|
407
|
+
new (...args: any[]): T & object;
|
|
394
408
|
} | {
|
|
395
|
-
(): T
|
|
396
|
-
} | PropMethod<T
|
|
397
|
-
type PropType<T
|
|
409
|
+
(): T;
|
|
410
|
+
} | PropMethod<T>;
|
|
411
|
+
type PropType<T> = PropConstructor<T> | PropConstructor<T>[];
|
|
398
412
|
type ComponentPropsOptions = Record<string, PropOptions<any> | PropType<any> | null>;
|
|
399
|
-
interface PropOptions<T
|
|
400
|
-
type?: PropType<T
|
|
413
|
+
interface PropOptions<T = any> {
|
|
414
|
+
type?: PropType<T> | true | null;
|
|
401
415
|
/**
|
|
402
416
|
* 默认值(对齐 Vue 的 `default`;会被赋给小程序 property 的 `value`)
|
|
403
417
|
*/
|
|
404
|
-
default?: T
|
|
418
|
+
default?: T | (() => T);
|
|
405
419
|
/**
|
|
406
420
|
* 小程序 `value` 的别名
|
|
407
421
|
*/
|
|
408
|
-
value?: T
|
|
422
|
+
value?: T | (() => T);
|
|
409
423
|
required?: boolean;
|
|
410
424
|
}
|
|
411
|
-
type HasDefault<T
|
|
425
|
+
type HasDefault<T> = T extends {
|
|
412
426
|
default: infer D;
|
|
413
|
-
} ? D extends (() => undefined) | undefined ? false : true : T
|
|
427
|
+
} ? D extends (() => undefined) | undefined ? false : true : T extends {
|
|
414
428
|
value: infer V;
|
|
415
429
|
} ? V extends (() => undefined) | undefined ? false : true : false;
|
|
416
|
-
type IsBooleanProp<T
|
|
430
|
+
type IsBooleanProp<T> = T extends {
|
|
417
431
|
type?: infer U;
|
|
418
|
-
} ? IsBooleanProp<U> : T
|
|
419
|
-
type RequiredKeys<T
|
|
432
|
+
} ? IsBooleanProp<U> : T extends readonly any[] ? true extends IsBooleanProp<T[number]> ? true : false : T extends BooleanConstructor ? true : false;
|
|
433
|
+
type RequiredKeys<T> = { [K in keyof T]: T[K] extends {
|
|
420
434
|
required: true;
|
|
421
|
-
} ? K : HasDefault<T
|
|
422
|
-
type OptionalKeys<T
|
|
423
|
-
type DefaultKeys<T
|
|
435
|
+
} ? K : HasDefault<T[K]> extends true ? K : IsBooleanProp<T[K]> extends true ? K : never }[keyof T];
|
|
436
|
+
type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
|
|
437
|
+
type DefaultKeys<T> = { [K in keyof T]: HasDefault<T[K]> extends true ? K : IsBooleanProp<T[K]> extends true ? K : never }[keyof T];
|
|
424
438
|
type InferPropType<O> = O extends null ? any : O extends {
|
|
425
439
|
type?: infer T;
|
|
426
440
|
} ? InferPropConstructor<T> : O extends PropType<infer V> ? V : InferPropConstructor<O>;
|
|
427
|
-
type InferPropConstructor<T
|
|
428
|
-
type InferProps<P
|
|
429
|
-
type ExtractPropTypes<P
|
|
430
|
-
type ExtractPublicPropTypes<P
|
|
431
|
-
type ExtractDefaultPropTypes<P
|
|
432
|
-
type SetupFunction<P
|
|
433
|
-
interface SetupContext<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions, P
|
|
441
|
+
type InferPropConstructor<T> = T extends readonly any[] ? InferPropConstructor<T[number]> : T extends undefined ? any : T extends null ? any : T extends BooleanConstructor ? boolean : T extends NumberConstructor ? number : T extends StringConstructor ? string : T extends DateConstructor ? Date : T extends ArrayConstructor ? any[] : T extends ObjectConstructor ? Record<string, any> : T extends PropConstructor<infer V> ? V : any;
|
|
442
|
+
type InferProps<P extends ComponentPropsOptions = ComponentPropsOptions> = { [K in keyof Pick<P, RequiredKeys<P>>]: HasDefault<P[K]> extends true ? Exclude<InferPropType<P[K]>, undefined> : InferPropType<P[K]> } & { [K in keyof Pick<P, OptionalKeys<P>>]?: InferPropType<P[K]> };
|
|
443
|
+
type ExtractPropTypes<P extends ComponentPropsOptions = ComponentPropsOptions> = InferProps<P>;
|
|
444
|
+
type ExtractPublicPropTypes<P extends ComponentPropsOptions = ComponentPropsOptions> = InferProps<P>;
|
|
445
|
+
type ExtractDefaultPropTypes<P extends ComponentPropsOptions = ComponentPropsOptions> = { [K in keyof Pick<P, DefaultKeys<P>>]: InferPropType<P[K]> };
|
|
446
|
+
type SetupFunction<P extends ComponentPropsOptions, D extends object, C extends ComputedDefinitions, M extends MethodDefinitions, R extends Record<string, any> | void = Record<string, any> | void> = (props: InferProps<P>, ctx: SetupContext<D, C, M, P>) => R;
|
|
447
|
+
interface SetupContext<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions, P extends ComponentPropsOptions = ComponentPropsOptions> {
|
|
434
448
|
/**
|
|
435
449
|
* 组件 props(来自小程序 properties)
|
|
436
450
|
*/
|
|
437
|
-
props: InferProps<P
|
|
451
|
+
props: InferProps<P>;
|
|
438
452
|
/**
|
|
439
453
|
* 运行时实例
|
|
440
454
|
*/
|
|
@@ -481,15 +495,15 @@ interface SetupContext<D extends object, C extends ComputedDefinitions, M extend
|
|
|
481
495
|
}
|
|
482
496
|
//#endregion
|
|
483
497
|
//#region src/vue-types.d.ts
|
|
484
|
-
type Ref$2<T
|
|
485
|
-
type ShallowRef$2<T
|
|
498
|
+
type Ref$2<T = any, S = T> = Ref$1<T, S>;
|
|
499
|
+
type ShallowRef$2<T = any, S = T> = ShallowRef$1<T, S>;
|
|
486
500
|
type AllowedComponentProps = AllowedComponentProps$1;
|
|
487
501
|
type ComponentCustomProps = ComponentCustomProps$1;
|
|
488
502
|
type ComponentOptionsMixin = ComponentOptionsMixin$1;
|
|
489
503
|
type DefineComponent<PropsOrPropOptions = ComponentPropsOptions, RawBindings = Record<string, any>, D = Record<string, any>, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin$1 = ComponentOptionsMixin$1, Extends extends ComponentOptionsMixin$1 = ComponentOptionsMixin$1, E extends EmitsOptions$1 = EmitsOptions$1, EE extends string = string, PP = PublicProps$1, Props = (PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions), Defaults = (PropsOrPropOptions extends ComponentPropsOptions ? ExtractDefaultPropTypes<PropsOrPropOptions> : {}), S extends SlotsType = SlotsType> = DefineComponent$1<PropsOrPropOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, PP, Props, Defaults, S>;
|
|
490
504
|
type ObjectDirective<HostElement = any, Value = any, Modifiers extends string = string, Arg = any> = ObjectDirective$1<HostElement, Value, Modifiers, Arg>;
|
|
491
505
|
type PublicProps = PublicProps$1;
|
|
492
|
-
type ShallowUnwrapRef<T
|
|
506
|
+
type ShallowUnwrapRef<T> = ShallowUnwrapRef$1<T>;
|
|
493
507
|
type VNode<HostNode = any, HostElement = any, ExtraProps = Record<string, any>> = VNode$1<HostNode, HostElement, ExtraProps>;
|
|
494
508
|
type VNodeProps = VNodeProps$1;
|
|
495
509
|
//#endregion
|
|
@@ -607,7 +621,7 @@ interface SetDataDebugInfo {
|
|
|
607
621
|
}
|
|
608
622
|
//#endregion
|
|
609
623
|
//#region src/runtime/types/options.d.ts
|
|
610
|
-
interface DefineComponentOptions<P
|
|
624
|
+
interface DefineComponentOptions<P extends ComponentPropsOptions = ComponentPropsOptions, D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions, S extends Record<string, any> | void = Record<string, any> | void> extends MiniProgramComponentOptions, MiniProgramPageLifetimes {
|
|
611
625
|
/**
|
|
612
626
|
* 页面特性开关(用于按需注入 Page 事件处理函数)。
|
|
613
627
|
*
|
|
@@ -622,9 +636,9 @@ interface DefineComponentOptions<P$1 extends ComponentPropsOptions = ComponentPr
|
|
|
622
636
|
/**
|
|
623
637
|
* 类 Vue 的 props 定义(会被规范化为小程序 `properties`)
|
|
624
638
|
*/
|
|
625
|
-
props?: P
|
|
639
|
+
props?: P;
|
|
626
640
|
watch?: Record<string, any>;
|
|
627
|
-
setup?: SetupFunction<P
|
|
641
|
+
setup?: SetupFunction<P, D, C, M, S>;
|
|
628
642
|
/**
|
|
629
643
|
* 组件 data(建议使用函数返回初始值)。
|
|
630
644
|
*/
|
|
@@ -647,7 +661,7 @@ interface DefineComponentOptions<P$1 extends ComponentPropsOptions = ComponentPr
|
|
|
647
661
|
*/
|
|
648
662
|
[key: string]: any;
|
|
649
663
|
}
|
|
650
|
-
type AppSetupProps =
|
|
664
|
+
type AppSetupProps = {};
|
|
651
665
|
interface DefineAppOptions<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions> extends MiniProgramAppOptions {
|
|
652
666
|
watch?: Record<string, any>;
|
|
653
667
|
setup?: (props: AppSetupProps, ctx: SetupContext<D, C, M, AppSetupProps>) => Record<string, any> | void;
|
|
@@ -768,7 +782,7 @@ interface ComponentDefinition<D extends object, C extends ComputedDefinitions, M
|
|
|
768
782
|
};
|
|
769
783
|
}
|
|
770
784
|
type SetupBindings<S> = Exclude<S, void> extends never ? Record<string, never> : Exclude<S, void>;
|
|
771
|
-
type ResolveProps<P
|
|
785
|
+
type ResolveProps<P> = P extends ComponentPropsOptions ? InferProps<P> : P;
|
|
772
786
|
interface WevuComponentConstructor<Props, RawBindings, D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> {
|
|
773
787
|
new (): ComponentPublicInstance<D, C, M, Props> & ShallowUnwrapRef<RawBindings>;
|
|
774
788
|
}
|
|
@@ -815,7 +829,7 @@ interface DefineComponentWithTypeProps<TypeProps> {
|
|
|
815
829
|
* ```
|
|
816
830
|
*/
|
|
817
831
|
declare function defineComponent<TypeProps = any>(options: DefineComponentTypePropsOptions<TypeProps>): DefineComponentWithTypeProps<TypeProps> & ComponentDefinition<Record<string, any>, ComputedDefinitions, MethodDefinitions>;
|
|
818
|
-
declare function defineComponent<P
|
|
832
|
+
declare function defineComponent<P extends ComponentPropsOptions = ComponentPropsOptions, D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions, S extends Record<string, any> | void = Record<string, any> | void>(options: DefineComponentOptions<P, D, C, M, S>): WevuComponentConstructor<ResolveProps<P>, SetupBindings<S>, D, C, M> & ComponentDefinition<D, C, M>;
|
|
819
833
|
/**
|
|
820
834
|
* 从 Vue SFC 选项创建 wevu 组件,供 weapp-vite 编译产物直接调用的兼容入口。
|
|
821
835
|
*
|
|
@@ -829,9 +843,9 @@ declare function createWevuScopedSlotComponent(overrides?: {
|
|
|
829
843
|
}): void;
|
|
830
844
|
//#endregion
|
|
831
845
|
//#region src/runtime/hooks.d.ts
|
|
832
|
-
declare function getCurrentInstance<T
|
|
846
|
+
declare function getCurrentInstance<T extends InternalRuntimeState = InternalRuntimeState>(): T | undefined;
|
|
833
847
|
declare function setCurrentInstance(inst: InternalRuntimeState | undefined): void;
|
|
834
|
-
declare function getCurrentSetupContext<T
|
|
848
|
+
declare function getCurrentSetupContext<T = any>(): T | undefined;
|
|
835
849
|
declare function setCurrentSetupContext(ctx: any | undefined): void;
|
|
836
850
|
declare function callHookList(target: InternalRuntimeState, name: string, args?: any[]): void;
|
|
837
851
|
declare function callHookReturn(target: InternalRuntimeState, name: string, args?: any[]): any;
|
|
@@ -903,7 +917,7 @@ declare function onServerPrefetch(_handler: () => void): void;
|
|
|
903
917
|
declare function callUpdateHooks(target: InternalRuntimeState, phase: 'before' | 'after'): void;
|
|
904
918
|
//#endregion
|
|
905
919
|
//#region src/runtime/noSetData.d.ts
|
|
906
|
-
declare function markNoSetData<T
|
|
920
|
+
declare function markNoSetData<T extends object>(value: T): T;
|
|
907
921
|
declare function isNoSetData(value: unknown): boolean;
|
|
908
922
|
//#endregion
|
|
909
923
|
//#region src/runtime/provide.d.ts
|
|
@@ -922,7 +936,7 @@ declare function isNoSetData(value: unknown): boolean;
|
|
|
922
936
|
* })
|
|
923
937
|
* ```
|
|
924
938
|
*/
|
|
925
|
-
declare function provide<T
|
|
939
|
+
declare function provide<T>(key: any, value: T): void;
|
|
926
940
|
/**
|
|
927
941
|
* 从祖先组件(或全局存储)读取提供的值。
|
|
928
942
|
*
|
|
@@ -940,15 +954,15 @@ declare function provide<T$1>(key: any, value: T$1): void;
|
|
|
940
954
|
* })
|
|
941
955
|
* ```
|
|
942
956
|
*/
|
|
943
|
-
declare function inject<T
|
|
957
|
+
declare function inject<T>(key: any, defaultValue?: T): T;
|
|
944
958
|
/**
|
|
945
959
|
* 全局注入值,适用于组件外部调用场景。
|
|
946
960
|
*/
|
|
947
|
-
declare function provideGlobal<T
|
|
961
|
+
declare function provideGlobal<T>(key: any, value: T): void;
|
|
948
962
|
/**
|
|
949
963
|
* 从全局存储读取值,适用于组件外部调用场景。
|
|
950
964
|
*/
|
|
951
|
-
declare function injectGlobal<T
|
|
965
|
+
declare function injectGlobal<T>(key: any, defaultValue?: T): T;
|
|
952
966
|
//#endregion
|
|
953
967
|
//#region src/runtime/register/watch.d.ts
|
|
954
968
|
type WatchHandler = (this: any, value: any, oldValue: any) => void;
|
|
@@ -985,30 +999,30 @@ declare function normalizeClass(value: any): string;
|
|
|
985
999
|
//#region src/runtime/vueCompat.d.ts
|
|
986
1000
|
declare function useAttrs(): Record<string, any>;
|
|
987
1001
|
declare function useSlots(): Record<string, any>;
|
|
988
|
-
type TemplateRef<T
|
|
989
|
-
declare function useTemplateRef<K
|
|
990
|
-
declare function useTemplateRef<T
|
|
991
|
-
declare function useModel<T
|
|
1002
|
+
type TemplateRef<T = unknown> = Readonly<ShallowRef<T | null>>;
|
|
1003
|
+
declare function useTemplateRef<K extends keyof TemplateRefs>(name: K): TemplateRef<TemplateRefs[K]>;
|
|
1004
|
+
declare function useTemplateRef<T = unknown>(name: string): TemplateRef<T>;
|
|
1005
|
+
declare function useModel<T = any>(props: Record<string, any>, name: string): Ref<T>;
|
|
992
1006
|
/**
|
|
993
1007
|
* useBindModel 返回绑定到当前运行时实例的 bindModel。
|
|
994
1008
|
* 该方法必须在 setup() 的同步阶段调用。
|
|
995
1009
|
*/
|
|
996
|
-
type BindModelWithHelper<DefaultEvent extends string = 'input', DefaultValueProp extends string = 'value'> = (<T
|
|
997
|
-
model: <T
|
|
998
|
-
value: <T
|
|
999
|
-
on: <T
|
|
1010
|
+
type BindModelWithHelper<DefaultEvent extends string = 'input', DefaultValueProp extends string = 'value'> = (<T = any>(path: string, options?: ModelBindingOptions<T>) => ModelBinding<T>) & {
|
|
1011
|
+
model: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(path: string, options?: ModelBindingOptions<T, Event, ValueProp, Formatted>) => ModelBindingPayload<T, Event, ValueProp, Formatted>;
|
|
1012
|
+
value: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(path: string, options?: ModelBindingOptions<T, Event, ValueProp, Formatted>) => Formatted;
|
|
1013
|
+
on: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(path: string, options?: ModelBindingOptions<T, Event, ValueProp, Formatted>) => (event: any) => void;
|
|
1000
1014
|
};
|
|
1001
1015
|
declare function useBindModel<DefaultEvent extends string = 'input', DefaultValueProp extends string = 'value'>(defaultOptions?: ModelBindingOptions<any, DefaultEvent, DefaultValueProp, any>): BindModelWithHelper<DefaultEvent, DefaultValueProp>;
|
|
1002
|
-
declare function mergeModels<T
|
|
1016
|
+
declare function mergeModels<T>(a: T, b: T): T;
|
|
1003
1017
|
//#endregion
|
|
1004
1018
|
//#region src/macros.d.ts
|
|
1005
|
-
type Prettify<T
|
|
1006
|
-
type LooseRequired<T
|
|
1007
|
-
type IfAny<T
|
|
1019
|
+
type Prettify<T> = { [K in keyof T]: T[K] } & {};
|
|
1020
|
+
type LooseRequired<T> = { [P in keyof (T & Required<T>)]: T[P] };
|
|
1021
|
+
type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
|
|
1008
1022
|
type ComponentObjectPropsOptions = ComponentPropsOptions;
|
|
1009
|
-
type ExtractPropTypes$1<P
|
|
1010
|
-
type DefineProps<T
|
|
1011
|
-
type BooleanKey<T
|
|
1023
|
+
type ExtractPropTypes$1<P extends ComponentObjectPropsOptions> = InferProps<P>;
|
|
1024
|
+
type DefineProps<T, BKeys extends keyof T> = Readonly<T> & { readonly [K in BKeys]-?: boolean };
|
|
1025
|
+
type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? T[K] extends boolean | undefined ? T[K] extends never | undefined ? never : K : never : never;
|
|
1012
1026
|
/**
|
|
1013
1027
|
* wevu + Volar 类型检查使用的 script-setup 宏。
|
|
1014
1028
|
*
|
|
@@ -1065,12 +1079,12 @@ declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentO
|
|
|
1065
1079
|
* ```
|
|
1066
1080
|
*/
|
|
1067
1081
|
declare function defineProps<TypeProps>(): DefineProps<LooseRequired<TypeProps>, BooleanKey<TypeProps>>;
|
|
1068
|
-
type NotUndefined<T
|
|
1069
|
-
type MappedOmit<T
|
|
1070
|
-
type InferDefaults<T
|
|
1082
|
+
type NotUndefined<T> = T extends undefined ? never : T;
|
|
1083
|
+
type MappedOmit<T, K extends keyof any> = { [P in keyof T as P extends K ? never : P]: T[P] };
|
|
1084
|
+
type InferDefaults<T> = { [K in keyof T]?: InferDefault<T, T[K]> };
|
|
1071
1085
|
type NativeType = null | undefined | number | string | boolean | symbol | Function;
|
|
1072
|
-
type InferDefault<P
|
|
1073
|
-
type PropsWithDefaults<T
|
|
1086
|
+
type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never);
|
|
1087
|
+
type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = T extends unknown ? Readonly<MappedOmit<T, keyof Defaults>> & { readonly [K in keyof Defaults as K extends keyof T ? K : never]-?: K extends keyof T ? Defaults[K] extends undefined ? IfAny<Defaults[K], NotUndefined<T[K]>, T[K]> : NotUndefined<T[K]> : never } & { readonly [K in BKeys]-?: K extends keyof Defaults ? Defaults[K] extends undefined ? boolean | undefined : boolean : boolean } : never;
|
|
1074
1088
|
/**
|
|
1075
1089
|
* withDefaults 为 defineProps 指定默认值(仅类型层)。
|
|
1076
1090
|
* 默认值会影响可选/必选推导,但不生成运行时代码。
|
|
@@ -1086,7 +1100,7 @@ type PropsWithDefaults<T$1, Defaults extends InferDefaults<T$1>, BKeys extends k
|
|
|
1086
1100
|
* })
|
|
1087
1101
|
* ```
|
|
1088
1102
|
*/
|
|
1089
|
-
declare function withDefaults<T
|
|
1103
|
+
declare function withDefaults<T, BKeys extends keyof T, Defaults extends InferDefaults<T>>(props: DefineProps<T, BKeys>, defaults: Defaults): PropsWithDefaults<T, Defaults, BKeys>;
|
|
1090
1104
|
type EmitsOptions = Record<string, ((...args: any[]) => any) | null> | string[];
|
|
1091
1105
|
/**
|
|
1092
1106
|
* defineEmits 字符串数组或映射写法。
|
|
@@ -1117,7 +1131,7 @@ declare function defineEmits<E extends Record<string, ((...args: any[]) => any)
|
|
|
1117
1131
|
* emit('save', 1)
|
|
1118
1132
|
* ```
|
|
1119
1133
|
*/
|
|
1120
|
-
declare function defineEmits<T
|
|
1134
|
+
declare function defineEmits<T extends (...args: any[]) => any>(): T;
|
|
1121
1135
|
/**
|
|
1122
1136
|
* defineExpose 向父级 ref 暴露成员。
|
|
1123
1137
|
* 仅影响类型提示,不会生成运行时代码。
|
|
@@ -1130,7 +1144,7 @@ declare function defineEmits<T$1 extends (...args: any[]) => any>(): T$1;
|
|
|
1130
1144
|
* })
|
|
1131
1145
|
* ```
|
|
1132
1146
|
*/
|
|
1133
|
-
declare function defineExpose<T
|
|
1147
|
+
declare function defineExpose<T extends Record<string, any> = Record<string, any>>(exposed?: T): void;
|
|
1134
1148
|
type ScriptSetupDefineOptions<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions> = Omit<DefineComponentOptions<ComponentPropsOptions, D, C, M>, 'props' | 'options'> & {
|
|
1135
1149
|
/**
|
|
1136
1150
|
* props 必须通过 defineProps() 声明。
|
|
@@ -1188,7 +1202,7 @@ declare function defineOptions<D extends object = Record<string, any>, C extends
|
|
|
1188
1202
|
* }>()
|
|
1189
1203
|
* ```
|
|
1190
1204
|
*/
|
|
1191
|
-
declare function defineSlots<T
|
|
1205
|
+
declare function defineSlots<T extends Record<string, any> = Record<string, any>>(): T;
|
|
1192
1206
|
/**
|
|
1193
1207
|
* defineModel 声明 v-model 绑定(weapp 变体)。
|
|
1194
1208
|
* 支持默认字段与自定义字段名。
|
|
@@ -1200,7 +1214,7 @@ declare function defineSlots<T$1 extends Record<string, any> = Record<string, an
|
|
|
1200
1214
|
* const count = defineModel<number>('count', { default: 0 })
|
|
1201
1215
|
* ```
|
|
1202
1216
|
*/
|
|
1203
|
-
declare function defineModel<T
|
|
1217
|
+
declare function defineModel<T = any>(name?: string, options?: Record<string, any>): Ref<T | undefined>;
|
|
1204
1218
|
//#endregion
|
|
1205
1219
|
//#region src/store/types.d.ts
|
|
1206
1220
|
type MutationType = 'patch object' | 'patch function' | 'direct';
|
|
@@ -1238,8 +1252,8 @@ interface DefineStoreOptions<S extends Record<string, any>, G extends GetterTree
|
|
|
1238
1252
|
}
|
|
1239
1253
|
//#endregion
|
|
1240
1254
|
//#region src/store/define.d.ts
|
|
1241
|
-
type SetupDefinition<T
|
|
1242
|
-
declare function defineStore<T
|
|
1255
|
+
type SetupDefinition<T> = () => T;
|
|
1256
|
+
declare function defineStore<T extends Record<string, any>>(id: string, setup: SetupDefinition<T>): () => T & {
|
|
1243
1257
|
$id: string;
|
|
1244
1258
|
$patch: (patch: Record<string, any> | ((state: any) => void)) => void;
|
|
1245
1259
|
$reset: () => void;
|
|
@@ -1269,7 +1283,7 @@ declare function defineStore<S extends Record<string, any>, G extends Record<str
|
|
|
1269
1283
|
declare function createStore(): StoreManager;
|
|
1270
1284
|
//#endregion
|
|
1271
1285
|
//#region src/store/storeToRefs.d.ts
|
|
1272
|
-
type StoreToRefsResult<T
|
|
1273
|
-
declare function storeToRefs<T
|
|
1286
|
+
type StoreToRefsResult<T extends Record<string, any>> = { [K in keyof T]: T[K] extends ((...args: any[]) => any) ? T[K] : T[K] extends Ref<infer V> ? Ref<V> : Ref<T[K]> };
|
|
1287
|
+
declare function storeToRefs<T extends Record<string, any>>(store: T): StoreToRefsResult<T>;
|
|
1274
1288
|
//#endregion
|
|
1275
|
-
export { ActionSubscriber, type AllowedComponentProps, type AppConfig, type ComponentCustomProps, ComponentDefinition, type ComponentOptionsMixin, type ComponentPropsOptions, type ComponentPublicInstance, type ComputedDefinitions, ComputedGetter, ComputedRef, ComputedSetter, type CreateAppOptions, type DefineAppOptions, type DefineComponent, type DefineComponentOptions, DefineStoreOptions, EffectScope, EmitsOptions, type ExtractComputed, type ExtractDefaultPropTypes, type ExtractMethods, type ExtractPropTypes, type ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, type InferPropType, type InferProps, type InternalRuntimeState, type InternalRuntimeStateFields, MaybeRef, MaybeRefOrGetter, type MethodDefinitions, type MiniProgramAdapter, type MiniProgramAppOptions, type MiniProgramBehaviorIdentifier, type MiniProgramComponentBehaviorOptions, type MiniProgramComponentOptions, type MiniProgramComponentRawOptions, type MiniProgramInstance, type MiniProgramPageLifetimes, type ModelBinding, type ModelBindingOptions, type ModelBindingPayload, type MutationKind, type MutationOp, type MutationRecord, MutationType, type ObjectDirective, type PageFeatures, type PrelinkReactiveTreeOptions, type PropConstructor, type PropOptions, type PropType, type PublicProps, Ref, type RuntimeApp, type RuntimeInstance, type SetDataDebugInfo, type SetDataSnapshotOptions, type SetupContext, type SetupFunction, ShallowRef, type ShallowUnwrapRef, StoreManager, SubscriptionCallback, TemplateRef, TemplateRefValue, TemplateRefs, ToRefs, type TriggerEventOptions, type VNode, type VNodeProps, WatchOptions, WatchStopHandle, WevuDefaults, WevuGlobalComponents, WevuGlobalDirectives, type WevuPlugin, WritableComputedOptions, WritableComputedRef, addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createStore, createWevuComponent, createWevuScopedSlotComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, defineStore, effect, effectScope, endBatch, getCurrentInstance, getCurrentScope, getCurrentSetupContext, getDeepWatchStrategy, getReactiveVersion, inject, injectGlobal, isNoSetData, isRaw, isReactive, isRef, isShallowReactive, isShallowRef, markNoSetData, markRaw, mergeModels, mountRuntimeInstance, nextTick, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, prelinkReactiveTree, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, removeMutationRecorder, resetWevuDefaults, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setDeepWatchStrategy, setWevuDefaults, shallowReactive, shallowRef, startBatch, stop, storeToRefs, teardownRuntimeInstance, toRaw, toRef, toRefs, toValue, touchReactive, traverse, triggerRef, unref, useAttrs, useBindModel, useModel, useSlots, useTemplateRef, watch, watchEffect, withDefaults };
|
|
1289
|
+
export { ActionSubscriber, type AllowedComponentProps, type AppConfig, type ComponentCustomProps, ComponentDefinition, type ComponentOptionsMixin, type ComponentPropsOptions, type ComponentPublicInstance, type ComputedDefinitions, ComputedGetter, ComputedRef, ComputedSetter, type CreateAppOptions, type DefineAppOptions, type DefineComponent, type DefineComponentOptions, DefineStoreOptions, EffectScope, EmitsOptions, type ExtractComputed, type ExtractDefaultPropTypes, type ExtractMethods, type ExtractPropTypes, type ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, type InferPropType, type InferProps, type InternalRuntimeState, type InternalRuntimeStateFields, MapSources, MaybeRef, MaybeRefOrGetter, MaybeUndefined, type MethodDefinitions, type MiniProgramAdapter, type MiniProgramAppOptions, type MiniProgramBehaviorIdentifier, type MiniProgramComponentBehaviorOptions, type MiniProgramComponentOptions, type MiniProgramComponentRawOptions, type MiniProgramInstance, type MiniProgramPageLifetimes, type ModelBinding, type ModelBindingOptions, type ModelBindingPayload, MultiWatchSources, type MutationKind, type MutationOp, type MutationRecord, MutationType, type ObjectDirective, OnCleanup, type PageFeatures, type PrelinkReactiveTreeOptions, type PropConstructor, type PropOptions, type PropType, type PublicProps, Ref, type RuntimeApp, type RuntimeInstance, type SetDataDebugInfo, type SetDataSnapshotOptions, type SetupContext, type SetupFunction, ShallowRef, type ShallowUnwrapRef, StoreManager, SubscriptionCallback, TemplateRef, TemplateRefValue, TemplateRefs, ToRefs, type TriggerEventOptions, type VNode, type VNodeProps, WatchCallback, WatchEffect, WatchEffectOptions, WatchMultiSources, WatchOptions, WatchScheduler, WatchSource, WatchSourceValue, WatchSources, WatchStopHandle, WevuDefaults, WevuGlobalComponents, WevuGlobalDirectives, type WevuPlugin, WritableComputedOptions, WritableComputedRef, addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createStore, createWevuComponent, createWevuScopedSlotComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, defineStore, effect, effectScope, endBatch, getCurrentInstance, getCurrentScope, getCurrentSetupContext, getDeepWatchStrategy, getReactiveVersion, inject, injectGlobal, isNoSetData, isRaw, isReactive, isRef, isShallowReactive, isShallowRef, markNoSetData, markRaw, mergeModels, mountRuntimeInstance, nextTick, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, prelinkReactiveTree, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, removeMutationRecorder, resetWevuDefaults, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setDeepWatchStrategy, setWevuDefaults, shallowReactive, shallowRef, startBatch, stop, storeToRefs, teardownRuntimeInstance, toRaw, toRef, toRefs, toValue, touchReactive, traverse, triggerRef, unref, useAttrs, useBindModel, useModel, useSlots, useTemplateRef, watch, watchEffect, withDefaults };
|