Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support export declarations #801

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions examples/basic/src/export-declaration.ts
@@ -0,0 +1,26 @@
// This file contains some export declarations that appear before the
// symbols they export. This is done on purpose to ensure that typedoc
// does not choke on such order, which is legal as far as TS is
// concerned.
export { funcFromMod, someVarFromMod as someVarFromModRenamed, SomeClassFromMod,
SomeInterfaceFromMod as SomeInterfaceFromModRenamed } from "./mod";
export * from "./mod2";

export { exportedLocalFunction, exportedLocalFunction2 }

function exportedLocalFunction(): boolean { return true; }

function exportedLocalFunction2(): boolean { return true; }

export { exportedLocalFunction3 as renamedExportedLocalFunction3,
exportedLocalFunction4 as renamedExportedLocalFunction4 }

function exportedLocalFunction3(a: string, b: number): void {}
function exportedLocalFunction4(c: number, d: string): void {}

const notExportedVar = 1;
export const exportedVar1 = notExportedVar;

export const exportedVar2 = 1;

export default function defaultSymbol() {}
13 changes: 13 additions & 0 deletions examples/basic/src/mod.ts
@@ -0,0 +1,13 @@
export function funcFromMod(a: number): void {
a++;
}

export const someVarFromMod: string = "some value";

export class SomeClassFromMod {
property: number = 1;
}

export interface SomeInterfaceFromMod {
foo: number;
}
15 changes: 15 additions & 0 deletions examples/basic/src/mod2.ts
@@ -0,0 +1,15 @@
export function funcFromMod2(a: number): void {
a++;
}

export const someVarFromMod2: string = "some value";

export class SomeClassFromMod2 {
property: number = 1;
}

export interface SomeInterfaceFromMod2 {
foo: number;
}

export { funcFromMod as funcFromModRenamedInMod2 } from "./mod";