Skip to content

Commit 01036e7

Browse files
s-hoffEisenbergEffect
authored andcommitted
fix(typings): Typings for StageComponent (#52)
* fix(typings): Corrected create() argument types Relates to #46 * fix(typings): Correct typings for StageComponent Turned StageComponent into a class with static functions as TypeScript would turn the JSON const to `any`. Fixes #46
1 parent fb642c1 commit 01036e7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/component-tester.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import {View} from 'aurelia-templating';
22
import {Aurelia} from 'aurelia-framework';
33

4-
export const StageComponent = {
5-
withResources(resources): ComponentTester {
4+
export class StageComponent {
5+
static withResources(resources: string | string[]): ComponentTester {
66
return new ComponentTester().withResources(resources);
77
}
8-
};
8+
}
99

1010
export class ComponentTester {
1111
bind: (bindingContext: any) => void;
@@ -43,7 +43,7 @@ export class ComponentTester {
4343
return this;
4444
}
4545

46-
create(bootstrap: (aurelia: Aurelia) => Promise<void>): Promise<void> {
46+
create(bootstrap: (configure: (aurelia: Aurelia) => Promise<void>) => Promise<void>): Promise<void> {
4747
return bootstrap(aurelia => {
4848
return Promise.resolve(this.configure(aurelia)).then(() => {
4949
if (this._resources) {

0 commit comments

Comments
 (0)