import { Path, StudioPathLike } from "/home/runner/work/visual-editing/visual-editing/node_modules/.pnpm/@sanity+client@7.22.1/node_modules/@sanity/client/dist/csm.js"; import { SanityNode, SanityNode as SanityNode$1, SanityStegaNode, SanityStegaNode as SanityStegaNode$1 } from "@sanity/visual-editing-types"; /** * Helper * @internal */ type WithRequired = T & { [P in K]-?: T[P] }; /** * The metadata that can be embedded in a data attribute. * All values are marked optional in the base type as they can be provided incrementally using the `createDataAttribute` function. * @public */ interface CreateDataAttributeProps { /** The studio base URL, optional */ baseUrl?: string; /** The dataset, optional */ dataset?: string; /** The document ID, required */ id?: string; /** The field path, required */ path?: StudioPathLike; /** The project ID, optional */ projectId?: string; /** The studio tool name, optional */ tool?: string; /** The document type, required */ type?: string; /** The studio workspace, optional */ workspace?: string; /** The studio perspective, optional, used for "Open in Studio" links */ perspective?: string; } /** * @public */ type CreateDataAttribute = (T extends WithRequired ? { /** * Returns a string representation of the data attribute * @param path - An optional path to concatenate with any existing path * @public */ (path?: StudioPathLike): string; /** * Returns a string representation of the data attribute * @public */ toString(): string; } : T extends WithRequired ? (path: StudioPathLike) => string : object) & { /** * Concatenate the current path with a new path * @param path - A path to concatenate with any existing path * @public */ scope(path: StudioPathLike): CreateDataAttribute; /** * Combines the current props with additional props * @param props - New props to merge with any existing props * @public */ combine: (props: U) => CreateDataAttribute; }; /** * A helper function for creating `data-sanity` attributes by explicitly providing metadata. * @returns An object with methods for incrementally adding and scoping metadata, and for generating a data attribute string. * @public */ declare function createDataAttribute(props: T): CreateDataAttribute; /** @internal */ declare function urlStringToPath(str: string): Path; /** * Transforms sanity node data into an encoded string * @param node - An unencoded sanity node object * @returns An encoded string of sanity data * @public */ declare function encodeSanityNodeData(node: SanityNode$1): string | undefined; /** * Transforms sanity data from multiple formats into sanity node data * @param str - Sanity data as a string of unknown format * @internal */ declare function decodeSanityNodeData(data: SanityStegaNode$1 | string): SanityNode$1 | SanityStegaNode$1 | undefined; /** @internal */ declare function pathToUrlString(path: Path): string; export { type CreateDataAttribute, type CreateDataAttributeProps, type SanityNode, type SanityStegaNode, type WithRequired, createDataAttribute, decodeSanityNodeData, encodeSanityNodeData, pathToUrlString, urlStringToPath }; //# sourceMappingURL=index.d.ts.map