feat: expose Long

This commit is contained in:
alina 🌸 2025-01-19 19:54:22 +03:00
parent 7d0ebd346f
commit 4393a36a79
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
2 changed files with 5 additions and 1 deletions

View file

@ -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',
}) })

View file

@ -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)
} }