import { Component, AsyncComponent, ComponentOptions, FunctionalComponentOptions, WatchOptionsWithHandler, WatchHandler, DirectiveOptions, DirectiveFunction, RecordPropsDefinition, ThisTypedComponentOptionsWithArrayProps, ThisTypedComponentOptionsWithRecordProps, WatchOptions } from './options' import { VNode, VNodeData, VNodeChildren, NormalizedScopedSlot } from './vnode' import { PluginFunction, PluginObject } from './plugin' export interface CreateElement { ( tag?: | string | Component | AsyncComponent | (() => Component), children?: VNodeChildren ): VNode ( tag?: | string | Component | AsyncComponent | (() => Component), data?: VNodeData, children?: VNodeChildren ): VNode } export interface Vue { readonly $el: Element readonly $options: ComponentOptions readonly $parent: Vue readonly $root: Vue readonly $children: Vue[] readonly $refs: { [key: string]: Vue | Element | (Vue | Element)[] | undefined } readonly $slots: { [key: string]: VNode[] | undefined } readonly $scopedSlots: { [key: string]: NormalizedScopedSlot | undefined } 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 | 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 extends Vue, Data, Methods, Computed, Props, SetupBindings > = Data & Methods & Computed & Props & Instance & (SetupBindings extends void ? {} : SetupBindings) export type ExtendedVue< Instance extends Vue, Data, Methods, Computed, Props, SetupBindings > = VueConstructor< CombinedVueInstance & Vue > export interface VueConfiguration { 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 | RegExp)[] keyCodes: { [key: string]: number | number[] } async: boolean } export interface VueConstructor { /** * new with array props */ new < Data = object, Methods = object, Computed = object, PropNames extends string = never, SetupBindings = {} >( options?: ThisTypedComponentOptionsWithArrayProps< V, Data, Methods, Computed, PropNames, SetupBindings > ): CombinedVueInstance< V, Data, Methods, Computed, Record, SetupBindings > /** * new with object props * ideally, the return type should just contain Props, * not Record. But TS requires to have Base constructors * with the same return type. */ new < Data = object, Methods = object, Computed = object, Props = object, SetupBindings = {} >( options?: ThisTypedComponentOptionsWithRecordProps< V, Data, Methods, Computed, Props, SetupBindings > ): CombinedVueInstance< V, Data, Methods, Computed, Record, SetupBindings > /** * new with no props */ new (options?: ComponentOptions): CombinedVueInstance< V, object, object, object, Record, {} > /** * extend with array props */ extend< Data, Methods, Computed, PropNames extends string = never, SetupBindings = {} >( options?: ThisTypedComponentOptionsWithArrayProps< V, Data, Methods, Computed, PropNames, SetupBindings > ): ExtendedVue< V, Data, Methods, Computed, Record, SetupBindings > /** * extend with object props */ extend( options?: ThisTypedComponentOptionsWithRecordProps< V, Data, Methods, Computed, Props, SetupBindings > ): ExtendedVue /** * extend with functional + array props */ extend( definition: FunctionalComponentOptions, PropNames[]> ): ExtendedVue, {}> /** * extend with functional + object props */ extend( definition: FunctionalComponentOptions> ): ExtendedVue /** * extend with no props */ extend(options?: ComponentOptions): ExtendedVue nextTick(callback: (this: T) => void, context?: T): void nextTick(): Promise set(object: object, key: string | number, value: T): T set(array: T[], key: number, value: T): T delete(object: object, key: string | number): 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< Data, Methods, Computed, PropNames extends string = never, SetupBindings = {} >( id: string, definition?: ThisTypedComponentOptionsWithArrayProps< V, Data, Methods, Computed, PropNames, SetupBindings > ): ExtendedVue< V, Data, Methods, Computed, Record, SetupBindings > component( id: string, definition?: ThisTypedComponentOptionsWithRecordProps< V, Data, Methods, Computed, Props, SetupBindings > ): ExtendedVue component( id: string, definition: FunctionalComponentOptions, PropNames[]> ): ExtendedVue, {}> component( id: string, definition: FunctionalComponentOptions> ): ExtendedVue component( id: string, definition?: ComponentOptions ): ExtendedVue use( plugin: PluginObject | PluginFunction, options?: T ): VueConstructor use( plugin: PluginObject | PluginFunction, ...options: any[] ): VueConstructor mixin(mixin: VueConstructor | ComponentOptions): VueConstructor compile(template: string): { render(createElement: typeof Vue.prototype.$createElement): VNode staticRenderFns: (() => VNode)[] } observable(obj: T): T util: { warn(msg: string, vm?: InstanceType): void } config: VueConfiguration version: string } export const Vue: VueConstructor