1 | import Vue$1, { VNode, VueConstructor, ComponentOptions, AsyncComponent, VNodeDirective, CreateElement } from 'vue';
|
2 | import { Component as Component$1, AsyncComponent as AsyncComponent$1 } from 'vue/types/options';
|
3 | import { VNodeChildren, VNode as VNode$1, VNodeData } from 'vue/types/vnode';
|
4 |
|
5 | declare type Data = {
|
6 | [key: string]: unknown;
|
7 | };
|
8 |
|
9 | declare type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[];
|
10 | declare type ComponentObjectPropsOptions<P = Data> = {
|
11 | [K in keyof P]: Prop<P[K]> | null;
|
12 | };
|
13 | declare type Prop<T, D = T> = PropOptions<T, D> | PropType<T>;
|
14 | declare type DefaultFactory<T> = () => T | null | undefined;
|
15 | interface PropOptions<T = any, D = T> {
|
16 | type?: PropType<T> | true | null;
|
17 | required?: boolean;
|
18 | default?: D | DefaultFactory<D> | null | undefined | object;
|
19 | validator?(value: unknown): boolean;
|
20 | }
|
21 | declare type PropType<T> = PropConstructor<T> | PropConstructor<T>[];
|
22 | declare type PropConstructor<T> = {
|
23 | new (...args: any[]): T & object;
|
24 | } | {
|
25 | (): T;
|
26 | } | {
|
27 | new (...args: string[]): Function;
|
28 | };
|
29 | declare type RequiredKeys<T> = {
|
30 | [K in keyof T]: T[K] extends {
|
31 | required: true;
|
32 | } | {
|
33 | default: any;
|
34 | } | BooleanConstructor | {
|
35 | type: BooleanConstructor;
|
36 | } ? K : never;
|
37 | }[keyof T];
|
38 | declare type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
|
39 | declare type ExtractFunctionPropType<T extends Function, TArgs extends Array<any> = any[], TResult = any> = T extends (...args: TArgs) => TResult ? T : never;
|
40 | declare type ExtractCorrectPropType<T> = T extends Function ? ExtractFunctionPropType<T> : Exclude<T, Function>;
|
41 | declare type InferPropType<T> = T extends null ? any : T extends {
|
42 | type: null | true;
|
43 | } ? any : T extends ObjectConstructor | {
|
44 | type: ObjectConstructor;
|
45 | } ? Record<string, any> : T extends BooleanConstructor | {
|
46 | type: BooleanConstructor;
|
47 | } ? boolean : T extends DateConstructor | {
|
48 | type: DateConstructor;
|
49 | } ? Date : T extends FunctionConstructor | {
|
50 | type: FunctionConstructor;
|
51 | } ? Function : T extends Prop<infer V, infer D> ? unknown extends V ? D extends null | undefined ? V : D : ExtractCorrectPropType<V> : T;
|
52 | declare type ExtractPropTypes<O> = {
|
53 | [K in keyof Pick<O, RequiredKeys<O>>]: InferPropType<O[K]>;
|
54 | } & {
|
55 | [K in keyof Pick<O, OptionalKeys<O>>]?: InferPropType<O[K]>;
|
56 | };
|
57 | declare type DefaultKeys<T> = {
|
58 | [K in keyof T]: T[K] extends {
|
59 | default: any;
|
60 | } | BooleanConstructor | {
|
61 | type: BooleanConstructor;
|
62 | } ? T[K] extends {
|
63 | type: BooleanConstructor;
|
64 | required: true;
|
65 | } ? never : K : never;
|
66 | }[keyof T];
|
67 | declare type ExtractDefaultPropTypes<O> = O extends object ? {
|
68 | [K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]>;
|
69 | } : {};
|
70 |
|
71 | declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
72 |
|
73 | declare type Slot = (...args: any[]) => VNode[];
|
74 | declare type InternalSlots = {
|
75 | [name: string]: Slot | undefined;
|
76 | };
|
77 | declare type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>;
|
78 | declare type EmitsOptions = ObjectEmitsOptions | string[];
|
79 | declare type EmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = keyof Options, ReturnType extends void | Vue$1 = void> = Options extends Array<infer V> ? (event: V, ...args: any[]) => ReturnType : {} extends Options ? (event: string, ...args: any[]) => ReturnType : UnionToIntersection<{
|
80 | [key in Event]: Options[key] extends (...args: infer Args) => any ? (event: key, ...args: Args) => ReturnType : (event: key, ...args: any[]) => ReturnType;
|
81 | }[Event]>;
|
82 | declare type ComponentRenderEmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = keyof Options, T extends Vue$1 | void = void> = EmitFn<Options, Event, T>;
|
83 | declare type Slots = Readonly<InternalSlots>;
|
84 | interface SetupContext<E extends EmitsOptions = {}> {
|
85 | attrs: Data;
|
86 | slots: Slots;
|
87 | emit: EmitFn<E>;
|
88 | |
89 |
|
90 |
|
91 | expose: (exposed?: Record<string, any>) => void;
|
92 | |
93 |
|
94 |
|
95 | readonly parent: ComponentInstance | null;
|
96 | |
97 |
|
98 |
|
99 | readonly root: ComponentInstance;
|
100 | |
101 |
|
102 |
|
103 | readonly listeners: {
|
104 | [key in string]?: Function;
|
105 | };
|
106 | |
107 |
|
108 |
|
109 | readonly refs: {
|
110 | [key: string]: Vue | Element | Vue[] | Element[];
|
111 | };
|
112 | }
|
113 |
|
114 |
|
115 |
|
116 |
|
117 | declare interface ComponentInternalInstance {
|
118 | uid: number;
|
119 | type: Record<string, unknown>;
|
120 | parent: ComponentInternalInstance | null;
|
121 | root: ComponentInternalInstance;
|
122 | |
123 |
|
124 |
|
125 | vnode: VNode;
|
126 | |
127 |
|
128 |
|
129 | |
130 |
|
131 |
|
132 | update: Function;
|
133 | data: Data;
|
134 | props: Data;
|
135 | attrs: Data;
|
136 | refs: Data;
|
137 | emit: EmitFn;
|
138 | slots: InternalSlots;
|
139 | emitted: Record<string, boolean> | null;
|
140 | proxy: ComponentInstance;
|
141 | isMounted: boolean;
|
142 | isUnmounted: boolean;
|
143 | isDeactivated: boolean;
|
144 | }
|
145 | declare function getCurrentInstance(): ComponentInternalInstance | null;
|
146 |
|
147 | declare type EmitsToProps<T extends EmitsOptions> = T extends string[] ? {
|
148 | [K in string & `on${Capitalize<T[number]>}`]?: (...args: any[]) => any;
|
149 | } : T extends ObjectEmitsOptions ? {
|
150 | [K in string & `on${Capitalize<string & keyof T>}`]?: K extends `on${infer C}` ? T[Uncapitalize<C>] extends null ? (...args: any[]) => any : (...args: T[Uncapitalize<C>] extends (...args: infer P) => any ? P : never) => any : never;
|
151 | } : {};
|
152 | declare type ComponentInstance = InstanceType<VueConstructor>;
|
153 | declare type ComponentRenderProxy<P = {},
|
154 | B = {},
|
155 | D = {},
|
156 | C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false> = {
|
157 | $data: D;
|
158 | $props: Readonly<MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<P & PublicProps, keyof Defaults> : P & PublicProps>;
|
159 | $attrs: Record<string, string>;
|
160 | $emit: ComponentRenderEmitFn<Emits, keyof Emits, ComponentRenderProxy<P, B, D, C, M, Mixin, Extends, Emits, PublicProps, Defaults, MakeDefaultsOptional>>;
|
161 | } & Readonly<P> & ShallowUnwrapRef<B> & D & M & ExtractComputedReturns<C> & Omit<Vue$1, '$data' | '$props' | '$attrs' | '$emit'>;
|
162 | declare type VueConstructorProxy<PropsOptions, RawBindings, Data, Computed extends ComputedOptions, Methods extends MethodOptions, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}, Props = ExtractPropTypes<PropsOptions> & ({} extends Emits ? {} : EmitsToProps<Emits>)> = Omit<VueConstructor, never> & {
|
163 | new (...args: any[]): ComponentRenderProxy<Props, ShallowUnwrapRef<RawBindings>, Data, Computed, Methods, Mixin, Extends, Emits, Props, ExtractDefaultPropTypes<PropsOptions>, true>;
|
164 | };
|
165 | declare type DefaultData<V> = object | ((this: V) => object);
|
166 | declare type DefaultMethods<V> = {
|
167 | [key: string]: (this: V, ...args: any[]) => any;
|
168 | };
|
169 | declare type DefaultComputed = {
|
170 | [key: string]: any;
|
171 | };
|
172 | declare type VueProxy<PropsOptions, RawBindings, Data = DefaultData<Vue$1>, Computed extends ComputedOptions = DefaultComputed, Methods extends MethodOptions = DefaultMethods<Vue$1>, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}> = ComponentOptions<Vue$1, ShallowUnwrapRef<RawBindings> & Data, Methods, Computed, PropsOptions, ExtractPropTypes<PropsOptions>> & VueConstructorProxy<PropsOptions, RawBindings, Data, Computed, Methods, Mixin, Extends, Emits>;
|
173 | declare type ComponentPublicInstance<P = {},
|
174 | B = {},
|
175 | D = {},
|
176 | C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false> = {
|
177 | $: ComponentInternalInstance;
|
178 | $data: D;
|
179 | $props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<P & PublicProps, keyof Defaults> : P & PublicProps;
|
180 | $attrs: Data;
|
181 | $refs: Data;
|
182 | $slots: Slots;
|
183 | $root: ComponentPublicInstance | null;
|
184 | $parent: ComponentPublicInstance | null;
|
185 | $emit: EmitFn<E>;
|
186 | $el: any;
|
187 | $forceUpdate: () => void;
|
188 | $nextTick: typeof nextTick;
|
189 | $watch(source: string | Function, cb: Function, options?: WatchOptions): WatchStopHandle;
|
190 | } & P & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M;
|
191 |
|
192 | declare type ComputedGetter$1<T> = (ctx?: any) => T;
|
193 | declare type ComputedSetter$1<T> = (v: T) => void;
|
194 | interface WritableComputedOptions$1<T> {
|
195 | get: ComputedGetter$1<T>;
|
196 | set: ComputedSetter$1<T>;
|
197 | }
|
198 | declare type ComputedOptions = Record<string, ComputedGetter$1<any> | WritableComputedOptions$1<any>>;
|
199 | interface MethodOptions {
|
200 | [key: string]: Function;
|
201 | }
|
202 | declare type SetupFunction<Props, RawBindings = {}, Emits extends EmitsOptions = {}> = (this: void, props: Readonly<Props>, ctx: SetupContext<Emits>) => RawBindings | (() => VNode | null) | void;
|
203 | interface ComponentOptionsBase<Props, D = Data, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}> extends Omit<ComponentOptions<Vue$1, D, M, C, Props>, 'data' | 'computed' | 'method' | 'setup' | 'props'> {
|
204 | [key: string]: any;
|
205 | data?: (this: Props & Vue$1, vm: Props) => D;
|
206 | computed?: C;
|
207 | methods?: M;
|
208 | }
|
209 | declare type ExtractComputedReturns<T extends any> = {
|
210 | [key in keyof T]: T[key] extends {
|
211 | get: (...args: any[]) => infer TReturn;
|
212 | } ? TReturn : T[key] extends (...args: any[]) => infer TReturn ? TReturn : never;
|
213 | };
|
214 | declare type ComponentOptionsWithProps<PropsOptions = ComponentPropsOptions, RawBindings = Data, D = Data, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}, Props = ExtractPropTypes<PropsOptions>> = ComponentOptionsBase<Props, D, C, M> & {
|
215 | props?: PropsOptions;
|
216 | emits?: Emits & ThisType<void>;
|
217 | setup?: SetupFunction<Props, RawBindings, Emits>;
|
218 | } & ThisType<ComponentRenderProxy<Props, RawBindings, D, C, M, Mixin, Extends, Emits>>;
|
219 | declare type ComponentOptionsWithArrayProps<PropNames extends string = string, RawBindings = Data, D = Data, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}, Props = Readonly<{
|
220 | [key in PropNames]?: any;
|
221 | }>> = ComponentOptionsBase<Props, D, C, M> & {
|
222 | props?: PropNames[];
|
223 | emits?: Emits & ThisType<void>;
|
224 | setup?: SetupFunction<Props, RawBindings, Emits>;
|
225 | } & ThisType<ComponentRenderProxy<Props, RawBindings, D, C, M, Mixin, Extends, Emits>>;
|
226 | declare type ComponentOptionsWithoutProps<Props = {}, RawBindings = Data, D = Data, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}> = ComponentOptionsBase<Props, D, C, M> & {
|
227 | props?: undefined;
|
228 | emits?: Emits & ThisType<void>;
|
229 | setup?: SetupFunction<Props, RawBindings, Emits>;
|
230 | } & ThisType<ComponentRenderProxy<Props, RawBindings, D, C, M, Mixin, Extends, Emits>>;
|
231 |
|
232 | declare type AnyObject = Record<string | number | symbol, any>;
|
233 | declare type Equal<Left, Right> = (<U>() => U extends Left ? 1 : 0) extends (<U>() => U extends Right ? 1 : 0) ? true : false;
|
234 | declare type HasDefined<T> = Equal<T, unknown> extends true ? false : true;
|
235 |
|
236 | /**
|
237 | * overload 1: object format with no props
|
238 | */
|
239 | declare function defineComponent<RawBindings, D = Data, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}>(options: ComponentOptionsWithoutProps<{}, RawBindings, D, C, M, Mixin, Extends, Emits>): VueProxy<{}, RawBindings, D, C, M, Mixin, Extends, Emits>;
|
240 | /**
|
241 | * overload 2: object format with array props declaration
|
242 | * props inferred as `{ [key in PropNames]?: any }`
|
243 | *
|
244 | * return type is for Vetur and TSX support
|
245 | */
|
246 | declare function defineComponent<PropNames extends string, RawBindings = Data, D = Data, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}, PropsOptions extends ComponentPropsOptions = ComponentPropsOptions>(options: ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, Emits>): VueProxy<Readonly<{
|
247 | [key in PropNames]?: any;
|
248 | }>, RawBindings, D, C, M, Mixin, Extends, Emits>;
|
249 | /**
|
250 | * overload 3: object format with object props declaration
|
251 | *
|
252 | * see `ExtractPropTypes` in './componentProps.ts'
|
253 | */
|
254 | declare function defineComponent<Props, RawBindings = Data, D = Data, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}, PropsOptions extends ComponentPropsOptions = ComponentPropsOptions>(options: HasDefined<Props> extends true ? ComponentOptionsWithProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, Emits, Props> : ComponentOptionsWithProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, Emits>): VueProxy<PropsOptions, RawBindings, D, C, M, Mixin, Extends, Emits>;
|
255 |
|
256 | declare type Component = VueProxy<any, any, any, any, any>;
|
257 | declare type ComponentOrComponentOptions = Component | ComponentOptionsWithoutProps | ComponentOptionsWithArrayProps | ComponentOptionsWithProps;
|
258 | declare type AsyncComponentResolveResult<T = ComponentOrComponentOptions> = T | {
|
259 | default: T;
|
260 | };
|
261 | declare type AsyncComponentLoader = () => Promise<AsyncComponentResolveResult>;
|
262 | interface AsyncComponentOptions {
|
263 | loader: AsyncComponentLoader;
|
264 | loadingComponent?: ComponentOrComponentOptions;
|
265 | errorComponent?: ComponentOrComponentOptions;
|
266 | delay?: number;
|
267 | timeout?: number;
|
268 | suspensible?: boolean;
|
269 | onError?: (error: Error, retry: () => void, fail: () => void, attempts: number) => any;
|
270 | }
|
271 | declare function defineAsyncComponent(source: AsyncComponentLoader | AsyncComponentOptions): AsyncComponent;
|
272 |
|
273 | declare type DirectiveModifiers = Record<string, boolean>;
|
274 | interface DirectiveBinding<V> extends Readonly<VNodeDirective> {
|
275 | readonly modifiers: DirectiveModifiers;
|
276 | readonly value: V;
|
277 | readonly oldValue: V | null;
|
278 | }
|
279 | declare type DirectiveHook<T = any, Prev = VNode | null, V = any> = (el: T, binding: DirectiveBinding<V>, vnode: VNode, prevVNode: Prev) => void;
|
280 | interface ObjectDirective<T = any, V = any> {
|
281 | bind?: DirectiveHook<T, any, V>;
|
282 | inserted?: DirectiveHook<T, any, V>;
|
283 | update?: DirectiveHook<T, any, V>;
|
284 | componentUpdated?: DirectiveHook<T, any, V>;
|
285 | unbind?: DirectiveHook<T, any, V>;
|
286 | }
|
287 | declare type FunctionDirective<T = any, V = any> = DirectiveHook<T, any, V>;
|
288 | declare type Directive<T = any, V = any> = ObjectDirective<T, V> | FunctionDirective<T, V>;
|
289 |
|
290 | declare const Plugin: {
|
291 | install: (Vue: VueConstructor) => void;
|
292 | };
|
293 |
|
294 | declare const _refBrand: unique symbol;
|
295 | interface Ref<T = any> {
|
296 | readonly [_refBrand]: true;
|
297 | value: T;
|
298 | }
|
299 | interface WritableComputedRef<T> extends Ref<T> {
|
300 | |
301 |
|
302 |
|
303 |
|
304 |
|
305 | effect: true;
|
306 | }
|
307 | interface ComputedRef<T = any> extends WritableComputedRef<T> {
|
308 | readonly value: T;
|
309 | }
|
310 | declare type ToRefs<T = any> = {
|
311 | [K in keyof T]: Ref<T[K]>;
|
312 | };
|
313 | declare type CollectionTypes = IterableCollections | WeakCollections;
|
314 | declare type IterableCollections = Map<any, any> | Set<any>;
|
315 | declare type WeakCollections = WeakMap<any, any> | WeakSet<any>;
|
316 | declare type BaseTypes = string | number | boolean | Node | Window | Date;
|
317 | declare type ShallowUnwrapRef<T> = {
|
318 | [K in keyof T]: T[K] extends Ref<infer V> ? V : T[K];
|
319 | };
|
320 | declare type UnwrapRef<T> = T extends Ref<infer V> ? UnwrapRefSimple<V> : UnwrapRefSimple<T>;
|
321 | declare type UnwrapRefSimple<T> = T extends Function | CollectionTypes | BaseTypes | Ref ? T : T extends Array<any> ? {
|
322 | [K in keyof T]: UnwrapRefSimple<T[K]>;
|
323 | } : T extends object ? {
|
324 | [P in keyof T]: P extends symbol ? T[P] : UnwrapRef<T[P]>;
|
325 | } : T;
|
326 | interface RefOption<T> {
|
327 | get(): T;
|
328 | set?(x: T): void;
|
329 | }
|
330 | declare class RefImpl<T> implements Ref<T> {
|
331 | readonly [_refBrand]: true;
|
332 | value: T;
|
333 | constructor({ get, set }: RefOption<T>);
|
334 | }
|
335 | declare function createRef<T>(options: RefOption<T>, isReadonly?: boolean, isComputed?: boolean): RefImpl<T>;
|
336 | declare function ref<T extends object>(raw: T): T extends Ref ? T : Ref<UnwrapRef<T>>;
|
337 | declare function ref<T>(raw: T): Ref<UnwrapRef<T>>;
|
338 | declare function ref<T = any>(): Ref<T | undefined>;
|
339 | declare function isRef<T>(value: any): value is Ref<T>;
|
340 | declare function unref<T>(ref: T | Ref<T>): T;
|
341 | declare function toRefs<T extends object>(obj: T): ToRefs<T>;
|
342 | declare type CustomRefFactory<T> = (track: () => void, trigger: () => void) => {
|
343 | get: () => T;
|
344 | set: (value: T) => void;
|
345 | };
|
346 | declare function customRef<T>(factory: CustomRefFactory<T>): Ref<T>;
|
347 | declare function toRef<T extends object, K extends keyof T>(object: T, key: K): Ref<T[K]>;
|
348 | declare function shallowRef<T extends object>(value: T): T extends Ref ? T : Ref<T>;
|
349 | declare function shallowRef<T>(value: T): Ref<T>;
|
350 | declare function shallowRef<T = any>(): Ref<T | undefined>;
|
351 | declare function triggerRef(value: any): void;
|
352 | declare function proxyRefs<T extends object>(objectWithRefs: T): ShallowUnwrapRef<T>;
|
353 |
|
354 | declare function isRaw(obj: any): boolean;
|
355 | declare function isReactive(obj: any): boolean;
|
356 | declare function shallowReactive<T extends object = any>(obj: T): T;
|
357 |
|
358 |
|
359 |
|
360 | declare function reactive<T extends object>(obj: T): UnwrapRef<T>;
|
361 |
|
362 |
|
363 |
|
364 | declare function markRaw<T extends object>(obj: T): T;
|
365 | declare function toRaw<T>(observed: T): T;
|
366 |
|
367 | declare function isReadonly(obj: any): boolean;
|
368 | declare type Primitive = string | number | boolean | bigint | symbol | undefined | null;
|
369 | declare type Builtin = Primitive | Function | Date | Error | RegExp;
|
370 | declare type DeepReadonly<T> = T extends Builtin ? T : T extends Map<infer K, infer V> ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>> : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>> : T extends WeakMap<infer K, infer V> ? WeakMap<DeepReadonly<K>, DeepReadonly<V>> : T extends Set<infer U> ? ReadonlySet<DeepReadonly<U>> : T extends ReadonlySet<infer U> ? ReadonlySet<DeepReadonly<U>> : T extends WeakSet<infer U> ? WeakSet<DeepReadonly<U>> : T extends Promise<infer U> ? Promise<DeepReadonly<U>> : T extends {} ? {
|
371 | readonly [K in keyof T]: DeepReadonly<T[K]>;
|
372 | } : Readonly<T>;
|
373 | declare type UnwrapNestedRefs<T> = T extends Ref ? T : UnwrapRefSimple<T>;
|
374 |
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 | declare function readonly<T extends object>(target: T): DeepReadonly<UnwrapNestedRefs<T>>;
|
381 | declare function shallowReadonly<T extends object>(obj: T): Readonly<T>;
|
382 |
|
383 |
|
384 |
|
385 |
|
386 |
|
387 |
|
388 | declare function set<T>(target: AnyObject, key: any, val: T): T;
|
389 |
|
390 |
|
391 |
|
392 |
|
393 | declare function del(target: AnyObject, key: any): void;
|
394 |
|
395 | declare const onBeforeMount: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
396 | declare const onMounted: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
397 | declare const onBeforeUpdate: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
398 | declare const onUpdated: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
399 | declare const onBeforeUnmount: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
400 | declare const onUnmounted: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
401 | declare const onErrorCaptured: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
402 | declare const onActivated: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
403 | declare const onDeactivated: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
404 | declare const onServerPrefetch: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
405 |
|
406 | declare type WatchEffect = (onInvalidate: InvalidateCbRegistrator) => void;
|
407 | declare type WatchSource<T = any> = Ref<T> | ComputedRef<T> | (() => T);
|
408 | declare type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onInvalidate: InvalidateCbRegistrator) => any;
|
409 | declare type MapSources<T, Immediate> = {
|
410 | [K in keyof T]: T[K] extends WatchSource<infer V> ? Immediate extends true ? V | undefined : V : never;
|
411 | };
|
412 | declare type MultiWatchSources = (WatchSource<unknown> | object)[];
|
413 | interface WatchOptionsBase {
|
414 | flush?: FlushMode;
|
415 | }
|
416 | declare type InvalidateCbRegistrator = (cb: () => void) => void;
|
417 | declare type FlushMode = 'pre' | 'post' | 'sync';
|
418 | interface WatchOptions<Immediate = boolean> extends WatchOptionsBase {
|
419 | immediate?: Immediate;
|
420 | deep?: boolean;
|
421 | }
|
422 | interface VueWatcher {
|
423 | lazy: boolean;
|
424 | get(): any;
|
425 | teardown(): void;
|
426 | run(): void;
|
427 | value: any;
|
428 | }
|
429 | declare type WatchStopHandle = () => void;
|
430 | declare function watchEffect(effect: WatchEffect, options?: WatchOptionsBase): WatchStopHandle;
|
431 | declare function watchPostEffect(effect: WatchEffect): WatchStopHandle;
|
432 | declare function watchSyncEffect(effect: WatchEffect): WatchStopHandle;
|
433 | declare function watch<T extends Readonly<MultiWatchSources>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
434 | declare function watch<T extends Readonly<MultiWatchSources>, Immediate extends Readonly<boolean> = false>(sources: T, cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
435 | declare function watch<T extends MultiWatchSources, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
436 | declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
437 | declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
438 |
|
439 | declare type ComputedGetter<T> = (ctx?: any) => T;
|
440 | declare type ComputedSetter<T> = (v: T) => void;
|
441 | interface WritableComputedOptions<T> {
|
442 | get: ComputedGetter<T>;
|
443 | set: ComputedSetter<T>;
|
444 | }
|
445 | declare function computed<T>(getter: ComputedGetter<T>): ComputedRef<T>;
|
446 | declare function computed<T>(options: WritableComputedOptions<T>): WritableComputedRef<T>;
|
447 |
|
448 | interface InjectionKey<T> extends Symbol {
|
449 | }
|
450 | declare function provide<T>(key: InjectionKey<T> | string, value: T): void;
|
451 | declare function inject<T>(key: InjectionKey<T> | string): T | undefined;
|
452 | declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T, treatDefaultAsFactory?: false): T;
|
453 | declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T | (() => T), treatDefaultAsFactory?: true): T;
|
454 |
|
455 | declare const useCssModule: (name?: string) => Record<string, string>;
|
456 |
|
457 |
|
458 |
|
459 | declare const useCSSModule: (name?: string) => Record<string, string>;
|
460 |
|
461 | interface App<T = any> {
|
462 | config: VueConstructor['config'];
|
463 | use: VueConstructor['use'];
|
464 | mixin: VueConstructor['mixin'];
|
465 | component: VueConstructor['component'];
|
466 | directive(name: string): Directive | undefined;
|
467 | directive(name: string, directive: Directive): this;
|
468 | provide<T>(key: InjectionKey<T> | symbol | string, value: T): this;
|
469 | mount: Vue$1['$mount'];
|
470 | unmount: Vue$1['$destroy'];
|
471 | }
|
472 | declare function createApp(rootComponent: any, rootProps?: any): App;
|
473 |
|
474 | declare type NextTick = Vue$1['$nextTick'];
|
475 | declare const nextTick: NextTick;
|
476 |
|
477 | interface H extends CreateElement {
|
478 | (this: ComponentInternalInstance | null | undefined, tag?: string | Component$1<any, any, any, any> | AsyncComponent$1<any, any, any, any> | (() => Component$1), children?: VNodeChildren): VNode$1;
|
479 | (this: ComponentInternalInstance | null | undefined, tag?: string | Component$1<any, any, any, any> | AsyncComponent$1<any, any, any, any> | (() => Component$1), data?: VNodeData, children?: VNodeChildren): VNode$1;
|
480 | }
|
481 | declare const createElement: H;
|
482 |
|
483 | /**
|
484 | * Displays a warning message (using console.error) with a stack trace if the
|
485 | * function is called inside of active component.
|
486 | *
|
487 | * @param message warning message to be displayed
|
488 | */
|
489 | declare function warn(message: string): void;
|
490 |
|
491 | declare class EffectScopeImpl {
|
492 | active: boolean;
|
493 | effects: EffectScope[];
|
494 | cleanups: (() => void)[];
|
495 | constructor(vm: Vue);
|
496 | run<T>(fn: () => T): T | undefined;
|
497 | on(): void;
|
498 | off(): void;
|
499 | stop(): void;
|
500 | }
|
501 | declare class EffectScope extends EffectScopeImpl {
|
502 | constructor(detached?: boolean);
|
503 | }
|
504 | declare function effectScope(detached?: boolean): EffectScope;
|
505 | declare function getCurrentScope(): EffectScope | undefined;
|
506 | declare function onScopeDispose(fn: () => void): void;
|
507 |
|
508 | declare function useSlots(): SetupContext['slots'];
|
509 | declare function useAttrs(): SetupContext['attrs'];
|
510 |
|
511 | declare const version: string;
|
512 |
|
513 | declare module 'vue/types/options' {
|
514 | interface ComponentOptions<V extends Vue$1> {
|
515 | setup?: SetupFunction<Data, Data>;
|
516 | }
|
517 | }
|
518 |
|
519 | export { App, ComponentInstance, ComponentInternalInstance, ComponentPropsOptions, ComponentPublicInstance, ComponentRenderProxy, ComputedGetter, ComputedOptions, ComputedRef, ComputedSetter, Data, DeepReadonly, Directive, DirectiveBinding, DirectiveHook, DirectiveModifiers, EffectScope, ExtractDefaultPropTypes, ExtractPropTypes, FlushMode, FunctionDirective, InjectionKey, MethodOptions, ObjectDirective, PropOptions, PropType, Ref, SetupContext, SetupFunction, ShallowUnwrapRef, ToRefs, UnwrapNestedRefs, UnwrapRef, UnwrapRefSimple, VueWatcher, WatchCallback, WatchEffect, WatchOptions, WatchOptionsBase, WatchSource, WatchStopHandle, WritableComputedOptions, WritableComputedRef, computed, createApp, createRef, customRef, Plugin as default, defineAsyncComponent, defineComponent, del, effectScope, getCurrentInstance, getCurrentScope, createElement as h, inject, isRaw, isReactive, isReadonly, isRef, markRaw, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, provide, proxyRefs, reactive, readonly, ref, set, shallowReactive, shallowReadonly, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, useAttrs, useCSSModule, useCssModule, useSlots, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect };
|
520 |
|
\ | No newline at end of file |