declare module lib_code { /** * @author fenris */ interface interface_code { /** * @author fenris */ encode(x: type_from): type_to; /** * @author fenris */ decode(x: type_to): type_from; } } declare module lib_code { } declare module lib_code { /** * @author Christian Fraß */ function custom_encode(function_: (from: type_from) => type_to, from: type_from): type_to; /** * @author Christian Fraß */ function custom_decode(function_: (to: type_to) => type_from, to: type_to): type_from; } declare module lib_code { /** * @author fenris */ class class_code_custom implements interface_code { /** * @author fenris */ private encodefunc; /** * @author fenris */ private decodefunc; /** * @author fenris */ constructor(encodefunc: (from: type_from) => type_to, decodefunc: (to: type_to) => type_from); /** * @implementation * @author fenris */ encode(x: type_from): type_to; /** * @implementation * @author fenris */ decode(x: type_to): type_from; } } declare module lib_code { /** * @author fenris */ function inverse_encode(decode: (to: type_to) => type_from, to: type_to): type_from; /** * @author fenris */ function inverse_decode(encode: (from: type_from) => type_to, from: type_from): type_to; } declare module lib_code { } declare module lib_code { /** * @author fenris */ class class_code_inverse implements interface_code { /** * @author fenris */ protected subject: interface_code; /** * @author fenris */ constructor(subject: interface_code); /** * @implementation * @author fenris */ encode(to: type_to): type_from; /** * @implementation * @author fenris */ decode(from: type_from): type_to; } } declare module lib_code { /** * @author fenris */ function pair_encode(encode_first: (from: type_from) => type_between, encode_second: (between: type_between) => type_to, from: type_from): type_to; /** * @author fenris */ function pair_decode(decode_first: (between: type_between) => type_from, decode_second: (to: type_to) => type_between, to: type_to): type_from; } declare module lib_code { } declare module lib_code { /** * @author fenris */ class class_code_pair implements interface_code { /** * @author fenris */ protected first: interface_code; /** * @author fenris */ protected second: interface_code; /** * @author fenris */ constructor(first: interface_code, second: interface_code); /** * @implementation * @author fenris */ encode(from: type_from): type_to; /** * @implementation * @author fenris */ decode(to: type_to): type_from; } } declare module lib_code { /** * @author fenris */ function chain_encode(encode_links: Array<(from: any) => any>, from: any): any; /** * @author fenris */ function chain_decode(decode_links: Array<(to: any) => any>, to: any): any; } declare module lib_code { /** * @author fenris */ class class_code_chain implements interface_code { /** * @author fenris */ protected links: Array>; /** * @author fenris */ constructor(links: Array>); /** * @implementation * @author fenris */ encode(from: any): any; /** * @implementation * @author fenris */ decode(to: any): any; } } declare module lib_code { /** * @author Christian Fraß */ type type_flatten_from = Array<{ [name: string]: any; }>; /** * @author Christian Fraß */ type type_flatten_to = { keys: Array; data: Array>; }; /** * @author Christian Fraß */ function flatten_encode(from: type_flatten_from, keys?: Array): type_flatten_to; /** * @author Christian Fraß */ function flatten_decode(to: type_flatten_to): type_flatten_from; } declare module lib_code { /** * @author fenris */ class class_code_flatten implements interface_code { /** * @author fenris */ constructor(); /** * @implementation * @author fenris */ encode(x: type_flatten_from): type_flatten_to; /** * @implementation * @author fenris */ decode(x: type_flatten_to): type_flatten_from; } } declare module lib_code { /** * @author fenris */ function jsdate_encode(date: Date): string; /** * @author fenris */ function jsdate_decode(date_: string): Date; } declare module lib_code { } declare module lib_code { /** * @author fenris */ class class_code_jsdate implements interface_code { /** * @author fenris */ constructor(); /** * @implementation * @author fenris */ encode(x: Date): string; /** * @implementation * @author fenris */ decode(x: string): Date; } } declare module lib_code { /** * @author Christian Fraß */ type type_csv_from = { head: Array; data: Array>; }; /** * @author Christian Fraß * @todo escaping */ function csv_encode(from: type_csv_from, { "delimiter": delimiter, "linebreak": linebreak, }?: { delimiter?: string; linebreak?: string; }): string; /** * @author Christian Fraß */ function csv_decode(to: string, { "delimiter": delimiter, "linebreak": linebreak, "with_head": with_head, }?: { delimiter?: string; linebreak?: string; with_head?: boolean; }): type_csv_from; } declare module lib_code { /** * @author fenris */ class class_code_csv implements interface_code { /** * @author fenris */ constructor(); /** * @implementation * @author fenris */ encode(x: type_csv_from): string; /** * @implementation * @author fenris */ decode(x: string): type_csv_from; } }