git.schokokeks.org
Repositories
Help
Report an Issue
fs-words.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
faf7e12
Branches
Tags
develop-client_server
master
typescript
fs-words.git
server
lib
plankton
comm-server
logic-decl.d.ts
[mov] server
Christian Fraß
commited
faf7e12
at 2021-03-08 23:05:42
logic-decl.d.ts
Blame
History
Raw
declare module lib_comm { /** * @author fenris */ type type_answering_executor<type_message_in, type_message_out> = (message: type_message_in) => lib_call.type_executor<type_message_out, Error>; /** * @author fenris */ type type_answering_promise<type_message_in, type_message_out> = (message: type_message_in) => lib_call.type_promise<type_message_out, Error>; /** * @author fenris */ type type_answering<type_message_in, type_message_out> = type_answering_promise<type_message_in, type_message_out>; } declare module lib_comm { } declare module lib_comm { /** * @author fenris */ interface interface_server<type_message_in, type_message_out> { /** * @desc this method shall prepare the server to a point, where it just needs to be started afterwards * @param {type_answering<type_message_in, type_message_out>} answering specifies how the server should handle incoming messages to formulate an answer * @author fenris */ setup(answering: type_answering<type_message_in, type_message_out>): lib_call.type_promise<void, Error>; /** * @desc starts to listen * @author fenris */ run(): void; } } declare module lib_comm { /** * @author fenris */ type type_response_server_http = { code: int; text: string; }; /** * @author fenris */ type type_parameters_server_http = { protocol?: string; port?: int; headers?: { [name: string]: string; }; ssl_key?: string; ssl_cert?: string; ssl_ca?: string; }; /** * @author fenris */ var default_parameters_server_http: type_parameters_server_http; } declare module lib_comm { /** * @author fenris */ type type_server_http = { parameters: type_parameters_server_http; answering: type_answering<string, type_response_server_http>; serverinstance: any; }; /** * @author fenris */ function server_http_construct(parameters?: type_parameters_server_http): type_server_http; /** * @author fenris */ function server_http_setup(subject: type_server_http, answering: type_answering<string, type_response_server_http>): lib_call.type_promise<void, Error>; /** * @author fenris */ function server_http_run(subject: type_server_http): void; } declare module lib_comm { } declare module lib_comm { /** * @author fenris */ class class_server_http implements interface_server<string, type_response_server_http> { /** * @author fenris */ protected subject: type_server_http; /** * @author fenris */ constructor(parameters?: type_parameters_server_http); /** * @author fenris * @implementation */ setup(answering: type_answering<string, type_response_server_http>): lib_call.type_promise<void, Error>; /** * @author fenris * @implementation */ run(): void; } } declare module lib_comm { /** * @author fenris */ class class_server_mhttp implements interface_server<string, string> { /** * @author fenris */ protected core: class_server_http; /** * @author fenris */ constructor(parameters?: type_parameters_server_http); /** * @author fenris * @implementation */ setup(answering: type_answering<string, string>): lib_call.type_promise<void, Error>; /** * @author fenris * @implementation */ run(): void; } } declare module lib_comm { /** * @desc wrapper for string-based servers * @author fenris */ class class_server_complex implements interface_server<any, any> { /** * @author fenris */ protected core: interface_server<string, string>; /** * @author fenris */ protected code: lib_code.interface_code<any, string>; /** * @author fenris */ constructor(core: interface_server<string, string>, code?: lib_code.interface_code<any, string>); /** * @author fenris * @implementation */ setup(answering: type_answering<any, any>): lib_call.type_promise<void, Error>; /** * @author fenris * @implementation */ run(): void; } }