Skip to content

Commit

Permalink
fix(typings): Typings for StageComponent (#52)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
s-hoff authored and EisenbergEffect committed Jan 31, 2017
1 parent fb642c1 commit 01036e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/component-tester.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {View} from 'aurelia-templating';
import {Aurelia} from 'aurelia-framework';

export const StageComponent = {
withResources(resources): ComponentTester {
export class StageComponent {
static withResources(resources: string | string[]): ComponentTester {
return new ComponentTester().withResources(resources);
}
};
}

export class ComponentTester {
bind: (bindingContext: any) => void;
Expand Down Expand Up @@ -43,7 +43,7 @@ export class ComponentTester {
return this;
}

create(bootstrap: (aurelia: Aurelia) => Promise<void>): Promise<void> {
create(bootstrap: (configure: (aurelia: Aurelia) => Promise<void>) => Promise<void>): Promise<void> {
return bootstrap(aurelia => {
return Promise.resolve(this.configure(aurelia)).then(() => {
if (this._resources) {
Expand Down

0 comments on commit 01036e7

Please sign in to comment.