Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt

Use this file to discover all available pages before exploring further.

Re-exporting in TypeScript is the mechanism of forwarding exports from one module through another without binding them to the local scope. It acts as a pass-through, allowing a module to expose members defined in separate files directly to consumers. TypeScript supports several syntactical forms for re-exporting, handling named exports, default exports, and type-level constructs. Aggregate Re-export (Wildcard) Forwards all named exports from the target module. This syntax explicitly ignores the default export of the target module to prevent naming collisions.
export * from './utilities';
Selective Re-export Forwards specific named exports from the target module.
export { parseString, formatDate } from './utilities';
Aliased Re-export Renames a specific export during the forwarding process using the as keyword.
export { parseString as parse } from './utilities';
Namespace Re-export Aggregates all exports (including the default export, if present) from the target module into a single named object.
export * as Utils from './utilities';
Default Re-export Because the wildcard (*) ignores default exports, they must be forwarded explicitly. A default export can be re-exported as the current module’s default export, or aliased into a named export.
// Forwards the target's default export as this module's default export
export { default } from './utilities';

// Forwards the target's default export as a named export
export { default as UtilityCore } from './utilities';
Type-Only Re-export TypeScript provides the export type modifier to guarantee that the re-exported members are strictly type-level constructs. This ensures the TypeScript compiler completely erases these statements during the JavaScript emit phase, preventing runtime reference errors.
// Selective type re-export
export type { UserConfig, AppState } from './types';

// Wildcard type re-export (TypeScript 5.0+)
export type * from './types';
Master TypeScript with Deep Grasping Methodology!Learn More