import { Path } from "@portabletext/editor";
import { ReactNode } from "react";
/**
 * Maintains a list index map for the editor and serves it through context.
 * Mount inside `EditorProvider`, wrapping whatever reads the indices:
 *
 * ```tsx
 * <EditorProvider initialConfig={...}>
 *   <ListIndexProvider>
 *     <PortableTextEditable />
 *   </ListIndexProvider>
 * </EditorProvider>
 * ```
 *
 * The map is rebuilt at most once per microtask burst of operations,
 * regardless of how many operations the burst contains or how many
 * components read it, and only when the burst contains an operation that can
 * affect list indices. Reads via {@link useListIndex} only re-render when the
 * index at their own path changes.
 *
 * @beta
 */
declare function ListIndexProvider(props: {
  children?: ReactNode;
}): import("react").JSX.Element;
/**
 * Read the 1-based list index of the block at `path`, or `undefined` when
 * the block is not a list item. Re-renders only when the index at this
 * path changes.
 *
 * `path` is the keyed block path render callbacks receive, e.g.
 * `[{_key: 'b0'}]`.
 *
 * @beta
 */
declare function useListIndex(path: Path): number | undefined;
export { ListIndexProvider, useListIndex };
//# sourceMappingURL=index.d.ts.map