typescript-flat-serializer
Version:
A typescript library to serialize/deserialize classes to/from string in a flat format. Supports inheritance, circular reference and more
13 lines (12 loc) • 677 B
TypeScript
import { Type } from './helpers';
export type CollectionTypeString = 'array' | 'dictionary' | 'map' | 'set';
export type CollectionType = Array<any> | {
[key: string]: any;
} | Map<any, any> | Set<any>;
export type CollectionTransformerEach = (item: any, key: any, collection: CollectionType) => any;
export interface TSFlatCollectionMetadata {
collectionType: CollectionTypeString;
}
export type TSFlatCollectionOptions = TSFlatCollectionMetadata;
export declare const TSFlatCollection: (options: TSFlatCollectionOptions) => Function;
export declare function registerTSFlatCollection<T>(target: Type<T>, propertyName: keyof T, options: TSFlatCollectionOptions): void;