git.schokokeks.org
Repositories
Help
Report an Issue
fs-words.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
6ae1cb8
Branches
Tags
develop-client_server
master
typescript
fs-words.git
client
lib
plankton
comm-client
logic-decl.d.ts
[add] client
Christian Fraß
commited
6ae1cb8
at 2021-03-08 23:52:24
logic-decl.d.ts
Blame
History
Raw
declare module lib_comm { } declare module lib_comm { /** * @author fenris */ interface interface_client<type_message_out, type_message_in> { /** * @desc prepare the client to a point where sending messages can be done without any more preparation * @author fenris */ setup(): lib_call.type_promise<void, Error>; /** * @desc send a message * @author fenris */ send(message: type_message_out): lib_call.type_promise<type_message_in, Error>; } } declare module lib_comm { /** * @author fenris */ type type_response_client_http = { code: int; text: string; }; /** * @author fenris */ type type_parameters_client_http = { protocol?: string; host?: string; port?: int; path?: string; omit_protocol?: boolean; content_type?: string; with_credentials?: boolean; }; /** * @author fenris */ var default_parameters_client_http: type_parameters_client_http; } declare module lib_comm { /** * @author fenris */ type type_client_http = { parameters: type_parameters_client_http; method: string; headers: { [key: string]: string; }; }; /** * @author fenris */ function client_http_construct(parameters?: type_parameters_client_http, method?: string, headers?: { [key: string]: string; }): type_client_http; /** * @author fenris */ function client_http_setup(subject: type_client_http): lib_call.type_promise<void, Error>; /** * @author fenris */ function client_http_send(subject: type_client_http, message: string): lib_call.type_promise<type_response_client_http, Error>; /** * @author Martin Springwald <springwald@greenscale.de> * @author Christian Neubauer <neubauer@greenscale.de> * @author Christian Fraß <frass@greenscale.de> */ function http_get_blob({ "url": url, "mime": type }: { url: string; mime: string; }): lib_call.type_promise<Blob, void>; } declare module lib_comm { } declare module lib_comm { /** * @author fenris */ class class_client_http implements interface_client<string, type_response_client_http> { /** * @author fenris */ protected subject: type_client_http; /** * @author fenris */ constructor(parameters?: type_parameters_client_http, method?: string, headers?: { [key: string]: string; }); /** * @author fenris * @implementation */ setup(): lib_call.type_promise<void, Error>; /** * @author fenris * @implementation */ send(message: string): lib_call.type_promise<type_response_client_http, Error>; } } declare module lib_comm { /** * @author fenris */ class class_client_mhttp implements interface_client<string, string> { /** * @author fenris */ protected core: class_client_http; /** * @author fenris */ constructor(parameters?: type_parameters_client_http); /** * @author fenris * @implementation */ setup(): lib_call.type_promise<void, Error>; /** * @author fenris * @implementation */ send(message: string): lib_call.type_promise<string, Error>; } } declare module lib_comm { /** * @desc wrapper for string-based clients * @author fenris */ class class_client_complex implements interface_client<any, any> { /** * @author fenris */ protected core: interface_client<string, string>; /** * @author fenris */ protected code: lib_code.interface_code<any, string>; /** * @author fenris */ constructor(core: interface_client<string, string>, code?: lib_code.interface_code<any, string>); /** * @author fenris * @implementation */ setup(): lib_call.type_promise<void, Error>; /** * @author fenris * @implementation */ send(message: any): lib_call.type_promise<any, Error>; } }