mtcute/packages/file-id
teidesu 390b65f796 build(docs): api reference generation improvements
- added readme in each package
- updated typedoc, fixed related issues
- use @link instead of @see
- moved configs to typedoc.js, improved exclusion of unneeded stuff
- custom plugin for typedoc for cross-package references
- preparing to move documentation to separate repository
2022-08-24 23:37:26 +03:00
..
src build(docs): api reference generation improvements 2022-08-24 23:37:26 +03:00
tests refactor: prettier-ed code, rearranged imports, fixed tests 2022-06-30 16:32:56 +03:00
package.json build(docs): api reference generation improvements 2022-08-24 23:37:26 +03:00
README.md build(docs): api reference generation improvements 2022-08-24 23:37:26 +03:00
tsconfig.json build(docs): api reference generation improvements 2022-08-24 23:37:26 +03:00
typedoc.js build(docs): api reference generation improvements 2022-08-24 23:37:26 +03:00

@mtcute/file-id

A package that is used internally by @mtcute/client to parse, serialize and manipulate TDLib and Bot API compatible File IDs, but can also be used for any other purposes.

Contents

This package exports a number of functions, namely:

  • parseFileId() which parses provided File ID to an object representing its contents
  • toFileId() which serializes provided object containing file info to a File ID
  • toUniqueFileId() which serializes provided object containing file info to a Unique File ID
  • fileIdTo*() which converts a File ID to an input TL object, which can be used in RPC calls etc.

This package also exports namespace tdFileId, which contains all the types used by the library

Acknowledgements

This is basically a port of a portion of TDLib APIs, but greatly simplified in usage and made to work seamlessly with the rest of the MTCute APIs.

This is a list of files from TDLib repository, from which most of the code was taken:

Additionally, some of the test cases were taken from a similar Python library, luckydonald/telegram_file_id