@barchart/common-js
Version:
Library of common JavaScript utilities
52 lines (51 loc) • 1.08 kB
TypeScript
/**
* A simple field.
*
* @public
*/
export default class Field {
/**
* @param {string} name
* @param {DataType} dataType
* @param {boolean=} optional
* @param {boolean=} array
*/
constructor(name: string, dataType: DataType, optional?: boolean | undefined, array?: boolean | undefined);
/**
* Name of the field.
*
* @public
* @returns {string}
*/
public get name(): string;
/**
* Type of the field.
*
* @public
* @returns {DataType}
*/
public get dataType(): DataType;
/**
* Indicates if the field can be omitted without violating the schema.
*
* @public
* @returns {boolean}
*/
public get optional(): boolean;
/**
* Indicates if the field is an array.
*
* @public
* @returns {boolean}
*/
public get array(): boolean;
/**
* Returns a string representation.
*
* @public
* @returns {string}
*/
public toString(): string;
#private;
}
import DataType from './DataType.js';