Skip to content

Instantly share code, notes, and snippets.

@vvuk
Last active January 31, 2017 21:25
Show Gist options
  • Save vvuk/0847b8175b2821c9c6973aca18e619de to your computer and use it in GitHub Desktop.
Save vvuk/0847b8175b2821c9c6973aca18e619de to your computer and use it in GitHub Desktop.
// == one.ts ==
export interface SomethingPublic {
foo(a: number): number;
}
// == two.ts ==
// error: SomethingPublic is not visible here
// this doesn't help:
/// <reference path="one.ts" />
class Foo implements SomethingPublic {
foo(a: number): number {
return a + 1;
}
}
export createFoo(): Foo {
return new Foo();
}
// == mything.ts ==
export * from './one';
// == example.ts ==
import * as MyThing from './mything';
let foo = MyThing.createFoo();
// MyThing.Foo -> not defined/exported here
foo.foo(5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment