global-api.js 815 B

123456789101112131415161718192021
  1. declare interface GlobalAPI {
  2. cid: number;
  3. options: Object;
  4. config: Config;
  5. util: Object;
  6. extend: (options: Object) => Function;
  7. set: <T>(target: Object | Array<T>, key: string | number, value: T) => T;
  8. delete: <T>(target: Object| Array<T>, key: string | number) => void;
  9. nextTick: (fn: Function, context?: Object) => void | Promise<*>;
  10. use: (plugin: Function | Object) => GlobalAPI;
  11. mixin: (mixin: Object) => GlobalAPI;
  12. compile: (template: string) => { render: Function, staticRenderFns: Array<Function> };
  13. directive: (id: string, def?: Function | Object) => Function | Object | void;
  14. component: (id: string, def?: Class<Component> | Object) => Class<Component>;
  15. filter: (id: string, def?: Function) => Function | void;
  16. // allow dynamic method registration
  17. [key: string]: any
  18. };