import { t as DeserializerRule } from "../types-DlDb6U1D.js";
import { PortableTextObject, PortableTextSpan, Schema } from "@portabletext/schema";
/**
 * The type names and array fields of the three table levels, role-keyed to
 * mirror `@portabletext/plugin-table`'s `defineTable({containers})`. Only
 * `type` and `arrayField` are read, so the container definitions passed to
 * `defineTable` can be passed here unchanged; any render or `of` they carry
 * is ignored. Omitted roles and fields fall back to the canonical names
 * (`table`/`rows`, `row`/`cells`, `cell`/`value`).
 *
 * @beta
 */
type TableRuleContainers = {
  table?: {
    type?: string;
    arrayField?: string;
  };
  row?: {
    type?: string;
    arrayField?: string;
  };
  cell?: {
    type?: string;
    arrayField?: string;
  };
};
/**
 * A `DeserializerRule` that converts `<table>` HTML into a nested table
 * shape: one custom block carrying `rows`, each row carrying `cells`, each
 * cell carrying a Portable Text `value` array. Matches the block/array-field
 * names `@portabletext/plugin-table`'s `defineTable` produces, configurable
 * through `containers` for consumers that renamed them.
 *
 * @example
 * ```html
 * <table>
 *   <thead>
 *     <tr><th>Year</th><th>Sales</th></tr>
 *   </thead>
 *   <tbody>
 *     <tr><td>2022</td><td>$8,000</td></tr>
 *   </tbody>
 * </table>
 * ```
 * Turns into
 * ```json
 * {
 *   "_type": "table",
 *   "headerRows": 1,
 *   "rows": [
 *     {"_type": "row", "cells": [{"_type": "cell", "value": [...Year...]}, ...]},
 *     {"_type": "row", "cells": [{"_type": "cell", "value": [...2022...]}, ...]}
 *   ]
 * }
 * ```
 *
 * `colspan`/`rowspan` are ignored: a spanning cell contributes one cell,
 * and rows shorter than the widest row are padded with empty cells.
 *
 * @beta
 */
declare function createTableRule({ schema, keyGenerator, containers }: {
  schema: Schema;
  keyGenerator?: () => string;
  containers?: TableRuleContainers;
}): DeserializerRule;
/**
 * An opinionated `DeserializerRule` that flattens tables in a way that repeats
 * the header row for each cell in the row.
 *
 * @example
 * ```html
 * <table>
 *   <thead>
 *     <tr>
 *       <th>Header 1</th>
 *       <th>Header 2</th>
 *     </tr>
 *   </thead>
 *   <tbody>
 *     <tr>
 *       <td>Cell 1</td>
 *       <td>Cell 2</td>
 *     </tr>
 *   </tbody>
 * </table>
 * ```
 * Turns into
 * ```json
 * [
 *   {
 *     _type: 'block',
 *     children: [
 *       {
 *         _type: 'text',
 *         text: 'Header 1'
 *       },
 *       {
 *         _type: 'text',
 *         text: 'Cell 1'
 *       }
 *     ]
 *   },
 *   {
 *     _type: 'block',
 *     children: [
 *       {
 *         _type: 'text',
 *         text: 'Header 2'
 *       },
 *       {
 *         _type: 'text',
 *         text: 'Cell 2'
 *       }
 *     ]
 *   }
 * ]
 * ```
 *
 * Use the `separator` option to control if a child element should separate
 * headers and cells.
 *
 * @beta
 */
declare function createFlattenTableRule({ schema, separator }: {
  schema: Schema;
  separator?: () => (Omit<PortableTextSpan, '_key'> & {
    _key?: string;
  }) | (Omit<PortableTextObject, '_key'> & {
    _key?: string;
  }) | undefined;
}): DeserializerRule;
export { TableRuleContainers, createFlattenTableRule, createTableRule };
//# sourceMappingURL=index.d.ts.map