import { EditorContext } from "@portabletext/editor";
import { BehaviorGuard, NativeBehaviorEvent } from "@portabletext/editor/behaviors";
/**
 * Guard function that controls when the paste link behavior runs.
 * Return `false` to skip the behavior and fall through to default paste handling.
 * @public
 */
type PasteLinkGuard = BehaviorGuard<Extract<NativeBehaviorEvent, {
  type: 'clipboard.paste';
}>, true>;
/**
 * Context provided to link matchers.
 * @public
 */
type LinkMatcherContext = Pick<EditorContext, 'schema' | 'keyGenerator'>;
/**
 * Value provided to link matchers.
 * @public
 */
type LinkMatcherValue = {
  href: string;
};
/**
 * Object returned by link matchers.
 * @public
 */
type LinkMatcherResult = {
  _type: string;
  _key?: string;
  [other: string]: unknown;
};
/**
 * Function that converts a pasted URL into a link annotation.
 * Return `undefined` to skip handling.
 * @public
 */
type LinkMatcher = (params: {
  context: LinkMatcherContext;
  value: LinkMatcherValue;
}) => LinkMatcherResult | undefined;
/**
 * @public
 */
type PasteLinkPluginProps = {
  guard?: PasteLinkGuard;
  link?: LinkMatcher;
};
/**
 * Plugin that handles pasting URLs in the editor.
 *
 * When text is selected and a URL is pasted, adds a link annotation to the selection.
 * When the caret is collapsed (no selection) and a URL is pasted, inserts the URL as text with a link annotation.
 *
 * @public
 */
declare function PasteLinkPlugin({ guard, link }: PasteLinkPluginProps): null;
export { type LinkMatcher, type LinkMatcherContext, type LinkMatcherResult, type LinkMatcherValue, type PasteLinkGuard, PasteLinkPlugin, type PasteLinkPluginProps };
//# sourceMappingURL=index.d.ts.map