UNPKG

@barchart/common-js

Version:
46 lines (45 loc) 1.13 kB
/** * A fluent interface for building a {@link Component} instance. * * @public */ export default class ComponentBuilder { /** * @param {string} name - The name of the schema */ constructor(name: string); /** * The {@link Schema} current schema instance. * * @public * @returns {Component} */ public get component(): Component; /** * Adds a new {@link Field} to the schema and returns the current instance. * * @public * @param {string} name * @param {DataType} dataType * @returns {ComponentBuilder} */ public withField(name: string, dataType: DataType): ComponentBuilder; /** * Adds a "reviver" function for use with JSON.parse. * * @public * @param {Function} reviver * @returns {ComponentBuilder} */ public withReviver(reviver: Function): ComponentBuilder; /** * Returns a string representation. * * @public * @returns {string} */ public toString(): string; #private; } import Component from './../Component.js'; import DataType from './../DataType.js';