docs: use @default jsdoc tag

This commit is contained in:
alina 🌸 2023-10-29 20:25:06 +03:00
parent 2fe228a4c7
commit 73cd1e7dc9
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
38 changed files with 179 additions and 129 deletions

View file

@ -616,7 +616,7 @@ export interface TelegramClient extends BaseTelegramClient {
/** /**
* Whether to log out if current session is logged in. * Whether to log out if current session is logged in.
* *
* Defaults to false. * @default false.
*/ */
logout?: boolean logout?: boolean
@ -703,11 +703,11 @@ export interface TelegramClient extends BaseTelegramClient {
/** /**
* Custom method that is called when a code is sent. Can be used * Custom method that is called when a code is sent. Can be used
* to show a GUI alert of some kind. * to show a GUI alert of some kind.
* Defaults to `console.log`.
* *
* This method is called *before* {@link start.params.code}. * This method is called *before* {@link start.params.code}.
* *
* @param code * @param code
* @default `console.log`.
*/ */
codeSentCallback?: (code: SentCode) => MaybeAsync<void> codeSentCallback?: (code: SentCode) => MaybeAsync<void>
}): Promise<User> }): Promise<User>
@ -855,12 +855,13 @@ export interface TelegramClient extends BaseTelegramClient {
/** /**
* Parse mode to use when parsing inline message text. * Parse mode to use when parsing inline message text.
* Defaults to current default parse mode (if any).
* *
* Passing `null` will explicitly disable formatting. * Passing `null` will explicitly disable formatting.
* *
* **Note**: inline results themselves *can not* have markup * **Note**: inline results themselves *can not* have markup
* entities, only the messages that are sent once a result is clicked. * entities, only the messages that are sent once a result is clicked.
*
* @default current default parse mode (if any).
*/ */
parseMode?: string | null parseMode?: string | null
}, },
@ -892,7 +893,7 @@ export interface TelegramClient extends BaseTelegramClient {
/** /**
* Scope of the commands. * Scope of the commands.
* *
* Defaults to `BotScope.default_` (i.e. `botCommandScopeDefault`) * @default `BotScope.default_` (i.e. `botCommandScopeDefault`)
*/ */
scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope
@ -941,7 +942,7 @@ export interface TelegramClient extends BaseTelegramClient {
/** /**
* Timeout for the query in ms. * Timeout for the query in ms.
* *
* Defaults to `10000` (10 sec) * @default `10000` (10 sec)
*/ */
timeout?: number timeout?: number
@ -994,7 +995,7 @@ export interface TelegramClient extends BaseTelegramClient {
/** /**
* Scope of the commands. * Scope of the commands.
* *
* Defaults to `BotScope.default_` (i.e. `botCommandScopeDefault`) * @default `BotScope.default_` (i.e. `botCommandScopeDefault`)
*/ */
scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope
@ -1116,7 +1117,7 @@ export interface TelegramClient extends BaseTelegramClient {
/** /**
* Scope of the commands. * Scope of the commands.
* *
* Defaults to `BotScope.default_` (i.e. `botCommandScopeDefault`) * @default `BotScope.default_` (i.e. `botCommandScopeDefault`)
*/ */
scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope
@ -1452,10 +1453,11 @@ export interface TelegramClient extends BaseTelegramClient {
params?: { params?: {
/** /**
* Search query to filter members by their display names and usernames * Search query to filter members by their display names and usernames
* Defaults to `''` (empty string)
* *
* > **Note**: Only used for these values of `filter`: * > **Note**: Only used for these values of `filter`:
* > `all, banned, restricted, mention, contacts` * > `all, banned, restricted, mention, contacts`
*
* @default `''` (empty string)
*/ */
query?: string query?: string
@ -1486,7 +1488,9 @@ export interface TelegramClient extends BaseTelegramClient {
* - `contacts`: get only contacts * - `contacts`: get only contacts
* - `mention`: get users that can be mentioned (see {@link tl.RawChannelParticipantsMentions}) * - `mention`: get users that can be mentioned (see {@link tl.RawChannelParticipantsMentions})
* *
* Only used for channels and supergroups. Defaults to `recent` * Only used for channels and supergroups.
*
* @default `recent`
*/ */
type?: 'all' | 'banned' | 'restricted' | 'bots' | 'recent' | 'admins' | 'contacts' | 'mention' type?: 'all' | 'banned' | 'restricted' | 'bots' | 'recent' | 'admins' | 'contacts' | 'mention'
}, },
@ -1584,7 +1588,7 @@ export interface TelegramClient extends BaseTelegramClient {
* Chunk size, which will be passed as `limit` parameter * Chunk size, which will be passed as `limit` parameter
* to {@link getChatMembers}. Usually you shouldn't care about this. * to {@link getChatMembers}. Usually you shouldn't care about this.
* *
* Defaults to `200` * @default `200`
*/ */
chunkSize?: number chunkSize?: number
}, },
@ -1942,7 +1946,9 @@ export interface TelegramClient extends BaseTelegramClient {
/** /**
* Whether to share your own phone number * Whether to share your own phone number
* with the newly created contact (defaults to `false`) * with the newly created contact
*
* @default false
*/ */
sharePhone?: boolean sharePhone?: boolean
}): Promise<User> }): Promise<User>
@ -2589,7 +2595,9 @@ export interface TelegramClient extends BaseTelegramClient {
* Maximum number of users that can be members of this chat * Maximum number of users that can be members of this chat
* at the same time after joining using this link. * at the same time after joining using this link.
* *
* Integer in range `[1, 99999]` or `Infinity`, defaults to `Infinity` * Integer in range `[1, 99999]` or `Infinity`
*
* @default `Infinity`
*/ */
usageLimit?: number usageLimit?: number
@ -2838,7 +2846,7 @@ export interface TelegramClient extends BaseTelegramClient {
/** /**
* Size of chunks which are fetched. Usually not needed. * Size of chunks which are fetched. Usually not needed.
* *
* Defaults to `100` * @default `100`
*/ */
chunkSize?: number chunkSize?: number
}, },
@ -2924,10 +2932,11 @@ export interface TelegramClient extends BaseTelegramClient {
text?: string | FormattedString<string> text?: string | FormattedString<string>
/** /**
* Parse mode to use to parse entities before sending * Parse mode to use to parse entities before sending the message.
* the message. Defaults to current default parse mode (if any). *
* *
* Passing `null` will explicitly disable formatting. * Passing `null` will explicitly disable formatting.
* @default current default parse mode (if any).
*/ */
parseMode?: string | null parseMode?: string | null
@ -2992,10 +3001,11 @@ export interface TelegramClient extends BaseTelegramClient {
text?: string | FormattedString<string> text?: string | FormattedString<string>
/** /**
* Parse mode to use to parse entities before sending * Parse mode to use to parse entities before sending the message.
* the message. Defaults to current default parse mode (if any).
* *
* Passing `null` will explicitly disable formatting. * Passing `null` will explicitly disable formatting.
*
* @default current default parse mode (if any).
*/ */
parseMode?: string | null parseMode?: string | null
@ -3485,10 +3495,9 @@ export interface TelegramClient extends BaseTelegramClient {
limit?: number limit?: number
/** /**
* Filter the results using some filter. * Filter the results using some filter. (see {@link SearchFilters})
* Defaults to {@link SearchFilters.Empty} (i.e. will return all messages)
* *
* @link SearchFilters * @default {@link SearchFilters.Empty} (i.e. will return all messages)
*/ */
filter?: tl.TypeMessagesFilter filter?: tl.TypeMessagesFilter
@ -3572,14 +3581,14 @@ export interface TelegramClient extends BaseTelegramClient {
/** /**
* Minimum message date to return * Minimum message date to return
* *
* Defaults to `0` (disabled). * @default `0` (disabled).
*/ */
minDate?: number | Date minDate?: number | Date
/** /**
* Maximum message date to return * Maximum message date to return
* *
* Defaults to `0` (disabled). * @default `0` (disabled).
*/ */
maxDate?: number | Date maxDate?: number | Date
@ -3596,10 +3605,9 @@ export interface TelegramClient extends BaseTelegramClient {
limit?: number limit?: number
/** /**
* Filter the results using some filter. * Filter the results using some filter (see {@link SearchFilters})
* Defaults to {@link SearchFilters.Empty} (i.e. will return all messages)
* *
* @link SearchFilters * @default {@link SearchFilters.Empty} (i.e. will return all messages)
*/ */
filter?: tl.TypeMessagesFilter filter?: tl.TypeMessagesFilter
@ -4181,18 +4189,26 @@ export interface TelegramClient extends BaseTelegramClient {
/** /**
* Type of the stickers in this set. * Type of the stickers in this set.
* Defaults to `sticker`, i.e. regular stickers.
* *
* Creating `emoji` stickers via API is not supported yet * @default `sticker`, i.e. regular stickers.
*/ */
type?: StickerType type?: StickerType
/** /**
* File source type for the stickers in this set. * File source type for the stickers in this set.
* Defaults to `static`, i.e. regular WEBP stickers. *
* @default `static`, i.e. regular WEBP stickers.
*/ */
sourceType?: StickerSourceType sourceType?: StickerSourceType
/**
* Whether to create "adaptive" emoji set.
*
* Color of the emoji will be changed depending on the text color.
* Only works for TGS-based emoji stickers
*/
adaptive?: boolean
/** /**
* List of stickers to be immediately added into the pack. * List of stickers to be immediately added into the pack.
* There must be at least one sticker in this list. * There must be at least one sticker in this list.
@ -4414,10 +4430,10 @@ export interface TelegramClient extends BaseTelegramClient {
entities?: tl.TypeMessageEntity[] entities?: tl.TypeMessageEntity[]
/** /**
* Parse mode to use to parse entities before sending * Parse mode to use to parse entities before sending the message.
* the message. Defaults to current default parse mode (if any).
*
* Passing `null` will explicitly disable formatting. * Passing `null` will explicitly disable formatting.
*
* @default current default parse mode (if any).
*/ */
parseMode?: string | null parseMode?: string | null
@ -4449,6 +4465,7 @@ export interface TelegramClient extends BaseTelegramClient {
*/ */
archived?: boolean archived?: boolean
}): Promise<AllStories> }): Promise<AllStories>
/** /**
* Get information about boosts in a channel * Get information about boosts in a channel
* *
@ -4797,10 +4814,10 @@ export interface TelegramClient extends BaseTelegramClient {
entities?: tl.TypeMessageEntity[] entities?: tl.TypeMessageEntity[]
/** /**
* Parse mode to use to parse entities before sending * Parse mode to use to parse entities before sending the message.
* the message. Defaults to current default parse mode (if any).
*
* Passing `null` will explicitly disable formatting. * Passing `null` will explicitly disable formatting.
*
* @default current default parse mode (if any).
*/ */
parseMode?: string | null parseMode?: string | null

View file

@ -20,7 +20,7 @@ export async function startTest(
/** /**
* Whether to log out if current session is logged in. * Whether to log out if current session is logged in.
* *
* Defaults to false. * @default false.
*/ */
logout?: boolean logout?: boolean

View file

@ -82,11 +82,11 @@ export async function start(
/** /**
* Custom method that is called when a code is sent. Can be used * Custom method that is called when a code is sent. Can be used
* to show a GUI alert of some kind. * to show a GUI alert of some kind.
* Defaults to `console.log`.
* *
* This method is called *before* {@link start.params.code}. * This method is called *before* {@link start.params.code}.
* *
* @param code * @param code
* @default `console.log`.
*/ */
codeSentCallback?: (code: SentCode) => MaybeAsync<void> codeSentCallback?: (code: SentCode) => MaybeAsync<void>
}, },

View file

@ -99,12 +99,13 @@ export async function answerInlineQuery(
/** /**
* Parse mode to use when parsing inline message text. * Parse mode to use when parsing inline message text.
* Defaults to current default parse mode (if any).
* *
* Passing `null` will explicitly disable formatting. * Passing `null` will explicitly disable formatting.
* *
* **Note**: inline results themselves *can not* have markup * **Note**: inline results themselves *can not* have markup
* entities, only the messages that are sent once a result is clicked. * entities, only the messages that are sent once a result is clicked.
*
* @default current default parse mode (if any).
*/ */
parseMode?: string | null parseMode?: string | null
}, },

View file

@ -16,7 +16,7 @@ export async function deleteMyCommands(
/** /**
* Scope of the commands. * Scope of the commands.
* *
* Defaults to `BotScope.default_` (i.e. `botCommandScopeDefault`) * @default `BotScope.default_` (i.e. `botCommandScopeDefault`)
*/ */
scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope

View file

@ -19,7 +19,7 @@ export async function getCallbackAnswer(
/** /**
* Timeout for the query in ms. * Timeout for the query in ms.
* *
* Defaults to `10000` (10 sec) * @default `10000` (10 sec)
*/ */
timeout?: number timeout?: number

View file

@ -15,7 +15,7 @@ export async function getMyCommands(
/** /**
* Scope of the commands. * Scope of the commands.
* *
* Defaults to `BotScope.default_` (i.e. `botCommandScopeDefault`) * @default `BotScope.default_` (i.e. `botCommandScopeDefault`)
*/ */
scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope

View file

@ -21,7 +21,7 @@ export async function setMyCommands(
/** /**
* Scope of the commands. * Scope of the commands.
* *
* Defaults to `BotScope.default_` (i.e. `botCommandScopeDefault`) * @default `BotScope.default_` (i.e. `botCommandScopeDefault`)
*/ */
scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope

View file

@ -20,10 +20,11 @@ export async function getChatMembers(
params?: { params?: {
/** /**
* Search query to filter members by their display names and usernames * Search query to filter members by their display names and usernames
* Defaults to `''` (empty string)
* *
* > **Note**: Only used for these values of `filter`: * > **Note**: Only used for these values of `filter`:
* > `all, banned, restricted, mention, contacts` * > `all, banned, restricted, mention, contacts`
*
* @default `''` (empty string)
*/ */
query?: string query?: string
@ -54,7 +55,9 @@ export async function getChatMembers(
* - `contacts`: get only contacts * - `contacts`: get only contacts
* - `mention`: get users that can be mentioned (see {@link tl.RawChannelParticipantsMentions}) * - `mention`: get users that can be mentioned (see {@link tl.RawChannelParticipantsMentions})
* *
* Only used for channels and supergroups. Defaults to `recent` * Only used for channels and supergroups.
*
* @default `recent`
*/ */
type?: 'all' | 'banned' | 'restricted' | 'bots' | 'recent' | 'admins' | 'contacts' | 'mention' type?: 'all' | 'banned' | 'restricted' | 'bots' | 'recent' | 'admins' | 'contacts' | 'mention'
}, },

View file

@ -23,7 +23,7 @@ export async function* iterChatMembers(
* Chunk size, which will be passed as `limit` parameter * Chunk size, which will be passed as `limit` parameter
* to {@link getChatMembers}. Usually you shouldn't care about this. * to {@link getChatMembers}. Usually you shouldn't care about this.
* *
* Defaults to `200` * @default `200`
*/ */
chunkSize?: number chunkSize?: number
}, },

View file

@ -31,7 +31,9 @@ export async function addContact(
/** /**
* Whether to share your own phone number * Whether to share your own phone number
* with the newly created contact (defaults to `false`) * with the newly created contact
*
* @default false
*/ */
sharePhone?: boolean sharePhone?: boolean
}, },

View file

@ -23,7 +23,8 @@ export async function uploadMedia(
params: { params: {
/** /**
* Peer to associate this media with. * Peer to associate this media with.
* Defaults to `self` *
* @default `self`
*/ */
peer?: InputPeerLike peer?: InputPeerLike

View file

@ -26,7 +26,9 @@ export async function createInviteLink(
* Maximum number of users that can be members of this chat * Maximum number of users that can be members of this chat
* at the same time after joining using this link. * at the same time after joining using this link.
* *
* Integer in range `[1, 99999]` or `Infinity`, defaults to `Infinity` * Integer in range `[1, 99999]` or `Infinity`
*
* @default `Infinity`
*/ */
usageLimit?: number usageLimit?: number

View file

@ -28,7 +28,7 @@ export async function* iterInviteLinks(
/** /**
* Size of chunks which are fetched. Usually not needed. * Size of chunks which are fetched. Usually not needed.
* *
* Defaults to `100` * @default `100`
*/ */
chunkSize?: number chunkSize?: number
}, },

View file

@ -30,10 +30,11 @@ export async function editInlineMessage(
text?: string | FormattedString<string> text?: string | FormattedString<string>
/** /**
* Parse mode to use to parse entities before sending * Parse mode to use to parse entities before sending the message.
* the message. Defaults to current default parse mode (if any). *
* *
* Passing `null` will explicitly disable formatting. * Passing `null` will explicitly disable formatting.
* @default current default parse mode (if any).
*/ */
parseMode?: string | null parseMode?: string | null

View file

@ -32,10 +32,11 @@ export async function editMessage(
text?: string | FormattedString<string> text?: string | FormattedString<string>
/** /**
* Parse mode to use to parse entities before sending * Parse mode to use to parse entities before sending the message.
* the message. Defaults to current default parse mode (if any).
* *
* Passing `null` will explicitly disable formatting. * Passing `null` will explicitly disable formatting.
*
* @default current default parse mode (if any).
*/ */
parseMode?: string | null parseMode?: string | null

View file

@ -31,9 +31,10 @@ export interface ForwardMessageOptions {
/** /**
* Parse mode to use to parse entities in caption. * Parse mode to use to parse entities in caption.
* Defaults to current default parse mode (if any).
* *
* Passing `null` will explicitly disable formatting. * Passing `null` will explicitly disable formatting.
*
* @default current default parse mode (if any).
*/ */
parseMode?: string | null parseMode?: string | null
@ -63,7 +64,7 @@ export interface ForwardMessageOptions {
/** /**
* Whether to clear draft after sending this message (only used for caption) * Whether to clear draft after sending this message (only used for caption)
* *
* Defaults to `false` * @default `false`
*/ */
clearDraft?: boolean clearDraft?: boolean

View file

@ -42,10 +42,9 @@ export async function searchGlobal(
limit?: number limit?: number
/** /**
* Filter the results using some filter. * Filter the results using some filter. (see {@link SearchFilters})
* Defaults to {@link SearchFilters.Empty} (i.e. will return all messages)
* *
* @link SearchFilters * @default {@link SearchFilters.Empty} (i.e. will return all messages)
*/ */
filter?: tl.TypeMessagesFilter filter?: tl.TypeMessagesFilter

View file

@ -73,14 +73,14 @@ export async function searchMessages(
/** /**
* Minimum message date to return * Minimum message date to return
* *
* Defaults to `0` (disabled). * @default `0` (disabled).
*/ */
minDate?: number | Date minDate?: number | Date
/** /**
* Maximum message date to return * Maximum message date to return
* *
* Defaults to `0` (disabled). * @default `0` (disabled).
*/ */
maxDate?: number | Date maxDate?: number | Date
@ -97,10 +97,9 @@ export async function searchMessages(
limit?: number limit?: number
/** /**
* Filter the results using some filter. * Filter the results using some filter (see {@link SearchFilters})
* Defaults to {@link SearchFilters.Empty} (i.e. will return all messages)
* *
* @link SearchFilters * @default {@link SearchFilters.Empty} (i.e. will return all messages)
*/ */
filter?: tl.TypeMessagesFilter filter?: tl.TypeMessagesFilter

View file

@ -28,7 +28,7 @@ export interface CommonSendParams {
* *
* Incurs an additional request, so only use when really needed. * Incurs an additional request, so only use when really needed.
* *
* Defaults to `false` * @default `false`
*/ */
mustReply?: boolean mustReply?: boolean
@ -62,10 +62,10 @@ export interface CommonSendParams {
quoteEntities?: tl.TypeMessageEntity[] quoteEntities?: tl.TypeMessageEntity[]
/** /**
* Parse mode to use to parse entities before sending * Parse mode to use to parse entities before sending the message.
* the message. Defaults to current default parse mode (if any).
*
* Passing `null` will explicitly disable formatting. * Passing `null` will explicitly disable formatting.
*
* @default current default parse mode (if any).
*/ */
parseMode?: string | null parseMode?: string | null
@ -86,7 +86,7 @@ export interface CommonSendParams {
/** /**
* Whether to clear draft after sending this message. * Whether to clear draft after sending this message.
* *
* Defaults to `false` * @default `false`
*/ */
clearDraft?: boolean clearDraft?: boolean

View file

@ -19,9 +19,10 @@ export interface SendCopyParams extends CommonSendParams {
/** /**
* Parse mode to use to parse `text` entities before sending * Parse mode to use to parse `text` entities before sending
* the message. Defaults to current default parse mode (if any). * the message.
*
* Passing `null` will explicitly disable formatting. * Passing `null` will explicitly disable formatting.
*
* @default current default parse mode (if any).
*/ */
parseMode?: string | null parseMode?: string | null

View file

@ -1,4 +1,4 @@
import { BaseTelegramClient, MtArgumentError, tl } from '@mtcute/core' import { BaseTelegramClient, tl } from '@mtcute/core'
import { import {
InputFileLike, InputFileLike,
@ -49,18 +49,26 @@ export async function createStickerSet(
/** /**
* Type of the stickers in this set. * Type of the stickers in this set.
* Defaults to `sticker`, i.e. regular stickers.
* *
* Creating `emoji` stickers via API is not supported yet * @default `sticker`, i.e. regular stickers.
*/ */
type?: StickerType type?: StickerType
/** /**
* File source type for the stickers in this set. * File source type for the stickers in this set.
* Defaults to `static`, i.e. regular WEBP stickers. *
* @default `static`, i.e. regular WEBP stickers.
*/ */
sourceType?: StickerSourceType sourceType?: StickerSourceType
/**
* Whether to create "adaptive" emoji set.
*
* Color of the emoji will be changed depending on the text color.
* Only works for TGS-based emoji stickers
*/
adaptive?: boolean
/** /**
* List of stickers to be immediately added into the pack. * List of stickers to be immediately added into the pack.
* There must be at least one sticker in this list. * There must be at least one sticker in this list.
@ -89,10 +97,6 @@ export async function createStickerSet(
progressCallback?: (idx: number, uploaded: number, total: number) => void progressCallback?: (idx: number, uploaded: number, total: number) => void
}, },
): Promise<StickerSet> { ): Promise<StickerSet> {
if (params.type === 'emoji') {
throw new MtArgumentError('Creating emoji stickers is not supported yet by the API')
}
const owner = normalizeToInputUser(await resolvePeer(client, params.owner), params.owner) const owner = normalizeToInputUser(await resolvePeer(client, params.owner), params.owner)
const inputStickers: tl.TypeInputStickerSetItem[] = [] const inputStickers: tl.TypeInputStickerSetItem[] = []
@ -127,8 +131,8 @@ export async function createStickerSet(
animated: params.sourceType === 'animated', animated: params.sourceType === 'animated',
videos: params.sourceType === 'video', videos: params.sourceType === 'video',
masks: params.type === 'mask', masks: params.type === 'mask',
// currently not supported emojis: params.type === 'emoji',
// emojis: params.type === 'emoji', textColor: params.adaptive,
userId: owner, userId: owner,
title: params.title, title: params.title,
shortName: params.shortName, shortName: params.shortName,

View file

@ -43,10 +43,10 @@ export async function editStory(
entities?: tl.TypeMessageEntity[] entities?: tl.TypeMessageEntity[]
/** /**
* Parse mode to use to parse entities before sending * Parse mode to use to parse entities before sending the message.
* the message. Defaults to current default parse mode (if any).
*
* Passing `null` will explicitly disable formatting. * Passing `null` will explicitly disable formatting.
*
* @default current default parse mode (if any).
*/ */
parseMode?: string | null parseMode?: string | null

View file

@ -4,6 +4,7 @@ import { InputPeerLike } from '../../types/index.js'
import { BoostStats } from '../../types/stories/boost-stats.js' import { BoostStats } from '../../types/stories/boost-stats.js'
import { resolvePeer } from '../users/resolve-peer.js' import { resolvePeer } from '../users/resolve-peer.js'
// @available=user
/** /**
* Get information about boosts in a channel * Get information about boosts in a channel
* *

View file

@ -42,10 +42,10 @@ export async function sendStory(
entities?: tl.TypeMessageEntity[] entities?: tl.TypeMessageEntity[]
/** /**
* Parse mode to use to parse entities before sending * Parse mode to use to parse entities before sending the message.
* the message. Defaults to current default parse mode (if any).
*
* Passing `null` will explicitly disable formatting. * Passing `null` will explicitly disable formatting.
*
* @default current default parse mode (if any).
*/ */
parseMode?: string | null parseMode?: string | null

View file

@ -60,7 +60,7 @@ export interface InputInlineResultArticle extends BaseInputInlineResult {
* Whether to prevent article URL from * Whether to prevent article URL from
* displaying by the client * displaying by the client
* *
* Defaults to `false` * @default `false`
*/ */
hideUrl?: boolean hideUrl?: boolean
@ -88,10 +88,11 @@ export interface InputInlineResultGif extends BaseInputInlineResult {
media: string | tl.RawInputWebDocument | tl.RawInputDocument media: string | tl.RawInputWebDocument | tl.RawInputDocument
/** /**
* Media MIME type, defaults to `video/mp4`, only applicable * Media MIME type, only applicable to URLs.
* to URLs.
* *
* Usually unnecessary, since Telegram automatically infers it. * Usually unnecessary, since Telegram automatically infers it.
*
* @default `video/mp4`
*/ */
mime?: string mime?: string
@ -106,13 +107,16 @@ export interface InputInlineResultGif extends BaseInputInlineResult {
description?: string description?: string
/** /**
* Animation thumbnail URL. Defaults to `media`, * Animation thumbnail URL, only applicable in case `media` is a URL
* only applicable in case `media` is a URL *
* @default `media`
*/ */
thumb?: string | tl.RawInputWebDocument thumb?: string | tl.RawInputWebDocument
/** /**
* Thumbnail MIME type (defaults to `image/jpeg`) * Thumbnail MIME type
*
* @default `image/jpeg`
*/ */
thumbMime?: string thumbMime?: string
@ -167,10 +171,11 @@ export interface InputInlineResultVideo extends BaseInputInlineResult {
description?: string description?: string
/** /**
* Video thumbnail URL (must be jpeg). Defaults to `media`, * Video thumbnail URL (must be jpeg), only applicable in case `media` is a URL.
* only applicable in case `media` is a URL.
* *
* Must be provided explicitly if this is a video loaded by URL. * Must be provided explicitly if this is a video loaded by URL.
*
* @default `media`
*/ */
thumb?: string | tl.RawInputWebDocument thumb?: string | tl.RawInputWebDocument
@ -208,9 +213,11 @@ export interface InputInlineResultAudio extends BaseInputInlineResult {
media: string | tl.RawInputWebDocument | tl.RawInputDocument media: string | tl.RawInputWebDocument | tl.RawInputDocument
/** /**
* MIME type of the audio file, defaults to `audio/mpeg` * MIME type of the audio file
* *
* Usually unnecessary, since Telegram infers it automatically. * Usually unnecessary, since Telegram infers it automatically.
*
* @default `audio/mpeg`
*/ */
mime?: string mime?: string
@ -296,8 +303,9 @@ export interface InputInlineResultPhoto extends BaseInputInlineResult {
height?: number height?: number
/** /**
* Photo thumbnail URL (must be jpeg). Defaults to `media`, * Photo thumbnail URL (must be jpeg), only applicable in case `media` is a URL
* only applicable in case `media` is a URL *
* @default `media`
*/ */
thumb?: string | tl.RawInputWebDocument thumb?: string | tl.RawInputWebDocument
} }
@ -355,8 +363,9 @@ export interface InputInlineResultFile extends BaseInputInlineResult {
description?: string description?: string
/** /**
* Photo thumbnail URL (must be jpeg). Defaults to `media`, * Photo thumbnail URL (must be jpeg), only applicable in case `media` is a URL
* only applicable in case `media` is a URL *
* @default `media`
*/ */
thumb?: string | tl.RawInputWebDocument thumb?: string | tl.RawInputWebDocument
} }

View file

@ -302,7 +302,7 @@ export namespace BotKeyboard {
* `url` domain must be the same as the domain linked * `url` domain must be the same as the domain linked
* with the bot. * with the bot.
* *
* Defaults to current bot * @default current bot
*/ */
bot?: tl.TypeInputUser bot?: tl.TypeInputUser
} = {}, } = {},

View file

@ -367,7 +367,7 @@ export class Conversation {
/** /**
* Message for which to wait for response for. * Message for which to wait for response for.
* *
* Defaults to last sent/received message * @default last sent/received message
*/ */
message?: number message?: number
@ -376,7 +376,7 @@ export class Conversation {
* *
* When the timeout is reached, `TimeoutError` is thrown. * When the timeout is reached, `TimeoutError` is thrown.
* *
* Defaults to `15000` (15 sec) * @default `15000` (15 sec)
*/ */
timeout?: number | null timeout?: number | null
}, },
@ -403,7 +403,7 @@ export class Conversation {
/** /**
* Message for which to wait for reply for. * Message for which to wait for reply for.
* *
* Defaults to last sent/received message * @default last sent/received message
*/ */
message?: number message?: number
@ -412,7 +412,7 @@ export class Conversation {
* *
* When the timeout is reached, `TimeoutError` is thrown. * When the timeout is reached, `TimeoutError` is thrown.
* *
* Defaults to `15000` (15 sec) * @default `15000` (15 sec)
*/ */
timeout?: number | null timeout?: number | null
}, },
@ -446,7 +446,7 @@ export class Conversation {
/** /**
* Message for which to wait for reply for. * Message for which to wait for reply for.
* *
* Defaults to last received message * @default last received message
*/ */
message?: number message?: number
@ -455,7 +455,7 @@ export class Conversation {
* *
* When the timeout is reached, `TimeoutError` is thrown. * When the timeout is reached, `TimeoutError` is thrown.
* *
* Defaults to `15000` (15 sec) * @default `15000` (15 sec)
*/ */
timeout?: number | null timeout?: number | null
}, },

View file

@ -170,9 +170,9 @@ export interface InputMediaSticker extends FileMixin, CaptionMixin {
* Note that animated stickers must be in TGS * Note that animated stickers must be in TGS
* format, which is Lottie JSON compressed using GZip * format, which is Lottie JSON compressed using GZip
* *
* Defaults to `false`
*
* Only applicable to newly uploaded files. * Only applicable to newly uploaded files.
*
* @default false
*/ */
isAnimated?: boolean isAnimated?: boolean

View file

@ -39,28 +39,28 @@ export class RawLocation {
/** /**
* Map width in pixels before applying scale (16-1024) * Map width in pixels before applying scale (16-1024)
* *
* Defaults to `128` * @default `128`
*/ */
width?: number width?: number
/** /**
* Map height in pixels before applying scale (16-1024) * Map height in pixels before applying scale (16-1024)
* *
* Defaults to `128` * @default `128`
*/ */
height?: number height?: number
/** /**
* Map zoom level (13-20) * Map zoom level (13-20)
* *
* Defaults to `15` * @default `15`
*/ */
zoom?: number zoom?: number
/** /**
* Map scale (1-3) * Map scale (1-3)
* *
* Defaults to `1` * @default `1`
*/ */
scale?: number scale?: number
} = {}, } = {},

View file

@ -19,7 +19,9 @@ export interface PollAnswer {
/** /**
* Number of people who has chosen this result. * Number of people who has chosen this result.
* If not available (i.e. not voted yet), defaults to `0` * If not available (i.e. not voted yet)
*
* @default `0`
*/ */
voters: number voters: number
@ -30,7 +32,9 @@ export interface PollAnswer {
/** /**
* Whether this answer is correct (for quizzes). * Whether this answer is correct (for quizzes).
* Not available before choosing an answer, and defaults to `false` * Not available before choosing an answer
*
* @default `false`
*/ */
correct: boolean correct: boolean
} }

View file

@ -68,7 +68,8 @@ export interface BaseTelegramClientOptions {
* Can be used to connect to other networks (like test DCs). * Can be used to connect to other networks (like test DCs).
* *
* When session already contains primary DC, this parameter is ignored. * When session already contains primary DC, this parameter is ignored.
* Defaults to Production DC 2. *
* @default Production DC 2.
*/ */
defaultDcs?: ITelegramStorage.DcOptions defaultDcs?: ITelegramStorage.DcOptions
@ -91,13 +92,15 @@ export interface BaseTelegramClientOptions {
/** /**
* Transport factory to use in the client. * Transport factory to use in the client.
* Defaults to platform-specific transport: WebSocket on the web, TCP in node *
* @default platform-specific transport: WebSocket on the web, TCP in node
*/ */
transport?: TransportFactory transport?: TransportFactory
/** /**
* Reconnection strategy. * Reconnection strategy.
* Defaults to simple reconnection strategy: first 0ms, then up to 5s (increasing by 1s) *
* @default simple reconnection strategy: first 0ms, then up to 5s (increasing by 1s)
*/ */
reconnectionStrategy?: ReconnectionStrategy<PersistentConnectionParams> reconnectionStrategy?: ReconnectionStrategy<PersistentConnectionParams>

View file

@ -91,7 +91,8 @@ export interface NetworkManagerExtraParams {
/** /**
* Idle timeout for non-main connections, in ms * Idle timeout for non-main connections, in ms
* Defaults to 60 seconds. *
* @default 60000 (60 seconds).
*/ */
inactivityTimeout?: number inactivityTimeout?: number
} }

View file

@ -22,14 +22,14 @@ export class JsonFileStorage extends JsonMemoryStorage {
* a blank file because of the app being stopped while * a blank file because of the app being stopped while
* the storage is being written. * the storage is being written.
* *
* Defaults to `true` * @default `true`
*/ */
safe?: boolean safe?: boolean
/** /**
* Whether to save file on process exit. * Whether to save file on process exit.
* *
* Defaults to `true` * @default `true`
*/ */
cleanup?: boolean cleanup?: boolean
}, },

View file

@ -74,7 +74,7 @@ export class MemoryStorage implements ITelegramStorage /*, IStateStorage*/ {
* by a local storage), and only available within * by a local storage), and only available within
* the current runtime. * the current runtime.
* *
* Defaults to `100`, use `0` to disable * @default `100`, use `0` to disable
*/ */
cacheSize?: number cacheSize?: number
@ -84,7 +84,7 @@ export class MemoryStorage implements ITelegramStorage /*, IStateStorage*/ {
* When vacuuming, the storage will remove expired FSM * When vacuuming, the storage will remove expired FSM
* states to reduce memory usage. * states to reduce memory usage.
* *
* Defaults to `300_000` (5 minutes) * @default `300_000` (5 minutes)
*/ */
vacuumInterval?: number vacuumInterval?: number
}) { }) {

View file

@ -25,7 +25,7 @@ export interface MtcuteI18nParameters<Strings extends I18nStrings, Input> {
/** /**
* Language that will be used if no language is specified * Language that will be used if no language is specified
* *
* Defaults to {@link primaryLanguage} * @default {@link primaryLanguage}
*/ */
defaultLanguage?: string defaultLanguage?: string

View file

@ -29,7 +29,7 @@ export interface NodeTelegramClientOptions extends Omit<TelegramClientOptions, '
* Both HTML and Markdown parse modes are * Both HTML and Markdown parse modes are
* registered automatically. * registered automatically.
* *
* Defaults to `html` * @default `html`
*/ */
defaultParseMode?: 'html' | 'markdown' defaultParseMode?: 'html' | 'markdown'

View file

@ -206,7 +206,7 @@ export class SqliteStorage implements ITelegramStorage /*, IStateStorage*/ {
* used when finding peer by ID, since other * used when finding peer by ID, since other
* kinds of lookups (phone, username) may get stale quickly * kinds of lookups (phone, username) may get stale quickly
* *
* Defaults to `100` * @default `100`
*/ */
cacheSize?: number cacheSize?: number
@ -219,7 +219,7 @@ export class SqliteStorage implements ITelegramStorage /*, IStateStorage*/ {
* state in case of concurrent accesses), you * state in case of concurrent accesses), you
* can disable this by passing `0` * can disable this by passing `0`
* *
* Defaults to `100` * @default `100`
*/ */
fsmCacheSize?: number fsmCacheSize?: number
@ -232,7 +232,7 @@ export class SqliteStorage implements ITelegramStorage /*, IStateStorage*/ {
* state in case of concurrent accesses), you * state in case of concurrent accesses), you
* can disable this by passing `0` * can disable this by passing `0`
* *
* Defaults to `100` * @default `100`
*/ */
rlCacheSize?: number rlCacheSize?: number
@ -244,7 +244,7 @@ export class SqliteStorage implements ITelegramStorage /*, IStateStorage*/ {
* However, you might encounter some issues, * However, you might encounter some issues,
* and if you do, you can disable WAL by passing `true` * and if you do, you can disable WAL by passing `true`
* *
* Defaults to false * @default false
*/ */
disableWal?: boolean disableWal?: boolean
@ -255,7 +255,7 @@ export class SqliteStorage implements ITelegramStorage /*, IStateStorage*/ {
* *
* If you are having issues with this, you can set this to `0` * If you are having issues with this, you can set this to `0`
* *
* Defaults to `30000` (30 sec) * @default `30000` (30 sec)
*/ */
unimportantSavesDelay?: number unimportantSavesDelay?: number
@ -265,7 +265,7 @@ export class SqliteStorage implements ITelegramStorage /*, IStateStorage*/ {
* When vacuuming, the storage will remove expired FSM * When vacuuming, the storage will remove expired FSM
* states to reduce disk and memory usage. * states to reduce disk and memory usage.
* *
* Defaults to `300_000` (5 minutes) * @default `300_000` (5 minutes)
*/ */
vacuumInterval?: number vacuumInterval?: number
}, },