@ -16,6 +16,8 @@ declare interface GlobalAPI {
component: (id: string, def?: Class<Component> | Object) => Class<Component>;
filter: (id: string, def?: Function) => Function | void;
observable: <T>(value: T) => T;
// allow dynamic method registration
[key: string]: any
};
@ -46,7 +46,7 @@ export function initGlobalAPI (Vue: GlobalAPI) {
Vue.nextTick = nextTick
// 2.6 explicit observable API
Vue.observable = (obj: any): any => {
Vue.observable = <T>(obj: T): T => {
observe(obj)
return obj
}
@ -200,3 +200,6 @@ declare function decorate<VC extends typeof Vue>(v: VC): VC;
class Decorated extends Vue {
a = 123;
const obj = Vue.observable({ a: 1 })
obj.a++
@ -119,6 +119,8 @@ export interface VueConstructor<V extends Vue = Vue> {
staticRenderFns: (() => VNode)[];
observable<T>(obj: T): T;
config: VueConfiguration;