diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 5a2a654cbc..3c0d3c15cf 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -1734,11 +1734,11 @@ declare module 'ember' { key: keyof this, target: Target, method: ObserverMethod - ): void; + ): this; addObserver( key: keyof this, method: ObserverMethod - ): void; + ): this; /** * Remove an observer you have previously registered on this object. Pass * the same key, target, and method you passed to `addObserver()` and your @@ -1748,11 +1748,11 @@ declare module 'ember' { key: keyof this, target: Target, method: ObserverMethod - ): any; + ): this; removeObserver( key: keyof this, method: ObserverMethod - ): any; + ): this; /** * Retrieves the value of a property, or a default value in the case that the * property returns `undefined`. @@ -3147,33 +3147,33 @@ declare module 'ember' { /** * Specify a method that observes property changes. */ - function observer(key1: string, func: (target: any, key: string) => void): void; - function observer( + function observer void>(key1: string, func: Fn): Fn; + function observer void>( key1: string, key2: string, - func: (target: any, key: string) => void - ): void; - function observer( + func: Fn + ): Fn; + function observer void>( key1: string, key2: string, key3: string, - func: (target: any, key: string) => void - ): void; - function observer( + func: Fn + ): Fn; + function observer void>( key1: string, key2: string, key3: string, key4: string, - func: (target: any, key: string) => void - ): void; - function observer( + func: Fn + ): Fn; + function observer void>( key1: string, key2: string, key3: string, key4: string, key5: string, - func: (target: any, key: string) => void - ): void; + func: Fn + ): Fn; /** * Adds an observer on a property. */ diff --git a/types/ember/test/private/observable-tests.ts b/types/ember/test/private/observable-tests.ts index be3d4bd69f..1a789cc114 100644 --- a/types/ember/test/private/observable-tests.ts +++ b/types/ember/test/private/observable-tests.ts @@ -69,13 +69,13 @@ class DemoObservable implements Observable { notifyPropertyChange(keyName: string): this { throw new Error("Method not implemented."); } - addObserver(key: keyof this, target: Target, method: keyof Target | ((this: Target, sender: this, key: string, value: any, rev: number) => void)): void; - addObserver(key: K, method: keyof this | ((this: this, sender: this, key: K, value: this[K], rev: number) => void)): void; + addObserver(key: keyof this, target: Target, method: keyof Target | ((this: Target, sender: this, key: string, value: any, rev: number) => void)): any; + addObserver(key: K, method: keyof this | ((this: this, sender: this, key: K, value: this[K], rev: number) => void)): any; addObserver(key: any, target: any, method?: any) { throw new Error("Method not implemented."); } - removeObserver(key: keyof this, target: Target, method: keyof Target | ((this: Target, sender: this, key: string, value: any, rev: number) => void)): void; - removeObserver(key: keyof this, method: keyof this | ((this: this, sender: this, key: string, value: any, rev: number) => void)): void; + removeObserver(key: keyof this, target: Target, method: keyof Target | ((this: Target, sender: this, key: string, value: any, rev: number) => void)): any; + removeObserver(key: keyof this, method: keyof this | ((this: this, sender: this, key: string, value: any, rev: number) => void)): any; removeObserver(key: any, target: any, method?: any): void { throw new Error("Method not implemented."); }