typescript export module code example
Example 1: module.exports equivalent typescript
exports["default"] = A; module.exports = exports["default"];
Example 2: module.exports in typescript
class Person {
private firstName: string;
private lastName: string;
constructor(firstName: string, lastName: string) {
this.firstName = firstName;
this.lastName = lastName;
}
public getFullName() {
return `${this.firstName} ${this.lastName}`;
}
}
export = Person;
Example 3: export interface typescript
interface Props {}
export interface IRefered {
name: string
}