global-api.ts 1.0 KB

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