import { $ as OverlayPluginExclusiveDefinition, Q as OverlayPluginDefinitionBase, X as OverlayPluginComponent, Z as OverlayPluginDefinition, _ as OverlayComponentResolverContext, at as VisualEditingOptions, b as OverlayElementParent, d as HistoryRefresh, et as OverlayPluginHudDefinition, f as HistoryUpdate, g as OverlayComponentResolver, h as OverlayComponentProps, it as VisualEditingNode, l as HistoryAdapter, m as OverlayComponent, nt as SanityNode, s as ElementNode, u as HistoryAdapterNavigate, y as OverlayElementField } from "../_chunks-dts/types.js";
import { a as OptimisticReducer, c as PathValue, i as OptimisticDocumentPatches, l as DatasetMutatorMachineInput, n as DocumentsMutate, o as OptimisticReducerAction, r as OptimisticDocument, s as Path, t as DocumentsGet, u as createDatasetMutator } from "../_chunks-dts/types2.js";
import { n as useDocuments, t as useOptimistic } from "../_chunks-dts/useOptimistic.js";
import { a as emptyActor, n as EmptyActor, r as MutatorActor, t as createDocumentMutator } from "../_chunks-dts/documentMutator.js";
import { CreateDataAttribute, CreateDataAttributeProps, SanityStegaNode, WithRequired, createDataAttribute } from "@sanity/visual-editing-csm";
import { ClientPerspective, ClientReturn, ContentSourceMap, QueryParams } from "@sanity/client";
import { DocumentSchema, PreviewSnapshot, ResolvedSchemaTypeMap, SchemaArrayItem, SchemaArrayNode, SchemaBooleanNode, SchemaInlineNode, SchemaNode, SchemaNullNode, SchemaNumberNode, SchemaObjectField, SchemaObjectNode, SchemaStringNode, SchemaType, SchemaUnionNode, SchemaUnionNodeOptions, SchemaUnionOption, SchemaUnknownNode, Serializable, SerializableArray, SerializableObject, SerializablePrimitive, TypeSchema, UnresolvedPath, VisualEditingControllerMsg, VisualEditingNodeMsg } from "@sanity/presentation-comlink";
/**
* @public
*/
declare const VisualEditing: {
(props: VisualEditingOptions & {
portal: boolean;
}): React.ReactNode;
displayName: string;
};
declare function useOptimisticActor(): MutatorActor | EmptyActor;
/**
* The environment is `null` initially, until `` is rendered on the page.
* It then becomes `'standalone'` by default. If Presentation Tool is detected and connected over comlink it then becomes either:
* - `'presentation-iframe'` if the page is loaded in an iframe, this is the default
* - `'presentation-window'` if the page is loaded in a new window, which happens if the studio user has clicked the "Open preview" button in the Presentation Tool URL bar.
*/
type VisualEditingEnvironment = null | 'presentation-iframe' | 'presentation-window' | 'standalone';
/**
* @alpha - unstable API, may have breaking changes in a minor release
*/
declare function useVisualEditingEnvironment(): VisualEditingEnvironment;
/**
* Initially returns `null`, until `` is rendered on the page.
* Returns `false` if there's no parent window context with Presentation Tool connected over comlink.
* Returns `true` when a connection is established over comlink and window.postMessage, the handshake might take a while and the hook may return `false` initially before it eventually returns `true`.
*/
declare function useIsPresentationTool(): null | boolean;
/** @alpha */
type UsePresentationQueryReturnsInactive = {
data: null;
sourceMap: null;
perspective: null;
};
/** @alpha */
type UsePresentationQueryReturnsActive = {
data: ClientReturn;
sourceMap: ContentSourceMap | null;
perspective: ClientPerspective;
};
/**
* Returns the inactive state when no Presentation Tool connection is available,
* or the active state with query results when connected.
* @alpha
*/
type UsePresentationQueryReturns = UsePresentationQueryReturnsInactive | UsePresentationQueryReturnsActive;
/**
* Experimental hook that can run queries in Presentation Tool.
* Query results are sent back over postMessage whenever the query results change.
* It also works with optimistic updates in the studio itself, offering low latency updates.
* It's not as low latency as the `useOptimistic` hook, but it's a good compromise for some use cases.
*
* Requires `` to be rendered on the page to establish the comlink connection.
* @alpha
*/
declare function usePresentationQuery(props: {
query: QueryString;
params?: QueryParams | Promise;
stega?: boolean;
}): UsePresentationQueryReturns;
export { type CreateDataAttribute, type CreateDataAttributeProps, type DatasetMutatorMachineInput, type DocumentSchema, type DocumentsGet, type DocumentsMutate, type ElementNode, type EmptyActor, type HistoryAdapter, type HistoryAdapterNavigate, type HistoryRefresh, type HistoryUpdate, type MutatorActor, type OptimisticDocument, type OptimisticDocumentPatches, type OptimisticReducer, type OptimisticReducerAction, type OverlayComponent, type OverlayComponentProps, type OverlayComponentResolver, type OverlayComponentResolverContext, type OverlayElementField, type OverlayElementParent, type OverlayPluginComponent, type OverlayPluginDefinition, type OverlayPluginDefinitionBase, type OverlayPluginExclusiveDefinition, type OverlayPluginHudDefinition, type Path, type PathValue, type PreviewSnapshot, type ResolvedSchemaTypeMap, type SanityNode, type SanityStegaNode, type SchemaArrayItem, type SchemaArrayNode, type SchemaBooleanNode, type SchemaInlineNode, type SchemaNode, type SchemaNullNode, type SchemaNumberNode, type SchemaObjectField, type SchemaObjectNode, type SchemaStringNode, type SchemaType, type SchemaUnionNode, type SchemaUnionNodeOptions, type SchemaUnionOption, type SchemaUnknownNode, type Serializable, type SerializableArray, type SerializableObject, type SerializablePrimitive, type TypeSchema, type UnresolvedPath, type UsePresentationQueryReturns, type UsePresentationQueryReturnsActive, type UsePresentationQueryReturnsInactive, VisualEditing, type VisualEditingControllerMsg, type VisualEditingNode, type VisualEditingNodeMsg, type VisualEditingOptions, type WithRequired, createDataAttribute, createDatasetMutator, createDocumentMutator, emptyActor, useDocuments, useIsPresentationTool, useOptimistic, useOptimisticActor, usePresentationQuery, useVisualEditingEnvironment };
//# sourceMappingURL=index.d.ts.map