import { n as TypedObject, t as DeserializerRule } from "./_chunks-dts/types.js"; import * as _portabletext_schema3 from "@portabletext/schema"; import { PortableTextObject, Schema, SchemaDefinition } from "@portabletext/schema"; /** * Matcher function for mapping HTML objects to Portable Text block or inline objects. * * @public */ type ObjectMatcher = Record> = ({ context, value, isInline }: { context: { schema: Schema; keyGenerator: () => string; }; value: TValue; isInline: boolean; }) => PortableTextObject | undefined; /** * @public */ declare function buildObjectMatcher(definition: TDefinition): ObjectMatcher>; /** * @public */ type ExtractValue[0]> = TDefinition extends { fields: ReadonlyArray<{ name: infer TNames; }>; } ? Record : Record; /** * Options for converting HTML to Portable Text * * @public */ type HtmlToPortableTextOptions = { schema?: Schema; keyGenerator?: () => string; parseHtml?: (html: string) => Document; rules?: DeserializerRule[]; whitespaceMode?: 'preserve' | 'remove' | 'normalize'; types?: { image?: ObjectMatcher<{ src?: string; alt?: string; }>; code?: ObjectMatcher<{ language: string | undefined; code: string; }>; }; }; /** * Convert HTML to Portable Text * * @param html - The HTML string to convert * @param options - Options for the conversion * @returns Array of Portable Text blocks * @public */ declare function htmlToPortableText(html: string, options?: HtmlToPortableTextOptions): (Omit, "_key"> & { _key: string; })[]; /** * The default schema for converting HTML to Portable Text. * * @public */ declare const defaultSchema: _portabletext_schema3.Schema; export { type DeserializerRule, type HtmlToPortableTextOptions, type ObjectMatcher, buildObjectMatcher, defaultSchema, htmlToPortableText }; //# sourceMappingURL=index.d.ts.map