git.schokokeks.org
Repositories
Help
Report an Issue
fs-words.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
2f5e2be
Branches
Tags
develop-client_server
master
typescript
fs-words.git
server
lib
plankton
code
logic-decl.d.ts
[mod] server:lib:plankton
Christian Fraß
commited
2f5e2be
at 2021-03-12 22:01:27
logic-decl.d.ts
Blame
History
Raw
declare module lib_code { /** * @author fenris */ interface interface_code<type_from, type_to> { /** * @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ß <frass@greenscale.de> */ function custom_encode<type_from, type_to>(function_: (from: type_from) => type_to, from: type_from): type_to; /** * @author Christian Fraß <frass@greenscale.de> */ function custom_decode<type_from, type_to>(function_: (to: type_to) => type_from, to: type_to): type_from; } declare module lib_code { /** * @author fenris */ class class_code_custom<type_from, type_to> implements interface_code<type_from, type_to> { /** * @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<type_from, type_to>(decode: (to: type_to) => type_from, to: type_to): type_from; /** * @author fenris */ function inverse_decode<type_from, type_to>(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<type_from, type_to> implements interface_code<type_to, type_from> { /** * @author fenris */ protected subject: interface_code<type_from, type_to>; /** * @author fenris */ constructor(subject: interface_code<type_from, type_to>); /** * @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<type_from, type_between, type_to>(encode_first: (from: type_from) => type_between, encode_second: (between: type_between) => type_to, from: type_from): type_to; /** * @author fenris */ function pair_decode<type_from, type_between, type_to>(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<type_from, type_between, type_to> implements interface_code<type_from, type_to> { /** * @author fenris */ protected first: interface_code<type_from, type_between>; /** * @author fenris */ protected second: interface_code<type_between, type_to>; /** * @author fenris */ constructor(first: interface_code<type_from, type_between>, second: interface_code<type_between, type_to>); /** * @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<any, any> { /** * @author fenris */ protected links: Array<interface_code<any, any>>; /** * @author fenris */ constructor(links: Array<interface_code<any, any>>); /** * @implementation * @author fenris */ encode(from: any): any; /** * @implementation * @author fenris */ decode(to: any): any; } } declare module lib_code { /** * @author Christian Fraß <frass@greenscale.de> */ type type_flatten_from = Array<{ [name: string]: any; }>; /** * @author Christian Fraß <frass@greenscale.de> */ type type_flatten_to = { keys: Array<string>; data: Array<Array<any>>; }; /** * @author Christian Fraß <frass@greenscale.de> */ function flatten_encode(from: type_flatten_from, keys?: Array<string>): type_flatten_to; /** * @author Christian Fraß <frass@greenscale.de> */ function flatten_decode(to: type_flatten_to): type_flatten_from; } declare module lib_code { /** * @author fenris */ class class_code_flatten implements interface_code<type_flatten_from, type_flatten_to> { /** * @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<Date, string> { /** * @author fenris */ constructor(); /** * @implementation * @author fenris */ encode(x: Date): string; /** * @implementation * @author fenris */ decode(x: string): Date; } } declare module lib_code { /** * @author Christian Fraß <frass@greenscale.de> */ type type_csv_from = { head: Array<string>; data: Array<Array<string>>; }; /** * @author Christian Fraß <frass@greenscale.de> * @todo escaping */ function csv_encode(from: type_csv_from, { "delimiter": delimiter, "linebreak": linebreak, }?: { delimiter?: string; linebreak?: string; }): string; /** * @author Christian Fraß <frass@greenscale.de> */ 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<type_csv_from, string> { /** * @author fenris */ constructor(); /** * @implementation * @author fenris */ encode(x: type_csv_from): string; /** * @implementation * @author fenris */ decode(x: string): type_csv_from; } }