@mtcute/web 0.16.6 → 0.16.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/{cjs/client.d.ts → client.d.ts} +1 -1
- package/{esm/crypto.d.ts → crypto.d.ts} +1 -1
- package/idb/idb.test.d.ts +1 -0
- package/index.cjs +961 -0
- package/index.d.ts +7 -1
- package/index.js +951 -1
- package/methods.cjs +14 -0
- package/methods.d.ts +1 -1
- package/methods.js +1 -1
- package/package.json +56 -40
- package/utils.cjs +14 -0
- package/utils.d.ts +1 -1
- package/utils.js +1 -1
- package/{esm/websocket.d.ts → websocket.d.ts} +3 -3
- package/websocket.test.d.ts +1 -0
- package/{cjs/worker.d.ts → worker.d.ts} +1 -1
- package/cjs/client.js +0 -41
- package/cjs/client.js.map +0 -1
- package/cjs/common-internals-web/base64.js +0 -112
- package/cjs/common-internals-web/base64.js.map +0 -1
- package/cjs/common-internals-web/hex.js +0 -69
- package/cjs/common-internals-web/hex.js.map +0 -1
- package/cjs/common-internals-web/logging.js +0 -35
- package/cjs/common-internals-web/logging.js.map +0 -1
- package/cjs/common-internals-web/utf8.js +0 -29
- package/cjs/common-internals-web/utf8.js.map +0 -1
- package/cjs/crypto.d.ts +0 -21
- package/cjs/crypto.js +0 -73
- package/cjs/crypto.js.map +0 -1
- package/cjs/exit-hook.js +0 -24
- package/cjs/exit-hook.js.map +0 -1
- package/cjs/idb/driver.js +0 -139
- package/cjs/idb/driver.js.map +0 -1
- package/cjs/idb/index.js +0 -34
- package/cjs/idb/index.js.map +0 -1
- package/cjs/idb/repository/auth-keys.js +0 -71
- package/cjs/idb/repository/auth-keys.js.map +0 -1
- package/cjs/idb/repository/kv.js +0 -35
- package/cjs/idb/repository/kv.js.map +0 -1
- package/cjs/idb/repository/peers.js +0 -39
- package/cjs/idb/repository/peers.js.map +0 -1
- package/cjs/idb/repository/ref-messages.js +0 -62
- package/cjs/idb/repository/ref-messages.js.map +0 -1
- package/cjs/idb/utils.js +0 -18
- package/cjs/idb/utils.js.map +0 -1
- package/cjs/index.js +0 -30
- package/cjs/index.js.map +0 -1
- package/cjs/methods.js +0 -24
- package/cjs/methods.js.map +0 -1
- package/cjs/package.json +0 -3
- package/cjs/platform.js +0 -49
- package/cjs/platform.js.map +0 -1
- package/cjs/utils.js +0 -24
- package/cjs/utils.js.map +0 -1
- package/cjs/wasm.js +0 -36
- package/cjs/wasm.js.map +0 -1
- package/cjs/websocket.d.ts +0 -46
- package/cjs/websocket.js +0 -132
- package/cjs/websocket.js.map +0 -1
- package/cjs/worker.js +0 -129
- package/cjs/worker.js.map +0 -1
- package/esm/client.d.ts +0 -30
- package/esm/client.js +0 -36
- package/esm/client.js.map +0 -1
- package/esm/common-internals-web/base64.d.ts +0 -2
- package/esm/common-internals-web/base64.js +0 -107
- package/esm/common-internals-web/base64.js.map +0 -1
- package/esm/common-internals-web/hex.d.ts +0 -2
- package/esm/common-internals-web/hex.js +0 -64
- package/esm/common-internals-web/hex.js.map +0 -1
- package/esm/common-internals-web/logging.d.ts +0 -2
- package/esm/common-internals-web/logging.js +0 -31
- package/esm/common-internals-web/logging.js.map +0 -1
- package/esm/common-internals-web/utf8.d.ts +0 -3
- package/esm/common-internals-web/utf8.js +0 -23
- package/esm/common-internals-web/utf8.js.map +0 -1
- package/esm/crypto.js +0 -69
- package/esm/crypto.js.map +0 -1
- package/esm/exit-hook.d.ts +0 -1
- package/esm/exit-hook.js +0 -20
- package/esm/exit-hook.js.map +0 -1
- package/esm/idb/driver.d.ts +0 -18
- package/esm/idb/driver.js +0 -135
- package/esm/idb/driver.js.map +0 -1
- package/esm/idb/index.d.ts +0 -22
- package/esm/idb/index.js +0 -29
- package/esm/idb/index.js.map +0 -1
- package/esm/idb/repository/auth-keys.d.ts +0 -14
- package/esm/idb/repository/auth-keys.js +0 -67
- package/esm/idb/repository/auth-keys.js.map +0 -1
- package/esm/idb/repository/kv.d.ts +0 -11
- package/esm/idb/repository/kv.js +0 -31
- package/esm/idb/repository/kv.js.map +0 -1
- package/esm/idb/repository/peers.d.ts +0 -12
- package/esm/idb/repository/peers.js +0 -35
- package/esm/idb/repository/peers.js.map +0 -1
- package/esm/idb/repository/ref-messages.d.ts +0 -12
- package/esm/idb/repository/ref-messages.js +0 -58
- package/esm/idb/repository/ref-messages.js.map +0 -1
- package/esm/idb/utils.d.ts +0 -2
- package/esm/idb/utils.js +0 -13
- package/esm/idb/utils.js.map +0 -1
- package/esm/index.d.ts +0 -7
- package/esm/index.js +0 -8
- package/esm/index.js.map +0 -1
- package/esm/methods.d.ts +0 -1
- package/esm/methods.js +0 -2
- package/esm/methods.js.map +0 -1
- package/esm/platform.d.ts +0 -21
- package/esm/platform.js +0 -45
- package/esm/platform.js.map +0 -1
- package/esm/utils.d.ts +0 -1
- package/esm/utils.js +0 -2
- package/esm/utils.js.map +0 -1
- package/esm/wasm.d.ts +0 -2
- package/esm/wasm.js +0 -32
- package/esm/wasm.js.map +0 -1
- package/esm/websocket.js +0 -124
- package/esm/websocket.js.map +0 -1
- package/esm/worker.d.ts +0 -10
- package/esm/worker.js +0 -124
- package/esm/worker.js.map +0 -1
- /package/{cjs/common-internals-web → common-internals-web}/base64.d.ts +0 -0
- /package/{cjs/common-internals-web → common-internals-web}/hex.d.ts +0 -0
- /package/{cjs/common-internals-web → common-internals-web}/logging.d.ts +0 -0
- /package/{cjs/common-internals-web → common-internals-web}/utf8.d.ts +0 -0
- /package/{cjs/exit-hook.d.ts → exit-hook.d.ts} +0 -0
- /package/{cjs/idb → idb}/driver.d.ts +0 -0
- /package/{cjs/idb → idb}/index.d.ts +0 -0
- /package/{cjs/idb → idb}/repository/auth-keys.d.ts +0 -0
- /package/{cjs/idb → idb}/repository/kv.d.ts +0 -0
- /package/{cjs/idb → idb}/repository/peers.d.ts +0 -0
- /package/{cjs/idb → idb}/repository/ref-messages.d.ts +0 -0
- /package/{cjs/idb → idb}/utils.d.ts +0 -0
- /package/{cjs/index.d.ts → index.d.cts} +0 -0
- /package/{cjs/methods.d.ts → methods.d.cts} +0 -0
- /package/{cjs/platform.d.ts → platform.d.ts} +0 -0
- /package/{cjs/utils.d.ts → utils.d.cts} +0 -0
- /package/{cjs/wasm.d.ts → wasm.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -31,6 +31,9 @@ You can also use this package with web workers to offload most of the heavy lift
|
|
|
31
31
|
// worker.ts
|
|
32
32
|
import { BaseTelegramClient, TelegramWorker } from '@mtcute/web'
|
|
33
33
|
|
|
34
|
+
// main.ts
|
|
35
|
+
import { TelegramClient, TelegramWorkerPort } from '@mtcute/web'
|
|
36
|
+
|
|
34
37
|
const client = new BaseTelegramClient({
|
|
35
38
|
apiId: 12345,
|
|
36
39
|
apiHash: 'abcdef',
|
|
@@ -39,13 +42,10 @@ const client = new BaseTelegramClient({
|
|
|
39
42
|
|
|
40
43
|
new TelegramWorker({ client })
|
|
41
44
|
|
|
42
|
-
// main.ts
|
|
43
|
-
import { TelegramClient, TelegramWorkerPort } from '@mtcute/web'
|
|
44
|
-
|
|
45
45
|
const worker = new Worker(new URL('./worker.ts', import.meta.url), { type: 'module' }) // or SharedWorker
|
|
46
46
|
const port = new TelegramWorkerPort({ worker })
|
|
47
47
|
const tg = new TelegramClient({ client: port })
|
|
48
48
|
|
|
49
49
|
const self = await tg.start()
|
|
50
50
|
console.log(`✨ logged in as ${user.displayName}`)
|
|
51
|
-
```
|
|
51
|
+
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ITelegramStorageProvider, PartialOnly } from '@mtcute/core';
|
|
2
|
-
import {
|
|
2
|
+
import { BaseTelegramClientOptions as BaseTelegramClientOptionsBase, TelegramClientOptions, BaseTelegramClient as BaseTelegramClientBase, TelegramClient as TelegramClientBase } from '@mtcute/core/client.js';
|
|
3
3
|
export type { TelegramClientOptions };
|
|
4
4
|
export interface BaseTelegramClientOptions extends PartialOnly<Omit<BaseTelegramClientOptionsBase, 'storage'>, 'transport' | 'crypto'> {
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IAesCtr, ICryptoProvider, IEncryptionScheme, BaseCryptoProvider } from '@mtcute/core/utils.js';
|
|
2
2
|
import { WasmInitInput } from './wasm.js';
|
|
3
3
|
export interface WebCryptoProviderOptions {
|
|
4
4
|
crypto?: Crypto;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|