fix: fixed build for other packages

This commit is contained in:
alina 🌸 2024-02-02 04:12:02 +03:00
parent c8e026dc03
commit 4e78b643df
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
9 changed files with 16 additions and 11 deletions

View file

@ -1,7 +1,7 @@
import { Parser } from 'htmlparser2' import { Parser } from 'htmlparser2'
import Long from 'long' import Long from 'long'
import type { InputText, MessageEntity, TextWithEntities, tl } from '@mtcute/client' import type { InputText, MessageEntity, TextWithEntities, tl } from '@mtcute/core'
const MENTION_REGEX = /^tg:\/\/user\?id=(\d+)(?:&hash=(-?[0-9a-fA-F]+)(?:&|$)|&|$)/ const MENTION_REGEX = /^tg:\/\/user\?id=(\d+)(?:&hash=(-?[0-9a-fA-F]+)(?:&|$)|&|$)/

View file

@ -8,6 +8,6 @@
"./src", "./src",
], ],
"references": [ "references": [
{ "path": "../client" } { "path": "../core" }
] ]
} }

View file

@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
import type { tl } from '@mtcute/client' import type { tl } from '@mtcute/core'
type Values<T> = T[keyof T] type Values<T> = T[keyof T]
type SafeGet<T, K extends string> = T extends Record<K, unknown> ? T[K] : never type SafeGet<T, K extends string> = T extends Record<K, unknown> ? T[K] : never

View file

@ -1,6 +1,6 @@
import Long from 'long' import Long from 'long'
import type { InputText, MessageEntity, TextWithEntities, tl } from '@mtcute/client' import type { InputText, MessageEntity, TextWithEntities, tl } from '@mtcute/core'
const MENTION_REGEX = /^tg:\/\/user\?id=(\d+)(?:&hash=(-?[0-9a-fA-F]+)(?:&|$)|&|$)/ const MENTION_REGEX = /^tg:\/\/user\?id=(\d+)(?:&hash=(-?[0-9a-fA-F]+)(?:&|$)|&|$)/
const EMOJI_REGEX = /^tg:\/\/emoji\?id=(-?\d+)/ const EMOJI_REGEX = /^tg:\/\/emoji\?id=(-?\d+)/

View file

@ -8,6 +8,6 @@
"./src", "./src",
], ],
"references": [ "references": [
{ "path": "../client" } { "path": "../core" }
] ]
} }

View file

@ -1,10 +1,10 @@
import { createRequire } from 'module' import { createRequire } from 'module'
import { createInterface, Interface as RlInterface } from 'readline' import { createInterface, Interface as RlInterface } from 'readline'
import { TelegramClient, TelegramClientOptions, User } from '@mtcute/client' import { TelegramClient, TelegramClientOptions, User } from '@mtcute/core'
import { SqliteStorage } from '@mtcute/sqlite' import { SqliteStorage } from '@mtcute/sqlite'
export * from '@mtcute/client' export * from '@mtcute/core'
export * from '@mtcute/html-parser' export * from '@mtcute/html-parser'
export * from '@mtcute/markdown-parser' export * from '@mtcute/markdown-parser'
export { SqliteStorage } export { SqliteStorage }
@ -29,6 +29,12 @@ try {
*/ */
export class NodeTelegramClient extends TelegramClient { export class NodeTelegramClient extends TelegramClient {
constructor(opts: TelegramClientOptions) { constructor(opts: TelegramClientOptions) {
if ('client' in opts) {
super(opts)
return
}
super({ super({
// eslint-disable-next-line // eslint-disable-next-line
crypto: nativeCrypto ? () => new nativeCrypto() : undefined, crypto: nativeCrypto ? () => new nativeCrypto() : undefined,
@ -99,6 +105,6 @@ export class NodeTelegramClient extends TelegramClient {
this.start(params) this.start(params)
.then(then) .then(then)
.catch((err) => this._emitError(err)) .catch((err) => this.emitError(err))
} }
} }

View file

@ -8,7 +8,7 @@
"./utils.ts", "./utils.ts",
], ],
"references": [ "references": [
{ "path": "../client" }, { "path": "../core" },
{ "path": "../sqlite" }, { "path": "../sqlite" },
{ "path": "../dispatcher" }, { "path": "../dispatcher" },
{ "path": "../html-parser" }, { "path": "../html-parser" },

View file

@ -2,7 +2,6 @@ module.exports = {
extends: ['../../.config/typedoc/config.base.cjs'], extends: ['../../.config/typedoc/config.base.cjs'],
entryPoints: ['./index.ts'], entryPoints: ['./index.ts'],
externalPattern: [ externalPattern: [
'../client/**',
'../core/**', '../core/**',
'../html-parser/**', '../html-parser/**',
'../markdown-parser/**', '../markdown-parser/**',

View file

@ -1 +1 @@
export * from '@mtcute/client/utils.js' export * from '@mtcute/core/utils.js'