{"_id":"@airgrams/web","name":"@airgrams/web","dist-tags":{"latest":"6.0.2"},"versions":{"6.0.2":{"name":"@airgrams/web","version":"6.0.2","private":false,"main":"index.js","types":"index.d.ts","keywords":["telegram","tdweb","airgram"],"publishConfig":{"access":"public"},"dependencies":{"@airgrams/core":"^6.0.2","tdweb":"~1.8.0"},"gitHead":"1093094122d896918b5e17e902199c9ad15f4a3b","sideEffects":false,"author":{"name":"Alexander Krisko"},"homepage":"https://airgram.io","repository":{"type":"git","url":"git+https://github.com/hht/airgram.git"},"description":"Use [`tdweb`](https://github.com/tdlib/td/tree/master/example/web/tdweb) on steroids.","bugs":{"url":"https://github.com/hht/airgram/issues"},"_id":"@airgrams/web@6.0.2","_nodeVersion":"16.14.0","_npmVersion":"lerna/3.22.1/node@v16.14.0+arm64 (darwin)","dist":{"integrity":"sha512-aX2/urkm4v7B+xFZCjXYTPgWV5yanNb47RPQMPRhuyTU54EtbDeRkL8PHQ1zWuxmRzhe6e83kqkFSS5yB0BBXA==","shasum":"0bf0cd7193b920ce81e5cb17a3eb4b29aa2c57ef","tarball":"https://registry.npmjs.org/@airgrams/web/-/web-6.0.2.tgz","fileCount":14,"unpackedSize":21962,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC3vVA5OHZMrZ4WRTgtZyKkOuYGUzqNTWeQOne+kmhjMAiEA+XK3CPHORpCITVERY93ov78RfKxtbyWh7VcBTjCAMbE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZqmVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqMXA/+P1hJAgyoCMTX19jRUZy3IIpVcGSH/iEM5Det0W7FNUHbINd5\r\nOnYWcQTF0UJkon6NZi94CgvsuwPaU4TKieivDqW4LnwzZL6dobPP6e3gUCeo\r\ncqeHE7HR3Re0PeucsgcoPY6UARsa8CiQtWSLUjf2tVODW0q3f6Kn24Kf9duw\r\ntGXfxMNdM3/X/fNVKaH9ZWAx8cGUV84phNYvAEEH+ffmoHkoBd8Yn4T1DA7Z\r\nZpnP3p2z7h7B/vPEseo1lPnqtatIenpX2ybJh85sQCZfluOCZhNcZ3s6IhGy\r\ngYULQa2UYeNsl5ycHgv7ad/1AGP4//TStYmqmhqe1pkyADw8llcm+7sgK8+d\r\nVaiq04nwCOHeTlt5VXjdOmiA+sYj6S87A/2uCx3VfHoxQEvn+z6forb3kYEJ\r\nxQQa9LNBnEsEPk/5Hl1iFJySOBRVmA0uRIv2s3hz/LFOzkztKYCC7TIJp3fA\r\nrUyG64qgBmtTOGhZY/NZPaeAyR6arJ5dZ+KMGcLQHJbKNkVaX0JFGNBMhAgs\r\nionrjeg4HNQU0dREaxwE0uf18UxvwszUGbuceVHQBCknfbrlq0y2BT0g6Us9\r\nZwSy1RNRlIlHOoLvJO+prH0chGlfHPdnPNBSxIcJPD7DWS7Md5dolmgNaDAo\r\nPy/BmUU+3iqtwb6d6Hi25UtdelMoxrJ4Bi4=\r\n=D+bM\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"s1m0ne","email":"hht@163.com"},"directories":{},"maintainers":[{"name":"s1m0ne","email":"hht@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/web_6.0.2_1650895253432_0.9420121157677213"},"_hasShrinkwrap":false}},"time":{"created":"2022-04-25T14:00:53.353Z","6.0.2":"2022-04-25T14:00:53.604Z","modified":"2022-04-25T14:00:53.771Z"},"maintainers":[{"name":"s1m0ne","email":"hht@163.com"}],"description":"Use [`tdweb`](https://github.com/tdlib/td/tree/master/example/web/tdweb) on steroids.","homepage":"https://airgram.io","keywords":["telegram","tdweb","airgram"],"repository":{"type":"git","url":"git+https://github.com/hht/airgram.git"},"author":{"name":"Alexander Krisko"},"bugs":{"url":"https://github.com/hht/airgram/issues"},"readme":"# Airgram for `tdweb`\n\nUse [`tdweb`](https://github.com/tdlib/td/tree/master/example/web/tdweb) on steroids.\n\n## Features\n\n- Strictly typed;\n- Documentation out of the box;\n- Supports models;\n- Built on middleware;\n\nAll TDLib classes and methods are described and have suitable wrappers in Airgram. There are only two differences:\n- All parameter names are represent in \"camelCase\".\n- Parameter `@type` renamed to `_`.\n\n## Documentation\n- [Installation](#installation) \n- [Usage](#usage)\n- [Configuration](#configuration)\n- [Api reference](#api-reference)\n---\nCheck out `airgram` documentation:\n- [Middleware](https://github.com/airgram/airgram#middleware)\n- [Getting updates](https://github.com/airgram/airgram#getting-updates)\n---\nTDLib API reference:\n- [TDLib methods](https://github.com/airgram/airgram-api/tree/master/docs/td-methods.md)\n- [TDLib input types](https://github.com/airgram/airgram-api/tree/master/docs/td-inputs.md)\n- [TDLib output types](https://github.com/airgram/airgram-api/tree/master/docs/td-outputs.md)\n\n## Installation\n```bash\nnpm install tdweb-airgram\n```\n\n## Usage\n- [Webpack example](https://github.com/airgram/tdweb-airgram/tree/master/examples/webpack-config)\n- [Rollup example](https://github.com/airgram/tdweb-airgram/tree/master/examples/rollup-example)\n\n## Configuration\n\nThis section describes the options you can pass to `Airgram` constructor:\n\n```typescript\nimport { Airgram } from 'tdweb-airgram'\n\nconst airgram = new Airgram({\n  // options\n})\n```\n\n### TDLib options\n\n| Key                | Type                     | Note                                                        |\n| ------------------ | ------------------------ | ----------------------------------------------------------- |\n| `useTestDc` | `boolean` | If set to true, the Telegram test environment will be used instead of the production  environment |\n| `databaseDirectory` | `string` | The path to the directory for the persistent database |\n| `filesDirectory` | `string` | The path to the directory for storing files |\n| `useFileDatabase` | `boolean` | If set to true, information about downloaded and uploaded files will be saved between application restarts |\n| `useChatInfoDatabase` | `boolean` | If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies `useFileDatabase` |\n| `useMessageDatabase` | `boolean` | If set to true, the library will maintain a cache of chats and messages. Implies `useChatInfoDatabase` |\n| `useSecretChats` | `boolean` | If set to true, support for secret chats will be enabled |\n| `apiId` | `number` | Application identifier for Telegram API access, which can be obtained at https://my.telegram.org |\n| `apiHash` | `string` | Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org |\n| `systemLanguageCode` | `string` | IETF language tag of the user's operating system language |\n| `deviceModel` | `string` | Model of the device the application is being run on |\n| `systemVersion` | `string` | Version of the operating system the application is being run on |\n| `applicationVersion` | `string` | Application version |\n| `enableStorageOptimizer` | `boolean` | If set to true, old files will automatically be deleted |\n| `ignoreFileNames` | `boolean` | If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name |\n| `databaseEncryptionKey` | `string` | Encryption key |\n\n### `tdweb` options:\n\n| Key                | Type                     | Note                                                        |\n| ------------------ | ------------------------ | ----------------------------------------------------------- |\n| `instanceName` | `string` | Name of the TDLib instance. Currently only one instance of TdClient with a given name is allowed. All but one instances with the same name will be automatically closed. Usually, the newest non-background instance is kept alive. Files will be stored in an IndexedDb table with the same name. |\n| `isBackground` | `boolean` | Pass true, if the instance is opened from the background. Default: `false` |\n| `jsLogVerbosityLevel` | `string` | The initial verbosity level of the JavaScript part of the code (one of 'error', 'warning', 'info', 'log', 'debug'). Default: `info` |\n| `logVerbosityLevel` | `number` | The initial verbosity level for the TDLib internal logging (0-1023). Default: 2 |\n| `useDatabase` | `boolean` | Pass false to use TDLib without database and secret chats. It will significantly improve loading time, but some functionality will be unavailable. Default: `true` |\n| `readOnly` | `boolean` | For debug only. Pass true to open TDLib database in read-only mode. Default: `false` |\n| `mode` | `string` | For debug only. The type of the TDLib build to use. 'asmjs' for asm.js and 'wasm' for WebAssembly. If mode == 'auto' WebAbassembly will be used if supported by browser, asm.js otherwise. Default: `auto` |\n\n\n### Other options\n\n| Key                | Type                     | Note                                                        |\n| ------------------ | ------------------------ | ----------------------------------------------------------- |\n| `models` | Function | Contains function, which converts plain JSON objects to models. [Details](https://github.com/airgram/airgram-use-models). |\n| `contextFactory` | Function | Function that returns custom middleware context. [Details](#ctx). |\n\n## API reference\n\nThis section describes public API of an `Airgram` instance:\n\n\n| Key                | Type                     | Note                                                        |\n| ------------------ | ------------------------ | ----------------------------------------------------------- |\n| `api` | Object | Contains wrappers for all [TDLib methods](https://github.com/airgram/airgram-api/blob/master/docs/td-methods.md). |\n| `config` | Object | Airgram configuration. Readonly. |\n| `catch` | `(handler) => void` | Overrides default error handler. Argument `handler` takes a function: `(error: Error, ctx?: Record<string, any>) => void`  |\n\n## License\n\nThe source code is licensed under GPL v3. License is available [here](/LICENSE).\n","readmeFilename":"README.md"}