Declare enableFeature (#29927)

* Declare `enableFeature`

* Add missing newline

Co-Authored-By: zeppelin <gabor.babicz@gmail.com>
This commit is contained in:
Gabor Babicz 2018-10-22 18:27:54 +02:00 committed by Sheetal Nandi
parent 434800bc66
commit 6e675310cc
3 changed files with 4 additions and 0 deletions

View File

@ -1,5 +1,6 @@
import Features from 'ember-feature-flags';
import 'ember-feature-flags/tests/helpers/with-feature';
import 'ember-feature-flags/test-support';
/** Static assertion that `value` has type `T` */
// Disable tslint here b/c the generic is used to let us do a type coercion and
@ -24,4 +25,5 @@ const setup = {
};
features.setup(setup); // $ExpectType void
withFeature('new-homepage'); // $ExpectType void
enableFeature('new-homepage'); // $ExpectType void
assertType<boolean>(features.get('someFeature'));

View File

@ -0,0 +1 @@
declare function enableFeature(name: string): void;

View File

@ -47,6 +47,7 @@
"files": [
"index.d.ts",
"tests/helpers/with-feature.d.ts",
"test-support/index.d.ts",
"ember-feature-flags-tests.ts"
]
}