/** * @author fenris */ type int = number; /** * @author fenris */ type float = number; declare class Buffer { constructor(x: string, modifier?: string); toString(modifier?: string): string; } declare namespace lib_plankton.base { /** * @author fenris */ function environment(): string; } /** * @author fenris */ type type_pseudopointer = { value: type_value; }; /** * @author fenris */ declare function pseudopointer_null(): type_pseudopointer; /** * @author fenris */ declare function pseudopointer_make(value: type_value): type_pseudopointer; /** * @author fenris */ declare function pseudopointer_isset(pseudopointer: type_pseudopointer): boolean; /** * @author fenris */ declare function pseudopointer_read(pseudopointer: type_pseudopointer): type_value; /** * @author fenris */ declare function pseudopointer_write(pseudopointer: type_pseudopointer, value: type_value): void; /** * @author fenris */ declare var instance_verbosity: int; /** * @desc the ability to check for equality with another element of the same domain * @author fenris */ interface interface_collatable { /** * @author fenris */ _collate(value: type_value): boolean; } /** * @author fenris */ declare function instance_collate(value1: (type_value & { _collate?: ((value: type_value) => boolean); }), value2: type_value): boolean; /** * @desc the ability to compare with another element of the same domain for determining if the first is "smaller than or equal to" the latter * @author fenris */ interface interface_comparable { /** * @author fenris */ _compare(value: type_value): boolean; } /** * @author fenris */ declare function instance_compare(value1: (type_value & { _compare: ((value: type_value) => boolean); }), value2: type_value): boolean; /** * @desc the ability to create an exact copy * @author fenris */ interface interface_cloneable { /** * @author fenris */ _clone(): type_value; } /** * @author fenris */ declare function instance_clone(value: (type_value & { _clone?: (() => type_value); })): type_value; /** * @author fenris */ interface interface_hashable { /** * @author fenris */ _hash(): string; } /** * @desc the ability to generate a string out of the element, which identifies it to a high degree * @author fenris */ declare function instance_hash(value: (type_value & { _hash?: (() => string); })): string; /** * @author fenris */ interface interface_showable { /** * @author fenris */ _show(): string; } /** * @desc the ability to map the element to a textual representation (most likely not injective) * @author fenris */ declare function instance_show(value: (type_value & { _show?: (() => string); })): string; /** * @author frac */ interface interface_decorator { /** * @author frac */ core: type_core; } /** * @author frac */ declare class class_observer { /** * @author frac */ protected counter: int; /** * @author frac */ protected actions: { [id: string]: (information: Object) => void; }; /** * @author frac */ protected buffer: Array; /** * @author frac */ constructor(); /** * @author frac */ empty(): boolean; /** * @author frac */ flush(): void; /** * @author frac */ set(id: string, action: (information: Object) => void): void; /** * @author frac */ del(id: string): void; /** * @author frac */ add(action: (information: Object) => void): void; /** * @author frac */ notify(information?: Object, delayed?: boolean): void; /** * @author frac */ rollout(): void; } /** * @author frac */ /** * @author frac */ /** * @author frac */ declare class class_error extends Error { /** * @author frac */ protected suberrors: Array; /** * @author frac */ protected mess: string; /** * @author frac */ constructor(message: string, suberrors?: Array); /** * @override * @author frac */ toString(): string; } declare namespace lib_plankton.base { /** * returns the current UNIX timestamp * * @author fenris */ function get_current_timestamp(rounded?: boolean): float; /** */ function object_merge(core: Record, mantle: Record): Record; /** */ function buffer_show(buffer: Buffer, { "block_size": option_block_size, "break_char": option_break_char, }?: { block_size?: int; break_char?: string; }): string; } declare module lib_plankton.pod { /** * @author fenris */ type type_pod = { kind: ("empty" | "filled"); value?: type_value; }; /** * @author fenris */ function make_empty(): type_pod; /** * @author fenris */ function make_filled(value: type_value): type_pod; /** * whether the pod is filled * * @author fenris */ function is_filled(pod: type_pod): boolean; /** * return the value, stored in the pod-wrapper * * @author fenris */ function cull(pod: type_pod): type_value; /** * to pass on a empty-pod or to use a filled-pod * * @author fenris */ function propagate(pod: type_pod, function_: ((value: type_value) => type_value_)): type_pod; /** * @author fenris */ function distinguish(pod: type_pod, function_empty: (() => type_result), function_filled: ((value: type_value) => type_result)): type_result; /** */ function show(pod: type_pod, options?: { show_value?: ((value: type_value) => string); }): string; } declare module lib_plankton.pod { /** */ class class_pod { private subject; constructor(subject: type_pod); tear(): type_pod; static empty(): class_pod; static filled(value: type_value): class_pod; is_empty(): boolean; is_filled(): boolean; cull(): type_value; show(show_value?: any): string; toString(): string; propagate(function_: ((value: type_value) => type_value_)): class_pod; distinguish(function_empty: (() => type_result), function_filled: ((value: type_value) => type_result)): type_result; } } /** * might be completely obsolete */ declare namespace lib_plankton.call { /** * @author fenris */ type type_promise = Promise; /** * @author fenris */ function promise_reject(reason: type_reason): type_promise; /** * @author fenris */ function promise_resolve(result: type_result): type_promise; /** * @author fenris */ function promise_make(executor: (resolve: ((result?: type_result) => void), reject: ((reason?: type_reason) => void)) => void): type_promise; /** * @author fenris */ function promise_then_close(promise: type_promise, resolver: ((result: type_result) => void), rejector: ((reason: type_reason) => void)): void; /** * @author fenris */ function promise_then_append(promise: type_promise, resolver: ((result: type_result) => type_promise), rejector?: ((reason: type_reason) => type_promise)): type_promise; /** * @author fenris */ function promise_all(promises: Array>): type_promise, type_reason>; /** * @author fenris */ function promise_chain(promises: (Array<(input: type_result) => type_promise>), start?: type_result): type_promise; /** * @author fenris */ function promise_condense(promises: Array<() => type_promise>): type_promise, type_reason>; /** * @author fenris */ function promise_group(promises: Record type_promise)>, options?: { serial?: boolean; }): type_promise, type_reason>; /** * @author fenris */ function promise_wrap(promise: type_promise, transformator_result: ((reason: type_result_inner) => type_result_outer), transformator_reason?: ((reason: type_reason) => type_reason)): type_promise; /** * @author fenris */ /** * @author fenris */ /** * @author fenris */ function promise_attach(state: Record, promise: type_promise, name: string): type_promise, type_reason>; /** * @author fenris */ function promise_delay(promise: type_promise, delay: int): type_promise; } /** * initializer might be obsolete, since promises are reusable after having been resolved or rejected */ declare namespace lib_plankton.call { /** * @author fenris */ enum enum_initializer_state { initial = 0, waiting = 1, successful = 2, failed = 3 } /** * @author fenris */ type type_initializer = { fetcher: (() => type_promise); state?: enum_initializer_state; queue: Array<{ resolve: ((result?: type_result) => void); reject: ((reason?: type_reason) => void); }>; result?: type_result; reason?: type_reason; }; /** * @author fenris */ function initializer_make(fetcher: (() => type_promise)): type_initializer; /** * @author fenris */ function initializer_reset(subject: type_initializer): void; /** * @author fenris */ function initializer_state(subject: type_initializer): enum_initializer_state; /** * @author fenris */ function initializer_get(subject: type_initializer): type_promise; } declare namespace lib_plankton.call { /** * @author fenris */ type type_deferral = { representation: (input: type_input) => Promise; }; /** * @author fenris * @desc activates the deferral and handles its output according to a given procedure * @param {(value : type_value)=>void} procedure a function which receives the output of the deferral as argument */ function deferral_use(deferral: type_deferral, input: type_input, procedure: (output: type_output) => void): void; /** * @author fenris * @desc creates a deferral-subject (similar to "new Promise", where "convey" reflects "resolve"/"reject") */ function deferral_make(handler: (input: type_input, convey: (output: type_output) => void) => void): type_deferral; /** * @author fenris * @desc wraps a simple function into a deferral (similar to "Promise.resolve"/"Promise.reject") */ function deferral_wrap(function_: (input: type_input) => type_output): type_deferral; /** * @author fenris */ function deferral_id(): type_deferral; /** * @author fenris */ function deferral_const(value: type_value): type_deferral; /** * @author fenris */ function deferral_delay(output: type_output, delay: int): type_deferral; /** * @author fenris * @desc connects two deferrals to form a new one; the output of the first is taken as input for the second * (similar to "Promise.then" when passing a function which returns a new promise) * @param {type_deferral} first a simple deferral * @param {(value1 : type_value1)=>type_deferral} second a function depending from a value returning a deferral */ function deferral_compose_serial(first: type_deferral, second: type_deferral): type_deferral; /** * @author fenris */ function deferral_compose_parallel({ "left": deferral_left, "right": deferral_right, }: { left: type_deferral; right: type_deferral; }): type_deferral; /** * @author fenris * @desc repeatedly applied serial composition */ function deferral_chain(members: Array>): type_deferral; /** * @author fenris */ } declare namespace lib_plankton.call { /** * @author fenris */ class class_deferral { /** * @author fenris */ private subject; /** * @author fenris */ private constructor(); /** * @author fenris */ private static _cram; /** * @author fenris */ private static _tear; /** * @author fenris */ static make(handler: (input: type_input, convey: (value: type_output) => void) => void): class_deferral; /** * @author fenris */ use(input: type_input, procedure: (value: type_output) => void): void; /** * @author fenris */ compose_serial(second: class_deferral): class_deferral; /** * @author fenris */ static chain(members: Array>): class_deferral; /** * @author fenris */ static wrap(function_: (input: type_input) => type_output): class_deferral; /** * @author fenris */ static const_(value: type_value): class_deferral; /** * @author fenris */ static delay(output: type_output, delay: int): class_deferral; } } declare namespace lib_plankton.call { /** * converts the "arguments"-map into an array * * @param {Object} args * @author fenris */ export function args2list(args: any): Array; /** * just the empty function; useful for some callbacks etc. * * @author fenris */ export function nothing(): void; /** * just the identity; useful for some callbacks etc.; defined as function instead of const for using type parameters * * @author fenris */ export function id(x: type_value): type_value; /** * just the identity; useful for some callbacks etc. * * @author fenris */ export function const_(x: type_value): ((y: any) => type_value); /** * composes two functions (i.e. returns a function that return the result of the successive execution of both input-functions) * * @param {function} function_f * @param {function} function_g * @author fenris */ export function compose(function_f: ((type_x: any) => type_y), function_g: ((type_y: any) => type_z)): ((value: type_x) => type_z); /** * transforms a function with sequential input to a function with leveled input; example: add(2,3) = curryfy(add)(2)(3) * * @param {function} f * @return {function} the currified version of the in put function * @author fenris */ export function curryfy(f: Function): Function; /** * @author fenris */ export function convey(value: any, functions: Array): any; /** */ class class_value_wrapper { /** */ private value; /** */ constructor(value: type_value); /** */ convey(function_: ((value: type_value) => type_value_result)): class_value_wrapper; /** */ cull(): type_value; } /** */ export function wrap(value: type_value): class_value_wrapper; /** * @author fenris */ export function timeout(procedure: (() => void), delay_in_seconds: float): int; /** * Promise version of "setTimeout" * * @author fenris */ export function defer(seconds: float, action: (() => type_result)): Promise; /** * a definition for a value being "defined" * * @author neuc */ export function is_def(obj: type_value, options?: { null_is_valid?: boolean; }): boolean; /** * returns the value if set and, when a type is specified, if the type is correct, if not return default_value * * @author neuc */ export function def_val(value: any, default_value: any, options?: { type?: (null | string); null_is_valid?: boolean; }): any; /** * provides the call for an attribute of a class as a regular function; useful for processing lists of objects * * @param {string} name the name of the attribute * @return {function} * @author fenris */ export function attribute(name: string): ((object: type_object) => type_attribute); /** * provides a method of a class as a regular function; useful for processing lists of objects * * @param {string} name the name of the method * @return {function} * @author fenris */ export function method(name: string): ((object: type_object) => type_output); /** * @author fenris */ export type type_coproduct = { kind: string; data?: any; }; /** * @author fenris */ export function distinguish(coproduct: type_coproduct, handlers: Record type_output)>, options?: { fallback?: (null | ((coproduct?: type_coproduct) => type_output)); }): type_output; /** */ export function try_catch_wrap(get_value: (() => type_value)): { value: (null | type_value); error: (null | any); }; /** */ export function try_catch_wrap_async(get_value: (() => Promise)): Promise<{ value: (null | type_value); error: (null | any); }>; export {}; } declare namespace lib_plankton.file { /** * @author fenris */ function read(path: string): Promise; /** * @author fenris */ function write(path: string, content: string): Promise; /** * @author fenris */ function blob_read_text(blob: Blob): lib_plankton.call.type_promise; /** * @author fenris */ function blob_read_arraybuffer(blob: Blob): lib_plankton.call.type_promise; /** * @author fenris */ function blob_read_dataurl(blob: Blob): lib_plankton.call.type_promise; /** * @author fenris */ function blob_write_text(text: string): lib_plankton.call.type_promise; } declare namespace lib_plankton.code { /** * @author fenris */ interface interface_code { /** * @author fenris */ encode(x: type_from): type_to; /** * @author fenris */ decode(x: type_to): type_from; } } declare namespace lib_plankton.code { /** * @author fenris */ type type_code = { /** * @author fenris */ encode: (x: type_from) => type_to; /** * @author fenris */ decode: (x: type_to) => type_from; }; } declare namespace lib_plankton.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 namespace lib_plankton.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 namespace lib_plankton.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 namespace lib_plankton.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 namespace lib_plankton.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 namespace lib_plankton.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 namespace lib_plankton.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 namespace lib_plankton.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 namespace lib_plankton.json { /** */ type type_source = any; /** */ type type_target = string; /** * @author fenris */ export function encode(source: type_source, options?: { formatted?: boolean; }): type_target; /** * @author fenris */ export function decode(target: type_target): type_source; /** * @author fenris */ export function implementation_code(): lib_plankton.code.type_code; export {}; } declare namespace lib_plankton.json { /** * @author fenris */ class class_json implements lib_plankton.code.interface_code { /** * @author fenris */ constructor(); /** * @implementation * @author fenris */ encode(x: any): string; /** * @implementation * @author fenris */ decode(x: string): any; } } declare namespace lib_plankton.base64 { /** * @author fenris */ function encode(x: string): string; /** * @author fenris */ function decode(x: string): string; } declare namespace lib_plankton.base64 { /** * @author fenris */ class class_base64 implements lib_plankton.code.interface_code { /** * @author fenris */ constructor(); /** * @implementation * @author fenris */ encode(x: string): string; /** * @implementation * @author fenris */ decode(x: string): string; } } declare namespace lib_plankton.email { /** */ function send(smtp_credentials: { host: string; port: int; username: string; password: string; }, sender: string, receivers: Array, subject: string, content: string): Promise; } declare namespace lib_plankton.log { /** */ enum enum_level { debug = 0, info = 1, notice = 2, warning = 3, error = 4 } /** */ type type_entry = { level: enum_level; incident: string; tags: Array; details: any; }; /** */ type type_channel_description = lib_plankton.call.type_coproduct; /** */ type type_channel_logic = { send: ((entry: type_entry) => void); }; /** */ type type_logger_data = Array; /** */ type type_logger_logic = Array; /** */ type type_format_definition = ({ kind: "jsonl"; data: { structured: boolean; }; } | { kind: "human_readable"; data: {}; }); } declare namespace lib_plankton.log { /** */ function level_order(level1: enum_level, level2: enum_level): boolean; /** */ function level_show(level: enum_level, { "abbreviated": option_abbreviated, }?: { abbreviated?: boolean; }): string; /** */ function level_decode(level_string: string): enum_level; } declare namespace lib_plankton.log { /** * @todo use label */ function get_logger_logic(logger_data: type_logger_data): type_logger_logic; /** */ function format_entry(format_definition: type_format_definition, entry: type_entry): string; /** */ function parse_format_definition(format_definition_raw: any): type_format_definition; } declare namespace lib_plankton.log.channel.filtered { /** */ type type_predicate = ((entry: type_entry) => boolean); /** */ type type_subject = { /** * @todo check if it has to be logic */ core: type_channel_logic; predicate: type_predicate; }; /** */ function predicate_incident(substring: string): type_predicate; /** */ function predicate_level(threshold: enum_level): type_predicate; /** */ function predicate_tag(tag: string): type_predicate; /** * combines other predicates in disjunctive normal form */ function predicate_complex(definition: Array>): type_predicate; /** */ function send(subject: type_subject, entry: type_entry): void; /** */ function logic(subject: type_subject): type_channel_logic; } declare namespace lib_plankton.log.channel.minlevel { /** */ type type_subject = { /** * @todo check if it has to be logic */ core: type_channel_logic; threshold: enum_level; }; /** */ function send(subject: type_subject, entry: type_entry): void; /** */ function logic(subject: type_subject): type_channel_logic; } /** * output for writing log entries to web console */ declare namespace lib_plankton.log.channel.console_ { /** */ type type_subject = {}; /** * @todo tags */ function send(subject: type_subject, entry: type_entry): void; /** */ function logic(subject: type_subject): type_channel_logic; } declare namespace lib_plankton.log { /** */ function get_channel_logic(channel_description: type_channel_description): type_channel_logic; } declare namespace lib_plankton.log { /** */ function default_logger(): type_logger_data; } declare namespace lib_plankton.log { /** */ function set_main_logger(logger_data: type_logger_data): void; /** * consumes a log entry, i.e. sends it to all channels */ function send_(logger: type_logger_logic, entry: type_entry): void; /** * [convenience] * * @todo rename to "send" */ function debug_(logger: type_logger_logic, incident: string, { "tags": option_tags, "details": option_details, }?: { tags?: Array; details?: any; }): void; /** * [convenience] * * @todo rename to "info" */ function info_(logger: type_logger_logic, incident: string, { "tags": option_tags, "details": option_details, }?: { tags?: Array; details?: any; }): void; /** * [convenience] * * @todo rename to "notice" */ function notice_(logger: type_logger_logic, incident: string, { "tags": option_tags, "details": option_details, }?: { tags?: Array; details?: any; }): void; /** * [convenience] * * @todo rename to "warning" */ function warning_(logger: type_logger_logic, incident: string, { "tags": option_tags, "details": option_details, }?: { tags?: Array; details?: any; }): void; /** * [convenience] * * @todo rename to "error" */ function error_(logger: type_logger_logic, incident: string, { "tags": option_tags, "details": option_details, }?: { tags?: Array; details?: any; }): void; /** * [convenience] */ function _send(entry: type_entry): void; /** * [convenience] */ function _debug(incident: string, { "tags": option_tags, "details": option_details, }?: { tags?: Array; details?: any; }): void; /** * [convenience] */ function _info(incident: string, { "tags": option_tags, "details": option_details, }?: { tags?: Array; details?: any; }): void; /** * [convenience] */ function _notice(incident: string, { "tags": option_tags, "details": option_details, }?: { tags?: Array; details?: any; }): void; /** * [convenience] */ function _warning(incident: string, { "tags": option_tags, "details": option_details, }?: { tags?: Array; details?: any; }): void; /** * [convenience] */ function _error(incident: string, { "tags": option_tags, "details": option_details, }?: { tags?: Array; details?: any; }): void; /** * [convenience] * * @deprecated use ._debug instead! */ function debug(incident: string, details?: any, tags?: Array): void; /** * [convenience] * * @deprecated use ._info instead! */ function info(incident: string, details?: any, tags?: Array): void; /** * [convenience] * * @deprecated use ._notice instead! */ function notice(incident: string, details?: any, tags?: Array): void; /** * [convenience] * * @deprecated use ._warning instead! */ function warning(incident: string, details?: any, tags?: Array): void; /** * [convenience] * * @deprecated use ._error instead! */ function error(incident: string, details?: any, tags?: Array): void; } declare var plain_text_to_html: (text: string) => string; /** * @desc makes a valid */ declare var format_sentence: (str: string, rtl?: boolean, caseSense?: boolean) => string; declare var fill_string_template: (template_string: string, object: any, fabric: Function, delimiter: string, default_string: string, sloppy: boolean) => string; declare var make_string_template: (_template: string, _fabrics?: Object) => (object: { [key: string]: string; }) => string; declare var make_eml_header: (object: { [key: string]: string; }) => string; declare var make_eml_body: Object; declare namespace lib_plankton.string { /** * @author neuc,frac */ function empty(str: string): boolean; /** * @desc returns a unique string * @param {string} prefix an optional prefix for the generated string * @return {string} * @author fenris */ function generate(prefix?: string): string; /** * @author fenris */ function join(parts: Array, glue?: string): string; /** * @desc splits a string, but returns an empty list, if the string is empty * @param {string} chain * @param {string} separator * @return {Array} * @author fenris */ function split(chain: string, separator: string): Array; /** * @author neu3no */ function explode(str: string, needle: string, max: int): Array; /** * @desc concats a given word with itself n times * @param {string} word * @param {int} * @return {string} * @author fenris */ function repeat(word: string, count: int): string; /** * @desc lengthens a string by repeatedly appending or prepending another string * @param {string} word the string to pad * @param {int} length the length, which the result shall have * @param {string} symbol the string, which will be added (multiple times) * @param {boolean} [prepend]; whether to prepend (~true) or append (~false); default: false * @return {string} the padded string * @author fenris */ function pad(word: string, length: int, symbol?: string, mode?: string): string; /** * @desc checks if a given string conttains a certain substring * @param {string} string * @param {string} part * @return {boolean} * @author fenris */ function contains(chain: string, part: string): boolean; /** * @desc checks if a given string starts with a certain substring * @param {string} string * @param {string} part * @return {boolean} * @author fenris */ function startsWith(chain: string, part: string): boolean; /** * @desc checks if a given string ends with a certain substring * @param {string} string * @param {string} part * @return {boolean} * @author fenris */ function endsWith(chain: string, part: string): boolean; /** * @desc count the occourrences of a string in a string * @param string haystack_string the string wich should be examined * @param string needle_string the string which should be counted * @author neuc */ function count_occourrences(haystack_string: string, needle_string: string, check_escape: boolean): int; /** * @author fenris */ function replace(str: string, replacements: Array<{ from: string; to: string; }>, options?: {}): string; /** * @desc replaces occurences of "{{name}}" in a string by the corresponding values of an argument object * @author fenris */ function coin(str: string, args: { [id: string]: string; }, options?: { legacy?: boolean; open?: string; close?: string; }): string; /** * @author fenris * @deprecated use limit */ function cut(str: string, length: int, delimiter?: string): string; /** */ function limit(str: string, options?: { length?: int; indicator?: string; }): string; /** */ function slice(str: string, size: int): Array; /** */ function capitalize(str: string): string; } /** * @deprecated */ declare namespace lib_string { const empty: typeof lib_plankton.string.empty; const generate: typeof lib_plankton.string.generate; const split: typeof lib_plankton.string.split; const explode: typeof lib_plankton.string.repeat; const repeat: typeof lib_plankton.string.repeat; const pad: typeof lib_plankton.string.pad; const contains: typeof lib_plankton.string.contains; const startsWith: typeof lib_plankton.string.startsWith; const endsWith: typeof lib_plankton.string.endsWith; const count_occourrences: typeof lib_plankton.string.count_occourrences; const coin: typeof lib_plankton.string.coin; const stance: typeof lib_plankton.string.coin; const cut: typeof lib_plankton.string.cut; } declare namespace lib_plankton.string { /** * an implementation of c sprintf * @param {string} string format string * @param {array} args arguments which should be filled into * @returns {string} */ var sprintf: (input: string, args?: Array, original?: any) => string; /** * an implementation of c printf * @param {string} string format string * @param {array} args arguments which should be filled into * @returns {string} */ function printf(format: any, args: any): void; } declare var sprintf: (input: string, args?: Array, original?: any) => string; declare var printf: typeof lib_plankton.string.printf; declare var eml_log: any; declare var track_exports: any; declare var make_logger: (prefix: any, current_loglevel: any) => (obj: any, lvl: any) => void; declare namespace lib_plankton.object { /** * @author fenris * @deprecated use the "??" operator instead */ function fetch(object: Object, fieldname: string, options?: { fallback?: type_value; escalate?: boolean; }): type_value; /** */ function map(object_from: Record, transformator: ((value_from: type_from, key?: string) => type_to)): Record; /** * gibt ein Objekt mit bestimmten Einträgen des Eingabe-Objekts zurück */ function filter(object_from: Record, predicate: ((value_from: type_value, key?: string) => boolean)): Record; /** * wandelt ein Array mit Einträgen der Form {key,value} in ein entsprechendes Objekt um * * @deprecated use Object.fromEntries instead! */ function from_array(array: Array<{ key: string; value: type_value; }>): Record; /** * wandelt ein Objekt in ein entsprechendes Array mit Einträgen der Form {key,value} um * * @deprecated use Object.entries insetad! */ function to_array(object: Record): Array<{ key: string; value: type_value; }>; /** * gibt eine Liste von Schlüsseln eines Objekts zurück * * @deprecated use Object.keys instead! */ function keys(object: Record): Array; /** * gibt eine Liste von Werten eines Objekts zurück * * @deprecated use Object.values instead! */ function values(object: Record): Array; /** * liest ein Baum-artiges Objekt an einer bestimmten Stelle aus */ function path_read(object: Object, path: string, options?: { fallback?: type_value; escalate?: boolean; }): type_value; /** * schreibt einen Wert an eine bestimmte Stelle in einem Baum-artigen Objekt */ function path_write(object: Object, path: string, value: type_value, construct?: boolean): void; /** * prüft ob ein Objekt einem bestimmten Muster entspricht * * @deprecated not very useful */ function matches(object: Record, pattern: Record, options?: { collate?: ((value_pattern: type_value_pattern, value_object: type_value_object) => boolean); }): boolean; /** * erzeugt eine Projektion eines Baum-artigen Objekts in ein Listen-artiges Objekt */ function flatten(value: any, options?: { separator?: string; key_for_array_element?: ((index: int) => string); }): Record; /** * @deprecated use Object.assign instead! */ function clash(x: Record, y: Record, options?: { overwrite?: boolean; hooks?: { existing?: ((key?: string, value_old?: any, value_new?: any) => void); }; }): Record; /** * @deprecated use Object.assign instead! */ function patch(core: (null | Record), mantle: (null | Record), options?: { deep?: boolean; path?: (null | string); }): void; /** * @deprecated use Object.assign instead! */ function patched(core: Record, mantle: Record, options?: { deep?: boolean; }): Record; /** * @deprecated use Object.assign instead! */ function attached(object: Record, key: string, value: any): Record; /** * @author fenris */ function copy(object: Record): Record; } declare namespace lib_plankton.translate { /** * @author fenris */ type type_package_meta = { identifier: string; name?: string; }; /** * @author fenris */ type type_package = { meta: type_package_meta; tree: { [id: string]: string; }; }; /** * @desc the level of verbosity, specifiying how much output the system shall provide about its actions * @author fenris */ var _verbosity: int; /** * @desc moves a language to the top of the order, making it the primary one * @author fenris */ function promote(identifier: string): void; /** * @desc adds a package to the sytem * @author fenris */ function add(package_: type_package): void; /** * @desc integrates a package to the system, i.e. creates a new one if none existed so far or merges with an existing one * @author fenris */ function feed(package_: type_package): void; /** * @desc tries to retrieve a translation for a specific package identifier * @author fenris */ function fetch(identifier: string, path: string, args?: { [id: string]: string; }): lib_plankton.pod.type_pod; /** * @desc retrieves a string by going through the order and trying to fetch it for the current entry * @author fenris */ function get(path: string, args?: { [id: string]: string; }, fallback?: string): string; /** * @author fenris */ function list(): Array; /** * @author fenris * @todo get rid of this; it's currenly needed only for the cdh-internal lib_completion */ function paths(): Array; /** * @author fenris */ function initialize({ "logprefix": logprefix, "verbosity": verbosity, "packages": packages, "order": order, "autopromote": autopromote, }?: { logprefix?: string; verbosity?: int; packages?: Array; order?: Array; autopromote?: boolean; }): Promise; } declare namespace lib_plankton.translate { /** * @author fenris */ function iso_639_1_to_iso_639_2(iso6391: string): string; /** * @author fenris */ function stance(str: string): string; } declare namespace lib_plankton.database { /** */ type type_query = { template: string; arguments: Record; }; /** */ enum enum_type { boolean = "boolean", integer = "integer", string_short = "string_short", string_medium = "string_medium", string_long = "string_long", float = "float" } /** */ type type_description_create_table = { name: string; key_field?: (null | { name: string; type?: enum_type; comment?: (null | string); auto_increment?: (null | boolean); description?: (null | string); }); data_fields?: Array<{ name: string; nullable?: boolean; type: enum_type; default?: any; description?: (null | string); }>; constraints?: Array<{ kind: string; parameters?: Record; }>; description?: (null | string); }; /** */ type type_description_insert = { table_name: string; values: Record; returning?: (null | string); }; /** */ type type_description_update = { table_name: string; values: Record; condition?: (null | string); arguments?: (null | Record); }; /** */ type type_description_delete = { table_name: string; condition?: (null | string); arguments?: (null | Record); }; /** */ type type_description_select = { source: string; fields?: (null | Array); condition?: (null | string); group_by?: (null | string); having?: (null | string); order_by?: (null | string); limit?: (null | int); arguments?: (null | Record); }; /** * rows */ type type_result_get = Array>; /** * auto insert id */ type type_result_put = (null | int); /** * number of affected rows */ type type_result_set = int; /** * @author fenris */ type type_database = { wrap_name: ((name: string) => string); query_free_get: ((query: type_query) => Promise); query_free_put: ((query: type_query) => Promise); query_free_set: ((query: type_query) => Promise); query_create_table: ((description_create_table: type_description_create_table) => Promise); query_insert: ((description_insert: type_description_insert) => Promise); query_update: ((description_update: type_description_update) => Promise); query_delete: ((description_delete: type_description_delete) => Promise); query_select: ((description_select: type_description_select) => Promise); }; /** */ type interface_database = database.type_database; } declare namespace lib_plankton.storage { /** * implements the idea of a database, which houses datasets (type_value) and manages their access by ids or sth. similar (type_key) * * @author fenris */ type type_store = { /** * shall prepare the storage instance for use * * @author fenris */ setup(input: type_setup_input): Promise; /** * shall insert a new dataset and return its automatically assign key * * @author fenris */ create(value: type_value): Promise; /** * shall modify an existing dataset * * @author fenris */ update(key: type_key, value: type_value): Promise; /** * shall remove an existing dataset * * @author fenris */ delete(key: type_key): Promise; /** * shall get an existing dataset by its key * * @author fenris */ read(key: type_key): Promise; /** * shall list keys and previews of existing datasets, which match a certain search term * * @author fenris */ search(term?: (null | type_searchterm)): Promise>; }; /** * for class wrappers */ type interface_store = type_store; } declare namespace lib_plankton.storage { /** * implements the idea of a storage without managed keys * * @author fenris */ type type_chest = { /** * shall prepare the storage instance for use * * @author fenris */ setup(input: type_setup_input): Promise; /** * shall remove all items */ clear(): Promise; /** * shall insert a new or modify an existing dataset and return whether it is new * * @author fenris */ write(key: type_key, value: type_value): Promise; /** * shall remove an existing dataset * * @author fenris */ delete(key: type_key): Promise; /** * shall get an existing dataset by its key * * @author fenris */ read(key: type_key): Promise; /** * shall list keys and previews of existing datasets, which match a certain search term * * @author fenris */ search(term?: (null | type_searchterm)): Promise>; }; /** * for class wrappers */ type interface_chest = type_chest; } declare namespace lib_plankton.storage.memory { /** * @author fenris */ type type_subject = { data: Record; }; /** */ type type_parameters = {}; /** * @author fenris */ function make(parameters: type_parameters): type_subject; /** * @author fenris */ function clear(subject: type_subject): void; /** * @author fenris */ function write(subject: type_subject, key: string, value: type_value): boolean; /** * @author fenris */ function delete_(subject: type_subject, key: string): void; /** * @author fenris */ function read(subject: type_subject, key: string): type_value; /** * @author fenris */ function list(subject: type_subject): Array; /** * @author fenris */ function search(subject: type_subject, term: (null | string)): Array<{ key: string; preview: string; }>; /** * @author fenris */ function implementation_chest(parameters: type_parameters): type_chest; } declare namespace lib_plankton.storage.memory { /** * @author fenris */ class class_chest implements type_chest { private subject; constructor(parameters: type_parameters); setup(input: any): Promise; clear(): Promise; write(key: any, value: any): Promise; delete(key: any): Promise; read(key: any): Promise; search(term: any): Promise<{ key: string; preview: string; }[]>; } } declare namespace lib_plankton.storage.localstorage { /** * @author fenris */ type type_subject = { corner: string; }; /** * @author fenris */ type type_parameters = { corner?: string; }; /** * @author fenris */ function make(parameters: type_parameters): type_subject; /** * @author fenris */ function clear(subject: type_subject): void; /** * @author fenris */ function write(subject: type_subject, key: string, item: string): boolean; /** * @author fenris */ function delete_(subject: type_subject, key: string): void; /** * @author fenris */ function read(subject: type_subject, key: string): string; /** * @author fenris */ function list(subject: type_subject): Array; /** */ function implementation_chest(parameters: type_parameters): type_chest; } declare namespace lib_plankton.storage.localstorage { /** * uses the browsers localstorage as chest * * @author fenris */ class class_chest implements type_chest { private subject; constructor(parameters: type_parameters); setup(input: any): Promise; clear(): Promise; write(key: any, value: any): Promise; delete(key: any): Promise; read(key: any): Promise; search(term: any): Promise<{ key: string; preview: string; }[]>; } } declare namespace lib_plankton.map { /** */ type type_pair = { key: type_key; value: type_value; }; /** * @author fenris */ type type_map = { size: (() => int); has: ((key: type_key) => boolean); get: ((key: type_key, fallback?: lib_plankton.pod.type_pod) => type_value); set: ((key: type_key, value: type_value) => void); delete: ((key: type_key) => void); iterate: ((procedure: ((value: type_value, key?: type_key) => void)) => void); }; } declare namespace lib_plankton.map { /** */ function clear(map: type_map): void; /** */ function keys(map: type_map): Array; /** */ function values(map: type_map): Array; /** */ function dump(map: type_map): Array>; /** */ function show(map: type_map, options?: { show_key?: ((key: type_key) => string); show_value?: ((value: type_value) => string); }): string; } declare namespace lib_plankton.map.simplemap { /** */ type type_subject = { data: Record; }; /** */ function make(options?: { data?: Record; }): type_subject; /** */ function size(subject: type_subject): int; /** */ function has(subject: type_subject, key: string): boolean; /** */ function get_safe(subject: type_subject, key: string): lib_plankton.pod.type_pod; /** */ function get(subject: type_subject, key: string, fallback?: lib_plankton.pod.type_pod): type_value; /** */ function set(subject: type_subject, key: string, value: type_value): void; /** */ function delete_(subject: type_subject, key: string): void; /** */ function iterate(subject: type_subject, procedure: ((value?: type_value, key?: string) => void)): void; /** */ function implementation_map(subject: type_subject): type_map; } declare namespace lib_plankton.map.hashmap { /** * we base the hashmap on a simplemap, whos keys are the hashes and whos values are the key/value-pairs */ type type_subject = { hashing: ((key: type_key) => string); core: lib_plankton.map.simplemap.type_subject>; }; /** */ function make(hashing: ((key: type_key) => string), options?: { pairs?: Array>; }): type_subject; /** */ function size(subject: type_subject): int; /** */ function has(subject: type_subject, key: type_key): boolean; /** */ function get(subject: type_subject, key: type_key, fallback?: lib_plankton.pod.type_pod): type_value; /** */ function set(subject: type_subject, key: type_key, value: type_value): void; /** */ function delete_(subject: type_subject, key: type_key): void; /** */ function iterate(subject: type_subject, procedure: ((value?: type_value, key?: type_key) => void)): void; /** */ function implementation_map(subject: type_subject): type_map; } declare namespace lib_plankton.map.collatemap { /** */ type type_collation = ((key1: type_key, key2: type_key) => boolean); /** */ export type type_subject = { collation: type_collation; pairs: Array>; }; /** */ export function make(collation: type_collation, options?: { pairs?: Array>; }): type_subject; /** */ export function size(subject: type_subject): int; /** */ export function has(subject: type_subject, key: type_key): boolean; /** * @todo use .find */ export function get(subject: type_subject, key: type_key, fallback?: lib_plankton.pod.type_pod): type_value; /** */ export function set(subject: type_subject, key: type_key, value: type_value): void; /** */ export function delete_(subject: type_subject, key: type_key): void; /** */ export function iterate(subject: type_subject, function_: ((value?: type_value, key?: type_key) => void)): void; /** */ export function implementation_map(subject: type_subject): type_map; export {}; } declare namespace lib_plankton.pit { /** */ type type_date = { year: int; month: int; day: int; }; /** */ type type_ywd = { year: int; week: int; day: int; }; /** */ type type_time = { hour: int; minute: int; second: int; }; /** */ type type_datetime = { timezone_shift: int; date: type_date; time: (null | type_time); }; /** */ type type_pit = int; } declare namespace lib_plankton.pit { /** * @todo complete */ function timezone_name_to_timezone_shift(timezone_name: string): int; /** */ function date_object_get_week_of_year(date: Date): int; /** */ function to_unix_timestamp(pit: type_pit): int; /** */ function from_unix_timestamp(unix_timestamp: int): type_pit; /** */ function to_date_object(pit: type_pit): Date; /** * @todo test */ function to_datetime(pit: type_pit, { "timezone_shift": option_timezone_shift, }?: { timezone_shift?: int; }): type_datetime; /** */ function from_datetime(datetime: type_datetime): type_pit; /** */ function is_before(pit: type_pit, reference: type_pit): boolean; /** */ function is_between(pit: type_pit, reference_left: type_pit, reference_right: type_pit): boolean; /** */ function shift_day(pit: type_pit, increment: int): type_pit; /** */ function shift_week(pit: type_pit, increment: int): type_pit; /** */ function trunc_week(pit: type_pit): type_pit; /** */ function now(): type_pit; /** * @param year year according to specified timezone shift * @param week week according to specified timezone shift * @return the begin of the week (monday, 00:00) */ function from_ywd(ywd: type_ywd, { "timezone_shift": option_timezone_shift, }?: { timezone_shift?: int; }): type_pit; /** * @todo timezone */ function to_ywd(pit: type_pit, { "timezone_shift": option_timezone_shift, }?: { timezone_shift?: int; }): type_ywd; /** * computes the point in time for switching to central european summer time * * @todo write tests */ function cest_switch_on(year: int): type_pit; /** * computes the point in time for switching away from central european summer time * * @todo write tests */ function cest_switch_off(year: int): type_pit; /** */ function timezone_shift_ce(pit: type_pit): int; /** * [convenience] */ function to_datetime_ce(pit: type_pit): type_datetime; /** */ function datetime_translate(datetime: type_datetime, timezone_shift: int): type_datetime; /** * [convenience] */ function datetime_translate_ce(datetime: type_datetime): type_datetime; /** */ function timezone_shift_format(timezone_shift: int): string; /** */ function date_format(date: type_date): string; /** */ function time_format(time: type_time, { "show_seconds": option_show_seconds, }?: { show_seconds?: boolean; }): string; /** * @todo show timezone */ function datetime_format(datetime: (null | type_datetime), { "timezone_indicator": option_timezone_indicator, "show_timezone": option_show_timezone, "adjust_to_ce": option_adjust_to_ce, "omit_date": option_omit_date, }?: { timezone_indicator?: string; show_timezone?: boolean; adjust_to_ce?: boolean; omit_date?: boolean; }): string; /** */ function timespan_format(from: type_datetime, to: (null | type_datetime), { "timezone_indicator": option_timezone_indicator, "show_timezone": option_show_timezone, "adjust_to_ce": option_adjust_to_ce, "omit_date": option_omit_date, }?: { timezone_indicator?: string; show_timezone?: boolean; adjust_to_ce?: boolean; omit_date?: boolean; }): string; } declare namespace lib_plankton.zoo_input { /** * @author fenris */ interface interface_input { /** */ setup(parent: HTMLElement): Promise; /** */ read(): Promise; /** */ write(value: type_value): Promise; } } declare namespace lib_plankton.zoo_input { /** * @author fenris */ class class_input_wrapped implements interface_input { /** */ private core; /** */ private wrap; /** */ private unwrap; /** */ constructor(core: interface_input, wrap: ((value_inner: type_value_inner) => type_value_outer), unwrap: ((value_outer: type_value_outer) => type_value_inner), options?: {}); /** * [implementation] */ setup(parent: HTMLElement): Promise; /** * [implementation] */ read(): Promise; /** * [implementation] */ write(value: type_value_outer): Promise; } } declare namespace lib_plankton.zoo_input { /** * @author fenris */ class class_input_soft implements interface_input<(null | type_value_core)> { /** */ private core; /** */ private dom_set; /** */ private dom_wrapper; /** */ constructor(core: interface_input, options?: {}); /** */ private toggle; /** * [implementation] */ setup(parent: HTMLElement): Promise; /** * [implementation] */ read(): Promise<(null | type_value_core)>; /** * [implementation] */ write(value: (null | type_value_core)): Promise; } } declare namespace lib_plankton.zoo_input { /** * @author fenris */ class class_input_hidden implements interface_input { /** */ private dom_input; /** */ private value; /** */ constructor(options?: { initial_value?: any; }); /** * [implementation] */ setup(parent: HTMLElement): Promise; /** * [implementation] */ read(): Promise; /** * [implementation] */ write(value: any): Promise; } } declare namespace lib_plankton.zoo_input { /** * @author fenris * @todo abstract */ class class_input_text implements interface_input { /** */ private read_only; /** */ private pattern; /** */ /** */ private dom_input; /** */ constructor(options?: { read_only?: boolean; pattern?: (null | string); }); /** * [implementation] */ setup(parent: HTMLElement): Promise; /** * [implementation] */ read(): Promise; /** * [implementation] */ write(value: string): Promise; } } declare namespace lib_plankton.zoo_input { /** * @author fenris */ class class_input_email implements interface_input { /** */ private dom_input; /** */ constructor(); /** * [implementation] */ setup(parent: HTMLElement): Promise; /** * [implementation] */ read(): Promise; /** * [implementation] */ write(value: string): Promise; } } declare namespace lib_plankton.zoo_input { /** * @author fenris */ class class_input_textarea implements interface_input { /** */ private dom_textarea; /** */ constructor(); /** * [implementation] */ setup(parent: HTMLElement): Promise; /** * [implementation] */ read(): Promise; /** * [implementation] */ write(value: string): Promise; } } declare namespace lib_plankton.zoo_input { /** * @author fenris */ class class_input_date implements interface_input<(null | lib_plankton.pit.type_date)> { /** */ private required; /** */ private dom_input; /** */ constructor(options?: { required?: boolean; }); /** * [implementation] */ setup(parent: HTMLElement): Promise; /** * [implementation] */ read(): Promise<(null | lib_plankton.pit.type_date)>; /** * [implementation] */ write(value: (null | lib_plankton.pit.type_date)): Promise; } } declare namespace lib_plankton.zoo_input { /** * @author fenris * @todo abstract */ class class_input_number implements interface_input { /** */ private read_only; /** */ private step; /** */ private dom_input; /** */ constructor(options?: { read_only?: boolean; step?: (null | float); }); /** * [implementation] */ setup(parent: HTMLElement): Promise; /** * [implementation] */ read(): Promise; /** * [implementation] */ write(value: number): Promise; } } declare namespace lib_plankton.zoo_input { /** * @author fenris */ class class_input_checkbox implements interface_input { /** */ private read_only; /** */ private dom_input; /** */ private hooks_change; /** */ constructor(options?: { read_only?: boolean; hooks_change?: Array<((value: boolean) => void)>; }); /** * [implementation] */ setup(parent: HTMLElement): Promise; /** * [implementation] */ read(): Promise; /** * [implementation] */ write(value: boolean): Promise; } } declare namespace lib_plankton.zoo_input { /** * @author fenris */ class class_input_selection implements interface_input { /** */ private options; /** */ private dom_select; /** */ constructor(options: Array<{ value: string; label: string; }>); /** * [implementation] */ setup(parent: HTMLElement): Promise; /** * [implementation] */ read(): Promise; /** * [implementation] */ write(value: string): Promise; } } declare namespace lib_plankton.zoo_input { /** * @author fenris */ class class_input_enumeration implements interface_input { /** */ private options; /** */ private dom_inputs; /** */ constructor(options: Array<{ value: string; label: string; }>); /** * [implementation] * @todo unique name */ setup(parent: HTMLElement): Promise; /** * [implementation] */ read(): Promise; /** * [implementation] */ write(value: string): Promise; } } declare namespace lib_plankton.zoo_input { /** */ type type_translations = { add?: string; remove?: string; }; /** * @author fenris */ export class class_input_list implements interface_input> { /** */ private read_only; /** */ private element_input_factory; /** */ private elements_container_dom; /** */ private elements; /** */ private translations; /** */ constructor(element_input_factory: (() => interface_input), options?: { read_only?: boolean; translations?: type_translations; }); /** */ private clear; /** */ private add; /** * [implementation] */ setup(parent: HTMLElement): Promise; /** * [implementation] */ read(): Promise>; /** * [implementation] */ write(value: Array): Promise; } export {}; } declare namespace lib_plankton.zoo_input { /** * @author fenris */ class class_input_password implements interface_input { /** */ private dom_input; /** */ constructor(); /** * [implementation] */ setup(parent: HTMLElement): Promise; /** * [implementation] */ read(): Promise; /** * [implementation] */ write(value: string): Promise; } } declare namespace lib_plankton.zoo_input { /** * @author fenris */ class class_input_switch implements interface_input { /** */ private dom_element; /** */ private value; /** */ constructor(); /** * [implementation] */ setup(parent: HTMLElement): Promise; /** * [implementation] */ read(): Promise; /** * [implementation] */ write(value: boolean): Promise; } } declare namespace lib_plankton.zoo_input { /** * @author fenris */ class class_input_time implements interface_input<(null | lib_plankton.pit.type_time)> { /** */ private dom_input; /** */ constructor(); /** * [implementation] */ setup(parent: HTMLElement): Promise; /** * [implementation] */ read(): Promise<(null | lib_plankton.pit.type_time)>; /** * [implementation] */ write(value: (null | lib_plankton.pit.type_time)): Promise; } } declare namespace lib_plankton.zoo_input { /** * @author fenris */ class class_input_group implements interface_input { /** */ private fields; /** */ constructor(fields_raw: Array<{ name: string; input: interface_input; label?: (null | string); help?: (null | string); }>); /** * [implementation] */ setup(parent: HTMLElement): Promise; /** * [implementation] */ read(): Promise; /** * [implementation] */ write(value: type_record): Promise; } } declare namespace lib_plankton.zoo_input { /** */ class class_input_hashmap implements lib_plankton.zoo_input.interface_input> { /** */ private hash_key; /** */ private core; /** */ constructor(hash_key: ((key: type_key) => string), key_input_factory: (() => lib_plankton.zoo_input.interface_input), value_input_factory: (() => lib_plankton.zoo_input.interface_input)); /** * [implementation] */ setup(parent: HTMLElement): Promise; /** * [implementation] */ read(): Promise>; /** * [implementation] */ write(map: lib_plankton.map.type_map): Promise; } } declare namespace lib_plankton.zoo_input { /** */ class class_input_datetime implements interface_input { /** */ private core; /** */ constructor(options?: { label_timezone_shift?: string; label_date?: string; label_time?: string; }); /** */ setup(parent: HTMLElement): Promise; /** */ read(): Promise; /** */ write(value: lib_plankton.pit.type_datetime): Promise; } } declare namespace lib_plankton.zoo_input { /** * for central europe with daylight saving time feature */ class class_input_datetime_central_europe implements interface_input { /** */ private core; /** */ constructor(options?: { label_date?: string; label_time?: string; }); /** */ setup(parent: HTMLElement): Promise; /** */ read(): Promise; /** */ write(value: lib_plankton.pit.type_datetime): Promise; } } declare namespace lib_plankton.zoo_form { /** */ type type_field = { name: string; type: string; label: (null | string); }; /** */ export type type_form = { method: string; fields: Array; encode: ((value: type_value) => Record); decode: ((raw: Record) => type_value); class_prefix: string; root_element: (null | Element); }; /** */ export function make(method: string, fields: Array<{ name: string; type: string; label?: (null | string); }>, encode: ((value: type_value) => Record), decode: ((raw: Record) => type_value), options?: { class_prefix?: string; }): type_form; /** */ export function make_simple(method: string, fields: Array<{ name: string; type: string; label?: (null | string); }>, options?: { class_prefix?: string; }): type_form>; /** */ export function clear(subject: type_form): void; /** */ export function write(subject: type_form, value: type_value): void; /** */ export function read(subject: type_form): type_value; /** */ export function render(subject: type_form, target: Element): Promise; export {}; } declare namespace lib_plankton.zoo_form { /** */ type type_action = { label: string; target?: string; procedure?: ((get_value?: (() => Promise), get_representation?: (() => Promise)) => void); }; /** * @author fenris */ export class class_form { /** */ private encode; /** */ private decode; /** */ private actions; /** */ private input; /** */ constructor(encode: ((value: type_value) => type_representation), decode: ((representation: type_representation) => type_value), input: lib_plankton.zoo_input.interface_input, actions: Array>); /** */ setup(parent: HTMLElement): Promise; /** */ input_read_raw(): Promise; /** */ input_read(): Promise; /** */ input_write(value: type_value): Promise; } export {}; } declare namespace lib_plankton.zoo_search { /** */ type type_state = { term: (null | string); }; /** */ type type_search = { routine: ((term: string) => Promise>); encode_item: ((item: type_item) => string); hooks_select: Array<((item: type_item) => void)>; hooks_begin: Array<((term?: string) => void)>; hooks_end: Array<(() => void)>; class_prefix: string; root_element: (null | Element); state: (null | type_state); }; /** */ function make(routine: ((term: string) => Promise>), options: { encode_item?: ((item: type_item) => string); hooks_select?: Array<((item: type_item) => void)>; hooks_begin?: Array<((term?: string) => void)>; hooks_end?: Array<(() => void)>; class_prefix?: string; }): type_search; /** */ function hook_begin(subject: type_search, action: ((term: string) => void)): void; /** */ function hook_end(subject: type_search, action: (() => void)): void; /** */ function hook_select(subject: type_search, action: ((item: type_item) => void)): void; /** */ function set_state(subject: type_search, state: type_state): Promise; /** */ function render(subject: type_search, target: Element, options?: { state?: type_state; }): Promise; } declare namespace lib_plankton.zoo_editor { /** */ enum enum_mode { find = "find", view = "view", make = "make" } /** */ enum enum_action { keep = "keep", save = "save", delete = "delete", find = "find", make = "make" } /** */ enum enum_function { seek = "seek", read = "read", create = "create", update = "update", delete = "delete" } /** */ type type_state = { mode: enum_mode; key: (null | type_key); search_state: lib_plankton.zoo_search.type_state; }; /** */ type type_editor = { functions: Array; store: lib_plankton.storage.type_store; search: lib_plankton.zoo_search.type_search<{ key: type_key; preview: any; }>; form: lib_plankton.zoo_form.type_form; hook_switch: (null | ((state: type_state) => void)); state: (null | type_state); class_prefix: string; root_element: (null | Element); }; /** */ function make(store: lib_plankton.storage.type_store, form: lib_plankton.zoo_form.type_form, options?: { functions?: Array; encode_hit?: ((hit: { key: type_key; preview: any; }) => string); hook_switch?: (null | ((state: type_state) => void)); class_prefix?: string; }): type_editor; /** */ function render(subject: type_editor, target: Element, options?: { state?: type_state; }): Promise; } declare namespace lib_plankton.zoo_page { /** */ export type type_location = { name: string; parameters: Record; }; /** */ type type_handler = ((parameters: Record, target_element: Element) => void); /** */ export let _pool: Record; /** */ export function encode(location: type_location): string; /** */ export function add_nav_entry(location: type_location, options?: { label?: (null | string); }): void; /** * encodes a location in the URL and loads it */ export function set(location: type_location): void; /** */ export function register(location_name: string, handler: type_handler, options?: {}): void; /** */ export function init(target_element: Element, options?: { pool?: Record; fallback?: (null | type_location); }): void; /** */ export function start(): void; export {}; }