Add some type annotations

This commit is contained in:
Nick Farina
2015-07-09 14:48:06 -07:00
parent 1fab07286c
commit c8d729c732

View File

@@ -6,7 +6,7 @@ import { HOMEBRIDGE_VERSION } from '../homebridge';
// This class represents a HomeBridge Provider that may or may not be installed.
export class Provider {
constructor(name) {
constructor(name:string) {
this.name = name;
}
@@ -59,9 +59,9 @@ export class Provider {
static installed():Array<Provider> {
let providers:Array<Provider> = [];
let names = fs.readdirSync(Provider.installedProvidersDir);
let names:Array<string> = fs.readdirSync(Provider.installedProvidersDir);
for (let name of names) {
for (let name:string of names) {
// reconstruct full path
let fullPath:string = path.join(Provider.installedProvidersDir, name);