import * as platejs from 'platejs';
import { PluginConfig, EditorBeforeOptions, SlateEditor, TLinkElement, UnknownObject } from 'platejs';
import React__default from 'react';

type BaseLinkConfig = PluginConfig<'a', {
    /**
     * List of allowed URL schemes.
     *
     * @default ['http', 'https', 'mailto', 'tel']
     */
    allowedSchemes?: string[];
    /**
     * Skips sanitation of links.
     *
     * @default false
     */
    dangerouslySkipSanitization?: boolean;
    defaultLinkAttributes?: React.AnchorHTMLAttributes<HTMLAnchorElement>;
    forceSubmit?: boolean;
    /**
     * Keeps selected text on pasting links by default.
     *
     * @default true
     */
    keepSelectedTextOnPaste?: boolean;
    /**
     * Allow custom config for rangeBeforeOptions.
     *
     * @example
     *   {
     *     "matchString": " ",
     *     "skipInvalid": true,
     *     "afterMatch": true
     *   }
     */
    rangeBeforeOptions?: EditorBeforeOptions;
    /**
     * Hotkeys to trigger floating link.
     *
     * @default 'meta+k, ctrl+k'
     */
    triggerFloatingLinkHotkeys?: string[] | string;
    /**
     * On keyboard shortcut or toolbar mousedown, get the link url by calling
     * this promise. The default behavior is to use the browser's native
     * `prompt`.
     */
    getLinkUrl?: (prevUrl: string | null) => Promise<string | null>;
    /**
     * Callback to optionally get the href for a url
     *
     * @returns Href: an optional link to be used that is different from the
     *   text content (example https://google.com for google.com)
     */
    getUrlHref?: (url: string) => string | undefined;
    /**
     * Callback to validate an url.
     *
     * @default isUrl
     */
    isUrl?: (text: string) => boolean;
    /**
     * Transform the content of the URL input before validating it. Useful for
     * adding a protocol to a URL. E.g. `google.com` -> `https://google.com`
     *
     * Similar to `getUrlHref` but is used on URL inputs. Whereas that is used
     * on any entered text.
     *
     * @returns The transformed URL.
     */
    transformInput?: (url: string) => string | undefined;
}>;
/** Enables support for hyperlinks. */
declare const BaseLinkPlugin: platejs.SlatePlugin<BaseLinkConfig>;

declare const getLinkAttributes: (editor: SlateEditor, link: TLinkElement) => Pick<React__default.AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "target"> & UnknownObject;

export { type BaseLinkConfig as B, BaseLinkPlugin as a, getLinkAttributes as g };
