wevu 1.1.2 → 1.1.4
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 +52 -26
- package/dist/vue-types.d.mts +1320 -0
- package/package.json +5 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as WeappIntrinsicElements } from "./weappIntrinsicElements-zTAqU5H3.mjs";
|
|
2
|
-
import { Ref as Ref$1, ShallowRef as ShallowRef$1 } from "
|
|
3
|
-
import { AllowedComponentProps, ComponentCustomProps, ComponentOptionsMixin, DefineComponent, ObjectDirective, PublicProps, ShallowUnwrapRef, VNode, VNodeProps } from "vue";
|
|
2
|
+
import { Ref as Ref$1, ShallowRef as ShallowRef$1 } from "./vue-types";
|
|
3
|
+
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, ShallowUnwrapRef as ShallowUnwrapRef$1, SlotsType, VNode as VNode$1, VNodeProps as VNodeProps$1 } from "./vue-types";
|
|
4
4
|
|
|
5
5
|
//#region src/reactivity/ref.d.ts
|
|
6
|
-
type Ref<T$1 = any, S = T$1> = Ref$
|
|
7
|
-
type ShallowRef<T$1 = any> = ShallowRef$
|
|
6
|
+
type Ref<T$1 = any, S = T$1> = Ref$2<T$1, S>;
|
|
7
|
+
type ShallowRef<T$1 = any> = ShallowRef$2<T$1>;
|
|
8
8
|
declare function isRef(value: unknown): value is Ref<any>;
|
|
9
9
|
declare function ref<T$1>(value: T$1): Ref<T$1>;
|
|
10
10
|
declare function unref<T$1>(value: T$1 | Ref<T$1>): T$1;
|
|
@@ -243,27 +243,6 @@ declare function watch<T$1 extends ReadonlyArray<WatchSource<any>>>(source: T$1,
|
|
|
243
243
|
*/
|
|
244
244
|
declare function watchEffect(effectFn: (onCleanup: (cleanupFn: () => void) => void) => void): WatchStopHandle;
|
|
245
245
|
//#endregion
|
|
246
|
-
//#region src/runtime/types/core.d.ts
|
|
247
|
-
type ComputedDefinitions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>;
|
|
248
|
-
type MethodDefinitions = Record<string, (...args: any[]) => any>;
|
|
249
|
-
type ExtractComputed<C extends ComputedDefinitions> = { [K in keyof C]: C[K] extends ComputedGetter<infer R> ? R : C[K] extends WritableComputedOptions<infer R> ? R : never };
|
|
250
|
-
type ExtractMethods<M extends MethodDefinitions> = { [K in keyof M]: M[K] extends ((...args: infer P) => infer R) ? (...args: P) => R : never };
|
|
251
|
-
type ComponentPublicInstance<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions> = D & ExtractComputed<C> & ExtractMethods<M> & {
|
|
252
|
-
$attrs: Record<string, any>;
|
|
253
|
-
};
|
|
254
|
-
interface ModelBindingOptions<T$1 = any, Event extends string = string, ValueProp extends string = string, Formatted = T$1> {
|
|
255
|
-
event?: Event;
|
|
256
|
-
valueProp?: ValueProp;
|
|
257
|
-
parser?: (payload: any) => T$1;
|
|
258
|
-
formatter?: (value: T$1) => Formatted;
|
|
259
|
-
}
|
|
260
|
-
type ModelBindingPayload<T$1 = any, Event extends string = 'input', ValueProp extends string = 'value', Formatted = T$1> = { [K in ValueProp]: Formatted } & { [K in `on${Capitalize<Event>}`]: (event: any) => void };
|
|
261
|
-
interface ModelBinding<T$1 = any> {
|
|
262
|
-
value: T$1;
|
|
263
|
-
update: (value: T$1) => void;
|
|
264
|
-
model: <Event extends string = 'input', ValueProp extends string = 'value', Formatted = T$1>(options?: ModelBindingOptions<T$1, Event, ValueProp, Formatted>) => ModelBindingPayload<T$1, Event, ValueProp, Formatted>;
|
|
265
|
-
}
|
|
266
|
-
//#endregion
|
|
267
246
|
//#region src/runtime/types/miniprogram.d.ts
|
|
268
247
|
interface MiniProgramAdapter {
|
|
269
248
|
setData?: (payload: Record<string, any>) => void | Promise<void>;
|
|
@@ -342,6 +321,30 @@ type MiniProgramComponentRawOptions = Omit<WechatMiniprogram.Component.TrivialOp
|
|
|
342
321
|
behaviors?: MiniProgramBehaviorIdentifier[];
|
|
343
322
|
} & MiniProgramPageLifetimes & Record<string, any>;
|
|
344
323
|
//#endregion
|
|
324
|
+
//#region src/runtime/types/core.d.ts
|
|
325
|
+
type ComputedDefinitions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>;
|
|
326
|
+
type MethodDefinitions = Record<string, (...args: any[]) => any>;
|
|
327
|
+
type ExtractComputed<C extends ComputedDefinitions> = { [K in keyof C]: C[K] extends ComputedGetter<infer R> ? R : C[K] extends WritableComputedOptions<infer R> ? R : never };
|
|
328
|
+
type ExtractMethods<M extends MethodDefinitions> = { [K in keyof M]: M[K] extends ((...args: infer P) => infer R) ? (...args: P) => R : never };
|
|
329
|
+
type ComponentPublicInstance<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions, P$1 = Record<string, any>, S = Record<string, any>> = D & ExtractComputed<C> & ExtractMethods<M> & {
|
|
330
|
+
$attrs: Record<string, any>;
|
|
331
|
+
$props: P$1;
|
|
332
|
+
$slots: S;
|
|
333
|
+
$emit: (event: string, detail?: any, options?: TriggerEventOptions) => void;
|
|
334
|
+
};
|
|
335
|
+
interface ModelBindingOptions<T$1 = any, Event extends string = string, ValueProp extends string = string, Formatted = T$1> {
|
|
336
|
+
event?: Event;
|
|
337
|
+
valueProp?: ValueProp;
|
|
338
|
+
parser?: (payload: any) => T$1;
|
|
339
|
+
formatter?: (value: T$1) => Formatted;
|
|
340
|
+
}
|
|
341
|
+
type ModelBindingPayload<T$1 = any, Event extends string = 'input', ValueProp extends string = 'value', Formatted = T$1> = { [K in ValueProp]: Formatted } & { [K in `on${Capitalize<Event>}`]: (event: any) => void };
|
|
342
|
+
interface ModelBinding<T$1 = any> {
|
|
343
|
+
value: T$1;
|
|
344
|
+
update: (value: T$1) => void;
|
|
345
|
+
model: <Event extends string = 'input', ValueProp extends string = 'value', Formatted = T$1>(options?: ModelBindingOptions<T$1, Event, ValueProp, Formatted>) => ModelBindingPayload<T$1, Event, ValueProp, Formatted>;
|
|
346
|
+
}
|
|
347
|
+
//#endregion
|
|
345
348
|
//#region src/runtime/types/runtime.d.ts
|
|
346
349
|
interface AppConfig {
|
|
347
350
|
globalProperties: Record<string, any>;
|
|
@@ -414,6 +417,7 @@ type RequiredKeys<T$1> = { [K in keyof T$1]: T$1[K] extends {
|
|
|
414
417
|
required: true;
|
|
415
418
|
} ? K : HasDefault<T$1[K]> extends true ? K : IsBooleanProp<T$1[K]> extends true ? K : never }[keyof T$1];
|
|
416
419
|
type OptionalKeys<T$1> = Exclude<keyof T$1, RequiredKeys<T$1>>;
|
|
420
|
+
type DefaultKeys<T$1> = { [K in keyof T$1]: HasDefault<T$1[K]> extends true ? K : IsBooleanProp<T$1[K]> extends true ? K : never }[keyof T$1];
|
|
417
421
|
type InferPropType<O> = O extends null ? any : O extends {
|
|
418
422
|
type?: infer T;
|
|
419
423
|
} ? InferPropConstructor<T> : O extends PropType<infer V> ? V : InferPropConstructor<O>;
|
|
@@ -421,6 +425,7 @@ type InferPropConstructor<T$1> = T$1 extends readonly any[] ? InferPropConstruct
|
|
|
421
425
|
type InferProps<P$1 extends ComponentPropsOptions = ComponentPropsOptions> = { [K in keyof Pick<P$1, RequiredKeys<P$1>>]: HasDefault<P$1[K]> extends true ? Exclude<InferPropType<P$1[K]>, undefined> : InferPropType<P$1[K]> } & { [K in keyof Pick<P$1, OptionalKeys<P$1>>]?: InferPropType<P$1[K]> };
|
|
422
426
|
type ExtractPropTypes<P$1 extends ComponentPropsOptions = ComponentPropsOptions> = InferProps<P$1>;
|
|
423
427
|
type ExtractPublicPropTypes<P$1 extends ComponentPropsOptions = ComponentPropsOptions> = InferProps<P$1>;
|
|
428
|
+
type ExtractDefaultPropTypes<P$1 extends ComponentPropsOptions = ComponentPropsOptions> = { [K in keyof Pick<P$1, DefaultKeys<P$1>>]: InferPropType<P$1[K]> };
|
|
424
429
|
type SetupFunction<P$1 extends ComponentPropsOptions, D extends object, C extends ComputedDefinitions, M extends MethodDefinitions, R$1 extends Record<string, any> | void = Record<string, any> | void> = (props: InferProps<P$1>, ctx: SetupContext<D, C, M, P$1>) => R$1;
|
|
425
430
|
interface SetupContext<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions, P$1 extends ComponentPropsOptions = ComponentPropsOptions> {
|
|
426
431
|
/**
|
|
@@ -472,6 +477,19 @@ interface SetupContext<D extends object, C extends ComputedDefinitions, M extend
|
|
|
472
477
|
slots: Record<string, any>;
|
|
473
478
|
}
|
|
474
479
|
//#endregion
|
|
480
|
+
//#region src/vue-types.d.ts
|
|
481
|
+
type Ref$2<T$1 = any, S = T$1> = Ref$1<T$1, S>;
|
|
482
|
+
type ShallowRef$2<T$1 = any, S = T$1> = ShallowRef$1<T$1, S>;
|
|
483
|
+
type AllowedComponentProps = AllowedComponentProps$1;
|
|
484
|
+
type ComponentCustomProps = ComponentCustomProps$1;
|
|
485
|
+
type ComponentOptionsMixin = ComponentOptionsMixin$1;
|
|
486
|
+
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>;
|
|
487
|
+
type ObjectDirective<HostElement = any, Value = any, Modifiers extends string = string, Arg = any> = ObjectDirective$1<HostElement, Value, Modifiers, Arg>;
|
|
488
|
+
type PublicProps = PublicProps$1;
|
|
489
|
+
type ShallowUnwrapRef<T$1> = ShallowUnwrapRef$1<T$1>;
|
|
490
|
+
type VNode<HostNode = any, HostElement = any, ExtraProps = Record<string, any>> = VNode$1<HostNode, HostElement, ExtraProps>;
|
|
491
|
+
type VNodeProps = VNodeProps$1;
|
|
492
|
+
//#endregion
|
|
475
493
|
//#region src/runtime/types/setData.d.ts
|
|
476
494
|
interface SetDataSnapshotOptions {
|
|
477
495
|
/**
|
|
@@ -765,6 +783,9 @@ type SetupBindings<S> = Exclude<S, void> extends never ? Record<string, never> :
|
|
|
765
783
|
* })
|
|
766
784
|
* ```
|
|
767
785
|
*/
|
|
786
|
+
declare function defineComponent<TypeProps, P$1 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: {
|
|
787
|
+
__typeProps: TypeProps;
|
|
788
|
+
} & DefineComponentOptions<P$1, D, C, M, S>): DefineComponent<TypeProps, SetupBindings<S>, D, C, M> & ComponentDefinition<D, C, M>;
|
|
768
789
|
declare function defineComponent<P$1 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$1, D, C, M, S>): DefineComponent<P$1, SetupBindings<S>, D, C, M> & ComponentDefinition<D, C, M>;
|
|
769
790
|
/**
|
|
770
791
|
* 从 Vue SFC 选项创建 wevu 组件,供 weapp-vite 编译产物直接调用的兼容入口。
|
|
@@ -1221,4 +1242,9 @@ declare function createStore(): StoreManager;
|
|
|
1221
1242
|
type StoreToRefsResult<T$1 extends Record<string, any>> = { [K in keyof T$1]: T$1[K] extends ((...args: any[]) => any) ? T$1[K] : T$1[K] extends Ref<infer V> ? Ref<V> : Ref<T$1[K]> };
|
|
1222
1243
|
declare function storeToRefs<T$1 extends Record<string, any>>(store: T$1): StoreToRefsResult<T$1>;
|
|
1223
1244
|
//#endregion
|
|
1224
|
-
|
|
1245
|
+
//#region src/index.d.ts
|
|
1246
|
+
declare module './vue-types' {
|
|
1247
|
+
export * from 'wevu';
|
|
1248
|
+
}
|
|
1249
|
+
//#endregion
|
|
1250
|
+
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, 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, 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, touchReactive, traverse, triggerRef, unref, useAttrs, useBindModel, useModel, useSlots, useTemplateRef, watch, watchEffect, withDefaults };
|