[ember] consume Observable interface from @ember

This commit is contained in:
Mike North
2018-09-18 23:44:03 -07:00
parent c794b890ef
commit a56c0aa6ae
2 changed files with 18 additions and 9 deletions
+16 -8
View File
@@ -77,27 +77,35 @@ ex2.firstName; // $ExpectType string
type UnwStringSet = UnwrapComputedPropertySetter<string>; // $ExpectType string
type UnwStringGet = UnwrapComputedPropertyGetter<string>; // $ExpectType string
// $ExpectType string
type UnwCpStringSet1 = UnwrapComputedPropertySetter<
Ember.ComputedProperty<string>
>; // $ExpectType string
>;
// $ExpectType string
type UnwCpStringGet1 = UnwrapComputedPropertyGetter<
Ember.ComputedProperty<string>
>; // $ExpectType string
>;
// $ExpectType string
type UnwCpStringSet2 = UnwrapComputedPropertySetter<
Ember.ComputedProperty<string, string>
>; // $ExpectType string
>;
// $ExpectType string
type UnwCpStringGet2 = UnwrapComputedPropertyGetter<
Ember.ComputedProperty<string, string>
>; // $ExpectType string
>;
// $ExpectType string
type UnwCpStringSet3 = UnwrapComputedPropertySetter<
Ember.ComputedProperty<number, string>
>; // $ExpectType string
>;
// $ExpectType number
type UnwCpStringGet3 = UnwrapComputedPropertyGetter<
Ember.ComputedProperty<number, string>
>; // $ExpectType number
>;
// $ExpectType number
type UnwCpStringSet4 = UnwrapComputedPropertySetter<
Ember.ComputedProperty<string, number>
>; // $ExpectType number
>;
// $ExpectType string
type UnwCpStringGet4 = UnwrapComputedPropertyGetter<
Ember.ComputedProperty<string, number>
>; // $ExpectType string
>;
+2 -1
View File
@@ -7,12 +7,13 @@ import {
UnwrapComputedPropertyGetters,
UnwrapComputedPropertySetters
} from '@ember/object/-private/types';
import Observable from "@ember/object/observable";
class OtherThing {
observerOfDemo(target: DemoObservable, key: 'foo') {}
}
class DemoObservable implements Ember.Observable {
class DemoObservable implements Observable {
foo: string;
isFoo = true;
bar: [boolean, boolean];