@sanity/visual-editing
Version:
[](https://npm-stat.com/charts.html?package=@sanity/visual-editing) [](https://
48 lines • 3.75 kB
TypeScript
import { $ as OverlayPluginExclusiveDefinition, Q as OverlayPluginDefinitionBase, X as OverlayPluginComponent, Z as OverlayPluginDefinition, _ as OverlayComponentResolverContext, b as OverlayElementParent, et as OverlayPluginHudDefinition, g as OverlayComponentResolver, h as OverlayComponentProps, m as OverlayComponent, s as ElementNode, y as OverlayElementField } from "../_chunks-dts/types.js";
import { DocumentSchema, SanityNode, SchemaArrayItem, SchemaArrayNode, SchemaBooleanNode, SchemaInlineNode, SchemaNode, SchemaNode as SchemaNode$1, SchemaNullNode, SchemaNumberNode, SchemaObjectField, SchemaObjectNode, SchemaStringNode, SchemaUnionNode, SchemaUnionNode as SchemaUnionNode$1, SchemaUnionNodeOptions, SchemaUnionOption, SchemaUnknownNode } from "@sanity/presentation-comlink";
import { ComponentProps, FunctionComponent, HTMLAttributes, HTMLProps, PropsWithChildren } from "react";
declare const PointerEvents: FunctionComponent<PropsWithChildren<HTMLAttributes<HTMLDivElement>>>;
declare const UnionInsertMenuOverlay: OverlayComponent<{
direction?: 'horizontal' | 'vertical';
hoverAreaExtent?: HTMLProps<HTMLDivElement>['height' | 'width'];
}, SchemaUnionNode$1<SchemaNode$1>>;
declare function defineOverlayComponent<T extends OverlayComponent<Record<string, unknown>, any>>(component: T, props?: Omit<ComponentProps<T>, keyof OverlayComponentProps>): {
component: T;
props: typeof props;
};
declare function defineOverlayComponents<T extends OverlayComponent>(resolver: OverlayComponentResolver<T>): typeof resolver;
/**
* @public
* Helper type to check if an object has required keys
*/
type HasRequiredKeys<T> = Record<string, never> extends T ? false : true;
/**
* @public
*/
type OverlayPluginUserFnConfigOptions<O extends Record<string, unknown>> = HasRequiredKeys<O> extends true ? {
options: O;
} : {
options?: O;
};
/**
* @public
*/
type OverlayPluginUserFnConfig<O extends Record<string, unknown>> = {
guard?: OverlayPluginDefinition['guard'];
} & OverlayPluginUserFnConfigOptions<O>;
/**
* @public
*/
type OverlayPluginUserFn<O extends Record<string, unknown>> = HasRequiredKeys<O> extends true ? (config: OverlayPluginUserFnConfig<O>) => OverlayPluginDefinition : (config?: OverlayPluginUserFnConfig<O>) => OverlayPluginDefinition;
/**
* @public
*/
type OverlayPluginDefineFn<O extends Record<string, unknown>> = (options: O) => OverlayPluginDefinition;
/**
* @public
* Define an overlay plugin with conditional options parameter.
* Adds a guard that combines the user-provided guard with the plugin's guard.
*/
declare function defineOverlayPlugin<O extends Record<string, unknown> = Record<string, never>>(pluginDefinitionFn: OverlayPluginDefineFn<O>): OverlayPluginUserFn<O>;
export { type DocumentSchema, type ElementNode, type HasRequiredKeys, type OverlayComponent, type OverlayComponentProps, type OverlayComponentResolver, type OverlayComponentResolverContext, type OverlayElementField, type OverlayElementParent, type OverlayPluginComponent, type OverlayPluginDefineFn, type OverlayPluginDefinition, type OverlayPluginDefinitionBase, type OverlayPluginExclusiveDefinition, type OverlayPluginHudDefinition, type OverlayPluginUserFn, type OverlayPluginUserFnConfig, type OverlayPluginUserFnConfigOptions, PointerEvents, type SanityNode, type SchemaArrayItem, type SchemaArrayNode, type SchemaBooleanNode, type SchemaInlineNode, type SchemaNode, type SchemaNullNode, type SchemaNumberNode, type SchemaObjectField, type SchemaObjectNode, type SchemaStringNode, type SchemaUnionNode, type SchemaUnionNodeOptions, type SchemaUnionOption, type SchemaUnknownNode, UnionInsertMenuOverlay, defineOverlayComponent, defineOverlayComponents, defineOverlayPlugin };
//# sourceMappingURL=index.d.ts.map