typescript-flat-serializer
Version:
A typescript library to serialize/deserialize classes to/from string in a flat format. Supports inheritance, circular reference and more
11 lines (10 loc) • 513 B
TypeScript
import { Type } from './helpers';
export type PropertyTransformer = (property: any) => any;
export interface TSFlatPropertyMetadata {
beforeStringify?: PropertyTransformer;
afterParse?: PropertyTransformer;
ignore?: boolean;
}
export type TSFlatPropertyOptions = TSFlatPropertyMetadata;
export declare const TSFlatProperty: (options?: TSFlatPropertyOptions) => Function;
export declare function registerTSFlatProperty<T>(target: Type<T>, propertyName: keyof T, options?: TSFlatPropertyOptions): void;