global-api.d.ts 1.1 KB

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