stringiful
Version:
Easy to use stringify function with built-in configurable formatters
18 lines • 936 B
TypeScript
import { AxiosErrorFormatterConfig } from './errors/axiosError';
import { ErrorFormatterConfig } from './errors/error';
import { DateFormatterConfig } from './basicTypes/date';
import { StringFormatterConfig } from './basicTypes/string';
export declare type formatFunction = (obj: any) => any;
export declare type matchesFunction = (obj: any) => boolean;
interface IObjectFormatter {
matches: matchesFunction;
format?: formatFunction;
fieldsWhitelist?: string[];
fieldsBlacklist?: string[];
}
export declare const FormatterTypeOptions: readonly ["date", "axiosError", "string", "error"];
export declare type FormatterType = typeof FormatterTypeOptions[number];
export declare type ObjectFormatter = IObjectFormatter;
export declare type IFormatterConfig = ObjectFormatter | StringFormatterConfig | AxiosErrorFormatterConfig | DateFormatterConfig | ErrorFormatterConfig;
export {};
//# sourceMappingURL=interface.d.ts.map