@amalto/key-value-editor
Version:
A form input that can build a custom key value object.
44 lines (43 loc) • 1.22 kB
TypeScript
import * as React from 'react';
declare namespace KeyValueEditor {
interface KeyValDef {
[key: string]: {
contentType: string;
contentBytes: string;
};
}
interface KeyValStoreDef {
[idx: string]: {
key: string;
contentType: string;
contentBytes: string;
};
}
interface Props extends React.ClassAttributes<KeyValueEditor> {
handleChange: (keyValues: KeyValDef) => void;
keyValues: KeyValDef;
locale: string;
readonly?: boolean;
children?: React.ReactNode;
key?: React.ReactText;
ref?: React.Ref<KeyValueEditor>;
}
interface State {
wordings?: {
[key: string]: string;
};
}
}
declare class KeyValueEditor extends React.Component<KeyValueEditor.Props, KeyValueEditor.State> {
constructor(props: KeyValueEditor.Props);
render(): JSX.Element;
private downloadFile;
private addKeyValue;
private removeKeyValue;
private handleKeyChange;
private handleValueChange;
private handleFileUpload;
private getKeyValueStore;
private getKeyValuesObject;
}
export default KeyValueEditor;