collaborative-input
Version:
Collaborative input and textarea bindings to JSON CRDT
22 lines (21 loc) • 922 B
TypeScript
import type { CollaborativeStr } from 'collaborative-editor';
export interface CollaborativeInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
/** Ref to the input element. */
inp?: (el: HTMLInputElement | HTMLTextAreaElement | null) => void;
/** JSON CRDT "str" node API. */
str: () => CollaborativeStr;
/**
* Whether to poll for updates the underlying <input> or <textarea> element
* in case some third-party code modifies the value of the input element.
*/
polling?: boolean;
/**
* Whether the input is multiline. When `input` prop is not provided, this
* determines whether to use <input> or <textarea> element.
*
* @default false
*/
multiline?: boolean;
input?: (inp: (el: HTMLInputElement | HTMLTextAreaElement | null) => void) => React.ReactNode;
}
export declare const CollaborativeInput: React.FC<CollaborativeInputProps>;