hadron-document
Version:
Hadron Document
49 lines • 1.36 kB
TypeScript
import type { TypeCastTypes } from 'hadron-type-checker';
import type { BSONValue } from '../utils';
import type { Element } from '../element';
/**
* CRUD editor for standard values.
*/
export default class StandardEditor {
element: Element;
type: TypeCastTypes;
displayType: TypeCastTypes;
editing: boolean;
/**
* Create the editor with the element.
*
* @param element - The hadron document element.
*/
constructor(element: Element, displayType?: TypeCastTypes);
/**
* Edit the element with the provided value.
*
* @param {Object} value - The new value.
*/
edit(value: BSONValue): void;
/**
* Edit the element via a paste.
*
* @param {String} value - The value.
*/
paste(value: string): void;
/**
* Get the number of characters the value should display.
*
* @param {Boolean} editMode - If the element is being edited.
*
* @returns {Number} The number of characters.
*/
size(): number;
/**
* Get the value being edited. Always returns a string because this value will
* always be used by browser input elements that operate on nothing but
* strings
*
* @returns {string} The value.
*/
value(): string;
start(): void;
complete(): void;
}
//# sourceMappingURL=standard.d.ts.map