diff --git a/packages/client/src/client.ts b/packages/client/src/client.ts index 60678481..b26c8ff1 100644 --- a/packages/client/src/client.ts +++ b/packages/client/src/client.ts @@ -616,7 +616,7 @@ export interface TelegramClient extends BaseTelegramClient { /** * Whether to log out if current session is logged in. * - * Defaults to false. + * @default false. */ logout?: boolean @@ -703,11 +703,11 @@ export interface TelegramClient extends BaseTelegramClient { /** * Custom method that is called when a code is sent. Can be used * to show a GUI alert of some kind. - * Defaults to `console.log`. * * This method is called *before* {@link start.params.code}. * * @param code + * @default `console.log`. */ codeSentCallback?: (code: SentCode) => MaybeAsync }): Promise @@ -855,12 +855,13 @@ export interface TelegramClient extends BaseTelegramClient { /** * Parse mode to use when parsing inline message text. - * Defaults to current default parse mode (if any). * * Passing `null` will explicitly disable formatting. * * **Note**: inline results themselves *can not* have markup * entities, only the messages that are sent once a result is clicked. + * + * @default current default parse mode (if any). */ parseMode?: string | null }, @@ -892,7 +893,7 @@ export interface TelegramClient extends BaseTelegramClient { /** * Scope of the commands. * - * Defaults to `BotScope.default_` (i.e. `botCommandScopeDefault`) + * @default `BotScope.default_` (i.e. `botCommandScopeDefault`) */ scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope @@ -941,7 +942,7 @@ export interface TelegramClient extends BaseTelegramClient { /** * Timeout for the query in ms. * - * Defaults to `10000` (10 sec) + * @default `10000` (10 sec) */ timeout?: number @@ -994,7 +995,7 @@ export interface TelegramClient extends BaseTelegramClient { /** * Scope of the commands. * - * Defaults to `BotScope.default_` (i.e. `botCommandScopeDefault`) + * @default `BotScope.default_` (i.e. `botCommandScopeDefault`) */ scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope @@ -1116,7 +1117,7 @@ export interface TelegramClient extends BaseTelegramClient { /** * Scope of the commands. * - * Defaults to `BotScope.default_` (i.e. `botCommandScopeDefault`) + * @default `BotScope.default_` (i.e. `botCommandScopeDefault`) */ scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope @@ -1452,10 +1453,11 @@ export interface TelegramClient extends BaseTelegramClient { params?: { /** * Search query to filter members by their display names and usernames - * Defaults to `''` (empty string) * * > **Note**: Only used for these values of `filter`: * > `all, banned, restricted, mention, contacts` + * + * @default `''` (empty string) */ query?: string @@ -1486,7 +1488,9 @@ export interface TelegramClient extends BaseTelegramClient { * - `contacts`: get only contacts * - `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' }, @@ -1584,7 +1588,7 @@ export interface TelegramClient extends BaseTelegramClient { * Chunk size, which will be passed as `limit` parameter * to {@link getChatMembers}. Usually you shouldn't care about this. * - * Defaults to `200` + * @default `200` */ chunkSize?: number }, @@ -1942,7 +1946,9 @@ export interface TelegramClient extends BaseTelegramClient { /** * Whether to share your own phone number - * with the newly created contact (defaults to `false`) + * with the newly created contact + * + * @default false */ sharePhone?: boolean }): Promise @@ -2589,7 +2595,9 @@ export interface TelegramClient extends BaseTelegramClient { * Maximum number of users that can be members of this chat * 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 @@ -2838,7 +2846,7 @@ export interface TelegramClient extends BaseTelegramClient { /** * Size of chunks which are fetched. Usually not needed. * - * Defaults to `100` + * @default `100` */ chunkSize?: number }, @@ -2924,10 +2932,11 @@ export interface TelegramClient extends BaseTelegramClient { text?: string | FormattedString /** - * Parse mode to use to parse entities before sending - * the message. Defaults to current default parse mode (if any). + * Parse mode to use to parse entities before sending the message. + * * * Passing `null` will explicitly disable formatting. + * @default current default parse mode (if any). */ parseMode?: string | null @@ -2992,10 +3001,11 @@ export interface TelegramClient extends BaseTelegramClient { text?: string | FormattedString /** - * Parse mode to use to parse entities before sending - * the message. Defaults to current default parse mode (if any). + * Parse mode to use to parse entities before sending the message. * * Passing `null` will explicitly disable formatting. + * + * @default current default parse mode (if any). */ parseMode?: string | null @@ -3485,10 +3495,9 @@ export interface TelegramClient extends BaseTelegramClient { limit?: number /** - * Filter the results using some filter. - * Defaults to {@link SearchFilters.Empty} (i.e. will return all messages) + * Filter the results using some filter. (see {@link SearchFilters}) * - * @link SearchFilters + * @default {@link SearchFilters.Empty} (i.e. will return all messages) */ filter?: tl.TypeMessagesFilter @@ -3572,14 +3581,14 @@ export interface TelegramClient extends BaseTelegramClient { /** * Minimum message date to return * - * Defaults to `0` (disabled). + * @default `0` (disabled). */ minDate?: number | Date /** * Maximum message date to return * - * Defaults to `0` (disabled). + * @default `0` (disabled). */ maxDate?: number | Date @@ -3596,10 +3605,9 @@ export interface TelegramClient extends BaseTelegramClient { limit?: number /** - * Filter the results using some filter. - * Defaults to {@link SearchFilters.Empty} (i.e. will return all messages) + * Filter the results using some filter (see {@link SearchFilters}) * - * @link SearchFilters + * @default {@link SearchFilters.Empty} (i.e. will return all messages) */ filter?: tl.TypeMessagesFilter @@ -4181,18 +4189,26 @@ export interface TelegramClient extends BaseTelegramClient { /** * 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 /** * 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 + /** + * 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. * There must be at least one sticker in this list. @@ -4414,10 +4430,10 @@ export interface TelegramClient extends BaseTelegramClient { entities?: tl.TypeMessageEntity[] /** - * Parse mode to use to parse entities before sending - * the message. Defaults to current default parse mode (if any). - * + * Parse mode to use to parse entities before sending the message. * Passing `null` will explicitly disable formatting. + * + * @default current default parse mode (if any). */ parseMode?: string | null @@ -4449,6 +4465,7 @@ export interface TelegramClient extends BaseTelegramClient { */ archived?: boolean }): Promise + /** * Get information about boosts in a channel * @@ -4797,10 +4814,10 @@ export interface TelegramClient extends BaseTelegramClient { entities?: tl.TypeMessageEntity[] /** - * Parse mode to use to parse entities before sending - * the message. Defaults to current default parse mode (if any). - * + * Parse mode to use to parse entities before sending the message. * Passing `null` will explicitly disable formatting. + * + * @default current default parse mode (if any). */ parseMode?: string | null diff --git a/packages/client/src/methods/auth/start-test.ts b/packages/client/src/methods/auth/start-test.ts index 566a7c50..14038b4a 100644 --- a/packages/client/src/methods/auth/start-test.ts +++ b/packages/client/src/methods/auth/start-test.ts @@ -20,7 +20,7 @@ export async function startTest( /** * Whether to log out if current session is logged in. * - * Defaults to false. + * @default false. */ logout?: boolean diff --git a/packages/client/src/methods/auth/start.ts b/packages/client/src/methods/auth/start.ts index f737b614..00072f64 100644 --- a/packages/client/src/methods/auth/start.ts +++ b/packages/client/src/methods/auth/start.ts @@ -82,11 +82,11 @@ export async function start( /** * Custom method that is called when a code is sent. Can be used * to show a GUI alert of some kind. - * Defaults to `console.log`. * * This method is called *before* {@link start.params.code}. * * @param code + * @default `console.log`. */ codeSentCallback?: (code: SentCode) => MaybeAsync }, diff --git a/packages/client/src/methods/bots/answer-inline-query.ts b/packages/client/src/methods/bots/answer-inline-query.ts index f60dc7fb..363a0f08 100644 --- a/packages/client/src/methods/bots/answer-inline-query.ts +++ b/packages/client/src/methods/bots/answer-inline-query.ts @@ -99,12 +99,13 @@ export async function answerInlineQuery( /** * Parse mode to use when parsing inline message text. - * Defaults to current default parse mode (if any). * * Passing `null` will explicitly disable formatting. * * **Note**: inline results themselves *can not* have markup * entities, only the messages that are sent once a result is clicked. + * + * @default current default parse mode (if any). */ parseMode?: string | null }, diff --git a/packages/client/src/methods/bots/delete-my-commands.ts b/packages/client/src/methods/bots/delete-my-commands.ts index cf3de435..61ff23e5 100644 --- a/packages/client/src/methods/bots/delete-my-commands.ts +++ b/packages/client/src/methods/bots/delete-my-commands.ts @@ -16,7 +16,7 @@ export async function deleteMyCommands( /** * Scope of the commands. * - * Defaults to `BotScope.default_` (i.e. `botCommandScopeDefault`) + * @default `BotScope.default_` (i.e. `botCommandScopeDefault`) */ scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope diff --git a/packages/client/src/methods/bots/get-callback-answer.ts b/packages/client/src/methods/bots/get-callback-answer.ts index 0f0ba8a6..d92a6b44 100644 --- a/packages/client/src/methods/bots/get-callback-answer.ts +++ b/packages/client/src/methods/bots/get-callback-answer.ts @@ -19,7 +19,7 @@ export async function getCallbackAnswer( /** * Timeout for the query in ms. * - * Defaults to `10000` (10 sec) + * @default `10000` (10 sec) */ timeout?: number diff --git a/packages/client/src/methods/bots/get-my-commands.ts b/packages/client/src/methods/bots/get-my-commands.ts index 0c98be6e..56a8695e 100644 --- a/packages/client/src/methods/bots/get-my-commands.ts +++ b/packages/client/src/methods/bots/get-my-commands.ts @@ -15,7 +15,7 @@ export async function getMyCommands( /** * Scope of the commands. * - * Defaults to `BotScope.default_` (i.e. `botCommandScopeDefault`) + * @default `BotScope.default_` (i.e. `botCommandScopeDefault`) */ scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope diff --git a/packages/client/src/methods/bots/set-my-commands.ts b/packages/client/src/methods/bots/set-my-commands.ts index 2600760d..71034316 100644 --- a/packages/client/src/methods/bots/set-my-commands.ts +++ b/packages/client/src/methods/bots/set-my-commands.ts @@ -21,7 +21,7 @@ export async function setMyCommands( /** * Scope of the commands. * - * Defaults to `BotScope.default_` (i.e. `botCommandScopeDefault`) + * @default `BotScope.default_` (i.e. `botCommandScopeDefault`) */ scope?: tl.TypeBotCommandScope | BotCommands.IntermediateScope diff --git a/packages/client/src/methods/chats/get-chat-members.ts b/packages/client/src/methods/chats/get-chat-members.ts index ca0c3902..bc801a21 100644 --- a/packages/client/src/methods/chats/get-chat-members.ts +++ b/packages/client/src/methods/chats/get-chat-members.ts @@ -20,10 +20,11 @@ export async function getChatMembers( params?: { /** * Search query to filter members by their display names and usernames - * Defaults to `''` (empty string) * * > **Note**: Only used for these values of `filter`: * > `all, banned, restricted, mention, contacts` + * + * @default `''` (empty string) */ query?: string @@ -54,7 +55,9 @@ export async function getChatMembers( * - `contacts`: get only contacts * - `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' }, diff --git a/packages/client/src/methods/chats/iter-chat-members.ts b/packages/client/src/methods/chats/iter-chat-members.ts index 405b4f71..18917f40 100644 --- a/packages/client/src/methods/chats/iter-chat-members.ts +++ b/packages/client/src/methods/chats/iter-chat-members.ts @@ -23,7 +23,7 @@ export async function* iterChatMembers( * Chunk size, which will be passed as `limit` parameter * to {@link getChatMembers}. Usually you shouldn't care about this. * - * Defaults to `200` + * @default `200` */ chunkSize?: number }, diff --git a/packages/client/src/methods/contacts/add-contact.ts b/packages/client/src/methods/contacts/add-contact.ts index d5f3e6bf..358bf4af 100644 --- a/packages/client/src/methods/contacts/add-contact.ts +++ b/packages/client/src/methods/contacts/add-contact.ts @@ -31,7 +31,9 @@ export async function addContact( /** * Whether to share your own phone number - * with the newly created contact (defaults to `false`) + * with the newly created contact + * + * @default false */ sharePhone?: boolean }, diff --git a/packages/client/src/methods/files/upload-media.ts b/packages/client/src/methods/files/upload-media.ts index 1c49edf7..d1842d87 100644 --- a/packages/client/src/methods/files/upload-media.ts +++ b/packages/client/src/methods/files/upload-media.ts @@ -23,7 +23,8 @@ export async function uploadMedia( params: { /** * Peer to associate this media with. - * Defaults to `self` + * + * @default `self` */ peer?: InputPeerLike diff --git a/packages/client/src/methods/invite-links/create-invite-link.ts b/packages/client/src/methods/invite-links/create-invite-link.ts index c7034e4b..3efc4eef 100644 --- a/packages/client/src/methods/invite-links/create-invite-link.ts +++ b/packages/client/src/methods/invite-links/create-invite-link.ts @@ -26,7 +26,9 @@ export async function createInviteLink( * Maximum number of users that can be members of this chat * 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 diff --git a/packages/client/src/methods/invite-links/iter-invite-links.ts b/packages/client/src/methods/invite-links/iter-invite-links.ts index 2fca8eff..7d3d92d7 100644 --- a/packages/client/src/methods/invite-links/iter-invite-links.ts +++ b/packages/client/src/methods/invite-links/iter-invite-links.ts @@ -28,7 +28,7 @@ export async function* iterInviteLinks( /** * Size of chunks which are fetched. Usually not needed. * - * Defaults to `100` + * @default `100` */ chunkSize?: number }, diff --git a/packages/client/src/methods/messages/edit-inline-message.ts b/packages/client/src/methods/messages/edit-inline-message.ts index 0018f6b4..ef7d17eb 100644 --- a/packages/client/src/methods/messages/edit-inline-message.ts +++ b/packages/client/src/methods/messages/edit-inline-message.ts @@ -30,10 +30,11 @@ export async function editInlineMessage( text?: string | FormattedString /** - * Parse mode to use to parse entities before sending - * the message. Defaults to current default parse mode (if any). + * Parse mode to use to parse entities before sending the message. + * * * Passing `null` will explicitly disable formatting. + * @default current default parse mode (if any). */ parseMode?: string | null diff --git a/packages/client/src/methods/messages/edit-message.ts b/packages/client/src/methods/messages/edit-message.ts index 20fda651..d06d69e4 100644 --- a/packages/client/src/methods/messages/edit-message.ts +++ b/packages/client/src/methods/messages/edit-message.ts @@ -32,10 +32,11 @@ export async function editMessage( text?: string | FormattedString /** - * Parse mode to use to parse entities before sending - * the message. Defaults to current default parse mode (if any). + * Parse mode to use to parse entities before sending the message. * * Passing `null` will explicitly disable formatting. + * + * @default current default parse mode (if any). */ parseMode?: string | null diff --git a/packages/client/src/methods/messages/forward-messages.ts b/packages/client/src/methods/messages/forward-messages.ts index 17d38925..10921831 100644 --- a/packages/client/src/methods/messages/forward-messages.ts +++ b/packages/client/src/methods/messages/forward-messages.ts @@ -31,9 +31,10 @@ export interface ForwardMessageOptions { /** * Parse mode to use to parse entities in caption. - * Defaults to current default parse mode (if any). * * Passing `null` will explicitly disable formatting. + * + * @default current default parse mode (if any). */ parseMode?: string | null @@ -63,7 +64,7 @@ export interface ForwardMessageOptions { /** * Whether to clear draft after sending this message (only used for caption) * - * Defaults to `false` + * @default `false` */ clearDraft?: boolean diff --git a/packages/client/src/methods/messages/search-global.ts b/packages/client/src/methods/messages/search-global.ts index b6abf7b9..d49d6009 100644 --- a/packages/client/src/methods/messages/search-global.ts +++ b/packages/client/src/methods/messages/search-global.ts @@ -42,10 +42,9 @@ export async function searchGlobal( limit?: number /** - * Filter the results using some filter. - * Defaults to {@link SearchFilters.Empty} (i.e. will return all messages) + * Filter the results using some filter. (see {@link SearchFilters}) * - * @link SearchFilters + * @default {@link SearchFilters.Empty} (i.e. will return all messages) */ filter?: tl.TypeMessagesFilter diff --git a/packages/client/src/methods/messages/search-messages.ts b/packages/client/src/methods/messages/search-messages.ts index f4b5d127..592e2a5e 100644 --- a/packages/client/src/methods/messages/search-messages.ts +++ b/packages/client/src/methods/messages/search-messages.ts @@ -73,14 +73,14 @@ export async function searchMessages( /** * Minimum message date to return * - * Defaults to `0` (disabled). + * @default `0` (disabled). */ minDate?: number | Date /** * Maximum message date to return * - * Defaults to `0` (disabled). + * @default `0` (disabled). */ maxDate?: number | Date @@ -97,10 +97,9 @@ export async function searchMessages( limit?: number /** - * Filter the results using some filter. - * Defaults to {@link SearchFilters.Empty} (i.e. will return all messages) + * Filter the results using some filter (see {@link SearchFilters}) * - * @link SearchFilters + * @default {@link SearchFilters.Empty} (i.e. will return all messages) */ filter?: tl.TypeMessagesFilter diff --git a/packages/client/src/methods/messages/send-common.ts b/packages/client/src/methods/messages/send-common.ts index 4fa6882d..ba269fce 100644 --- a/packages/client/src/methods/messages/send-common.ts +++ b/packages/client/src/methods/messages/send-common.ts @@ -28,7 +28,7 @@ export interface CommonSendParams { * * Incurs an additional request, so only use when really needed. * - * Defaults to `false` + * @default `false` */ mustReply?: boolean @@ -62,10 +62,10 @@ export interface CommonSendParams { quoteEntities?: tl.TypeMessageEntity[] /** - * Parse mode to use to parse entities before sending - * the message. Defaults to current default parse mode (if any). - * + * Parse mode to use to parse entities before sending the message. * Passing `null` will explicitly disable formatting. + * + * @default current default parse mode (if any). */ parseMode?: string | null @@ -86,7 +86,7 @@ export interface CommonSendParams { /** * Whether to clear draft after sending this message. * - * Defaults to `false` + * @default `false` */ clearDraft?: boolean diff --git a/packages/client/src/methods/messages/send-copy.ts b/packages/client/src/methods/messages/send-copy.ts index 3c788483..031d2b60 100644 --- a/packages/client/src/methods/messages/send-copy.ts +++ b/packages/client/src/methods/messages/send-copy.ts @@ -19,9 +19,10 @@ export interface SendCopyParams extends CommonSendParams { /** * 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. + * + * @default current default parse mode (if any). */ parseMode?: string | null diff --git a/packages/client/src/methods/stickers/create-sticker-set.ts b/packages/client/src/methods/stickers/create-sticker-set.ts index 613db7ae..6e41c63e 100644 --- a/packages/client/src/methods/stickers/create-sticker-set.ts +++ b/packages/client/src/methods/stickers/create-sticker-set.ts @@ -1,4 +1,4 @@ -import { BaseTelegramClient, MtArgumentError, tl } from '@mtcute/core' +import { BaseTelegramClient, tl } from '@mtcute/core' import { InputFileLike, @@ -49,18 +49,26 @@ export async function createStickerSet( /** * 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 /** * 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 + /** + * 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. * 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 }, ): Promise { - 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 inputStickers: tl.TypeInputStickerSetItem[] = [] @@ -127,8 +131,8 @@ export async function createStickerSet( animated: params.sourceType === 'animated', videos: params.sourceType === 'video', masks: params.type === 'mask', - // currently not supported - // emojis: params.type === 'emoji', + emojis: params.type === 'emoji', + textColor: params.adaptive, userId: owner, title: params.title, shortName: params.shortName, diff --git a/packages/client/src/methods/stories/edit-story.ts b/packages/client/src/methods/stories/edit-story.ts index 7fcd04c1..819fe7e4 100644 --- a/packages/client/src/methods/stories/edit-story.ts +++ b/packages/client/src/methods/stories/edit-story.ts @@ -43,10 +43,10 @@ export async function editStory( entities?: tl.TypeMessageEntity[] /** - * Parse mode to use to parse entities before sending - * the message. Defaults to current default parse mode (if any). - * + * Parse mode to use to parse entities before sending the message. * Passing `null` will explicitly disable formatting. + * + * @default current default parse mode (if any). */ parseMode?: string | null diff --git a/packages/client/src/methods/stories/get-boost-stats.ts b/packages/client/src/methods/stories/get-boost-stats.ts index 622eca5f..0729edb1 100644 --- a/packages/client/src/methods/stories/get-boost-stats.ts +++ b/packages/client/src/methods/stories/get-boost-stats.ts @@ -4,6 +4,7 @@ import { InputPeerLike } from '../../types/index.js' import { BoostStats } from '../../types/stories/boost-stats.js' import { resolvePeer } from '../users/resolve-peer.js' +// @available=user /** * Get information about boosts in a channel * diff --git a/packages/client/src/methods/stories/send-story.ts b/packages/client/src/methods/stories/send-story.ts index 4a97283b..d715faa5 100644 --- a/packages/client/src/methods/stories/send-story.ts +++ b/packages/client/src/methods/stories/send-story.ts @@ -42,10 +42,10 @@ export async function sendStory( entities?: tl.TypeMessageEntity[] /** - * Parse mode to use to parse entities before sending - * the message. Defaults to current default parse mode (if any). - * + * Parse mode to use to parse entities before sending the message. * Passing `null` will explicitly disable formatting. + * + * @default current default parse mode (if any). */ parseMode?: string | null diff --git a/packages/client/src/types/bots/input/input-inline-result.ts b/packages/client/src/types/bots/input/input-inline-result.ts index de572200..77cf7cb1 100644 --- a/packages/client/src/types/bots/input/input-inline-result.ts +++ b/packages/client/src/types/bots/input/input-inline-result.ts @@ -60,7 +60,7 @@ export interface InputInlineResultArticle extends BaseInputInlineResult { * Whether to prevent article URL from * displaying by the client * - * Defaults to `false` + * @default `false` */ hideUrl?: boolean @@ -88,10 +88,11 @@ export interface InputInlineResultGif extends BaseInputInlineResult { media: string | tl.RawInputWebDocument | tl.RawInputDocument /** - * Media MIME type, defaults to `video/mp4`, only applicable - * to URLs. + * Media MIME type, only applicable to URLs. * * Usually unnecessary, since Telegram automatically infers it. + * + * @default `video/mp4` */ mime?: string @@ -106,13 +107,16 @@ export interface InputInlineResultGif extends BaseInputInlineResult { description?: string /** - * Animation thumbnail URL. Defaults to `media`, - * only applicable in case `media` is a URL + * Animation thumbnail URL, only applicable in case `media` is a URL + * + * @default `media` */ thumb?: string | tl.RawInputWebDocument /** - * Thumbnail MIME type (defaults to `image/jpeg`) + * Thumbnail MIME type + * + * @default `image/jpeg` */ thumbMime?: string @@ -167,10 +171,11 @@ export interface InputInlineResultVideo extends BaseInputInlineResult { description?: string /** - * Video thumbnail URL (must be jpeg). Defaults to `media`, - * only applicable in case `media` is a URL. + * Video thumbnail URL (must be jpeg), only applicable in case `media` is a URL. * * Must be provided explicitly if this is a video loaded by URL. + * + * @default `media` */ thumb?: string | tl.RawInputWebDocument @@ -208,9 +213,11 @@ export interface InputInlineResultAudio extends BaseInputInlineResult { 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. + * + * @default `audio/mpeg` */ mime?: string @@ -296,8 +303,9 @@ export interface InputInlineResultPhoto extends BaseInputInlineResult { height?: number /** - * Photo thumbnail URL (must be jpeg). Defaults to `media`, - * only applicable in case `media` is a URL + * Photo thumbnail URL (must be jpeg), only applicable in case `media` is a URL + * + * @default `media` */ thumb?: string | tl.RawInputWebDocument } @@ -355,8 +363,9 @@ export interface InputInlineResultFile extends BaseInputInlineResult { description?: string /** - * Photo thumbnail URL (must be jpeg). Defaults to `media`, - * only applicable in case `media` is a URL + * Photo thumbnail URL (must be jpeg), only applicable in case `media` is a URL + * + * @default `media` */ thumb?: string | tl.RawInputWebDocument } diff --git a/packages/client/src/types/bots/keyboards.ts b/packages/client/src/types/bots/keyboards.ts index acb03b45..37344dee 100644 --- a/packages/client/src/types/bots/keyboards.ts +++ b/packages/client/src/types/bots/keyboards.ts @@ -302,7 +302,7 @@ export namespace BotKeyboard { * `url` domain must be the same as the domain linked * with the bot. * - * Defaults to current bot + * @default current bot */ bot?: tl.TypeInputUser } = {}, diff --git a/packages/client/src/types/conversation.ts b/packages/client/src/types/conversation.ts index 1a3ec3d8..c28a603b 100644 --- a/packages/client/src/types/conversation.ts +++ b/packages/client/src/types/conversation.ts @@ -367,7 +367,7 @@ export class Conversation { /** * Message for which to wait for response for. * - * Defaults to last sent/received message + * @default last sent/received message */ message?: number @@ -376,7 +376,7 @@ export class Conversation { * * When the timeout is reached, `TimeoutError` is thrown. * - * Defaults to `15000` (15 sec) + * @default `15000` (15 sec) */ timeout?: number | null }, @@ -403,7 +403,7 @@ export class Conversation { /** * Message for which to wait for reply for. * - * Defaults to last sent/received message + * @default last sent/received message */ message?: number @@ -412,7 +412,7 @@ export class Conversation { * * When the timeout is reached, `TimeoutError` is thrown. * - * Defaults to `15000` (15 sec) + * @default `15000` (15 sec) */ timeout?: number | null }, @@ -446,7 +446,7 @@ export class Conversation { /** * Message for which to wait for reply for. * - * Defaults to last received message + * @default last received message */ message?: number @@ -455,7 +455,7 @@ export class Conversation { * * When the timeout is reached, `TimeoutError` is thrown. * - * Defaults to `15000` (15 sec) + * @default `15000` (15 sec) */ timeout?: number | null }, diff --git a/packages/client/src/types/media/input-media.ts b/packages/client/src/types/media/input-media.ts index 89fa927e..3700416b 100644 --- a/packages/client/src/types/media/input-media.ts +++ b/packages/client/src/types/media/input-media.ts @@ -170,9 +170,9 @@ export interface InputMediaSticker extends FileMixin, CaptionMixin { * Note that animated stickers must be in TGS * format, which is Lottie JSON compressed using GZip * - * Defaults to `false` - * * Only applicable to newly uploaded files. + * + * @default false */ isAnimated?: boolean diff --git a/packages/client/src/types/media/location.ts b/packages/client/src/types/media/location.ts index 5affcc53..b64cf13b 100644 --- a/packages/client/src/types/media/location.ts +++ b/packages/client/src/types/media/location.ts @@ -39,28 +39,28 @@ export class RawLocation { /** * Map width in pixels before applying scale (16-1024) * - * Defaults to `128` + * @default `128` */ width?: number /** * Map height in pixels before applying scale (16-1024) * - * Defaults to `128` + * @default `128` */ height?: number /** * Map zoom level (13-20) * - * Defaults to `15` + * @default `15` */ zoom?: number /** * Map scale (1-3) * - * Defaults to `1` + * @default `1` */ scale?: number } = {}, diff --git a/packages/client/src/types/media/poll.ts b/packages/client/src/types/media/poll.ts index 42f4a8d0..0c0b1c21 100644 --- a/packages/client/src/types/media/poll.ts +++ b/packages/client/src/types/media/poll.ts @@ -19,7 +19,9 @@ export interface PollAnswer { /** * 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 @@ -30,7 +32,9 @@ export interface PollAnswer { /** * 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 } diff --git a/packages/core/src/base-client.ts b/packages/core/src/base-client.ts index c24d4462..16da46d3 100644 --- a/packages/core/src/base-client.ts +++ b/packages/core/src/base-client.ts @@ -68,7 +68,8 @@ export interface BaseTelegramClientOptions { * Can be used to connect to other networks (like test DCs). * * When session already contains primary DC, this parameter is ignored. - * Defaults to Production DC 2. + * + * @default Production DC 2. */ defaultDcs?: ITelegramStorage.DcOptions @@ -91,13 +92,15 @@ export interface BaseTelegramClientOptions { /** * 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 /** * 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 diff --git a/packages/core/src/network/network-manager.ts b/packages/core/src/network/network-manager.ts index 217b0c98..14dce89e 100644 --- a/packages/core/src/network/network-manager.ts +++ b/packages/core/src/network/network-manager.ts @@ -91,7 +91,8 @@ export interface NetworkManagerExtraParams { /** * Idle timeout for non-main connections, in ms - * Defaults to 60 seconds. + * + * @default 60000 (60 seconds). */ inactivityTimeout?: number } diff --git a/packages/core/src/storage/json-file.ts b/packages/core/src/storage/json-file.ts index 56c971eb..09a9996c 100644 --- a/packages/core/src/storage/json-file.ts +++ b/packages/core/src/storage/json-file.ts @@ -22,14 +22,14 @@ export class JsonFileStorage extends JsonMemoryStorage { * a blank file because of the app being stopped while * the storage is being written. * - * Defaults to `true` + * @default `true` */ safe?: boolean /** * Whether to save file on process exit. * - * Defaults to `true` + * @default `true` */ cleanup?: boolean }, diff --git a/packages/core/src/storage/memory.ts b/packages/core/src/storage/memory.ts index 9247fc2c..0467b17d 100644 --- a/packages/core/src/storage/memory.ts +++ b/packages/core/src/storage/memory.ts @@ -74,7 +74,7 @@ export class MemoryStorage implements ITelegramStorage /*, IStateStorage*/ { * by a local storage), and only available within * the current runtime. * - * Defaults to `100`, use `0` to disable + * @default `100`, use `0` to disable */ cacheSize?: number @@ -84,7 +84,7 @@ export class MemoryStorage implements ITelegramStorage /*, IStateStorage*/ { * When vacuuming, the storage will remove expired FSM * states to reduce memory usage. * - * Defaults to `300_000` (5 minutes) + * @default `300_000` (5 minutes) */ vacuumInterval?: number }) { diff --git a/packages/i18n/src/index.ts b/packages/i18n/src/index.ts index a11dc94d..c1e44f9c 100644 --- a/packages/i18n/src/index.ts +++ b/packages/i18n/src/index.ts @@ -25,7 +25,7 @@ export interface MtcuteI18nParameters { /** * Language that will be used if no language is specified * - * Defaults to {@link primaryLanguage} + * @default {@link primaryLanguage} */ defaultLanguage?: string diff --git a/packages/node/index.ts b/packages/node/index.ts index 6057353f..d8bd823e 100644 --- a/packages/node/index.ts +++ b/packages/node/index.ts @@ -29,7 +29,7 @@ export interface NodeTelegramClientOptions extends Omit