UNPKG

alinea

Version:
26 lines (25 loc) 1.01 kB
import { Reference } from 'alinea/core/Reference'; export type PickerValue = { link?: Reference; description?: string; title?: string; blank?: boolean; }; export type PickerOptions = PickerValue & { requireDescription?: boolean; hasLink?: boolean; }; export declare function usePickTextLink(): { options: Partial<PickerOptions> | undefined; open: boolean; onClose: () => void; resolve: (value: PickerValue | undefined) => void; pickLink: (options: Partial<PickerOptions>) => Promise<PickerValue | undefined>; }; export type PickTextLinkState = ReturnType<typeof usePickTextLink>; export type PickTextLinkFunc = PickTextLinkState['pickLink']; export type PickTextLinkProps = { picker: PickTextLinkState; }; export declare function PickTextLinkForm({ open, onClose, resolve, options }: PickTextLinkState): import("react/jsx-runtime").JSX.Element; export declare function PickTextLink({ picker }: PickTextLinkProps): import("react/jsx-runtime").JSX.Element | null;