You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.4 KiB

1 month ago
  1. import Vue from 'vue'
  2. import type { PluginFunction, PluginObject, VueConstructor, Directive, InjectionKey, Component } from 'vue'
  3. declare const isVue2: boolean
  4. declare const isVue3: boolean
  5. declare const Vue2: typeof Vue | undefined
  6. declare const version: string
  7. declare const install: (vue?: typeof Vue) => void
  8. export declare function warn(msg: string, vm?: Component | null): void
  9. /**
  10. * @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead.
  11. * Refer to https://github.com/vueuse/vue-demi/issues/41
  12. */
  13. declare const V: typeof Vue
  14. // accept no generic because Vue 3 doesn't accept any
  15. // https://github.com/vuejs/vue-next/pull/2758/
  16. export declare type Plugin = PluginObject<any> | PluginFunction<any>
  17. export type { VNode } from 'vue'
  18. export * from 'vue'
  19. export { V as Vue, Vue2, isVue2, isVue3, version, install }
  20. // #region createApp polyfill
  21. export interface App<T = any> {
  22. config: VueConstructor['config']
  23. use: VueConstructor['use']
  24. mixin: VueConstructor['mixin']
  25. component: VueConstructor['component']
  26. directive(name: string): Directive | undefined
  27. directive(name: string, directive: Directive): this
  28. provide<T>(key: InjectionKey<T> | string, value: T): this
  29. mount: Vue['$mount']
  30. unmount: Vue['$destroy']
  31. }
  32. export declare function createApp(rootComponent: any, rootProps?: any): App
  33. // #endregion
  34. export declare function hasInjectionContext(): boolean