import { Component, AsyncComponent, ComponentOptions, FunctionalComponentOptions, WatchOptionsWithHandler, WatchHandler, DirectiveOptions, DirectiveFunction, RecordPropsDefinition, ThisTypedComponentOptionsWithArrayProps, ThisTypedComponentOptionsWithRecordProps, WatchOptions, } from "./options"; import { VNode, VNodeData, VNodeChildren, ScopedSlot } from "./vnode"; import { PluginFunction, PluginObject } from "./plugin"; export interface CreateElement { (tag?: string | Component | AsyncComponent, children?: VNodeChildren): VNode; (tag?: string | Component | AsyncComponent, data?: VNodeData, children?: VNodeChildren): VNode; } export interface Vue { readonly $el: HTMLElement; readonly $options: ComponentOptions; readonly $parent: Vue; readonly $root: Vue; readonly $children: Vue[]; readonly $refs: { [key: string]: Vue | Element | Vue[] | Element[] }; readonly $slots: { [key: string]: VNode[] }; readonly $scopedSlots: { [key: string]: ScopedSlot }; readonly $isServer: boolean; readonly $data: Record; readonly $props: Record; readonly $ssrContext: any; readonly $vnode: VNode; readonly $attrs: Record; readonly $listeners: Record; $mount(elementOrSelector?: Element | String, hydrating?: boolean): this; $forceUpdate(): void; $destroy(): void; $set: typeof Vue.set; $delete: typeof Vue.delete; $watch( expOrFn: string, callback: (this: this, n: any, o: any) => void, options?: WatchOptions ): (() => void); $watch( expOrFn: (this: this) => T, callback: (this: this, n: T, o: T) => void, options?: WatchOptions ): (() => void); $on(event: string | string[], callback: Function): this; $once(event: string, callback: Function): this; $off(event?: string | string[], callback?: Function): this; $emit(event: string, ...args: any[]): this; $nextTick(callback: (this: this) => void): void; $nextTick(): Promise; $createElement: CreateElement; } export type CombinedVueInstance = Instance & Data & Methods & Computed & Props; export type ExtendedVue = VueConstructor & Vue>; export interface VueConstructor { new (options?: ThisTypedComponentOptionsWithArrayProps): CombinedVueInstance>; // ideally, the return type should just contains Props, not Record. But TS requires Base constructors must all have the same return type. new (options?: ThisTypedComponentOptionsWithRecordProps): CombinedVueInstance>; new (options?: ComponentOptions): CombinedVueInstance>; extend(definition: FunctionalComponentOptions, PropNames[]>): ExtendedVue>; extend(definition: FunctionalComponentOptions>): ExtendedVue; extend(options?: ThisTypedComponentOptionsWithArrayProps): ExtendedVue>; extend(options?: ThisTypedComponentOptionsWithRecordProps): ExtendedVue; extend(options?: ComponentOptions): ExtendedVue; nextTick(callback: () => void, context?: any[]): void; nextTick(): Promise set(object: Object, key: string, value: T): T; set(array: T[], key: number, value: T): T; delete(object: Object, key: string): void; delete(array: T[], key: number): void; directive( id: string, definition?: DirectiveOptions | DirectiveFunction ): DirectiveOptions; filter(id: string, definition?: Function): Function; component(id: string): VueConstructor; component(id: string, constructor: VC): VC; component(id: string, definition: AsyncComponent): ExtendedVue; component(id: string, definition: FunctionalComponentOptions, PropNames[]>): ExtendedVue>; component(id: string, definition: FunctionalComponentOptions>): ExtendedVue; component(id: string, definition?: ThisTypedComponentOptionsWithArrayProps): ExtendedVue>; component(id: string, definition?: ThisTypedComponentOptionsWithRecordProps): ExtendedVue; component(id: string, definition?: ComponentOptions): ExtendedVue; use(plugin: PluginObject | PluginFunction, options?: T): void; use(plugin: PluginObject | PluginFunction, ...options: any[]): void; mixin(mixin: VueConstructor | ComponentOptions): void; compile(template: string): { render(createElement: typeof Vue.prototype.$createElement): VNode; staticRenderFns: (() => VNode)[]; }; config: { silent: boolean; optionMergeStrategies: any; devtools: boolean; productionTip: boolean; performance: boolean; errorHandler(err: Error, vm: Vue, info: string): void; warnHandler(msg: string, vm: Vue, trace: string): void; ignoredElements: string[]; keyCodes: { [key: string]: number | number[] }; } } export const Vue: VueConstructor;