fix(client): fixed typings

This commit is contained in:
alina 🌸 2023-12-04 15:08:05 +03:00
parent 78aae6ac78
commit 2eb4d307cb
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI

View file

@ -1,17 +1,3 @@
module.exports = ({ fs, path, outDir }) => ({
module.exports = {
esmOnlyDirectives: true,
final() {
function fixClient(file) {
// make TelegramClient a class, not an interface
const dTsContent = fs.readFileSync(path.join(outDir, file), 'utf8')
fs.writeFileSync(
path.join(outDir, file),
dTsContent.replace('export interface TelegramClient', 'export class TelegramClient'),
)
}
fixClient('esm/client.d.ts')
fixClient('cjs/client.d.ts')
},
})
}