/** * A mapper to allow some filtering for retrieved variables that could be undefined. */ export declare class LazyMapper { /** * Filter a data and set a default value if the data is undefined. If it's defined, transform the data the way you want then filter whatever the result is. * @param {any} data The data to filter. * @param {T} defaultValue The default value to set to your data in case it's undefined. * @param {(d: any) => T} transform A function to transform your any data type into your actual type. * @param {(d: T) => T} filter A function to filter your data. * @returns {T} The data with your choosen filtered data type. */ static filterData(data: any, defaultValue: T, transform: (d: any) => T, filter: (d: T) => T): T; /** * Filter the value of a received number or the default number in case the received number was undefined. * @param {any} data The data to filter. * @param {number} defaultValue The default number to set. * @param {(d: number) => number} filter The filtering function. * @returns {number} The filtered number. */ static filterNumber(data: any, defaultValue: number, filter: (d: number) => number): number; /** * Filter the value of a received string or the default string in case the received string was undefined. * @param {any} data The data to filter. * @param {string} defaultValue The default string to set. * @param {(d: string) => string} filter The filtering function. * @returns {string} The filtered number. */ static filterString(data: any, defaultValue: string, filter: (d: string) => string): string; /** * Filter a data and set a default value if the data is undefined. If it's defined, transform the data the way you want. * @param {any} data The data to filter. * @param {T} defaultValue The default value to set to your data in case it's undefined. * @param {(d: any) => T} transform A function to transform your any data type into your actual type. * @returns {T} The data with your choosen filtered data type. */ static defaultData(data: any, defaultValue: T, transform: (d: any) => T): T; /** * Retrieve a boolean from a data. If the data is undefined, the value will be set to a default value. * @param {any} data The data to filter. * @param {boolean} defaultValue The default value to set to your data in case it's undefined. * @returns {boolean} The filtered data. */ static defaultBoolean(data: any, defaultValue: boolean): boolean; /** * Retrieve a number from a data. If the data is undefined, the value will be set to a default value. * @param {any} data The data to filter. * @param {number} defaultValue The default value to set to your data in case it's undefined. * @returns {number} The filtered data. */ static defaultNumber(data: any, defaultValue: number): number; /** * Retrieve a string from a data. If the data is undefined, the value will be set to a default value. * @param {any} data The data to filter. * @param {string} defaultValue The default value to set to your data in case it's undefined. * @returns {string} The filtered data. */ static defaultString(data: any, defaultValue: string): string; /** * Convert a data to a boolean type. If undefined, it's set to false by default. * @param {any} data The data to convert. * @returns {boolean} The boolean representation of the data. */ static boolean(data: any): boolean; /** * Convert a data to a number type. If undefined, it's set to 0 by default. * @param {any} data The data to convert. * @returns {number} The number representation of the data. */ static number(data: any): number; /** * Convert a data to a string type. If undefined, it's set to "" by default. * @param {any} data The data to convert. * @returns {string} The string representation of the data. */ static string(data: any): string; } //# sourceMappingURL=lazyMapper.d.ts.map