refactor: import tl from core/client, not tl

This commit is contained in:
alina 🌸 2023-09-24 03:37:34 +03:00
parent e771e592fd
commit 7ff433ed0a
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
158 changed files with 197 additions and 346 deletions

View file

@ -14,7 +14,6 @@
}, },
"dependencies": { "dependencies": {
"@types/node": "18.16.0", "@types/node": "18.16.0",
"@mtcute/tl": "workspace:^160.0.0",
"@mtcute/core": "workspace:^1.0.0", "@mtcute/core": "workspace:^1.0.0",
"@mtcute/file-id": "workspace:^1.0.0", "@mtcute/file-id": "workspace:^1.0.0",
"eager-async-pool": "1.0.0", "eager-async-pool": "1.0.0",

View file

@ -31,12 +31,7 @@ ${text}`,
async function addSingleMethod(state, fileName) { async function addSingleMethod(state, fileName) {
const fileFullText = await fs.promises.readFile(fileName, 'utf-8') const fileFullText = await fs.promises.readFile(fileName, 'utf-8')
const program = ts.createSourceFile( const program = ts.createSourceFile(path.basename(fileName), fileFullText, ts.ScriptTarget.ES2018, true)
path.basename(fileName),
fileFullText,
ts.ScriptTarget.ES2018,
true,
)
const relPath = path.relative(targetDir, fileName).replace(/\\/g, '/') // replace path delim to unix const relPath = path.relative(targetDir, fileName).replace(/\\/g, '/') // replace path delim to unix
state.files[relPath] = fileFullText state.files[relPath] = fileFullText
@ -64,8 +59,7 @@ async function addSingleMethod(state, fileName) {
if ( if (
!stmt.importClause.namedBindings || !stmt.importClause.namedBindings ||
stmt.importClause.namedBindings.kind !== stmt.importClause.namedBindings.kind !== ts.SyntaxKind.NamedImports
ts.SyntaxKind.NamedImports
) { ) {
throwError(stmt, fileName, 'Only named imports are supported!') throwError(stmt, fileName, 'Only named imports are supported!')
} }
@ -74,25 +68,16 @@ async function addSingleMethod(state, fileName) {
if (module[0] === '.') { if (module[0] === '.') {
// relative, need to resolve // relative, need to resolve
const modFullPath = path.join( const modFullPath = path.join(path.dirname(fileName), stmt.moduleSpecifier.text)
path.dirname(fileName),
stmt.moduleSpecifier.text,
)
const modPath = path.dirname(modFullPath) const modPath = path.dirname(modFullPath)
const modName = path.basename(modFullPath) const modName = path.basename(modFullPath)
module = path module = path.join(path.relative(targetDir, modPath), modName).replace(/\\/g, '/') // replace path delim to unix
.join(path.relative(targetDir, modPath), modName)
.replace(/\\/g, '/') // replace path delim to unix
if (module[0] !== '.') module = './' + module if (module[0] !== '.') module = './' + module
} }
if (module === './client') { if (module === './client') {
throwError( throwError(stmt, fileName, "You can't copy an import from ./client")
stmt,
fileName,
"You can't copy an import from ./client",
)
} }
if (!(module in state.imports)) { if (!(module in state.imports)) {
@ -119,9 +104,7 @@ async function addSingleMethod(state, fileName) {
name !== '_normalizeInputFile' && name !== '_normalizeInputFile' &&
name !== '_normalizeInputMedia' name !== '_normalizeInputMedia'
const isExported = (stmt.modifiers || []).find( const isExported = (stmt.modifiers || []).find((mod) => mod.kind === ts.SyntaxKind.ExportKeyword)
(mod) => mod.kind === ts.SyntaxKind.ExportKeyword,
)
const isInitialize = checkForFlag(stmt, '@initialize') const isInitialize = checkForFlag(stmt, '@initialize')
const aliases = (function () { const aliases = (function () {
const flag = checkForFlag(stmt, '@alias') const flag = checkForFlag(stmt, '@alias')
@ -146,11 +129,7 @@ async function addSingleMethod(state, fileName) {
} }
if (isInitialize && isExported) { if (isInitialize && isExported) {
throwError( throwError(isExported, fileName, 'Initialization methods must not be exported')
isExported,
fileName,
'Initialization methods must not be exported',
)
} }
if (isInitialize) { if (isInitialize) {
@ -171,8 +150,7 @@ async function addSingleMethod(state, fileName) {
if ( if (
isExported && isExported &&
(!firstArg || (!firstArg ||
(firstArg.type.getText() !== 'TelegramClient' && (firstArg.type.getText() !== 'TelegramClient' && firstArg.type.getText() !== 'BaseTelegramClient'))
firstArg.type.getText() !== 'BaseTelegramClient'))
) { ) {
throwError( throwError(
firstArg || stmt.name, firstArg || stmt.name,
@ -183,16 +161,10 @@ async function addSingleMethod(state, fileName) {
const returnsExported = ( const returnsExported = (
stmt.body ? stmt.body ?
ts.getLeadingCommentRanges( ts.getLeadingCommentRanges(fileFullText, stmt.body.pos + 2) ||
fileFullText,
stmt.body.pos + 2,
) ||
(stmt.statements && (stmt.statements &&
stmt.statements.length && stmt.statements.length &&
ts.getLeadingCommentRanges( ts.getLeadingCommentRanges(fileFullText, stmt.statements[0].pos)) ||
fileFullText,
stmt.statements[0].pos,
)) ||
[] : [] :
[] []
) )
@ -246,23 +218,13 @@ async function addSingleMethod(state, fileName) {
} }
if (!checkForFlag(stmt, '@extension')) continue if (!checkForFlag(stmt, '@extension')) continue
const isExported = (stmt.modifiers || []).find( const isExported = (stmt.modifiers || []).find((mod) => mod.kind === 92 /* ExportKeyword */)
(mod) => mod.kind === 92, /* ExportKeyword */
)
if (isExported) { if (isExported) {
throwError( throwError(isExported, fileName, 'Extension interfaces must not be imported')
isExported,
fileName,
'Extension interfaces must not be imported',
)
} }
if (stmt.heritageClauses && stmt.heritageClauses.length) { if (stmt.heritageClauses && stmt.heritageClauses.length) {
throwError( throwError(stmt.heritageClauses[0], fileName, 'Extension interfaces must not be extended')
stmt.heritageClauses[0],
fileName,
'Extension interfaces must not be extended',
)
} }
for (const member of stmt.members || []) { for (const member of stmt.members || []) {
@ -278,9 +240,7 @@ async function addSingleMethod(state, fileName) {
} }
async function main() { async function main() {
const output = fs.createWriteStream( const output = fs.createWriteStream(path.join(__dirname, '../src/client.ts'))
path.join(__dirname, '../src/client.ts'),
)
const state = { const state = {
imports: {}, imports: {},
fields: [], fields: [],
@ -302,8 +262,7 @@ async function main() {
output.write( output.write(
'/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging, @typescript-eslint/unified-signatures */\n' + '/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging, @typescript-eslint/unified-signatures */\n' +
'/* THIS FILE WAS AUTO-GENERATED */\n' + '/* THIS FILE WAS AUTO-GENERATED */\n' +
"import { BaseTelegramClient, BaseTelegramClientOptions } from '@mtcute/core'\n" + "import { BaseTelegramClient, BaseTelegramClientOptions, tl } from '@mtcute/core'\n",
"import { tl } from '@mtcute/tl'\n",
) )
Object.entries(state.imports).forEach(([module, items]) => { Object.entries(state.imports).forEach(([module, items]) => {
items = [...items] items = [...items]
@ -316,9 +275,7 @@ async function main() {
output.write(`// from ${from}\n${code}\n`) output.write(`// from ${from}\n${code}\n`)
}) })
output.write( output.write('\nexport interface TelegramClient extends BaseTelegramClient {\n')
'\nexport interface TelegramClient extends BaseTelegramClient {\n',
)
output.write(`/** output.write(`/**
* Register a raw update handler * Register a raw update handler
@ -342,9 +299,7 @@ async function main() {
* @param name Event name * @param name Event name
* @param handler ${updates.toSentence(type, 'full')} * @param handler ${updates.toSentence(type, 'full')}
*/ */
on(name: '${type.typeName}', handler: ((upd: ${ on(name: '${type.typeName}', handler: ((upd: ${type.updateType}) => void)): this\n`)
type.updateType
}) => void)): this\n`)
}) })
const printer = ts.createPrinter() const printer = ts.createPrinter()
@ -365,13 +320,9 @@ on(name: '${type.typeName}', handler: ((upd: ${
// first let's determine the signature // first let's determine the signature
const returnType = func.type ? ': ' + func.type.getText() : '' const returnType = func.type ? ': ' + func.type.getText() : ''
const generics = func.typeParameters ? const generics = func.typeParameters ?
`<${func.typeParameters `<${func.typeParameters.map((it) => it.getFullText()).join(', ')}>` :
.map((it) => it.getFullText())
.join(', ')}>` :
'' ''
const rawParams = (func.parameters || []).filter( const rawParams = (func.parameters || []).filter((it) => !it.type || it.type.getText() !== 'TelegramClient')
(it) => !it.type || it.type.getText() !== 'TelegramClient',
)
const parameters = rawParams const parameters = rawParams
.map((it) => { .map((it) => {
if (it.initializer) { if (it.initializer) {
@ -382,33 +333,20 @@ on(name: '${type.typeName}', handler: ((upd: ${
// no explicit type. // no explicit type.
// infer from initializer // infer from initializer
if ( if (
it.initializer.kind === it.initializer.kind === ts.SyntaxKind.TrueKeyword ||
ts.SyntaxKind.TrueKeyword || it.initializer.kind === ts.SyntaxKind.FalseKeyword
it.initializer.kind ===
ts.SyntaxKind.FalseKeyword
) { ) {
it.type = { kind: ts.SyntaxKind.BooleanKeyword } it.type = { kind: ts.SyntaxKind.BooleanKeyword }
} else if ( } else if (it.initializer.kind === ts.SyntaxKind.StringLiteral) {
it.initializer.kind ===
ts.SyntaxKind.StringLiteral
) {
it.type = { kind: ts.SyntaxKind.StringKeyword } it.type = { kind: ts.SyntaxKind.StringKeyword }
} else if ( } else if (
it.initializer.kind === it.initializer.kind === ts.SyntaxKind.NumericLiteral ||
ts.SyntaxKind.NumericLiteral || (it.initializer.kind === ts.SyntaxKind.Identifier &&
(it.initializer.kind === (it.initializer.escapedText === 'NaN' || it.initializer.escapedText === 'Infinity'))
ts.SyntaxKind.Identifier &&
(it.initializer.escapedText === 'NaN' ||
it.initializer.escapedText ===
'Infinity'))
) { ) {
it.type = { kind: ts.SyntaxKind.NumberKeyword } it.type = { kind: ts.SyntaxKind.NumberKeyword }
} else { } else {
throwError( throwError(it, state.methods.used[origName], 'Cannot infer parameter type')
it,
state.methods.used[origName],
'Cannot infer parameter type',
)
} }
} }
it.initializer = undefined it.initializer = undefined
@ -445,22 +383,17 @@ on(name: '${type.typeName}', handler: ((upd: ${
comment = comment comment = comment
.replace(/^\s*\/\/+\s*@alias.*$/m, '') .replace(/^\s*\/\/+\s*@alias.*$/m, '')
.replace(/(\n^|\/\*)\s*\*\s*@internal.*/m, '') .replace(/(\n^|\/\*)\s*\*\s*@internal.*/m, '')
.replace( .replace(/((?:\n^|\/\*)\s*\*\s*@param )([^\s]+?)($|\s+)/gm, (_, pref, arg, post) => {
/((?:\n^|\/\*)\s*\*\s*@param )([^\s]+?)($|\s+)/gm, const param = rawParams.find((it) => it.name.escapedText === arg)
(_, pref, arg, post) => { if (!param) return _
const param = rawParams.find( if (!param._savedDefault) return _
(it) => it.name.escapedText === arg,
)
if (!param) return _
if (!param._savedDefault) return _
if (post) { if (post) {
return `${pref}${arg}${post}(default: \`${param._savedDefault.trim()}\`) ` return `${pref}${arg}${post}(default: \`${param._savedDefault.trim()}\`) `
} }
return `${pref}${arg}\n* (default: \`${param._savedDefault.trim()}\`)` return `${pref}${arg}\n* (default: \`${param._savedDefault.trim()}\`)`
}, })
)
for (const name of [origName, ...aliases]) { for (const name of [origName, ...aliases]) {
if (!hasOverloads) { if (!hasOverloads) {
@ -469,9 +402,7 @@ on(name: '${type.typeName}', handler: ((upd: ${
output.write(comment + '\n') output.write(comment + '\n')
} }
output.write( output.write(`${name}${generics}(${parameters})${returnType}\n`)
`${name}${generics}(${parameters})${returnType}\n`,
)
} }
if (!overload) { if (!overload) {

View file

@ -2,10 +2,9 @@
/* THIS FILE WAS AUTO-GENERATED */ /* THIS FILE WAS AUTO-GENERATED */
import { Readable } from 'stream' import { Readable } from 'stream'
import { BaseTelegramClient, BaseTelegramClientOptions, MaybeArray, MaybeAsync } from '@mtcute/core' import { BaseTelegramClient, BaseTelegramClientOptions, MaybeArray, MaybeAsync, tl } from '@mtcute/core'
import { AsyncLock, ConditionVariable, Deque, Logger, SortedLinkedList } from '@mtcute/core/utils' import { AsyncLock, ConditionVariable, Deque, Logger, SortedLinkedList } from '@mtcute/core/utils'
import { tdFileId } from '@mtcute/file-id' import { tdFileId } from '@mtcute/file-id'
import { tl } from '@mtcute/tl'
import { acceptTos } from './methods/auth/accept-tos' import { acceptTos } from './methods/auth/accept-tos'
import { checkPassword } from './methods/auth/check-password' import { checkPassword } from './methods/auth/check-password'

View file

@ -1,6 +1,5 @@
/* eslint-disable no-console */ /* eslint-disable no-console */
import { MtArgumentError } from '@mtcute/core' import { MtArgumentError, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { MaybeAsync, MaybeDynamic, SentCode, TermsOfService, User } from '../../types' import { MaybeAsync, MaybeDynamic, SentCode, TermsOfService, User } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { BotInline, InputInlineResult } from '../../types' import { BotInline, InputInlineResult } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { BotCommands } from '../../types' import { BotCommands } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike } from '../../types' import { InputPeerLike } from '../../types'

View file

@ -1,5 +1,5 @@
import { tl } from '@mtcute/core'
import { computeSrpParams } from '@mtcute/core/utils' import { computeSrpParams } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike } from '../../types' import { InputPeerLike } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { GameHighScore, InputPeerLike, PeersIndex } from '../../types' import { GameHighScore, InputPeerLike, PeersIndex } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { BotCommands } from '../../types' import { BotCommands } from '../../types'

View file

@ -1,5 +1,4 @@
import { assertNever } from '@mtcute/core' import { assertNever, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { BotCommands } from '../../types' import { BotCommands } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike } from '../../types' import { InputPeerLike } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike, Message } from '../../types' import { InputPeerLike, Message } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { BotCommands } from '../../types' import { BotCommands } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'

View file

@ -1,5 +1,4 @@
import { MaybeArray } from '@mtcute/core' import { MaybeArray, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike } from '../../types' import { InputPeerLike } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike } from '../../types' import { InputPeerLike } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike } from '../../types' import { InputPeerLike } from '../../types'

View file

@ -1,7 +1,6 @@
import Long from 'long' import Long from 'long'
import { assertNever, MaybeArray } from '@mtcute/core' import { assertNever, MaybeArray, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { ChatAction, ChatEvent, InputPeerLike, PeersIndex } from '../../types' import { ChatAction, ChatEvent, InputPeerLike, PeersIndex } from '../../types'

View file

@ -1,5 +1,5 @@
import { tl } from '@mtcute/core'
import { assertTypeIs } from '@mtcute/core/utils' import { assertTypeIs } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { ChatMember, InputPeerLike, MtInvalidPeerTypeError, PeersIndex } from '../../types' import { ChatMember, InputPeerLike, MtInvalidPeerTypeError, PeersIndex } from '../../types'

View file

@ -1,8 +1,7 @@
import Long from 'long' import Long from 'long'
import { assertNever } from '@mtcute/core' import { assertNever, tl } from '@mtcute/core'
import { assertTypeIs } from '@mtcute/core/utils' import { assertTypeIs } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { ArrayWithTotal, ChatMember, InputPeerLike, MtInvalidPeerTypeError, PeersIndex } from '../../types' import { ArrayWithTotal, ChatMember, InputPeerLike, MtInvalidPeerTypeError, PeersIndex } from '../../types'

View file

@ -1,5 +1,4 @@
import { MtArgumentError } from '@mtcute/core' import { MtArgumentError, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { Chat, InputPeerLike } from '../../types' import { Chat, InputPeerLike } from '../../types'

View file

@ -1,5 +1,4 @@
import { MtArgumentError } from '@mtcute/core' import { MtArgumentError, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { Chat, InputPeerLike } from '../../types' import { Chat, InputPeerLike } from '../../types'

View file

@ -1,6 +1,5 @@
import { getMarkedPeerId } from '@mtcute/core' import { getMarkedPeerId, tl } from '@mtcute/core'
import { assertTypeIs } from '@mtcute/core/utils' import { assertTypeIs } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { Chat } from '../../types' import { Chat } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike, MtInvalidPeerTypeError } from '../../types' import { InputPeerLike, MtInvalidPeerTypeError } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike } from '../../types' import { InputPeerLike } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { Chat, InputPeerLike } from '../../types' import { Chat, InputPeerLike } from '../../types'

View file

@ -1,6 +1,5 @@
import { MtArgumentError } from '@mtcute/core' import { MtArgumentError, tl } from '@mtcute/core'
import { fileIdToInputPhoto, tdFileId } from '@mtcute/file-id' import { fileIdToInputPhoto, tdFileId } from '@mtcute/file-id'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputFileLike, InputPeerLike, isUploadedFile, MtInvalidPeerTypeError } from '../../types' import { InputFileLike, InputPeerLike, isUploadedFile, MtInvalidPeerTypeError } from '../../types'

View file

@ -1,5 +1,4 @@
import { MaybeArray } from '@mtcute/core' import { MaybeArray, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike } from '../../types' import { InputPeerLike } from '../../types'

View file

@ -1,7 +1,6 @@
import Long from 'long' import Long from 'long'
import { PartialOnly } from '@mtcute/core' import { PartialOnly, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'

View file

@ -1,5 +1,4 @@
import { PartialExcept } from '@mtcute/core' import { PartialExcept, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'

View file

@ -1,5 +1,4 @@
import { MtArgumentError } from '@mtcute/core' import { MtArgumentError, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'

View file

@ -1,5 +1,4 @@
import { MtArgumentError } from '@mtcute/core' import { MtArgumentError, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'

View file

@ -1,7 +1,6 @@
import Long from 'long' import Long from 'long'
import { MtArgumentError } from '@mtcute/core' import { MtArgumentError, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { Dialog } from '../../types' import { Dialog } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'

View file

@ -1,6 +1,5 @@
import { getMarkedPeerId } from '@mtcute/core' import { getMarkedPeerId, tl } from '@mtcute/core'
import { assertTypeIsNot } from '@mtcute/core/utils' import { assertTypeIsNot } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { Dialog, PeersIndex } from '../../types' import { Dialog, PeersIndex } from '../../types'

View file

@ -1,7 +1,6 @@
import { ConnectionKind, MtArgumentError, MtUnsupportedError } from '@mtcute/core' import { ConnectionKind, MtArgumentError, MtUnsupportedError, tl } from '@mtcute/core'
import { ConditionVariable } from '@mtcute/core/utils' import { ConditionVariable } from '@mtcute/core/utils'
import { fileIdToInputFileLocation, fileIdToInputWebFileLocation, parseFileId } from '@mtcute/file-id' import { fileIdToInputFileLocation, fileIdToInputWebFileLocation, parseFileId } from '@mtcute/file-id'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { FileDownloadParameters, FileLocation } from '../../types' import { FileDownloadParameters, FileLocation } from '../../types'

View file

@ -1,5 +1,5 @@
import { tl } from '@mtcute/core'
import { assertTypeIs } from '@mtcute/core/utils' import { assertTypeIs } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputFileLike } from '../../types' import { InputFileLike } from '../../types'

View file

@ -1,6 +1,5 @@
import { MtArgumentError } from '@mtcute/core' import { MtArgumentError, tl } from '@mtcute/core'
import { tdFileId } from '@mtcute/file-id' import { tdFileId } from '@mtcute/file-id'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputFileLike, isUploadedFile } from '../../types' import { InputFileLike, isUploadedFile } from '../../types'

View file

@ -1,8 +1,8 @@
import Long from 'long' import Long from 'long'
import { tl } from '@mtcute/core'
import { assertTypeIs } from '@mtcute/core/utils' import { assertTypeIs } from '@mtcute/core/utils'
import { fileIdToInputDocument, fileIdToInputPhoto, parseFileId, tdFileId } from '@mtcute/file-id' import { fileIdToInputDocument, fileIdToInputPhoto, parseFileId, tdFileId } from '@mtcute/file-id'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputMediaLike, isUploadedFile, UploadFileLike } from '../../types' import { InputMediaLike, isUploadedFile, UploadFileLike } from '../../types'

View file

@ -2,9 +2,8 @@ import { fromBuffer as fileTypeFromBuffer } from 'file-type'
import type { ReadStream } from 'fs' import type { ReadStream } from 'fs'
import { Readable } from 'stream' import { Readable } from 'stream'
import { MtArgumentError } from '@mtcute/core' import { MtArgumentError, tl } from '@mtcute/core'
import { AsyncLock, randomLong } from '@mtcute/core/utils' import { AsyncLock, randomLong } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { UploadedFile, UploadFileLike } from '../../types' import { UploadedFile, UploadFileLike } from '../../types'

View file

@ -83,5 +83,6 @@ export async function uploadMedia(
throw new MtArgumentError("This media (story) can't be uploaded") throw new MtArgumentError("This media (story) can't be uploaded")
default: default:
assertNever(normMedia) assertNever(normMedia)
// ^?
} }
} }

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { ChatInviteLinkJoinedMember, InputPeerLike, PeersIndex, User } from '../../types' import { ChatInviteLinkJoinedMember, InputPeerLike, PeersIndex, User } from '../../types'

View file

@ -1,5 +1,5 @@
import { tl } from '@mtcute/core'
import { assertTypeIsNot } from '@mtcute/core/utils' import { assertTypeIsNot } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { ChatInviteLink, InputPeerLike, PeersIndex } from '../../types' import { ChatInviteLink, InputPeerLike, PeersIndex } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { BotKeyboard, FormattedString, InputMediaLike, ReplyMarkup } from '../../types' import { BotKeyboard, FormattedString, InputMediaLike, ReplyMarkup } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { BotKeyboard, FormattedString, InputMediaLike, InputPeerLike, Message, ReplyMarkup } from '../../types' import { BotKeyboard, FormattedString, InputMediaLike, InputPeerLike, Message, ReplyMarkup } from '../../types'

View file

@ -1,5 +1,4 @@
import { MtTypeAssertionError } from '@mtcute/core' import { MtTypeAssertionError, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { Message, PeersIndex } from '../../types' import { Message, PeersIndex } from '../../types'

View file

@ -1,6 +1,5 @@
import { MaybeArray, MtArgumentError } from '@mtcute/core' import { MaybeArray, MtArgumentError, tl } from '@mtcute/core'
import { randomLong } from '@mtcute/core/utils' import { randomLong } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { FormattedString, InputMediaLike, InputPeerLike, Message, PeersIndex } from '../../types' import { FormattedString, InputMediaLike, InputPeerLike, Message, PeersIndex } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike, Message, PeersIndex } from '../../types' import { InputPeerLike, Message, PeersIndex } from '../../types'

View file

@ -1,6 +1,5 @@
import { MaybeArray } from '@mtcute/core' import { MaybeArray, tl } from '@mtcute/core'
import { assertTypeIsNot } from '@mtcute/core/utils' import { assertTypeIsNot } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { Message, PeersIndex } from '../../types' import { Message, PeersIndex } from '../../types'

View file

@ -1,6 +1,5 @@
import { MaybeArray } from '@mtcute/core' import { MaybeArray, tl } from '@mtcute/core'
import { assertTypeIsNot } from '@mtcute/core/utils' import { assertTypeIsNot } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike, Message, PeersIndex } from '../../types' import { InputPeerLike, Message, PeersIndex } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike, PeerReaction, PeersIndex } from '../../types' import { InputPeerLike, PeerReaction, PeersIndex } from '../../types'

View file

@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
import { MtArgumentError } from '@mtcute/core' import { MtArgumentError, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { FormattedString } from '../../types' import { FormattedString } from '../../types'

View file

@ -1,5 +1,5 @@
import { tl } from '@mtcute/core'
import { assertTypeIsNot } from '@mtcute/core/utils' import { assertTypeIsNot } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { Message, PeersIndex, SearchFilters } from '../../types' import { Message, PeersIndex, SearchFilters } from '../../types'

View file

@ -1,7 +1,7 @@
import Long from 'long' import Long from 'long'
import { tl } from '@mtcute/core'
import { assertTypeIsNot } from '@mtcute/core/utils' import { assertTypeIsNot } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike, Message, PeersIndex, SearchFilters } from '../../types' import { InputPeerLike, Message, PeersIndex, SearchFilters } from '../../types'

View file

@ -1,5 +1,4 @@
import { getMarkedPeerId } from '@mtcute/core' import { getMarkedPeerId, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { FormattedString, InputPeerLike, Message, MtMessageNotFoundError, ReplyMarkup } from '../../types' import { FormattedString, InputPeerLike, Message, MtMessageNotFoundError, ReplyMarkup } from '../../types'

View file

@ -1,6 +1,5 @@
import { getMarkedPeerId, MtArgumentError } from '@mtcute/core' import { getMarkedPeerId, MtArgumentError, tl } from '@mtcute/core'
import { randomLong } from '@mtcute/core/utils' import { randomLong } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputMediaLike, InputPeerLike, Message, MtMessageNotFoundError, PeersIndex } from '../../types' import { InputMediaLike, InputPeerLike, Message, MtMessageNotFoundError, PeersIndex } from '../../types'

View file

@ -1,6 +1,5 @@
import { getMarkedPeerId, MtArgumentError } from '@mtcute/core' import { getMarkedPeerId, MtArgumentError, tl } from '@mtcute/core'
import { randomLong } from '@mtcute/core/utils' import { randomLong } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { import {

View file

@ -1,7 +1,6 @@
import Long from 'long' import Long from 'long'
import { MtTypeAssertionError } from '@mtcute/core' import { MtTypeAssertionError, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike, Message, PeersIndex } from '../../types' import { InputPeerLike, Message, PeersIndex } from '../../types'

View file

@ -1,6 +1,5 @@
import { getMarkedPeerId, MtArgumentError, MtTypeAssertionError } from '@mtcute/core' import { getMarkedPeerId, MtArgumentError, MtTypeAssertionError, tl } from '@mtcute/core'
import { randomLong } from '@mtcute/core/utils' import { randomLong } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { import {

View file

@ -1,5 +1,4 @@
import { assertNever } from '@mtcute/core' import { assertNever, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike, TypingStatus } from '../../types' import { InputPeerLike, TypingStatus } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { TakeoutSession } from '../../types' import { TakeoutSession } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputStickerSetItem, StickerSet } from '../../types' import { InputStickerSetItem, StickerSet } from '../../types'

View file

@ -1,5 +1,4 @@
import { MtArgumentError } from '@mtcute/core' import { MtArgumentError, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { import {

View file

@ -1,5 +1,5 @@
import { tl } from '@mtcute/core'
import { fileIdToInputDocument, tdFileId } from '@mtcute/file-id' import { fileIdToInputDocument, tdFileId } from '@mtcute/file-id'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { StickerSet } from '../../types' import { StickerSet } from '../../types'

View file

@ -1,6 +1,5 @@
import { MtTypeAssertionError } from '@mtcute/core' import { MtTypeAssertionError, tl } from '@mtcute/core'
import { assertTypeIs } from '@mtcute/core/utils' import { assertTypeIs } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { Sticker } from '../../types' import { Sticker } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { StickerSet } from '../../types' import { StickerSet } from '../../types'

View file

@ -1,5 +1,5 @@
import { tl } from '@mtcute/core'
import { fileIdToInputDocument, tdFileId } from '@mtcute/file-id' import { fileIdToInputDocument, tdFileId } from '@mtcute/file-id'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { StickerSet } from '../../types' import { StickerSet } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputFileLike, StickerSet } from '../../types' import { InputFileLike, StickerSet } from '../../types'

View file

@ -1,5 +1,5 @@
/* eslint-disable max-depth */ /* eslint-disable max-depth */
import { assertNever, MtArgumentError } from '@mtcute/core' import { assertNever, MtArgumentError, tl } from '@mtcute/core'
import { import {
AsyncLock, AsyncLock,
ConditionVariable, ConditionVariable,
@ -11,7 +11,6 @@ import {
SortedLinkedList, SortedLinkedList,
toggleChannelIdMark, toggleChannelIdMark,
} from '@mtcute/core/utils' } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../client' import { TelegramClient } from '../client'
import { PeersIndex } from '../types' import { PeersIndex } from '../types'

View file

@ -1,6 +1,5 @@
import { MaybeArray } from '@mtcute/core' import { MaybeArray, tl } from '@mtcute/core'
import { fileIdToInputPhoto } from '@mtcute/file-id' import { fileIdToInputPhoto } from '@mtcute/file-id'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'

View file

@ -1,6 +1,6 @@
import Long from 'long' import Long from 'long'
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike, Photo } from '../../types' import { InputPeerLike, Photo } from '../../types'

View file

@ -1,6 +1,6 @@
import Long from 'long' import Long from 'long'
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike, Photo } from '../../types' import { InputPeerLike, Photo } from '../../types'

View file

@ -1,6 +1,6 @@
import { asyncPool } from 'eager-async-pool' import { asyncPool } from 'eager-async-pool'
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike } from '../../types' import { InputPeerLike } from '../../types'

View file

@ -1,8 +1,7 @@
import Long from 'long' import Long from 'long'
import { getBasicPeerType, getMarkedPeerId, MtTypeAssertionError, toggleChannelIdMark } from '@mtcute/core' import { getBasicPeerType, getMarkedPeerId, MtTypeAssertionError, tl, toggleChannelIdMark } from '@mtcute/core'
import { assertTypeIs } from '@mtcute/core/utils' import { assertTypeIs } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputPeerLike, MtPeerNotFoundError } from '../../types' import { InputPeerLike, MtPeerNotFoundError } from '../../types'

View file

@ -1,6 +1,5 @@
import { MtArgumentError } from '@mtcute/core' import { MtArgumentError, tl } from '@mtcute/core'
import { fileIdToInputPhoto, tdFileId } from '@mtcute/file-id' import { fileIdToInputPhoto, tdFileId } from '@mtcute/file-id'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { InputFileLike, Photo } from '../../types' import { InputFileLike, Photo } from '../../types'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { makeInspectable } from '../utils' import { makeInspectable } from '../utils'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { MessageEntity } from '../messages' import { MessageEntity } from '../messages'
import { makeInspectable } from '../utils' import { makeInspectable } from '../utils'

View file

@ -1,5 +1,4 @@
import { BasicPeerType, getBasicPeerType, getMarkedPeerId, MtArgumentError } from '@mtcute/core' import { BasicPeerType, getBasicPeerType, getMarkedPeerId, MtArgumentError, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { encodeInlineMessageId } from '../../utils/inline-utils' import { encodeInlineMessageId } from '../../utils/inline-utils'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { InputPeerLike } from '../peers' import { InputPeerLike } from '../peers'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { PeersIndex, User } from '../peers' import { PeersIndex, User } from '../peers'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { Location } from '../media' import { Location } from '../media'

View file

@ -1,5 +1,4 @@
import { assertNever } from '@mtcute/core' import { assertNever, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../../client' import { TelegramClient } from '../../../client'
import { InputMediaContact, InputMediaGeo, InputMediaGeoLive, InputMediaVenue } from '../../media' import { InputMediaContact, InputMediaGeo, InputMediaGeoLive, InputMediaVenue } from '../../media'

View file

@ -1,6 +1,5 @@
import { MtArgumentError } from '@mtcute/core' import { MtArgumentError, tl } from '@mtcute/core'
import { fileIdToInputDocument, fileIdToInputPhoto } from '@mtcute/file-id' import { fileIdToInputDocument, fileIdToInputPhoto } from '@mtcute/file-id'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../../client' import { TelegramClient } from '../../../client'
import { extractFileName } from '../../../utils/file-utils' import { extractFileName } from '../../../utils/file-utils'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import type { InlineKeyboardMarkup, ReplyKeyboardMarkup } from './keyboards' import type { InlineKeyboardMarkup, ReplyKeyboardMarkup } from './keyboards'

View file

@ -1,5 +1,4 @@
import { assertNever } from '@mtcute/core' import { assertNever, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { normalizeToInputUser } from '../../utils/peer-utils' import { normalizeToInputUser } from '../../utils/peer-utils'
import { BotKeyboardBuilder } from './keyboard-builder' import { BotKeyboardBuilder } from './keyboard-builder'

View file

@ -1,3 +1,5 @@
import { assertNever, tl } from '@mtcute/core'
/** /**
* Phone call discard reason. Can be: * Phone call discard reason. Can be:
* - `missed`: The call was missed * - `missed`: The call was missed
@ -5,9 +7,6 @@
* - `hangup`: The call was ended normally * - `hangup`: The call was ended normally
* - `busy`: The call was discarded because the user is in another call * - `busy`: The call was discarded because the user is in another call
*/ */
import { assertNever } from '@mtcute/core'
import { tl } from '@mtcute/tl'
export type CallDiscardReason = 'missed' | 'disconnect' | 'hangup' | 'busy' export type CallDiscardReason = 'missed' | 'disconnect' | 'hangup' | 'busy'
/** @internal */ /** @internal */

View file

@ -1,7 +1,6 @@
/* eslint-disable dot-notation */ /* eslint-disable dot-notation */
import { getMarkedPeerId, MaybeAsync, MtArgumentError, MtTimeoutError } from '@mtcute/core' import { getMarkedPeerId, MaybeAsync, MtArgumentError, MtTimeoutError, tl } from '@mtcute/core'
import { AsyncLock, ControllablePromise, createControllablePromise, Deque } from '@mtcute/core/utils' import { AsyncLock, ControllablePromise, createControllablePromise, Deque } from '@mtcute/core/utils'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../client' import { TelegramClient } from '../client'
import { InputMediaLike } from './media' import { InputMediaLike } from './media'

View file

@ -1,6 +1,6 @@
import { Readable } from 'stream' import { Readable } from 'stream'
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { makeInspectable } from '../utils' import { makeInspectable } from '../utils'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
/** /**
* Describes a file uploaded to the Telegram servers * Describes a file uploaded to the Telegram servers

View file

@ -1,8 +1,8 @@
import type { ReadStream } from 'fs' import type { ReadStream } from 'fs'
import type { Readable } from 'stream' import type { Readable } from 'stream'
import { tl } from '@mtcute/core'
import { tdFileId } from '@mtcute/file-id' import { tdFileId } from '@mtcute/file-id'
import { tl } from '@mtcute/tl'
import { FileLocation } from './file-location' import { FileLocation } from './file-location'
import { UploadedFile } from './uploaded-file' import { UploadedFile } from './uploaded-file'

View file

@ -1,5 +1,4 @@
import { MtArgumentError } from '@mtcute/core' import { MtArgumentError, tl } from '@mtcute/core'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { makeInspectable } from '../utils' import { makeInspectable } from '../utils'

View file

@ -1,5 +1,5 @@
import { tl } from '@mtcute/core'
import { tdFileId } from '@mtcute/file-id' import { tdFileId } from '@mtcute/file-id'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { makeInspectable } from '../utils' import { makeInspectable } from '../utils'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { makeInspectable } from '../utils' import { makeInspectable } from '../utils'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { makeInspectable } from '../utils' import { makeInspectable } from '../utils'

View file

@ -1,4 +1,4 @@
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/core'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { Audio } from './audio' import { Audio } from './audio'

View file

@ -1,5 +1,5 @@
import { tl } from '@mtcute/core'
import { tdFileId as td, toFileId, toUniqueFileId } from '@mtcute/file-id' import { tdFileId as td, toFileId, toUniqueFileId } from '@mtcute/file-id'
import { tl } from '@mtcute/tl'
import { TelegramClient } from '../../client' import { TelegramClient } from '../../client'
import { FileLocation } from '../files' import { FileLocation } from '../files'

Some files were not shown because too many files have changed in this diff Show more