import { TrBaseToken } from './trBase'; import { SyntaxToken } from '../syntax'; import type { Config, LintError } from '../../base'; import type { AttributesToken, TdToken, TrToken, Token } from '../../internal'; import type { TableCoords } from './trBase'; export type TableTokens = TableToken | TrToken | TdToken; /** @extends {Array} */ export declare class Layout extends Array { static from: (arr: TableCoords[][]) => Layout; } /** * table * * 表格 * @classdesc `{childNodes: [SyntaxToken, AttributesToken, ...TdToken[], ...TrToken[], SyntaxToken?]}` */ export declare abstract class TableToken extends TrBaseToken { readonly childNodes: readonly [SyntaxToken, AttributesToken, ...(TdToken | TrToken)[], SyntaxToken] | readonly [SyntaxToken, AttributesToken, ...(TdToken | TrToken)[]]; abstract get lastChild(): AttributesToken | TdToken | TrToken | SyntaxToken; get type(): 'table'; /** whether the table is closed / 表格是否闭合 */ get closed(): boolean; /** * @param syntax 表格语法 * @param attr 表格属性 */ constructor(syntax?: string, attr?: string, config?: Config, accum?: Token[]); /** * Close the table syntax * * 闭合表格语法 * @param syntax syntax of the table end / 表格结尾语法 */ close(syntax?: string, halfParsed?: boolean): void; /** * Get the table layout * * 获取表格布局 */ getLayout(stop?: { row?: number; column?: number; x?: number; y?: number; }): Layout; /** * Get all rows * * 获取所有行 */ getAllRows(): (TrToken | this)[]; /** * Get the `n`-th row * * 获取第n行 * @param n row number / 行号 */ getNthRow(n: number, force?: boolean, insert?: false): TrToken | this; }