Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
//library.js export default { run() { return this.check && this.check(42); }, check: undefined }; //index.js import obj from './library.js' obj.check = count => console.log(count); obj.run()
// library.d.ts type DefaultExport = { run(): void; check?: (count: number) => void; }; declare const de: DefaultExport; export default de;