usxeditor
Version:
USX editor react component.
34 lines (33 loc) • 1.68 kB
TypeScript
interface ParentProps {
children?: Children;
onChanged: (newVal: string) => void;
onSelectionChanged: (selectionStartIndex: number, selectionEndIndex: number) => void;
onInsertMarker: (isPara: boolean, style: string, newVal?: string) => void;
onDeleteBackward?: (index: number) => void;
}
interface ChildProps {
raw: string;
attrs?: Attributes;
children?: Children;
value?: string;
}
interface Child {
props: ChildProps;
}
declare type Children = Child[] | Child;
export declare function addHandlersToChildren(parentProps: ParentProps): any;
export declare function serialize(children: Children | undefined, replacementIndex?: number, replacementValue?: string | undefined): string;
export declare function serializeMerge(children: Children | undefined, from: number, to: number): string;
interface Attributes {
[key: string]: string;
}
export declare function toAttributesString(attrs: Attributes | undefined): string;
export declare function toOuterUsx(tag: string, attrs: Attributes | undefined, content: string): string;
export declare function readTagFromRaw(raw: string): string;
export declare function getTagName(child: any): string;
export declare function parentTag(tagStack: string[] | null): string | null;
export declare function postIncrementStartOffset(data: any, text: string): number;
export declare function allowMerge(toTag: string, fromTag: string): boolean;
export declare function backspaceDeletesComponent(toTag: string): boolean;
export declare function defaultDeleteBackward(props: any, index: number, componentTagName: string, attrs: Attributes | undefined): void;
export {};