@sanity/form-builder
Version:
Sanity form builder
38 lines • 1.46 kB
TypeScript
import React from 'react';
import { Marker, Path } from '@sanity/types';
import { FormFieldPresence } from '@sanity/base/presence';
import { OnCopyFn, OnPasteFn, PortableTextBlock, Type, HotkeyOptions } from '@sanity/portable-text-editor';
import PatchEvent from '../../PatchEvent';
import { Patch } from '../../patch/types';
import { RenderBlockActions, RenderCustomMarkers } from './types';
export declare const PortableTextInput: React.ComponentType<PortableTextInputProps>;
export declare type PatchWithOrigin = Patch & {
origin: 'local' | 'remote' | 'internal';
timestamp: Date;
};
declare type PatchSubscribe = (subscribeFn: PatchSubscriber) => () => void;
declare type PatchSubscriber = ({ patches, }: {
patches: PatchWithOrigin[];
snapshot: PortableTextBlock[] | undefined;
}) => void;
export declare type PortableTextInputProps = {
focusPath: Path;
hotkeys?: HotkeyOptions;
level: number;
markers: Marker[];
onBlur: () => void;
onChange: (event: PatchEvent) => void;
onFocus: (path: any) => void;
onCopy?: OnCopyFn;
onPaste?: OnPasteFn;
readOnly: boolean | null;
renderBlockActions?: RenderBlockActions;
renderCustomMarkers?: RenderCustomMarkers;
presence: FormFieldPresence[];
subscribe: PatchSubscribe;
type: Type;
value: PortableTextBlock[] | undefined;
compareValue: PortableTextBlock[] | undefined;
};
export {};
//# sourceMappingURL=PortableTextInput.d.ts.map