Re-exports
Often modules extend other modules, and partially expose some of their features. A re-export does not import it locally, or introduce a local variable.
ParseIntBasedZipCodeValidator.ts
export class ParseIntBasedZipCodeValidator { isAcceptable(s: string) { return s.length === 5 && parseInt(s).toString() === s; } } // Export original validator but rename it export {ZipCodeValidator as RegExpBasedZipCodeValidator} from "./ZipCodeValidator";
Optionally, a module can wrap one or more modules and combine all their exports using export * from "module"
syntax.
AllValidators.ts
export * from "./StringValidator"; // exports interface 'StringValidator' export * from "./LettersOnlyValidator"; // exports class 'LettersOnlyValidator' export * from "./ZipCodeValidator"; // exports class 'ZipCodeValidator'
Please login to continue.