import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
import { Fragment } from '@atlaskit/editor-prosemirror/model';
import type { FlattenedItem } from './flatten-list';
export interface BuildResult {
    /**
     * For each element (by index), the offset within the fragment where the
     * element's content begins.
     *
     * To get the absolute document position after `tr.replaceWith(rangeStart, …)`,
     * add `rangeStart` to the offset.
     */
    contentStartOffsets: number[];
    fragment: Fragment;
}
/** Rebuilds a list-like PM node from a flat array of items. */
type RebuildFn = (items: FlattenedItem[], schema: Schema) => {
    contentStartOffsets: number[];
    node: PMNode;
} | null;
/** Extracts top-level content nodes from an item being broken out past the root list. */
type ExtractContentFn = (item: FlattenedItem, schema: Schema) => PMNode[];
interface BuildReplacementFragmentOptions {
    extractContentFn: ExtractContentFn;
    items: FlattenedItem[];
    rebuildFn: RebuildFn;
    schema: Schema;
}
/**
 * Build a replacement Fragment from a flat array of items.
 *
 * Items with depth >= 0 are grouped and rebuilt via `rebuildFn`.
 * Items with depth < 0 are extracted via `extractContentFn`.
 */
export declare function buildReplacementFragment({ items, schema, rebuildFn, extractContentFn, }: BuildReplacementFragmentOptions): BuildResult;
export {};
