export declare enum BlockType { /** * 文档根节点 */ Page = 1, /** * 段落 */ Text = 2, Heading1 = 3, Heading2 = 4, Heading3 = 5, Heading4 = 6, Heading5 = 7, Heading6 = 8, Heading7 = 9, Heading8 = 10, Heading9 = 11, Bullet = 12, Ordered = 13, /** * CodeBlock */ Code = 14, Quote = 15, /** * 引用文档 */ MentionDoc = 16, /** * 代办事项 */ TodoList = 17, /** * 多维表格 */ Bitable = 18, /** * 高亮块 Block */ Callout = 19, /** * 群聊卡片 */ ChatCard = 20, /** * 流程图/UML Block */ Diagram = 21, Divider = 22, File = 23, /** * 分栏 Block */ Grid = 24, /** * 分栏列 Block */ GridColumn = 25, Iframe = 26, Image = 27, Widget = 28, MindNote = 29, Sheet = 30, Table = 31, TableCell = 32, View = 33, QuoteContainer = 34, /** * 画板 */ Board = 43, /** * 同步块 */ SyncedBlock = 999 } export declare enum StyleAlign { Left = 1, Center = 2, Right = 3 } export declare enum CodeLanguage { PlainText = 1, ABAP = 2, Ada = 3, Apache = 4, Apex = 5, AssemblyLanguage = 6, Bash = 7, CSharp = 8, CPlusPlus = 9, C = 10, COBOL = 11, CSS = 12, CoffeeScript = 13, D = 14, Dart = 15, Delphi = 16, Django = 17, Dockerfile = 18, Erlang = 19, Fortran = 20, FoxPro = 21, Go = 22, Groovy = 23, HTML = 24, HTMLBars = 25, HTTP = 26, Haskell = 27, JSON = 28, Java = 29, JavaScript = 30, Julia = 31, Kotlin = 32, LateX = 33, Lisp = 34, Logo = 35, Lua = 36, MATLAB = 37, Makefile = 38, Markdown = 39, Nginx = 40, ObjectiveC = 41, OpenEdgeABL = 42, PHP = 43, Perl = 44, PostScript = 45, PowerShell = 46, Prolog = 47, ProtoBuf = 48, Python = 49, R = 50, RPG = 51, Ruby = 52, Rust = 53, SAS = 54, SCSS = 55, SQL = 56, Scala = 57, Scheme = 58, Scratch = 59, Shell = 60, Swift = 61, Thrift = 62, TypeScript = 63, VBScript = 64, VisualBasic = 65, XML = 66, YAML = 67, CMake = 68, Diff = 69, Gherkin = 70, GraphQL = 71, OpenGLShadingLanguage = 72, Properties = 73, Solidity = 74, TOML = 75 } /** * Return code language by enum * @param code * @returns */ export declare const getCodeLanguage: (code: CodeLanguage) => string; export declare enum Color { LightPink = 1, LightOrange = 2, LightYellow = 3, LightGreen = 4, LightBlue = 5, LightPurple = 6, LightGray = 7, DarkPink = 8, DarkOrange = 9, DarkYellow = 10, DarkGreen = 11, DarkBlue = 12, DarkPurple = 13, DarkGray = 14, DarkSilverGray = 15 } export declare enum IframeType { Bilibili = 1, Xigua = 2, Youku = 3, Airtable = 4, BaiduMap = 5, GaodeMap = 6, Figma = 8, Modao = 9, Canva = 10, CodePen = 11, FeishuWenjuan = 12, Jinshuju = 13 } export interface TextStyle { align: StyleAlign; done: boolean; folded: boolean; language: CodeLanguage; wrap: boolean; } export declare enum ObjType { Doc = 1, Sheet = 3, Bitable = 8, MindNote = 11, File = 12, Slide = 15, Wiki = 16, Docx = 22 } export interface TextLink { url: string; } export interface TextElementStyle { bold: boolean; italic: boolean; strikethrough: boolean; underline: boolean; inline_code: boolean; background_color: Color; text_color: Color; link: TextLink; } export interface TextElement { text_run?: TextRun; file?: InlineFile; inline_block?: InlineBlock; equation?: TextRun; mention_doc?: MentionDoc; } export interface MentionDoc { token: string; obj_type: ObjType; url: string; title: string; text_element_style: TextElementStyle; } export interface InlineFile { file_token: string; source_block_id: string; text_element_style: TextElementStyle; } export interface TextRun { content: string; text_element_style?: TextElementStyle; } export interface InlineBlock { block_id: string; text_element_style: TextElementStyle; } export interface InlineFile { file_token: string; source_block_id: string; text_element_style: TextElementStyle; inline_block: InlineBlock; } export interface TextBlock { style: TextStyle; elements: TextElement[]; children: string[]; } export interface ImageBlock { width: number; height: number; token: string; align: StyleAlign; } export interface TableBlock { cells: string[]; property: { row_size: number; column_size: number; column_width: number[]; header_column: boolean; header_row: boolean; /** * 每一个 Item 为一个 Cell * 例如有个表格是 4x6 的,那么这个数组的长度就是 24 */ merge_info: TableMergeInfo[]; }; } export interface TableMergeInfo { row_span: number; col_span: number; } /** * https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/data-structure/block#28d02e32 */ export declare enum CalloutBackgroundColor { LightRed = 1, LightOrange = 2, LightYellow = 3, LightGreen = 4, LightBlue = 5, LightPurple = 6, LightGray = 7, DarkRed = 8, DarkOrange = 9, DarkYellow = 10, DarkGreen = 11, DarkBlue = 12, DarkPurple = 13, DarkGray = 14 } export declare const CalloutBackgroundColorMap: { 1: string; 2: string; 3: string; 4: string; 5: string; 6: string; 7: string; 8: string; 9: string; 10: string; 11: string; 12: string; 13: string; 14: string; }; export type FontBackgroundColor = CalloutBackgroundColor; /** * */ export declare enum CalloutBorderColor { Red = 1, Orange = 2, Yellow = 3, Green = 4, Blue = 5, Purple = 6, Gray = 7 } export type FontColor = CalloutBorderColor; export declare const CalloutBorderColorMap: { 1: string; 2: string; 3: string; 4: string; 5: string; 6: string; 7: string; }; export declare const FontColorMap: { 1: string; 2: string; 3: string; 4: string; 5: string; 6: string; 7: string; }; export interface CalloutBlock { background_color: CalloutBackgroundColor; border_color: CalloutBorderColor; text_color: FontColor; emoji_id: String; } export interface Block { block_id: string; parent_id: string; children: string[]; block_type: BlockType; page: TextBlock; text: TextBlock; heading1: TextBlock; heading2: TextBlock; heading3: TextBlock; heading4: TextBlock; heading5: TextBlock; heading6: TextBlock; heading7: TextBlock; heading8: TextBlock; heading9: TextBlock; bullet: TextBlock; ordered: TextBlock; code: TextBlock; quote: TextBlock; todo: TextBlock; bitable: TextBlock; callout: CalloutBlock; chat_card: TextBlock; diagram: TextBlock; divider: TextBlock; file: { name: string; token: string; }; grid: { column_size: number; }; grid_column: { width_ratio: number; }; iframe: { component: { iframe_type: IframeType; /** * UrlEncoded */ url: string; }; }; image: ImageBlock; table: TableBlock; table_cell: TextBlock; board: ImageBlock; } export declare function getAlignStyle(align: StyleAlign): "center" | "left" | "right"; export interface FileToken { token: string; type: 'file' | 'image' | 'board'; }