Prefix all interfaces with Foo
interface IFooOptions {}
class Foo {
constructor(options: IFooOptions) {}
}
// usage
var foo = new Foo({});
Create a Foo module
module Foo {
export interface IOptions {
// ...
}
export class Foo {
constructor(options: IOptions) {}
}
}
// usage
var foo = new Foo.Foo({});
Create module Foo with factory function
module Foo {
export interface IOptions {
// ...
}
export class Foo {
constructor(options: IOptions) {}
}
export function create(options: IOptions): Foo {
return new Foo(options);
}
}
// usage
var foo = Foo.create({});