index.d.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import * as V from './vue';
  2. import * as Options from './options';
  3. import * as Plugin from './plugin';
  4. declare global {
  5. interface Array<T> {
  6. $remove(item: T): Array<T>;
  7. $set(index: any, val: T): T;
  8. }
  9. // For the projects/tools that depend on this namespace
  10. namespace vuejs {
  11. export type PropOption = Options.PropOptions;
  12. export type ComputedOption = Options.ComputedOptions<any>;
  13. export type WatchOption = Options.WatchOptions;
  14. export type DirectiveOption = Options.DirectiveOptions<Vue>;
  15. export type Directive = Options.DirectiveInstance<Vue>;
  16. export type TransitionOpsion = Options.TransitionOptions;
  17. export type ComponentOption = Options.ComponentOptions<any>;
  18. export type FilterOption = Options.FilterOptions;
  19. export type Vue = V.Vue;
  20. export type VueStatic = typeof V.Vue;
  21. export type VueConfig = typeof V.Vue.config;
  22. }
  23. }
  24. // `Vue` in `export = Vue` must be a namespace
  25. // All available types are exported via this namespace
  26. declare namespace Vue {
  27. export type Component = Options.Component;
  28. export type AsyncComponent = Options.AsyncComponent;
  29. export type ComponentOptions<V extends Vue> = Options.ComponentOptions<V>;
  30. export type PropOptions = Options.PropOptions;
  31. export type ComputedOptions<V extends Vue> = Options.ComputedOptions<V>;
  32. export type WatchHandler<V extends Vue> = Options.WatchHandler<V>;
  33. export type WatchOptions = Options.WatchOptions;
  34. export type DirectiveInstance<V extends Vue> = Options.DirectiveInstance<V>;
  35. export type DirectiveFunction<V extends Vue> = Options.DirectiveFunction<V>;
  36. export type DirectiveOptions<V extends Vue> = Options.DirectiveOptions<V>;
  37. export type FilterOptions = Options.FilterOptions;
  38. export type TransitionOpsions = Options.TransitionOptions;
  39. export type PluginFunction<T> = Plugin.PluginFunction<T>;
  40. export type PluginObject<T> = Plugin.PluginObject<T>;
  41. }
  42. // TS cannot merge imported class with namespace, declare a subclass to bypass
  43. declare class Vue extends V.Vue { }
  44. export = Vue;