global-api.d.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { Config } from '../src/core/config'
  2. import { Component } from './component'
  3. declare interface GlobalAPI {
  4. // new(options?: any): Component
  5. (options?: any): void
  6. cid: number
  7. options: Record<string, any>
  8. config: Config
  9. util: Object
  10. extend: (options: Object) => typeof Component
  11. set: <T>(target: Object | Array<T>, key: string | number, value: T) => T
  12. delete: <T>(target: Object | Array<T>, key: string | number) => void
  13. nextTick: (fn: Function, context?: Object) => void | Promise<any>
  14. use: (plugin: Function | Object) => GlobalAPI
  15. mixin: (mixin: Object) => GlobalAPI
  16. compile: (template: string) => {
  17. render: Function
  18. staticRenderFns: Array<Function>
  19. }
  20. directive: (id: string, def?: Function | Object) => Function | Object | void
  21. component: (
  22. id: string,
  23. def?: typeof Component | Object
  24. ) => typeof Component | void
  25. filter: (id: string, def?: Function) => Function | void
  26. observable: <T>(value: T) => T
  27. // allow dynamic method registration
  28. [key: string]: any
  29. }