UNPKG

@zohocrm/typescript-sdk-2.1

Version:
36 lines (35 loc) 1.44 kB
/** * This class converts JSON value to the expected object type and vice versa. */ declare class DataTypeConverter { private static preConverterMap; private static postConverterMap; /** * This method is to initialize the PreConverter and PostConverter lambda functions. */ private static init; private static preConvertObjectData; private static postConvertObjectData; /** * This method is to add PreConverter and PostConverter instance. * @param {string} name - A String containing the data type class name. * @param {object} preConverter - A PreConverter instance. * @param {object} postConverter - A PostConverter instance. */ private static addToMap; /** * This method is to convert JSON value to expected data value. * @param {object} obj - An Object containing the JSON value. * @param {string} type - A String containing the expected method return type. * @throws {Error} */ static preConvert(obj: any, type: string): any; /** * This method to convert JavaScript data to JSON data value. * @param {object} obj - An object containing the JavaScript data value. * @param {string} type - A String containing the expected method return type. * @throws {Error} */ static postConvert(obj: any, type: string): any; } export { DataTypeConverter as MasterModel, DataTypeConverter as DataTypeConverter };