/** * MTKruto - Cross-runtime JavaScript library for building Telegram clients * Copyright (C) 2023-2026 Roj * * This file is part of MTKruto. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ import { Api } from "../2_tl.js"; import { type Location } from "./0_location.js"; import { type ChatP } from "./1_chat_p.js"; import { type RichTextComponent } from "./3_rich_text_component.js"; /** * An unsupported type of page block. * @unlisted */ export interface PageBlockUnsupported { type: "unsupported"; } /** * A paragraph page block. * @unlisted */ export interface PageBlockParagraph { type: "paragraph"; /** The block's text. */ text: RichTextComponent; } /** * A pre-formatted page block. * @unlisted */ export interface PageBlockPre { type: "pre"; /** The block's code language. */ language?: string; /** The block's text. */ text: RichTextComponent; } /** * A footer page block. * @unlisted */ export interface PageBlockFooter { type: "footer"; /** The block's text. */ text: RichTextComponent; } /** * A divider page block. * @unlisted */ export interface PageBlockDivider { type: "divider"; } /** * An anchor page block. * @unlisted */ export interface PageBlockAnchor { type: "anchor"; /** The name of the anchor. */ name: string; } /** @unlisted */ export interface PageBlockListItemText { type: "text"; /** Whether the item is a checkbox. */ isCheckbox: boolean; /** Whether the item is a checked checkbox. */ isChecked: boolean; /** The text of the item. */ text: RichTextComponent; } /** @unlisted */ export interface PageBlockListItemBlockList { type: "blockList"; /** Whether the item is a checkbox. */ isCheckbox: boolean; /** Whether the item is a checked checkbox. */ isChecked: boolean; /** The blocks of the item. */ blocks: PageBlock[]; } /** @unlisted */ export type PageBlockListItem = PageBlockListItemText | PageBlockListItemBlockList; export declare function constructPageBlockListItem(pli: Api.PageListItem, photos: Api.Photo[], documents: Api.Document[]): PageBlockListItem; /** * A list page block. * @unlisted */ export interface PageBlockList { type: "list"; /** The list's items. */ items: PageBlockListItem[]; } /** * A block quote page block. * @unlisted */ export interface PageBlockBlockQuote { type: "blockQuote"; /** The block quote's text. */ text: RichTextComponent; /** The block quote's caption. */ caption: RichTextComponent; } /** * A pull quote page block. * @unlisted */ export interface PageBlockPullQuote { type: "pullQuote"; /** The pull quote's text. */ text: RichTextComponent; /** The pull quote's caption. */ caption: RichTextComponent; } /** * A page block's caption. * * @unlisted */ export interface PageBlockCaption { /** The caption's text. */ text: RichTextComponent; /** The caption's credit text. */ credit: RichTextComponent; } export declare function constructPageBlockCaption(pc: Api.PageCaption, photos: Api.Photo[]): PageBlockCaption; /** * A photo page block. * @unlisted */ export interface PageBlockPhoto { type: "photo"; /** The file identifier of the photo. */ fileId: string; /** The photo's caption. */ caption: PageBlockCaption; /** Whether the photo is a spoiler. */ isSpoiler: boolean; url?: string; linkPreviewId?: string; } /** * A video page block. * @unlisted */ export interface PageBlockVideo { type: "video"; /** The file identifier of the video. */ fileId: string; /** The video's caption. */ caption: PageBlockCaption; /** Whether the video is a spoiler. */ isSpoiler: boolean; /** Whether the video is played in loop. */ isLoop: boolean; /** Whether the video is automatically played. */ isAutoplay: boolean; linkPreviewId?: string; } /** * An animation page block. * @unlisted */ export interface PageBlockAnimation { type: "animation"; /** The file identifier of the animation. */ fileId: string; /** The animation's caption. */ caption: PageBlockCaption; /** Whether the animation is a spoiler. */ isSpoiler: boolean; /** Whether the animation is played in loop. */ isLoop: boolean; /** Whether the animation is automatically played. */ isAutoplay: boolean; linkPreviewId?: string; } /** * A cover page block. * @unlisted */ export interface PageBlockCover { type: "cover"; /** The cover. */ cover: PageBlock; } /** * An embed page block. * @unlisted */ export interface PageBlockEmbed { type: "embed"; isFullWidth: boolean; isScrollingAllowed: boolean; url?: string; html?: string; posterPhotoId?: string; width?: number; height?: number; caption: PageBlockCaption; } /** * An embed post page block. * @unlisted */ export interface PageBlockEmbedPost { type: "embedPost"; url: string; linkPreviewId: string; authorPhotoId: string; author: string; date: number; blocks: PageBlock[]; caption: PageBlockCaption; } /** * A collage page block. * @unlisted */ export interface PageBlockCollage { type: "collage"; items: PageBlock[]; caption: PageBlockCaption; } /** * A slideshow page block. * @unlisted */ export interface PageBlockSlideshow { type: "slideshow"; items: PageBlock[]; caption: PageBlockCaption; } /** * A channel page block. * @unlisted */ export interface PageBlockChannel { type: "channel"; chat: ChatP; } /** * An audio page block. * @unlisted */ export interface PageBlockAudio { type: "audio"; fileId: string; caption: PageBlockCaption; } /** * A voice page block. * @unlisted */ export interface PageBlockVoice { type: "voice"; fileId: string; caption: PageBlockCaption; } /** * A kicker page block. * @unlisted */ export interface PageBlockKicker { type: "kicker"; text: RichTextComponent; } /** @unlisted */ export interface PageBlockTableCell { isHeader: boolean; isCenterAligned: boolean; isRightAligned: boolean; isMiddleVerticallyAligned: boolean; isBottomVerticallyAligned: boolean; text?: RichTextComponent; colspan?: number; rowspan?: number; } export declare function constructPageBlockTableCell(ptc: Api.PageTableCell, photos: Api.Photo[]): PageBlockTableCell; /** @unlisted */ export interface PageBlockTableRow { cells: PageBlockTableCell[]; } export declare function constructPageBlockTableRow(ptr: Api.PageTableRow, photos: Api.Photo[]): PageBlockTableRow; /** * A table page block. * @unlisted */ export interface PageBlockTable { type: "table"; isBordered: boolean; isStriped: boolean; title: RichTextComponent; rows: PageBlockTableRow[]; } /** @unlisted */ export interface PageBlockOrderedListItemText { type: "text"; isCheckbox: boolean; isChecked: boolean; number?: string; value?: number; itemType?: string; text: RichTextComponent; } /** @unlisted */ export interface PageBlockOrderedListItemTextBlockList { type: "blockList"; isCheckbox: boolean; isChecked: boolean; number?: string; value?: number; itemType?: string; blocks: PageBlock[]; } /** @unlisted */ export type PageBlockOrderedListItem = PageBlockOrderedListItemText | PageBlockOrderedListItemTextBlockList; export declare function constructPageBlockOrderedListItem(ploi: Api.PageListOrderedItem, photos: Api.Photo[], documents: Api.Document[]): PageBlockOrderedListItem; /** * An order list page block. * @unlisted */ export interface PageBlockOrderedList { type: "orderedList"; isReversed: boolean; items: PageBlockOrderedListItem[]; start?: number; itemsType?: string; } /** * A details page block. * @unlisted */ export interface PageBlockDetails { type: "details"; isOpen: boolean; blocks: PageBlock[]; title: RichTextComponent; } /** * A map page block. * @unlisted */ export interface PageBlockMap { type: "map"; location: Location; zoom: number; width: number; height: number; caption: PageBlockCaption; } /** * A heading 1 page block. * @unlisted */ export interface PageBlockHeading1 { type: "heading1"; /** The block's text. */ text: RichTextComponent; } /** * A heading 2 page block. * @unlisted */ export interface PageBlockHeading2 { type: "heading2"; /** The block's text. */ text: RichTextComponent; } /** * A heading 3 page block. * @unlisted */ export interface PageBlockHeading3 { type: "heading3"; /** The block's text. */ text: RichTextComponent; } /** * A heading 4 page block. * @unlisted */ export interface PageBlockHeading4 { type: "heading4"; /** The block's text. */ text: RichTextComponent; } /** * A heading 5 page block. * @unlisted */ export interface PageBlockHeading5 { type: "heading5"; /** The block's text. */ text: RichTextComponent; } /** * A heading 6 page block. * @unlisted */ export interface PageBlockHeading6 { type: "heading6"; /** The block's text. */ text: RichTextComponent; } /** * A math page block. * @unlisted */ export interface PageBlockMath { type: "math"; /** The math code. */ code: string; } /** * A thinking block. * @unlisted */ export interface PageBlockThinking { type: "thinking"; /** The block's text. */ text: RichTextComponent; } /** * A block quote blocks block. * @unlisted */ export interface PageBlockBlockQuoteBlocks { type: "blockQuoteBlocks"; blocks: PageBlock[]; caption: RichTextComponent; } /** Any type of page block. */ export type PageBlock = PageBlockUnsupported | PageBlockParagraph | PageBlockPre | PageBlockFooter | PageBlockDivider | PageBlockAnchor | PageBlockList | PageBlockBlockQuote | PageBlockPullQuote | PageBlockPhoto | PageBlockVideo | PageBlockAnimation | PageBlockCover | PageBlockEmbed | PageBlockEmbedPost | PageBlockCollage | PageBlockSlideshow | PageBlockChannel | PageBlockAudio | PageBlockVoice | PageBlockKicker | PageBlockTable | PageBlockOrderedList | PageBlockDetails | PageBlockMap | PageBlockHeading1 | PageBlockHeading2 | PageBlockHeading3 | PageBlockHeading4 | PageBlockHeading5 | PageBlockHeading6 | PageBlockMath | PageBlockThinking | PageBlockBlockQuoteBlocks; export declare function constructPageBlock(pb: Api.PageBlock, photos: Api.Photo[], documents: Api.Document[]): PageBlock; //# sourceMappingURL=4_page_block.d.ts.map