feat: expose Long
This commit is contained in:
parent
7d0ebd346f
commit
4393a36a79
2 changed files with 5 additions and 1 deletions
|
@ -79,7 +79,9 @@ export async function setupMonaco() {
|
||||||
})
|
})
|
||||||
|
|
||||||
extraLibs.push({
|
extraLibs.push({
|
||||||
content: 'declare const tg: import("@mtcute/web").TelegramClient',
|
content:
|
||||||
|
'declare const tg: import("@mtcute/web").TelegramClient;\n'
|
||||||
|
+ 'declare const Long: import("@mtcute/web").Long;',
|
||||||
filePath: 'file:///tg.d.ts',
|
filePath: 'file:///tg.d.ts',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,8 @@ declare const window: typeof globalThis & {
|
||||||
tg: import('@mtcute/web').TelegramClient
|
tg: import('@mtcute/web').TelegramClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Object.defineProperty(globalThis, 'Long', { value: Long })
|
||||||
|
|
||||||
function sendToDevtools(message: any) {
|
function sendToDevtools(message: any) {
|
||||||
window.parent.postMessage({ event: 'TO_DEVTOOLS', value: message }, HOST_ORIGIN)
|
window.parent.postMessage({ event: 'TO_DEVTOOLS', value: message }, HOST_ORIGIN)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue