declare type sqlite3_default = typeof sqlite3.dbapi2 declare type tkinter_default = typeof tkinter.constants declare module base64 { var _ /** * Encode the bytes-like object s using Base64 and return a bytes object. * * Optional altchars should be a byte string of length 2 which specifies an * alternative alphabet for the '+' and '/' characters. This allows an * application to e.g. generate url or filesystem safe Base64 strings. * */ function b64encode(s, altchars?): Promise function b64encode$({ s, altchars }: { s, altchars?}): Promise /** * Decode the Base64 encoded bytes-like object or ASCII string s. * * Optional altchars must be a bytes-like object or ASCII string of length 2 * which specifies the alternative alphabet used instead of the '+' and '/' * characters. * * The result is returned as a bytes object. A binascii.Error is raised if * s is incorrectly padded. * * If validate is False (the default), characters that are neither in the * normal base-64 alphabet nor the alternative alphabet are discarded prior * to the padding check. If validate is True, these non-alphabet characters * in the input result in a binascii.Error. * */ function b64decode(s, altchars?, validate?: boolean): Promise function b64decode$({ s, altchars, validate }: { s, altchars?, validate?}): Promise /** * Encode bytes-like object s using the standard Base64 alphabet. * * The result is returned as a bytes object. * */ function standard_b64encode(s): Promise function standard_b64encode$({ s }): Promise /** * Decode bytes encoded with the standard Base64 alphabet. * * Argument s is a bytes-like object or ASCII string to decode. The result * is returned as a bytes object. A binascii.Error is raised if the input * is incorrectly padded. Characters that are not in the standard alphabet * are discarded prior to the padding check. * */ function standard_b64decode(s): Promise function standard_b64decode$({ s }): Promise /** * Encode bytes using the URL- and filesystem-safe Base64 alphabet. * * Argument s is a bytes-like object to encode. The result is returned as a * bytes object. The alphabet uses '-' instead of '+' and '_' instead of * '/'. * */ function urlsafe_b64encode(s): Promise function urlsafe_b64encode$({ s }): Promise /** * Decode bytes using the URL- and filesystem-safe Base64 alphabet. * * Argument s is a bytes-like object or ASCII string to decode. The result * is returned as a bytes object. A binascii.Error is raised if the input * is incorrectly padded. Characters that are not in the URL-safe base-64 * alphabet, and are not a plus '+' or slash '/', are discarded prior to the * padding check. * * The alphabet uses '-' instead of '+' and '_' instead of '/'. * */ function urlsafe_b64decode(s): Promise function urlsafe_b64decode$({ s }): Promise function b32encode(s): Promise function b32encode$({ s }): Promise function b32decode(s, casefold?: boolean, map01?): Promise function b32decode$({ s, casefold, map01 }: { s, casefold?, map01?}): Promise function b32hexencode(s): Promise function b32hexencode$({ s }): Promise function b32hexdecode(s, casefold?: boolean): Promise function b32hexdecode$({ s, casefold }: { s, casefold?}): Promise /** * Encode the bytes-like object s using Base16 and return a bytes object. * */ function b16encode(s): Promise function b16encode$({ s }): Promise /** * Decode the Base16 encoded bytes-like object or ASCII string s. * * Optional casefold is a flag specifying whether a lowercase alphabet is * acceptable as input. For security purposes, the default is False. * * The result is returned as a bytes object. A binascii.Error is raised if * s is incorrectly padded or if there are non-alphabet characters present * in the input. * */ function b16decode(s, casefold?: boolean): Promise function b16decode$({ s, casefold }: { s, casefold?}): Promise /** * Encode bytes-like object b using Ascii85 and return a bytes object. * * foldspaces is an optional flag that uses the special short sequence 'y' * instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This * feature is not supported by the "standard" Adobe encoding. * * wrapcol controls whether the output should have newline (b'\n') characters * added to it. If this is non-zero, each output line will be at most this * many characters long. * * pad controls whether the input is padded to a multiple of 4 before * encoding. Note that the btoa implementation always pads. * * adobe controls whether the encoded byte sequence is framed with <~ and ~>, * which is used by the Adobe implementation. * */ function a85encode(b): Promise function a85encode$({ b }): Promise /** * Decode the Ascii85 encoded bytes-like object or ASCII string b. * * foldspaces is a flag that specifies whether the 'y' short sequence should be * accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature is * not supported by the "standard" Adobe encoding. * * adobe controls whether the input sequence is in Adobe Ascii85 format (i.e. * is framed with <~ and ~>). * * ignorechars should be a byte string containing characters to ignore from the * input. This should only contain whitespace characters, and by default * contains all whitespace characters in ASCII. * * The result is returned as a bytes object. * */ function a85decode(b): Promise function a85decode$({ b }): Promise /** * Encode bytes-like object b in base85 format and return a bytes object. * * If pad is true, the input is padded with b'\0' so its length is a multiple of * 4 bytes before encoding. * */ function b85encode(b, pad?: boolean): Promise function b85encode$({ b, pad }: { b, pad?}): Promise /** * Decode the base85-encoded bytes-like object or ASCII string b * * The result is returned as a bytes object. * */ function b85decode(b): Promise function b85decode$({ b }): Promise /** * Encode a file; input and output are binary files. */ function encode(input, output): Promise function encode$({ input, output }): Promise /** * Decode a file; input and output are binary files. */ function decode(input, output): Promise function decode$({ input, output }): Promise /** * Encode a bytestring into a bytes object containing multiple lines * of base-64 data. */ function encodebytes(s): Promise function encodebytes$({ s }): Promise /** * Decode a bytestring of base-64 data into a bytes object. */ function decodebytes(s): Promise function decodebytes$({ s }): Promise /** * Small main program */ function main(): Promise function main$($: {}): Promise function test(): Promise function test$($: {}): Promise let bytes_types: Promise let MAXLINESIZE: Promise let MAXBINSIZE: Promise } declare module codecs { var _ /** * Open an encoded file using the given mode and return * a wrapped version providing transparent encoding/decoding. * * Note: The wrapped version will only accept the object format * defined by the codecs, i.e. Unicode objects for most builtin * codecs. Output is also codec dependent and will usually be * Unicode as well. * * Underlying encoded files are always opened in binary mode. * The default file mode is 'r', meaning to open the file in read mode. * * encoding specifies the encoding which is to be used for the * file. * * errors may be given to define the error handling. It defaults * to 'strict' which causes ValueErrors to be raised in case an * encoding error occurs. * * buffering has the same meaning as for the builtin open() API. * It defaults to -1 which means that the default buffer size will * be used. * * The returned wrapped file object provides an extra attribute * .encoding which allows querying the used encoding. This * attribute is only available if an encoding was specified as * parameter. * * */ function open(filename, mode?, encoding?, errors?, buffering?): Promise function open$({ filename, mode, encoding, errors, buffering }: { filename, mode?, encoding?, errors?, buffering?}): Promise /** * Return a wrapped version of file which provides transparent * encoding translation. * * Data written to the wrapped file is decoded according * to the given data_encoding and then encoded to the underlying * file using file_encoding. The intermediate data type * will usually be Unicode but depends on the specified codecs. * * Bytes read from the file are decoded using file_encoding and then * passed back to the caller encoded using data_encoding. * * If file_encoding is not given, it defaults to data_encoding. * * errors may be given to define the error handling. It defaults * to 'strict' which causes ValueErrors to be raised in case an * encoding error occurs. * * The returned wrapped file object provides two extra attributes * .data_encoding and .file_encoding which reflect the given * parameters of the same name. The attributes can be used for * introspection by Python programs. * * */ function EncodedFile(file, data_encoding, file_encoding?, errors?): Promise function EncodedFile$({ file, data_encoding, file_encoding, errors }: { file, data_encoding, file_encoding?, errors?}): Promise /** * Lookup up the codec for the given encoding and return * its encoder function. * * Raises a LookupError in case the encoding cannot be found. * * */ function getencoder(encoding): Promise function getencoder$({ encoding }): Promise /** * Lookup up the codec for the given encoding and return * its decoder function. * * Raises a LookupError in case the encoding cannot be found. * * */ function getdecoder(encoding): Promise function getdecoder$({ encoding }): Promise /** * Lookup up the codec for the given encoding and return * its IncrementalEncoder class or factory function. * * Raises a LookupError in case the encoding cannot be found * or the codecs doesn't provide an incremental encoder. * * */ function getincrementalencoder(encoding): Promise function getincrementalencoder$({ encoding }): Promise /** * Lookup up the codec for the given encoding and return * its IncrementalDecoder class or factory function. * * Raises a LookupError in case the encoding cannot be found * or the codecs doesn't provide an incremental decoder. * * */ function getincrementaldecoder(encoding): Promise function getincrementaldecoder$({ encoding }): Promise /** * Lookup up the codec for the given encoding and return * its StreamReader class or factory function. * * Raises a LookupError in case the encoding cannot be found. * * */ function getreader(encoding): Promise function getreader$({ encoding }): Promise /** * Lookup up the codec for the given encoding and return * its StreamWriter class or factory function. * * Raises a LookupError in case the encoding cannot be found. * * */ function getwriter(encoding): Promise function getwriter$({ encoding }): Promise /** * * Encoding iterator. * * Encodes the input strings from the iterator using an IncrementalEncoder. * * errors and kwargs are passed through to the IncrementalEncoder * constructor. * */ function iterencode(iterator, encoding, errors?): Promise function iterencode$({ iterator, encoding, errors }: { iterator, encoding, errors?}): Promise /** * * Decoding iterator. * * Decodes the input strings from the iterator using an IncrementalDecoder. * * errors and kwargs are passed through to the IncrementalDecoder * constructor. * */ function iterdecode(iterator, encoding, errors?): Promise function iterdecode$({ iterator, encoding, errors }: { iterator, encoding, errors?}): Promise /** * make_identity_dict(rng) -> dict * * Return a dictionary where elements of the rng sequence are * mapped to themselves. * * */ function make_identity_dict(rng): Promise function make_identity_dict$({ rng }): Promise /** * Creates an encoding map from a decoding map. * * If a target mapping in the decoding map occurs multiple * times, then that target is mapped to None (undefined mapping), * causing an exception when encountered by the charmap codec * during translation. * * One example where this happens is cp875.py which decodes * multiple character to \u001a. * * */ function make_encoding_map(decoding_map): Promise function make_encoding_map$({ decoding_map }): Promise /** * Codec details when looking up the codec registry */ interface ICodecInfo { } /** * Defines the interface for stateless encoders/decoders. * * The .encode()/.decode() methods may use different error * handling schemes by providing the errors argument. These * string values are predefined: * * 'strict' - raise a ValueError error (or a subclass) * 'ignore' - ignore the character and continue with the next * 'replace' - replace with a suitable replacement character; * Python will use the official U+FFFD REPLACEMENT * CHARACTER for the builtin Unicode codecs on * decoding and '?' on encoding. * 'surrogateescape' - replace with private code points U+DCnn. * 'xmlcharrefreplace' - Replace with the appropriate XML * character reference (only for encoding). * 'backslashreplace' - Replace with backslashed escape sequences. * 'namereplace' - Replace with \N{...} escape sequences * (only for encoding). * * The set of allowed values can be extended via register_error. * * */ interface ICodec { /** * Encodes the object input and returns a tuple (output * object, length consumed). * * errors defines the error handling to apply. It defaults to * 'strict' handling. * * The method may not store state in the Codec instance. Use * StreamWriter for codecs which have to keep state in order to * make encoding efficient. * * The encoder must be able to handle zero length input and * return an empty object of the output object type in this * situation. * * */ encode(input, errors?): Promise encode$({ input, errors }: { input, errors?}): Promise /** * Decodes the object input and returns a tuple (output * object, length consumed). * * input must be an object which provides the bf_getreadbuf * buffer slot. Python strings, buffer objects and memory * mapped files are examples of objects providing this slot. * * errors defines the error handling to apply. It defaults to * 'strict' handling. * * The method may not store state in the Codec instance. Use * StreamReader for codecs which have to keep state in order to * make decoding efficient. * * The decoder must be able to handle zero length input and * return an empty object of the output object type in this * situation. * * */ decode(input, errors?): Promise decode$({ input, errors }: { input, errors?}): Promise } /** * * An IncrementalEncoder encodes an input in multiple steps. The input can * be passed piece by piece to the encode() method. The IncrementalEncoder * remembers the state of the encoding process between calls to encode(). * */ /** * * Creates an IncrementalEncoder instance. * * The IncrementalEncoder may use different error handling schemes by * providing the errors keyword argument. See the module docstring * for a list of possible values. * */ function IncrementalEncoder(errors?): Promise function IncrementalEncoder$({ errors }: { errors?}): Promise interface IIncrementalEncoder { /** * * Encodes input and returns the resulting object. * */ encode(input, final?: boolean): Promise encode$({ input, final }: { input, final?}): Promise /** * * Resets the encoder to the initial state. * */ reset(): Promise reset$($: {}): Promise /** * * Return the current state of the encoder. * */ getstate(): Promise getstate$($: {}): Promise /** * * Set the current state of the encoder. state must have been * returned by getstate(). * */ setstate(state): Promise setstate$({ state }): Promise } /** * * This subclass of IncrementalEncoder can be used as the baseclass for an * incremental encoder if the encoder must keep some of the output in a * buffer between calls to encode(). * */ function BufferedIncrementalEncoder(errors?): Promise function BufferedIncrementalEncoder$({ errors }: { errors?}): Promise interface IBufferedIncrementalEncoder extends IIncrementalEncoder { encode(input, final?: boolean): Promise encode$({ input, final }: { input, final?}): Promise reset(): Promise reset$($: {}): Promise getstate(): Promise getstate$($: {}): Promise setstate(state): Promise setstate$({ state }): Promise } /** * * An IncrementalDecoder decodes an input in multiple steps. The input can * be passed piece by piece to the decode() method. The IncrementalDecoder * remembers the state of the decoding process between calls to decode(). * */ /** * * Create an IncrementalDecoder instance. * * The IncrementalDecoder may use different error handling schemes by * providing the errors keyword argument. See the module docstring * for a list of possible values. * */ function IncrementalDecoder(errors?): Promise function IncrementalDecoder$({ errors }: { errors?}): Promise interface IIncrementalDecoder { /** * * Decode input and returns the resulting object. * */ decode(input, final?: boolean): Promise decode$({ input, final }: { input, final?}): Promise /** * * Reset the decoder to the initial state. * */ reset(): Promise reset$($: {}): Promise /** * * Return the current state of the decoder. * * This must be a (buffered_input, additional_state_info) tuple. * buffered_input must be a bytes object containing bytes that * were passed to decode() that have not yet been converted. * additional_state_info must be a non-negative integer * representing the state of the decoder WITHOUT yet having * processed the contents of buffered_input. In the initial state * and after reset(), getstate() must return (b"", 0). * */ getstate(): Promise getstate$($: {}): Promise /** * * Set the current state of the decoder. * * state must have been returned by getstate(). The effect of * setstate((b"", 0)) must be equivalent to reset(). * */ setstate(state): Promise setstate$({ state }): Promise } /** * * This subclass of IncrementalDecoder can be used as the baseclass for an * incremental decoder if the decoder must be able to handle incomplete * byte sequences. * */ function BufferedIncrementalDecoder(errors?): Promise function BufferedIncrementalDecoder$({ errors }: { errors?}): Promise interface IBufferedIncrementalDecoder extends IIncrementalDecoder { decode(input, final?: boolean): Promise decode$({ input, final }: { input, final?}): Promise reset(): Promise reset$($: {}): Promise getstate(): Promise getstate$($: {}): Promise setstate(state): Promise setstate$({ state }): Promise } /** * Creates a StreamWriter instance. * * stream must be a file-like object open for writing. * * The StreamWriter may use different error handling * schemes by providing the errors keyword argument. These * parameters are predefined: * * 'strict' - raise a ValueError (or a subclass) * 'ignore' - ignore the character and continue with the next * 'replace'- replace with a suitable replacement character * 'xmlcharrefreplace' - Replace with the appropriate XML * character reference. * 'backslashreplace' - Replace with backslashed escape * sequences. * 'namereplace' - Replace with \N{...} escape sequences. * * The set of allowed parameter values can be extended via * register_error. * */ function StreamWriter(stream, errors?): Promise function StreamWriter$({ stream, errors }: { stream, errors?}): Promise interface IStreamWriter extends ICodec { /** * Writes the object's contents encoded to self.stream. * */ write(object): Promise write$({ object }): Promise /** * Writes the concatenated list of strings to the stream * using .write(). * */ writelines(list): Promise writelines$({ list }): Promise /** * Resets the codec buffers used for keeping internal state. * * Calling this method should ensure that the data on the * output is put into a clean state, that allows appending * of new fresh data without having to rescan the whole * stream to recover state. * * */ reset(): Promise reset$($: {}): Promise seek(offset, whence?): Promise seek$({ offset, whence }: { offset, whence?}): Promise } /** * Creates a StreamReader instance. * * stream must be a file-like object open for reading. * * The StreamReader may use different error handling * schemes by providing the errors keyword argument. These * parameters are predefined: * * 'strict' - raise a ValueError (or a subclass) * 'ignore' - ignore the character and continue with the next * 'replace'- replace with a suitable replacement character * 'backslashreplace' - Replace with backslashed escape sequences; * * The set of allowed parameter values can be extended via * register_error. * */ function StreamReader(stream, errors?): Promise function StreamReader$({ stream, errors }: { stream, errors?}): Promise interface IStreamReader extends ICodec { decode(input, errors?): Promise decode$({ input, errors }: { input, errors?}): Promise /** * Decodes data from the stream self.stream and returns the * resulting object. * * chars indicates the number of decoded code points or bytes to * return. read() will never return more data than requested, * but it might return less, if there is not enough available. * * size indicates the approximate maximum number of decoded * bytes or code points to read for decoding. The decoder * can modify this setting as appropriate. The default value * -1 indicates to read and decode as much as possible. size * is intended to prevent having to decode huge files in one * step. * * If firstline is true, and a UnicodeDecodeError happens * after the first line terminator in the input only the first line * will be returned, the rest of the input will be kept until the * next call to read(). * * The method should use a greedy read strategy, meaning that * it should read as much data as is allowed within the * definition of the encoding and the given size, e.g. if * optional encoding endings or state markers are available * on the stream, these should be read too. * */ read(size?, chars?, firstline?: boolean): Promise read$({ size, chars, firstline }: { size?, chars?, firstline?}): Promise /** * Read one line from the input stream and return the * decoded data. * * size, if given, is passed as size argument to the * read() method. * * */ readline(size?, keepends?: boolean): Promise readline$({ size, keepends }: { size?, keepends?}): Promise /** * Read all lines available on the input stream * and return them as a list. * * Line breaks are implemented using the codec's decoder * method and are included in the list entries. * * sizehint, if given, is ignored since there is no efficient * way to finding the true end-of-line. * * */ readlines(sizehint?, keepends?: boolean): Promise readlines$({ sizehint, keepends }: { sizehint?, keepends?}): Promise /** * Resets the codec buffers used for keeping internal state. * * Note that no stream repositioning should take place. * This method is primarily intended to be able to recover * from decoding errors. * * */ reset(): Promise reset$($: {}): Promise /** * Set the input stream's current position. * * Resets the codec buffers used for keeping state. * */ seek(offset, whence?): Promise seek$({ offset, whence }: { offset, whence?}): Promise charbuffertype } /** * StreamReaderWriter instances allow wrapping streams which * work in both read and write modes. * * The design is such that one can use the factory functions * returned by the codec.lookup() function to construct the * instance. * * */ /** * Creates a StreamReaderWriter instance. * * stream must be a Stream-like object. * * Reader, Writer must be factory functions or classes * providing the StreamReader, StreamWriter interface resp. * * Error handling is done in the same way as defined for the * StreamWriter/Readers. * * */ function StreamReaderWriter(stream, Reader, Writer, errors?): Promise function StreamReaderWriter$({ stream, Reader, Writer, errors }: { stream, Reader, Writer, errors?}): Promise interface IStreamReaderWriter { read(size?): Promise read$({ size }: { size?}): Promise readline(size?): Promise readline$({ size }: { size?}): Promise readlines(sizehint?): Promise readlines$({ sizehint }: { sizehint?}): Promise write(data): Promise write$({ data }): Promise writelines(list): Promise writelines$({ list }): Promise reset(): Promise reset$($: {}): Promise seek(offset, whence?): Promise seek$({ offset, whence }: { offset, whence?}): Promise encoding } /** * StreamRecoder instances translate data from one encoding to another. * * They use the complete set of APIs returned by the * codecs.lookup() function to implement their task. * * Data written to the StreamRecoder is first decoded into an * intermediate format (depending on the "decode" codec) and then * written to the underlying stream using an instance of the provided * Writer class. * * In the other direction, data is read from the underlying stream using * a Reader instance and then encoded and returned to the caller. * * */ /** * Creates a StreamRecoder instance which implements a two-way * conversion: encode and decode work on the frontend (the * data visible to .read() and .write()) while Reader and Writer * work on the backend (the data in stream). * * You can use these objects to do transparent * transcodings from e.g. latin-1 to utf-8 and back. * * stream must be a file-like object. * * encode and decode must adhere to the Codec interface; Reader and * Writer must be factory functions or classes providing the * StreamReader and StreamWriter interfaces resp. * * Error handling is done in the same way as defined for the * StreamWriter/Readers. * * */ function StreamRecoder(stream, encode, decode, Reader, Writer, errors?): Promise function StreamRecoder$({ stream, encode, decode, Reader, Writer, errors }: { stream, encode, decode, Reader, Writer, errors?}): Promise interface IStreamRecoder { read(size?): Promise read$({ size }: { size?}): Promise readline(size?): Promise readline$({ size }: { size?}): Promise readlines(sizehint?): Promise readlines$({ sizehint }: { sizehint?}): Promise write(data): Promise write$({ data }): Promise writelines(list): Promise writelines$({ list }): Promise reset(): Promise reset$($: {}): Promise seek(offset, whence?): Promise seek$({ offset, whence }: { offset, whence?}): Promise data_encoding file_encoding } let BOM_UTF8: Promise let BOM_LE: Promise let BOM_UTF16_LE: Promise let BOM_BE: Promise let BOM_UTF16_BE: Promise let BOM_UTF32_LE: Promise let BOM_UTF32_BE: Promise let BOM: Promise let BOM_UTF16: Promise let BOM_UTF32: Promise let BOM32_LE: Promise let BOM32_BE: Promise let BOM64_LE: Promise let BOM64_BE: Promise let strict_errors: Promise let ignore_errors: Promise let replace_errors: Promise let xmlcharrefreplace_errors: Promise let backslashreplace_errors: Promise let namereplace_errors: Promise } declare module colorsys { var _ function rgb_to_yiq(r, g, b): Promise function rgb_to_yiq$({ r, g, b }): Promise function yiq_to_rgb(y, i, q): Promise function yiq_to_rgb$({ y, i, q }): Promise function rgb_to_hls(r, g, b): Promise function rgb_to_hls$({ r, g, b }): Promise function hls_to_rgb(h, l, s): Promise function hls_to_rgb$({ h, l, s }): Promise function rgb_to_hsv(r, g, b): Promise function rgb_to_hsv$({ r, g, b }): Promise function hsv_to_rgb(h, s, v): Promise function hsv_to_rgb$({ h, s, v }): Promise let ONE_THIRD: Promise let ONE_SIXTH: Promise let TWO_THIRD: Promise } declare module crypt { var _ /** * Generate a salt for the specified method. * * If not specified, the strongest available method will be used. * * */ function mksalt(method?): Promise function mksalt$({ method }: { method?}): Promise /** * Return a string representing the one-way hash of a password, with a salt * prepended. * * If ``salt`` is not specified or is ``None``, the strongest * available method will be selected and a salt generated. Otherwise, * ``salt`` may be one of the ``crypt.METHOD_*`` values, or a string as * returned by ``crypt.mksalt()``. * * */ function crypt(word, salt?): Promise function crypt$({ word, salt }: { word, salt?}): Promise /** * Class representing a salt method per the Modular Crypt Format or the * legacy 2-character crypt method. */ interface I_Method { } let methods: Promise } declare module decimal { var _ } declare module email { module base64mime { var _ /** * Return the length of s when it is encoded with base64. */ function header_length(bytearray): Promise function header_length$({ bytearray }): Promise /** * Encode a single header line with Base64 encoding in a given charset. * * charset names the character set to use to encode the header. It defaults * to iso-8859-1. Base64 encoding is defined in RFC 2045. * */ function header_encode(header_bytes, charset?): Promise function header_encode$({ header_bytes, charset }: { header_bytes, charset?}): Promise /** * Encode a string with base64. * * Each line will be wrapped at, at most, maxlinelen characters (defaults to * 76 characters). * * Each line of encoded text will end with eol, which defaults to "\n". Set * this to "\r\n" if you will be using the result of this function directly * in an email. * */ function body_encode(s, maxlinelen?, eol?): Promise function body_encode$({ s, maxlinelen, eol }: { s, maxlinelen?, eol?}): Promise /** * Decode a raw base64 string, returning a bytes object. * * This function does not parse a full MIME header value encoded with * base64 (like =?iso-8859-1?b?bmloISBuaWgh?=) -- please use the high * level email.header class for that functionality. * */ function decode(string): Promise function decode$({ string }): Promise let CRLF: Promise let NL: Promise let EMPTYSTRING: Promise let MISC_LEN: Promise let body_decode: Promise let decodestring: Promise } } declare module encodings { module base64_codec { var _ function base64_encode(input, errors?): Promise function base64_encode$({ input, errors }: { input, errors?}): Promise function base64_decode(input, errors?): Promise function base64_decode$({ input, errors }: { input, errors?}): Promise function getregentry(): Promise function getregentry$($: {}): Promise interface ICodec { encode(input, errors?): Promise encode$({ input, errors }: { input, errors?}): Promise decode(input, errors?): Promise decode$({ input, errors }: { input, errors?}): Promise } interface IIncrementalEncoder { encode(input, final?: boolean): Promise encode$({ input, final }: { input, final?}): Promise } interface IIncrementalDecoder { decode(input, final?: boolean): Promise decode$({ input, final }: { input, final?}): Promise } interface IStreamWriter extends ICodec { charbuffertype } interface IStreamReader extends ICodec { } } module bz2_codec { var _ function bz2_encode(input, errors?): Promise function bz2_encode$({ input, errors }: { input, errors?}): Promise function bz2_decode(input, errors?): Promise function bz2_decode$({ input, errors }: { input, errors?}): Promise function getregentry(): Promise function getregentry$($: {}): Promise interface ICodec { encode(input, errors?): Promise encode$({ input, errors }: { input, errors?}): Promise decode(input, errors?): Promise decode$({ input, errors }: { input, errors?}): Promise } function IncrementalEncoder(errors?): Promise function IncrementalEncoder$({ errors }: { errors?}): Promise interface IIncrementalEncoder { encode(input, final?: boolean): Promise encode$({ input, final }: { input, final?}): Promise reset(): Promise reset$($: {}): Promise } function IncrementalDecoder(errors?): Promise function IncrementalDecoder$({ errors }: { errors?}): Promise interface IIncrementalDecoder { decode(input, final?: boolean): Promise decode$({ input, final }: { input, final?}): Promise reset(): Promise reset$($: {}): Promise } interface IStreamWriter extends ICodec { charbuffertype } interface IStreamReader extends ICodec { } } module hex_codec { var _ function hex_encode(input, errors?): Promise function hex_encode$({ input, errors }: { input, errors?}): Promise function hex_decode(input, errors?): Promise function hex_decode$({ input, errors }: { input, errors?}): Promise function getregentry(): Promise function getregentry$($: {}): Promise interface ICodec { encode(input, errors?): Promise encode$({ input, errors }: { input, errors?}): Promise decode(input, errors?): Promise decode$({ input, errors }: { input, errors?}): Promise } interface IIncrementalEncoder { encode(input, final?: boolean): Promise encode$({ input, final }: { input, final?}): Promise } interface IIncrementalDecoder { decode(input, final?: boolean): Promise decode$({ input, final }: { input, final?}): Promise } interface IStreamWriter extends ICodec { charbuffertype } interface IStreamReader extends ICodec { } } module palmos { var _ function getregentry(): Promise function getregentry$($: {}): Promise interface ICodec { encode(input, errors?): Promise encode$({ input, errors }: { input, errors?}): Promise decode(input, errors?): Promise decode$({ input, errors }: { input, errors?}): Promise } interface IIncrementalEncoder { encode(input, final?: boolean): Promise encode$({ input, final }: { input, final?}): Promise } interface IIncrementalDecoder { decode(input, final?: boolean): Promise decode$({ input, final }: { input, final?}): Promise } interface IStreamWriter extends ICodec { } interface IStreamReader extends ICodec { } let decoding_table: Promise let encoding_table: Promise } module quopri_codec { var _ function quopri_encode(input, errors?): Promise function quopri_encode$({ input, errors }: { input, errors?}): Promise function quopri_decode(input, errors?): Promise function quopri_decode$({ input, errors }: { input, errors?}): Promise function getregentry(): Promise function getregentry$($: {}): Promise interface ICodec { encode(input, errors?): Promise encode$({ input, errors }: { input, errors?}): Promise decode(input, errors?): Promise decode$({ input, errors }: { input, errors?}): Promise } interface IIncrementalEncoder { encode(input, final?: boolean): Promise encode$({ input, final }: { input, final?}): Promise } interface IIncrementalDecoder { decode(input, final?: boolean): Promise decode$({ input, final }: { input, final?}): Promise } interface IStreamWriter extends ICodec { charbuffertype } interface IStreamReader extends ICodec { } } module uu_codec { var _ function uu_encode(input, errors?, filename?, mode?): Promise function uu_encode$({ input, errors, filename, mode }: { input, errors?, filename?, mode?}): Promise function uu_decode(input, errors?): Promise function uu_decode$({ input, errors }: { input, errors?}): Promise function getregentry(): Promise function getregentry$($: {}): Promise interface ICodec { encode(input, errors?): Promise encode$({ input, errors }: { input, errors?}): Promise decode(input, errors?): Promise decode$({ input, errors }: { input, errors?}): Promise } interface IIncrementalEncoder { encode(input, final?: boolean): Promise encode$({ input, final }: { input, final?}): Promise } interface IIncrementalDecoder { decode(input, final?: boolean): Promise decode$({ input, final }: { input, final?}): Promise } interface IStreamWriter extends ICodec { charbuffertype } interface IStreamReader extends ICodec { } } module zlib_codec { var _ function zlib_encode(input, errors?): Promise function zlib_encode$({ input, errors }: { input, errors?}): Promise function zlib_decode(input, errors?): Promise function zlib_decode$({ input, errors }: { input, errors?}): Promise function getregentry(): Promise function getregentry$($: {}): Promise interface ICodec { encode(input, errors?): Promise encode$({ input, errors }: { input, errors?}): Promise decode(input, errors?): Promise decode$({ input, errors }: { input, errors?}): Promise } function IncrementalEncoder(errors?): Promise function IncrementalEncoder$({ errors }: { errors?}): Promise interface IIncrementalEncoder { encode(input, final?: boolean): Promise encode$({ input, final }: { input, final?}): Promise reset(): Promise reset$($: {}): Promise } function IncrementalDecoder(errors?): Promise function IncrementalDecoder$({ errors }: { errors?}): Promise interface IIncrementalDecoder { decode(input, final?: boolean): Promise decode$({ input, final }: { input, final?}): Promise reset(): Promise reset$($: {}): Promise } interface IStreamWriter extends ICodec { charbuffertype } interface IStreamReader extends ICodec { } } } declare module export { var _ function export_json(tree, pretty_print ?: boolean): Promise < any > function export_json$({ tree, pretty_print }: { tree, pretty_print?}): Promise function export_dict(tree): Promise function export_dict$({ tree }): Promise interface IDictExportVisitor { visit(node): Promise visit$({ node }): Promise default_visit(node): Promise default_visit$({ node }): Promise default_visit_field(val): Promise default_visit_field$({ val }): Promise visit_str(val): Promise visit_str$({ val }): Promise visit_Bytes(val): Promise visit_Bytes$({ val }): Promise visit_NoneType(val): Promise visit_NoneType$({ val }): Promise visit_field_NameConstant_value(val): Promise visit_field_NameConstant_value$({ val }): Promise visit_field_Num_n(val): Promise visit_field_Num_n$({ val }): Promise ast_type_field } } declare module gzip { var _ /** * Open a gzip-compressed file in binary or text mode. * * The filename argument can be an actual filename (a str or bytes object), or * an existing file object to read from or write to. * * The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or "ab" for * binary mode, or "rt", "wt", "xt" or "at" for text mode. The default mode is * "rb", and the default compresslevel is 9. * * For binary mode, this function is equivalent to the GzipFile constructor: * GzipFile(filename, mode, compresslevel). In this case, the encoding, errors * and newline arguments must not be provided. * * For text mode, a GzipFile object is created, and wrapped in an * io.TextIOWrapper instance with the specified encoding, error handling * behavior, and line ending(s). * * */ function open(filename, mode?, compresslevel?, encoding?, errors?, newline?): Promise function open$({ filename, mode, compresslevel, encoding, errors, newline }: { filename, mode?, compresslevel?, encoding?, errors?, newline?}): Promise function write32u(output, value): Promise function write32u$({ output, value }): Promise /** * Compress data in one shot and return the compressed string. * Optional argument is the compression level, in range of 0-9. * */ function compress(data, compresslevel?): Promise function compress$({ data, compresslevel }: { data, compresslevel?}): Promise /** * Decompress a gzip compressed string in one shot. * Return the decompressed string. * */ function decompress(data): Promise function decompress$({ data }): Promise function main(): Promise function main$($: {}): Promise /** * Minimal read-only file object that prepends a string to the contents * of an actual file. Shouldn't be used outside of gzip.py, as it lacks * essential functionality. */ interface I_PaddedFile { read(size): Promise read$({ size }): Promise prepend(prepend?): Promise prepend$({ prepend }: { prepend?}): Promise seek(off): Promise seek$({ off }): Promise seekable(): Promise seekable$($: {}): Promise } /** * Exception raised in some cases for invalid gzip files. */ interface IBadGzipFile { } /** * The GzipFile class simulates most of the methods of a file object with * the exception of the truncate() method. * * This class only supports opening files in binary mode. If you need to open a * compressed file in text mode, use the gzip.open() function. * * */ /** * Constructor for the GzipFile class. * * At least one of fileobj and filename must be given a * non-trivial value. * * The new class instance is based on fileobj, which can be a regular * file, an io.BytesIO object, or any other object which simulates a file. * It defaults to None, in which case filename is opened to provide * a file object. * * When fileobj is not None, the filename argument is only used to be * included in the gzip file header, which may include the original * filename of the uncompressed file. It defaults to the filename of * fileobj, if discernible; otherwise, it defaults to the empty string, * and in this case the original filename is not included in the header. * * The mode argument can be any of 'r', 'rb', 'a', 'ab', 'w', 'wb', 'x', or * 'xb' depending on whether the file will be read or written. The default * is the mode of fileobj if discernible; otherwise, the default is 'rb'. * A mode of 'r' is equivalent to one of 'rb', and similarly for 'w' and * 'wb', 'a' and 'ab', and 'x' and 'xb'. * * The compresslevel argument is an integer from 0 to 9 controlling the * level of compression; 1 is fastest and produces the least compression, * and 9 is slowest and produces the most compression. 0 is no compression * at all. The default is 9. * * The mtime argument is an optional numeric timestamp to be written * to the last modification time field in the stream when compressing. * If omitted or None, the current time is used. * * */ function GzipFile(filename?, mode?, compresslevel?, fileobj?, mtime?): Promise function GzipFile$({ filename, mode, compresslevel, fileobj, mtime }: { filename?, mode?, compresslevel?, fileobj?, mtime?}): Promise interface IGzipFile { filename(): Promise filename$($: {}): Promise /** * Last modification time read from stream, or None */ mtime(): Promise mtime$($: {}): Promise write(data): Promise write$({ data }): Promise read(size?): Promise read$({ size }: { size?}): Promise /** * Implements BufferedIOBase.read1() * * Reads up to a buffer's worth of data if size is negative. */ read1(size?): Promise read1$({ size }: { size?}): Promise peek(n): Promise peek$({ n }): Promise closed(): Promise closed$($: {}): Promise close(): Promise close$($: {}): Promise flush(zlib_mode?): Promise flush$({ zlib_mode }: { zlib_mode?}): Promise /** * Invoke the underlying file object's fileno() method. * * This will raise AttributeError if the underlying file object * doesn't support fileno(). * */ fileno(): Promise fileno$($: {}): Promise /** * Return the uncompressed stream file position indicator to the * beginning of the file */ rewind(): Promise rewind$($: {}): Promise readable(): Promise readable$($: {}): Promise writable(): Promise writable$($: {}): Promise seekable(): Promise seekable$($: {}): Promise seek(offset, whence?): Promise seek$({ offset, whence }: { offset, whence?}): Promise readline(size?): Promise readline$({ size }: { size?}): Promise myfileobj } interface I_GzipReader { read(size?): Promise read$({ size }: { size?}): Promise } } declare module hashlib { var _ let algorithms_guaranteed: Promise let algorithms_available: Promise let new$: Promise } declare module idlelib { module codecontext { var _ /** * Extract the beginning whitespace and first word from codeline. */ function get_spaces_firstword(codeline, c?): Promise function get_spaces_firstword$({ codeline, c }: { codeline, c?}): Promise /** * Return tuple of (line indent value, codeline, block start keyword). * * The indentation of empty lines (or comment lines) is INFINITY. * If the line does not start a block, the keyword value is False. * */ function get_line_info(codeline): Promise function get_line_info$({ codeline }): Promise /** * Display block context above the edit window. */ /** * Initialize settings for context block. * * editwin is the Editor window for the context block. * self.text is the editor window text widget. * * self.context displays the code context text above the editor text. * Initially None, it is toggled via <>. * self.topvisible is the number of the top text line displayed. * self.info is a list of (line number, indent level, line text, * block keyword) tuples for the block structure above topvisible. * self.info[0] is initialized with a 'dummy' line which * starts the toplevel 'block' of the module. * * self.t1 and self.t2 are two timer events on the editor text widget to * monitor for changes to the context text or editor font. * */ function CodeContext(editwin): Promise function CodeContext$({ editwin }): Promise interface ICodeContext { /** * Load class variables from config. */ reload(): Promise reload$($: {}): Promise /** * Toggle code context display. * * If self.context doesn't exist, create it to match the size of the editor * window text (toggle on). If it does exist, destroy it (toggle off). * Return 'break' to complete the processing of the binding. * */ toggle_code_context_event(event?): Promise toggle_code_context_event$({ event }: { event?}): Promise /** * Return a list of block line tuples and the 'last' indent. * * The tuple fields are (linenum, indent, text, opener). * The list represents header lines from new_topvisible back to * stopline with successively shorter indents > stopindent. * The list is returned ordered by line number. * Last indent returned is the smallest indent observed. * */ get_context(new_topvisible, stopline?, stopindent?): Promise get_context$({ new_topvisible, stopline, stopindent }: { new_topvisible, stopline?, stopindent?}): Promise /** * Update context information and lines visible in the context pane. * * No update is done if the text hasn't been scrolled. If the text * was scrolled, the lines that should be shown in the context will * be retrieved and the context area will be updated with the code, * up to the number of maxlines. * */ update_code_context(): Promise update_code_context$($: {}): Promise /** * Show clicked context line at top of editor. * * If a selection was made, don't jump; allow copying. * If no visible context, show the top line of the file. * */ jumptoline(event?): Promise jumptoline$({ event }: { event?}): Promise /** * Event on editor text widget triggered every UPDATEINTERVAL ms. */ timer_event(): Promise timer_event$($: {}): Promise update_font(): Promise update_font$($: {}): Promise update_highlight_colors(): Promise update_highlight_colors$($: {}): Promise UPDATEINTERVAL } let BLOCKOPENERS: Promise } module statusbar { var _ function MultiStatusBar(master): Promise function MultiStatusBar$({ master }): Promise interface IMultiStatusBar { set_label(name, text?, side?, width?): Promise set_label$({ name, text, side, width }: { name, text?, side?, width?}): Promise } } } declare module os { var _ /** * makedirs(name [, mode=0o777][, exist_ok=False]) * * Super-mkdir; create a leaf directory and all intermediate ones. Works like * mkdir, except that any intermediate path segment (not just the rightmost) * will be created if it does not exist. If the target directory already * exists, raise an OSError if exist_ok is False. Otherwise no exception is * raised. This is recursive. * * */ function makedirs(name, mode?, exist_ok?: boolean): Promise function makedirs$({ name, mode, exist_ok }: { name, mode?, exist_ok?}): Promise /** * removedirs(name) * * Super-rmdir; remove a leaf directory and all empty intermediate * ones. Works like rmdir except that, if the leaf directory is * successfully removed, directories corresponding to rightmost path * segments will be pruned away until either the whole path is * consumed or an error occurs. Errors during this latter phase are * ignored -- they generally mean that a directory was not empty. * * */ function removedirs(name): Promise function removedirs$({ name }): Promise /** * renames(old, new) * * Super-rename; create directories as necessary and delete any left * empty. Works like rename, except creation of any intermediate * directories needed to make the new pathname good is attempted * first. After the rename, directories corresponding to rightmost * path segments of the old name will be pruned until either the * whole path is consumed or a nonempty directory is found. * * Note: this function can fail with the new directory structure made * if you lack permissions needed to unlink the leaf directory or * file. * * */ function renames(old, New): Promise function renames$({ old, New }): Promise /** * Directory tree generator. * * For each directory in the directory tree rooted at top (including top * itself, but excluding '.' and '..'), yields a 3-tuple * * dirpath, dirnames, filenames * * dirpath is a string, the path to the directory. dirnames is a list of * the names of the subdirectories in dirpath (excluding '.' and '..'). * filenames is a list of the names of the non-directory files in dirpath. * Note that the names in the lists are just names, with no path components. * To get a full path (which begins with top) to a file or directory in * dirpath, do os.path.join(dirpath, name). * * If optional arg 'topdown' is true or not specified, the triple for a * directory is generated before the triples for any of its subdirectories * (directories are generated top down). If topdown is false, the triple * for a directory is generated after the triples for all of its * subdirectories (directories are generated bottom up). * * When topdown is true, the caller can modify the dirnames list in-place * (e.g., via del or slice assignment), and walk will only recurse into the * subdirectories whose names remain in dirnames; this can be used to prune the * search, or to impose a specific order of visiting. Modifying dirnames when * topdown is false has no effect on the behavior of os.walk(), since the * directories in dirnames have already been generated by the time dirnames * itself is generated. No matter the value of topdown, the list of * subdirectories is retrieved before the tuples for the directory and its * subdirectories are generated. * * By default errors from the os.scandir() call are ignored. If * optional arg 'onerror' is specified, it should be a function; it * will be called with one argument, an OSError instance. It can * report the error to continue with the walk, or raise the exception * to abort the walk. Note that the filename is available as the * filename attribute of the exception object. * * By default, os.walk does not follow symbolic links to subdirectories on * systems that support them. In order to get this functionality, set the * optional argument 'followlinks' to true. * * Caution: if you pass a relative pathname for top, don't change the * current working directory between resumptions of walk. walk never * changes the current directory, and assumes that the client doesn't * either. * * Example: * * import os * from os.path import join, getsize * for root, dirs, files in os.walk('python/Lib/email'): * print(root, "consumes", end="") * print(sum(getsize(join(root, name)) for name in files), end="") * print("bytes in", len(files), "non-directory files") * if 'CVS' in dirs: * dirs.remove('CVS') # don't visit CVS directories * * */ function walk(top, topdown?: boolean, onerror?, followlinks?: boolean): Promise function walk$({ top, topdown, onerror, followlinks }: { top, topdown?, onerror?, followlinks?}): Promise /** * Directory tree generator. * * This behaves exactly like walk(), except that it yields a 4-tuple * * dirpath, dirnames, filenames, dirfd * * `dirpath`, `dirnames` and `filenames` are identical to walk() output, * and `dirfd` is a file descriptor referring to the directory `dirpath`. * * The advantage of fwalk() over walk() is that it's safe against symlink * races (when follow_symlinks is False). * * If dir_fd is not None, it should be a file descriptor open to a directory, * and top should be relative; top will then be relative to that directory. * (dir_fd is always supported for fwalk.) * * Caution: * Since fwalk() yields file descriptors, those are only valid until the * next iteration step, so you should dup() them if you want to keep them * for a longer period. * * Example: * * import os * for root, dirs, files, rootfd in os.fwalk('python/Lib/email'): * print(root, "consumes", end="") * print(sum(os.stat(name, dir_fd=rootfd).st_size for name in files), * end="") * print("bytes in", len(files), "non-directory files") * if 'CVS' in dirs: * dirs.remove('CVS') # don't visit CVS directories * */ function fwalk(top?, topdown?: boolean, onerror?): Promise function fwalk$({ top, topdown, onerror }: { top?, topdown?, onerror?}): Promise /** * execl(file, *args) * * Execute the executable file with argument list args, replacing the * current process. */ function execl(file): Promise function execl$({ file }): Promise /** * execle(file, *args, env) * * Execute the executable file with argument list args and * environment env, replacing the current process. */ function execle(file): Promise function execle$({ file }): Promise /** * execlp(file, *args) * * Execute the executable file (which is searched for along $PATH) * with argument list args, replacing the current process. */ function execlp(file): Promise function execlp$({ file }): Promise /** * execlpe(file, *args, env) * * Execute the executable file (which is searched for along $PATH) * with argument list args and environment env, replacing the current * process. */ function execlpe(file): Promise function execlpe$({ file }): Promise /** * execvp(file, args) * * Execute the executable file (which is searched for along $PATH) * with argument list args, replacing the current process. * args may be a list or tuple of strings. */ function execvp(file, args): Promise function execvp$({ file, args }): Promise /** * execvpe(file, args, env) * * Execute the executable file (which is searched for along $PATH) * with argument list args and environment env, replacing the * current process. * args may be a list or tuple of strings. */ function execvpe(file, args, env): Promise function execvpe$({ file, args, env }): Promise /** * Returns the sequence of directories that will be searched for the * named executable (similar to a shell) when launching a process. * * *env* must be an environment variable dict or None. If *env* is None, * os.environ will be used. * */ function get_exec_path(env?): Promise function get_exec_path$({ env }: { env?}): Promise /** * Get an environment variable, return None if it doesn't exist. * The optional second argument can specify an alternate default. * key, default and the result are str. */ function getenv(key, def?): Promise function getenv$({ key, def }: { key, def?}): Promise /** * Get an environment variable, return None if it doesn't exist. * The optional second argument can specify an alternate default. * key, default and the result are bytes. */ function getenvb(key, def?): Promise function getenvb$({ key, def }: { key, def?}): Promise /** * spawnv(mode, file, args) -> integer * * Execute file with arguments from args in a subprocess. * If mode == P_NOWAIT return the pid of the process. * If mode == P_WAIT return the process's exit code if it exits normally; * otherwise return -SIG, where SIG is the signal that killed it. */ function spawnv(mode, file, args): Promise function spawnv$({ mode, file, args }): Promise /** * spawnve(mode, file, args, env) -> integer * * Execute file with arguments from args in a subprocess with the * specified environment. * If mode == P_NOWAIT return the pid of the process. * If mode == P_WAIT return the process's exit code if it exits normally; * otherwise return -SIG, where SIG is the signal that killed it. */ function spawnve(mode, file, args, env): Promise function spawnve$({ mode, file, args, env }): Promise /** * spawnvp(mode, file, args) -> integer * * Execute file (which is looked for along $PATH) with arguments from * args in a subprocess. * If mode == P_NOWAIT return the pid of the process. * If mode == P_WAIT return the process's exit code if it exits normally; * otherwise return -SIG, where SIG is the signal that killed it. */ function spawnvp(mode, file, args): Promise function spawnvp$({ mode, file, args }): Promise /** * spawnvpe(mode, file, args, env) -> integer * * Execute file (which is looked for along $PATH) with arguments from * args in a subprocess with the supplied environment. * If mode == P_NOWAIT return the pid of the process. * If mode == P_WAIT return the process's exit code if it exits normally; * otherwise return -SIG, where SIG is the signal that killed it. */ function spawnvpe(mode, file, args, env): Promise function spawnvpe$({ mode, file, args, env }): Promise /** * spawnl(mode, file, *args) -> integer * * Execute file with arguments from args in a subprocess. * If mode == P_NOWAIT return the pid of the process. * If mode == P_WAIT return the process's exit code if it exits normally; * otherwise return -SIG, where SIG is the signal that killed it. */ function spawnl(mode, file): Promise function spawnl$({ mode, file }): Promise /** * spawnle(mode, file, *args, env) -> integer * * Execute file with arguments from args in a subprocess with the * supplied environment. * If mode == P_NOWAIT return the pid of the process. * If mode == P_WAIT return the process's exit code if it exits normally; * otherwise return -SIG, where SIG is the signal that killed it. */ function spawnle(mode, file): Promise function spawnle$({ mode, file }): Promise /** * spawnlp(mode, file, *args) -> integer * * Execute file (which is looked for along $PATH) with arguments from * args in a subprocess with the supplied environment. * If mode == P_NOWAIT return the pid of the process. * If mode == P_WAIT return the process's exit code if it exits normally; * otherwise return -SIG, where SIG is the signal that killed it. */ function spawnlp(mode, file): Promise function spawnlp$({ mode, file }): Promise /** * spawnlpe(mode, file, *args, env) -> integer * * Execute file (which is looked for along $PATH) with arguments from * args in a subprocess with the supplied environment. * If mode == P_NOWAIT return the pid of the process. * If mode == P_WAIT return the process's exit code if it exits normally; * otherwise return -SIG, where SIG is the signal that killed it. */ function spawnlpe(mode, file): Promise function spawnlpe$({ mode, file }): Promise function popen(cmd, mode?, buffering?): Promise function popen$({ cmd, mode, buffering }: { cmd, mode?, buffering?}): Promise function fdopen(fd, mode?, buffering?, encoding?): Promise function fdopen$({ fd, mode, buffering, encoding }: { fd, mode?, buffering?, encoding?}): Promise /** * Add a path to the DLL search path. * * This search path is used when resolving dependencies for imported * extension modules (the module itself is resolved through sys.path), * and also by ctypes. * * Remove the directory by calling close() on the returned object or * using it in a with statement. * */ function add_dll_directory(path): Promise function add_dll_directory$({ path }): Promise interface I_Environ { copy(): Promise copy$($: {}): Promise setdefault(key, value): Promise setdefault$({ key, value }): Promise } interface I_wrap_close { close(): Promise close$($: {}): Promise } /** * Abstract base class for implementing the file system path protocol. */ interface IPathLike { } interface I_AddedDllDirectory { close(): Promise close$($: {}): Promise } let GenericAlias: Promise let name: Promise let linesep: Promise let supports_dir_fd: Promise let supports_effective_ids: Promise let supports_fd: Promise let supports_follow_symlinks: Promise let SEEK_SET: Promise let SEEK_CUR: Promise let SEEK_END: Promise let environ: Promise let supports_bytes_environ: Promise let environb: Promise let P_WAIT: Promise let P_NOWAIT: Promise let P_NOWAITO: Promise let fspath: Promise } declare module platform { var _ /** * Tries to determine the libc version that the file executable * (which defaults to the Python interpreter) is linked against. * * Returns a tuple of strings (lib,version) which default to the * given parameters in case the lookup fails. * * Note that the function has intimate knowledge of how different * libc versions add symbols to the executable and thus is probably * only usable for executables compiled using gcc. * * The file is read and scanned in chunks of chunksize bytes. * * */ function libc_ver(executable?, lib?, version?, chunksize?): Promise function libc_ver$({ executable, lib, version, chunksize }: { executable?, lib?, version?, chunksize?}): Promise function win32_is_iot(): Promise function win32_is_iot$($: {}): Promise function win32_edition(): Promise function win32_edition$($: {}): Promise function win32_ver(release?, version?, csd?, ptype?): Promise function win32_ver$({ release, version, csd, ptype }: { release?, version?, csd?, ptype?}): Promise /** * Get macOS version information and return it as tuple (release, * versioninfo, machine) with versioninfo being a tuple (version, * dev_stage, non_release_version). * * Entries which cannot be determined are set to the parameter values * which default to ''. All tuple entries are strings. * */ function mac_ver(release?, versioninfo?, machine?): Promise function mac_ver$({ release, versioninfo, machine }: { release?, versioninfo?, machine?}): Promise /** * Version interface for Jython. * * Returns a tuple (release, vendor, vminfo, osinfo) with vminfo being * a tuple (vm_name, vm_release, vm_vendor) and osinfo being a * tuple (os_name, os_version, os_arch). * * Values which cannot be determined are set to the defaults * given as parameters (which all default to ''). * * */ function java_ver(release?, vendor?, vminfo?, osinfo?): Promise function java_ver$({ release, vendor, vminfo, osinfo }: { release?, vendor?, vminfo?, osinfo?}): Promise /** * Returns (system, release, version) aliased to common * marketing names used for some systems. * * It also does some reordering of the information in some cases * where it would otherwise cause confusion. * * */ function system_alias(system, release, version): Promise function system_alias$({ system, release, version }): Promise /** * Queries the given executable (defaults to the Python interpreter * binary) for various architecture information. * * Returns a tuple (bits, linkage) which contains information about * the bit architecture and the linkage format used for the * executable. Both values are returned as strings. * * Values that cannot be determined are returned as given by the * parameter presets. If bits is given as '', the sizeof(pointer) * (or sizeof(long) on Python version < 1.5.2) is used as * indicator for the supported pointer size. * * The function relies on the system's "file" command to do the * actual work. This is available on most if not all Unix * platforms. On some non-Unix platforms where the "file" command * does not exist and the executable is set to the Python interpreter * binary defaults from _default_architecture are used. * * */ function architecture(executable?, bits?, linkage?): Promise function architecture$({ executable, bits, linkage }: { executable?, bits?, linkage?}): Promise /** * Fairly portable uname interface. Returns a tuple * of strings (system, node, release, version, machine, processor) * identifying the underlying platform. * * Note that unlike the os.uname function this also returns * possible processor information as an additional tuple entry. * * Entries which cannot be determined are set to ''. * * */ function uname(): Promise function uname$($: {}): Promise /** * Returns the system/OS name, e.g. 'Linux', 'Windows' or 'Java'. * * An empty string is returned if the value cannot be determined. * * */ function system(): Promise function system$($: {}): Promise /** * Returns the computer's network name (which may not be fully * qualified) * * An empty string is returned if the value cannot be determined. * * */ function node(): Promise function node$($: {}): Promise /** * Returns the system's release, e.g. '2.2.0' or 'NT' * * An empty string is returned if the value cannot be determined. * * */ function release(): Promise function release$($: {}): Promise /** * Returns the system's release version, e.g. '#3 on degas' * * An empty string is returned if the value cannot be determined. * * */ function version(): Promise function version$($: {}): Promise /** * Returns the machine type, e.g. 'i386' * * An empty string is returned if the value cannot be determined. * * */ function machine(): Promise function machine$($: {}): Promise /** * Returns the (true) processor name, e.g. 'amdk6' * * An empty string is returned if the value cannot be * determined. Note that many platforms do not provide this * information or simply return the same value as for machine(), * e.g. NetBSD does this. * * */ function processor(): Promise function processor$($: {}): Promise /** * Returns a string identifying the Python implementation. * * Currently, the following implementations are identified: * 'CPython' (C implementation of Python), * 'IronPython' (.NET implementation of Python), * 'Jython' (Java implementation of Python), * 'PyPy' (Python implementation of Python). * * */ function python_implementation(): Promise function python_implementation$($: {}): Promise /** * Returns the Python version as string 'major.minor.patchlevel' * * Note that unlike the Python sys.version, the returned value * will always include the patchlevel (it defaults to 0). * * */ function python_version(): Promise function python_version$($: {}): Promise /** * Returns the Python version as tuple (major, minor, patchlevel) * of strings. * * Note that unlike the Python sys.version, the returned value * will always include the patchlevel (it defaults to 0). * * */ function python_version_tuple(): Promise function python_version_tuple$($: {}): Promise /** * Returns a string identifying the Python implementation * branch. * * For CPython this is the SCM branch from which the * Python binary was built. * * If not available, an empty string is returned. * * */ function python_branch(): Promise function python_branch$($: {}): Promise /** * Returns a string identifying the Python implementation * revision. * * For CPython this is the SCM revision from which the * Python binary was built. * * If not available, an empty string is returned. * * */ function python_revision(): Promise function python_revision$($: {}): Promise /** * Returns a tuple (buildno, builddate) stating the Python * build number and date as strings. * * */ function python_build(): Promise function python_build$($: {}): Promise /** * Returns a string identifying the compiler used for compiling * Python. * * */ function python_compiler(): Promise function python_compiler$($: {}): Promise /** * Returns a single string identifying the underlying platform * with as much useful information as possible (but no more :). * * The output is intended to be human readable rather than * machine parseable. It may look different on different * platforms and this is intended. * * If "aliased" is true, the function will use aliases for * various platforms that report system names which differ from * their common names, e.g. SunOS will be reported as * Solaris. The system_alias() function is used to implement * this. * * Setting terse to true causes the function to return only the * absolute minimum information needed to identify the platform. * * */ function platform(aliased?, terse?): Promise function platform$({ aliased, terse }: { aliased?, terse?}): Promise /** * Return operation system identification from freedesktop.org os-release * */ function freedesktop_os_release(): Promise function freedesktop_os_release$($: {}): Promise interface I_Processor { get(): Promise get$($: {}): Promise get_win32(): Promise get_win32$($: {}): Promise get_OpenVMS(): Promise get_OpenVMS$($: {}): Promise /** * * Fall back to `uname -p` * */ from_subprocess(): Promise from_subprocess$($: {}): Promise } /** * * A uname_result that's largely compatible with a * simple namedtuple except that 'processor' is * resolved late and cached to avoid calling "uname" * except when needed. * */ interface Iuname_result { processor(): Promise processor$($: {}): Promise } let terse: Promise let aliased: Promise } declare module pstats { var _ function func_strip_path(func_name): Promise function func_strip_path$({ func_name }): Promise function func_get_function_name(func): Promise function func_get_function_name$({ func }): Promise function func_std_string(func_name): Promise function func_std_string$({ func_name }): Promise /** * Add together all the stats for two profile entries. */ function add_func_stats(target, source): Promise function add_func_stats$({ target, source }): Promise /** * Combine two caller lists in a single list. */ function add_callers(target, source): Promise function add_callers$({ target, source }): Promise /** * Sum the caller statistics to get total number of calls received. */ function count_calls(callers): Promise function count_calls$({ callers }): Promise function f8(x): Promise function f8$({ x }): Promise interface ISortKey { CALLS CUMULATIVE FILENAME LINE NAME NFL PCALLS STDNAME TIME } interface IFunctionProfile { } /** * Class for keeping track of an item in inventory. */ interface IStatsProfile { } /** * This class is used for creating reports from data generated by the * Profile class. It is a "friend" of that class, and imports data either * by direct access to members of Profile class, or by reading in a dictionary * that was emitted (via marshal) from the Profile class. * * The big change from the previous Profiler (in terms of raw functionality) * is that an "add()" method has been provided to combine Stats from * several distinct profile runs. Both the constructor and the add() * method now take arbitrarily many file names as arguments. * * All the print methods now take an argument that indicates how many lines * to print. If the arg is a floating point number between 0 and 1.0, then * it is taken as a decimal percentage of the available lines to be printed * (e.g., .1 means print 10% of all available lines). If it is an integer, * it is taken to mean the number of lines of data that you wish to have * printed. * * The sort_stats() method now processes some additional options (i.e., in * addition to the old -1, 0, 1, or 2 that are respectively interpreted as * 'stdname', 'calls', 'time', and 'cumulative'). It takes either an * arbitrary number of quoted strings or SortKey enum to select the sort * order. * * For example sort_stats('time', 'name') or sort_stats(SortKey.TIME, * SortKey.NAME) sorts on the major key of 'internal function time', and on * the minor key of 'the name of the function'. Look at the two tables in * sort_stats() and get_sort_arg_defs(self) for more examples. * * All methods return self, so you can string together commands like: * Stats('foo', 'goo').strip_dirs().sort_stats('calls'). print_stats(5).print_callers(5) * */ function Stats(): Promise function Stats$({ }): Promise interface IStats { init(arg): Promise init$({ arg }): Promise load_stats(arg): Promise load_stats$({ arg }): Promise get_top_level_stats(): Promise get_top_level_stats$($: {}): Promise add(): Promise add$($: {}): Promise /** * Write the profile data to a file we know how to load back. */ dump_stats(filename): Promise dump_stats$({ filename }): Promise /** * Expand all abbreviations that are unique. */ get_sort_arg_defs(): Promise get_sort_arg_defs$($: {}): Promise sort_stats(): Promise sort_stats$($: {}): Promise reverse_order(): Promise reverse_order$($: {}): Promise strip_dirs(): Promise strip_dirs$($: {}): Promise calc_callees(): Promise calc_callees$($: {}): Promise eval_print_amount(sel, list, msg): Promise eval_print_amount$({ sel, list, msg }): Promise /** * This method returns an instance of StatsProfile, which contains a mapping * of function names to instances of FunctionProfile. Each FunctionProfile * instance holds information related to the function's profile such as how * long the function took to run, how many times it was called, etc... * */ get_stats_profile(): Promise get_stats_profile$($: {}): Promise get_print_list(sel_list): Promise get_print_list$({ sel_list }): Promise print_stats(): Promise print_stats$($: {}): Promise print_callees(): Promise print_callees$($: {}): Promise print_callers(): Promise print_callers$($: {}): Promise print_call_heading(name_size, column_title): Promise print_call_heading$({ name_size, column_title }): Promise print_call_line(name_size, source, call_dict, arrow?): Promise print_call_line$({ name_size, source, call_dict, arrow }: { name_size, source, call_dict, arrow?}): Promise print_title(): Promise print_title$($: {}): Promise print_line(func): Promise print_line$({ func }): Promise sort_arg_dict_default } /** * This class provides a generic function for comparing any two tuples. * Each instance records a list of tuple-indices (from most significant * to least significant), and sort direction (ascending or descending) for * each tuple-index. The compare functions can then be used as the function * argument to the system sort() function when a list of tuples need to be * sorted in the instances order. */ function TupleComp(comp_select_list): Promise function TupleComp$({ comp_select_list }): Promise interface ITupleComp { compare(left, right): Promise compare$({ left, right }): Promise } function ProfileBrowser(profile?): Promise function ProfileBrowser$({ profile }: { profile?}): Promise interface IProfileBrowser { generic(fn, line): Promise generic$({ fn, line }): Promise generic_help(): Promise generic_help$($: {}): Promise do_add(line): Promise do_add$({ line }): Promise help_add(): Promise help_add$($: {}): Promise do_callees(line): Promise do_callees$({ line }): Promise help_callees(): Promise help_callees$($: {}): Promise do_callers(line): Promise do_callers$({ line }): Promise help_callers(): Promise help_callers$($: {}): Promise do_EOF(line): Promise do_EOF$({ line }): Promise help_EOF(): Promise help_EOF$($: {}): Promise do_quit(line): Promise do_quit$({ line }): Promise help_quit(): Promise help_quit$($: {}): Promise do_read(line): Promise do_read$({ line }): Promise help_read(): Promise help_read$($: {}): Promise do_reverse(line): Promise do_reverse$({ line }): Promise help_reverse(): Promise help_reverse$($: {}): Promise do_sort(line): Promise do_sort$({ line }): Promise help_sort(): Promise help_sort$($: {}): Promise complete_sort(text): Promise complete_sort$({ text }): Promise do_stats(line): Promise do_stats$({ line }): Promise help_stats(): Promise help_stats$($: {}): Promise do_strip(line): Promise do_strip$({ line }): Promise help_strip(): Promise help_strip$($: {}): Promise help_help(): Promise help_help$($: {}): Promise postcmd(stop, line): Promise postcmd$({ stop, line }): Promise } let initprofile: Promise let browser: Promise } declare module signal { var _ function signal(signalnum, handler): Promise function signal$({ signalnum, handler }): Promise function getsignal(signalnum): Promise function getsignal$({ signalnum }): Promise function pthread_sigmask(how, mask): Promise function pthread_sigmask$({ how, mask }): Promise function sigpending(): Promise function sigpending$($: {}): Promise function sigwait(sigset): Promise function sigwait$({ sigset }): Promise function valid_signals(): Promise function valid_signals$($: {}): Promise } declare module socket { var _ /** * fromfd(fd, family, type[, proto]) -> socket object * * Create a socket object from a duplicate of the given file * descriptor. The remaining arguments are the same as for socket(). * */ function fromfd(fd, family, type, proto?): Promise function fromfd$({ fd, family, type, proto }: { fd, family, type, proto?}): Promise /** * send_fds(sock, buffers, fds[, flags[, address]]) -> integer * * Send the list of file descriptors fds over an AF_UNIX socket. * */ function send_fds(sock, buffers, fds, flags?, address?): Promise function send_fds$({ sock, buffers, fds, flags, address }: { sock, buffers, fds, flags?, address?}): Promise /** * recv_fds(sock, bufsize, maxfds[, flags]) -> (data, list of file * descriptors, msg_flags, address) * * Receive up to maxfds file descriptors returning the message * data and a list containing the descriptors. * */ function recv_fds(sock, bufsize, maxfds, flags?): Promise function recv_fds$({ sock, bufsize, maxfds, flags }: { sock, bufsize, maxfds, flags?}): Promise /** * fromshare(info) -> socket object * * Create a socket object from the bytes object returned by * socket.share(pid). * */ function fromshare(info): Promise function fromshare$({ info }): Promise /** * socketpair([family[, type[, proto]]]) -> (socket object, socket object) * * Create a pair of socket objects from the sockets returned by the platform * socketpair() function. * The arguments are the same as for socket() except the default family is * AF_UNIX if defined on the platform; otherwise, the default is AF_INET. * */ function socketpair(family?, type?, proto?): Promise function socketpair$({ family, type, proto }: { family?, type?, proto?}): Promise function socketpair(family?, type?, proto?): Promise function socketpair$({ family, type, proto }: { family?, type?, proto?}): Promise /** * Get fully qualified domain name from name. * * An empty argument is interpreted as meaning the local host. * * First the hostname returned by gethostbyaddr() is checked, then * possibly existing aliases. In case no FQDN is available, hostname * from gethostname() is returned. * */ function getfqdn(name?): Promise function getfqdn$({ name }: { name?}): Promise /** * Connect to *address* and return the socket object. * * Convenience function. Connect to *address* (a 2-tuple ``(host, * port)``) and return the socket object. Passing the optional * *timeout* parameter will set the timeout on the socket instance * before attempting to connect. If no *timeout* is supplied, the * global default timeout setting returned by :func:`getdefaulttimeout` * is used. If *source_address* is set it must be a tuple of (host, port) * for the socket to bind as a source address before making the connection. * A host of '' or port 0 tells the OS to use the default. * */ function create_connection(address, timeout?, source_address?): Promise function create_connection$({ address, timeout, source_address }: { address, timeout?, source_address?}): Promise /** * Return True if the platform supports creating a SOCK_STREAM socket * which can handle both AF_INET and AF_INET6 (IPv4 / IPv6) connections. * */ function has_dualstack_ipv6(): Promise function has_dualstack_ipv6$($: {}): Promise /** * Convenience function which creates a SOCK_STREAM type socket * bound to *address* (a 2-tuple (host, port)) and return the socket * object. * * *family* should be either AF_INET or AF_INET6. * *backlog* is the queue size passed to socket.listen(). * *reuse_port* dictates whether to use the SO_REUSEPORT socket option. * *dualstack_ipv6*: if true and the platform supports it, it will * create an AF_INET6 socket able to accept both IPv4 or IPv6 * connections. When false it will explicitly disable this option on * platforms that enable it by default (e.g. Linux). * * >>> with create_server(('', 8000)) as server: * ... while True: * ... conn, addr = server.accept() * ... # handle new connection * */ function create_server(address): Promise function create_server$({ address }): Promise /** * Resolve host and port into list of address info entries. * * Translate the host/port argument into a sequence of 5-tuples that contain * all the necessary arguments for creating a socket connected to that service. * host is a domain name, a string representation of an IPv4/v6 address or * None. port is a string service name such as 'http', a numeric port number or * None. By passing None as the value of host and port, you can pass NULL to * the underlying C API. * * The family, type and proto arguments can be optionally specified in order to * narrow the list of addresses returned. Passing zero as a value for each of * these arguments selects the full range of results. * */ function getaddrinfo(host, port, family?, type?, proto?, flags?): Promise function getaddrinfo$({ host, port, family, type, proto, flags }: { host, port, family?, type?, proto?, flags?}): Promise interface I_GiveupOnSendfile { } /** * A subclass of _socket.socket adding the makefile() method. */ function socket(family?, type?, proto?, fileno?): Promise function socket$({ family, type, proto, fileno }: { family?, type?, proto?, fileno?}): Promise interface Isocket { /** * dup() -> socket object * * Duplicate the socket. Return a new socket object connected to the same * system resource. The new socket is non-inheritable. * */ dup(): Promise dup$($: {}): Promise /** * accept() -> (socket object, address info) * * Wait for an incoming connection. Return a new socket * representing the connection, and the address of the client. * For IP sockets, the address info is a pair (hostaddr, port). * */ accept(): Promise accept$($: {}): Promise /** * makefile(...) -> an I/O stream connected to the socket * * The arguments are as for io.open() after the filename, except the only * supported mode values are 'r' (default), 'w' and 'b'. * */ makefile(mode?, buffering?): Promise makefile$({ mode, buffering }: { mode?, buffering?}): Promise /** * sendfile(file[, offset[, count]]) -> sent * * Send a file until EOF is reached by using high-performance * os.sendfile() and return the total number of bytes which * were sent. * *file* must be a regular file object opened in binary mode. * If os.sendfile() is not available (e.g. Windows) or file is * not a regular file socket.send() will be used instead. * *offset* tells from where to start reading the file. * If specified, *count* is the total number of bytes to transmit * as opposed to sending the file until EOF is reached. * File position is updated on return or also in case of error in * which case file.tell() can be used to figure out the number of * bytes which were sent. * The socket must be of SOCK_STREAM type. * Non-blocking sockets are not supported. * */ sendfile(file, offset?, count?): Promise sendfile$({ file, offset, count }: { file, offset?, count?}): Promise close(): Promise close$($: {}): Promise /** * detach() -> file descriptor * * Close the socket object without closing the underlying file descriptor. * The object cannot be used after this call, but the file descriptor * can be reused for other purposes. The file descriptor is returned. * */ detach(): Promise detach$($: {}): Promise /** * Read-only access to the address family for this socket. * */ family(): Promise family$($: {}): Promise /** * Read-only access to the socket type. * */ type(): Promise type$($: {}): Promise } /** * Raw I/O implementation for stream sockets. * * This class supports the makefile() method on sockets. It provides * the raw I/O interface on top of a socket object. * */ function SocketIO(sock, mode): Promise function SocketIO$({ sock, mode }): Promise interface ISocketIO { /** * Read up to len(b) bytes into the writable buffer *b* and return * the number of bytes read. If the socket is non-blocking and no bytes * are available, None is returned. * * If *b* is non-empty, a 0 return value indicates that the connection * was shutdown at the other end. * */ readinto(b): Promise readinto$({ b }): Promise /** * Write the given bytes or bytearray object *b* to the socket * and return the number of bytes written. This can be less than * len(b) if not all data could be written. If the socket is * non-blocking and no bytes could be written None is returned. * */ write(b): Promise write$({ b }): Promise /** * True if the SocketIO is open for reading. * */ readable(): Promise readable$($: {}): Promise /** * True if the SocketIO is open for writing. * */ writable(): Promise writable$($: {}): Promise /** * True if the SocketIO is open for seeking. * */ seekable(): Promise seekable$($: {}): Promise /** * Return the file descriptor of the underlying socket. * */ fileno(): Promise fileno$($: {}): Promise name(): Promise name$($: {}): Promise mode(): Promise mode$($: {}): Promise /** * Close the SocketIO object. This doesn't close the underlying * socket, except if all references to it have disappeared. * */ close(): Promise close$($: {}): Promise } let EBADF: Promise let EAGAIN: Promise let EWOULDBLOCK: Promise let errorTab: Promise } declare module socketserver { var _ /** * Base class for server classes. * * Methods for the caller: * * - __init__(server_address, RequestHandlerClass) * - serve_forever(poll_interval=0.5) * - shutdown() * - handle_request() # if you do not use serve_forever() * - fileno() -> int # for selector * * Methods that may be overridden: * * - server_bind() * - server_activate() * - get_request() -> request, client_address * - handle_timeout() * - verify_request(request, client_address) * - server_close() * - process_request(request, client_address) * - shutdown_request(request) * - close_request(request) * - service_actions() * - handle_error() * * Methods for derived classes: * * - finish_request(request, client_address) * * Class variables that may be overridden by derived classes or * instances: * * - timeout * - address_family * - socket_type * - allow_reuse_address * * Instance variables: * * - RequestHandlerClass * - socket * * */ /** * Constructor. May be extended, do not override. */ function BaseServer(server_address, RequestHandlerClass): Promise function BaseServer$({ server_address, RequestHandlerClass }): Promise interface IBaseServer { /** * Called by constructor to activate the server. * * May be overridden. * * */ server_activate(): Promise server_activate$($: {}): Promise /** * Handle one request at a time until shutdown. * * Polls for shutdown every poll_interval seconds. Ignores * self.timeout. If you need to do periodic tasks, do them in * another thread. * */ serve_forever(poll_interval?): Promise serve_forever$({ poll_interval }: { poll_interval?}): Promise /** * Stops the serve_forever loop. * * Blocks until the loop has finished. This must be called while * serve_forever() is running in another thread, or it will * deadlock. * */ shutdown(): Promise shutdown$($: {}): Promise /** * Called by the serve_forever() loop. * * May be overridden by a subclass / Mixin to implement any code that * needs to be run during the loop. * */ service_actions(): Promise service_actions$($: {}): Promise /** * Handle one request, possibly blocking. * * Respects self.timeout. * */ handle_request(): Promise handle_request$($: {}): Promise /** * Called if no new request arrives within self.timeout. * * Overridden by ForkingMixIn. * */ handle_timeout(): Promise handle_timeout$($: {}): Promise /** * Verify the request. May be overridden. * * Return True if we should proceed with this request. * * */ verify_request(request, client_address): Promise verify_request$({ request, client_address }): Promise /** * Call finish_request. * * Overridden by ForkingMixIn and ThreadingMixIn. * * */ process_request(request, client_address): Promise process_request$({ request, client_address }): Promise /** * Called to clean-up the server. * * May be overridden. * * */ server_close(): Promise server_close$($: {}): Promise /** * Finish one request by instantiating RequestHandlerClass. */ finish_request(request, client_address): Promise finish_request$({ request, client_address }): Promise /** * Called to shutdown and close an individual request. */ shutdown_request(request): Promise shutdown_request$({ request }): Promise /** * Called to clean up an individual request. */ close_request(request): Promise close_request$({ request }): Promise /** * Handle an error gracefully. May be overridden. * * The default is to print a traceback and continue. * * */ handle_error(request, client_address): Promise handle_error$({ request, client_address }): Promise timeout } /** * Base class for various socket-based server classes. * * Defaults to synchronous IP stream (i.e., TCP). * * Methods for the caller: * * - __init__(server_address, RequestHandlerClass, bind_and_activate=True) * - serve_forever(poll_interval=0.5) * - shutdown() * - handle_request() # if you don't use serve_forever() * - fileno() -> int # for selector * * Methods that may be overridden: * * - server_bind() * - server_activate() * - get_request() -> request, client_address * - handle_timeout() * - verify_request(request, client_address) * - process_request(request, client_address) * - shutdown_request(request) * - close_request(request) * - handle_error() * * Methods for derived classes: * * - finish_request(request, client_address) * * Class variables that may be overridden by derived classes or * instances: * * - timeout * - address_family * - socket_type * - request_queue_size (only for stream sockets) * - allow_reuse_address * * Instance variables: * * - server_address * - RequestHandlerClass * - socket * * */ /** * Constructor. May be extended, do not override. */ function TCPServer(server_address, RequestHandlerClass, bind_and_activate?: boolean): Promise function TCPServer$({ server_address, RequestHandlerClass, bind_and_activate }: { server_address, RequestHandlerClass, bind_and_activate?}): Promise interface ITCPServer extends IBaseServer { /** * Called by constructor to bind the socket. * * May be overridden. * * */ server_bind(): Promise server_bind$($: {}): Promise /** * Called by constructor to activate the server. * * May be overridden. * * */ server_activate(): Promise server_activate$($: {}): Promise /** * Called to clean-up the server. * * May be overridden. * * */ server_close(): Promise server_close$($: {}): Promise /** * Return socket file number. * * Interface required by selector. * * */ fileno(): Promise fileno$($: {}): Promise /** * Get the request and client address from the socket. * * May be overridden. * * */ get_request(): Promise get_request$($: {}): Promise /** * Called to shutdown and close an individual request. */ shutdown_request(request): Promise shutdown_request$({ request }): Promise /** * Called to clean up an individual request. */ close_request(request): Promise close_request$({ request }): Promise address_family socket_type request_queue_size allow_reuse_address } /** * UDP server class. */ interface IUDPServer extends ITCPServer { get_request(): Promise get_request$($: {}): Promise server_activate(): Promise server_activate$($: {}): Promise shutdown_request(request): Promise shutdown_request$({ request }): Promise close_request(request): Promise close_request$({ request }): Promise max_packet_size } /** * Mix-in class to handle each request in a new process. */ interface IForkingMixIn { /** * Internal routine to wait for children that have exited. */ collect_children(): Promise collect_children$($: {}): Promise /** * Wait for zombies after self.timeout seconds of inactivity. * * May be extended, do not override. * */ handle_timeout(): Promise handle_timeout$($: {}): Promise /** * Collect the zombie child processes regularly in the ForkingMixIn. * * service_actions is called in the BaseServer's serve_forever loop. * */ service_actions(): Promise service_actions$($: {}): Promise /** * Fork a new subprocess to process the request. */ process_request(request, client_address): Promise process_request$({ request, client_address }): Promise server_close(): Promise server_close$($: {}): Promise active_children max_children block_on_close } /** * * Joinable list of all non-daemon threads. * */ interface I_Threads { append(thread): Promise append$({ thread }): Promise pop_all(): Promise pop_all$($: {}): Promise join(): Promise join$($: {}): Promise reap(): Promise reap$($: {}): Promise } /** * * Degenerate version of _Threads. * */ interface I_NoThreads { append(thread): Promise append$({ thread }): Promise join(): Promise join$($: {}): Promise } /** * Mix-in class to handle each request in a new thread. */ interface IThreadingMixIn { /** * Same as in BaseServer but as a thread. * * In addition, exception handling is done here. * * */ process_request_thread(request, client_address): Promise process_request_thread$({ request, client_address }): Promise /** * Start a new thread to process the request. */ process_request(request, client_address): Promise process_request$({ request, client_address }): Promise server_close(): Promise server_close$($: {}): Promise daemon_threads } interface IForkingUDPServer extends IForkingMixIn, IUDPServer { } interface IForkingTCPServer extends IForkingMixIn, ITCPServer { } interface IThreadingUDPServer extends IThreadingMixIn, IUDPServer { } interface IThreadingTCPServer extends IThreadingMixIn, ITCPServer { } interface IUnixStreamServer extends ITCPServer { } interface IUnixDatagramServer extends IUDPServer { } interface IThreadingUnixStreamServer extends IThreadingMixIn, IUnixStreamServer { } interface IThreadingUnixDatagramServer extends IThreadingMixIn, IUnixDatagramServer { } /** * Base class for request handler classes. * * This class is instantiated for each request to be handled. The * constructor sets the instance variables request, client_address * and server, and then calls the handle() method. To implement a * specific service, all you need to do is to derive a class which * defines a handle() method. * * The handle() method can find the request as self.request, the * client address as self.client_address, and the server (in case it * needs access to per-server information) as self.server. Since a * separate instance is created for each request, the handle() method * can define other arbitrary instance variables. * * */ function BaseRequestHandler(request, client_address, server): Promise function BaseRequestHandler$({ request, client_address, server }): Promise interface IBaseRequestHandler { setup(): Promise setup$($: {}): Promise handle(): Promise handle$($: {}): Promise finish(): Promise finish$($: {}): Promise } /** * Define self.rfile and self.wfile for stream sockets. */ interface IStreamRequestHandler extends IBaseRequestHandler { setup(): Promise setup$($: {}): Promise finish(): Promise finish$($: {}): Promise rbufsize wbufsize disable_nagle_algorithm } /** * Simple writable BufferedIOBase implementation for a socket * * Does not hold data in a buffer, avoiding any need to call flush(). */ interface I_SocketWriter { writable(): Promise writable$($: {}): Promise write(b): Promise write$({ b }): Promise fileno(): Promise fileno$($: {}): Promise } /** * Define self.rfile and self.wfile for datagram sockets. */ interface IDatagramRequestHandler extends IBaseRequestHandler { setup(): Promise setup$($: {}): Promise finish(): Promise finish$($: {}): Promise } } declare module sqlite3 { var _ module dbapi2 { var _ function DateFromTicks(ticks): Promise function DateFromTicks$({ ticks }): Promise function TimeFromTicks(ticks): Promise function TimeFromTicks$({ ticks }): Promise function TimestampFromTicks(ticks): Promise function TimestampFromTicks$({ ticks }): Promise function register_adapters_and_converters(): Promise function register_adapters_and_converters$($: {}): Promise function enable_shared_cache(enable): Promise function enable_shared_cache$({ enable }): Promise let paramstyle: Promise let threadsafety: Promise let apilevel: Promise let Date: Promise let Time: Promise let Timestamp: Promise let version_info: Promise let sqlite_version_info: Promise let Binary: Promise } module dump { var _ } } declare module stat { var _ /** * Return the portion of the file's mode that can be set by * os.chmod(). * */ function S_IMODE(mode): Promise function S_IMODE$({ mode }): Promise /** * Return the portion of the file's mode that describes the * file type. * */ function S_IFMT(mode): Promise function S_IFMT$({ mode }): Promise /** * Return True if mode is from a directory. */ function S_ISDIR(mode): Promise function S_ISDIR$({ mode }): Promise /** * Return True if mode is from a character special device file. */ function S_ISCHR(mode): Promise function S_ISCHR$({ mode }): Promise /** * Return True if mode is from a block special device file. */ function S_ISBLK(mode): Promise function S_ISBLK$({ mode }): Promise /** * Return True if mode is from a regular file. */ function S_ISREG(mode): Promise function S_ISREG$({ mode }): Promise /** * Return True if mode is from a FIFO (named pipe). */ function S_ISFIFO(mode): Promise function S_ISFIFO$({ mode }): Promise /** * Return True if mode is from a symbolic link. */ function S_ISLNK(mode): Promise function S_ISLNK$({ mode }): Promise /** * Return True if mode is from a socket. */ function S_ISSOCK(mode): Promise function S_ISSOCK$({ mode }): Promise /** * Return True if mode is from a door. */ function S_ISDOOR(mode): Promise function S_ISDOOR$({ mode }): Promise /** * Return True if mode is from an event port. */ function S_ISPORT(mode): Promise function S_ISPORT$({ mode }): Promise /** * Return True if mode is from a whiteout. */ function S_ISWHT(mode): Promise function S_ISWHT$({ mode }): Promise /** * Convert a file's mode to a string of the form '-rwxrwxrwx'. */ function filemode(mode): Promise function filemode$({ mode }): Promise let ST_MODE: Promise let ST_INO: Promise let ST_DEV: Promise let ST_NLINK: Promise let ST_UID: Promise let ST_GID: Promise let ST_SIZE: Promise let ST_ATIME: Promise let ST_MTIME: Promise let ST_CTIME: Promise let S_IFDIR: Promise let S_IFCHR: Promise let S_IFBLK: Promise let S_IFREG: Promise let S_IFIFO: Promise let S_IFLNK: Promise let S_IFSOCK: Promise let S_IFDOOR: Promise let S_IFPORT: Promise let S_IFWHT: Promise let S_ISUID: Promise let S_ISGID: Promise let S_ENFMT: Promise let S_ISVTX: Promise let S_IREAD: Promise let S_IWRITE: Promise let S_IEXEC: Promise let S_IRWXU: Promise let S_IRUSR: Promise let S_IWUSR: Promise let S_IXUSR: Promise let S_IRWXG: Promise let S_IRGRP: Promise let S_IWGRP: Promise let S_IXGRP: Promise let S_IRWXO: Promise let S_IROTH: Promise let S_IWOTH: Promise let S_IXOTH: Promise let UF_NODUMP: Promise let UF_IMMUTABLE: Promise let UF_APPEND: Promise let UF_OPAQUE: Promise let UF_NOUNLINK: Promise let UF_COMPRESSED: Promise let UF_HIDDEN: Promise let SF_ARCHIVED: Promise let SF_IMMUTABLE: Promise let SF_APPEND: Promise let SF_NOUNLINK: Promise let SF_SNAPSHOT: Promise let FILE_ATTRIBUTE_ARCHIVE: Promise let FILE_ATTRIBUTE_COMPRESSED: Promise let FILE_ATTRIBUTE_DEVICE: Promise let FILE_ATTRIBUTE_DIRECTORY: Promise let FILE_ATTRIBUTE_ENCRYPTED: Promise let FILE_ATTRIBUTE_HIDDEN: Promise let FILE_ATTRIBUTE_INTEGRITY_STREAM: Promise let FILE_ATTRIBUTE_NORMAL: Promise let FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: Promise let FILE_ATTRIBUTE_NO_SCRUB_DATA: Promise let FILE_ATTRIBUTE_OFFLINE: Promise let FILE_ATTRIBUTE_READONLY: Promise let FILE_ATTRIBUTE_REPARSE_POINT: Promise let FILE_ATTRIBUTE_SPARSE_FILE: Promise let FILE_ATTRIBUTE_SYSTEM: Promise let FILE_ATTRIBUTE_TEMPORARY: Promise let FILE_ATTRIBUTE_VIRTUAL: Promise } declare module statistics { var _ /** * Return the sample arithmetic mean of data. * * >>> mean([1, 2, 3, 4, 4]) * 2.8 * * >>> from fractions import Fraction as F * >>> mean([F(3, 7), F(1, 21), F(5, 3), F(1, 3)]) * Fraction(13, 21) * * >>> from decimal import Decimal as D * >>> mean([D("0.5"), D("0.75"), D("0.625"), D("0.375")]) * Decimal('0.5625') * * If ``data`` is empty, StatisticsError will be raised. * */ function mean(data): Promise function mean$({ data }): Promise /** * Convert data to floats and compute the arithmetic mean. * * This runs faster than the mean() function and it always returns a float. * If the input dataset is empty, it raises a StatisticsError. * * >>> fmean([3.5, 4.0, 5.25]) * 4.25 * */ function fmean(data, weights?): Promise function fmean$({ data, weights }: { data, weights?}): Promise /** * Convert data to floats and compute the geometric mean. * * Raises a StatisticsError if the input dataset is empty, * if it contains a zero, or if it contains a negative value. * * No special efforts are made to achieve exact results. * (However, this may change in the future.) * * >>> round(geometric_mean([54, 24, 36]), 9) * 36.0 * */ function geometric_mean(data): Promise function geometric_mean$({ data }): Promise /** * Return the harmonic mean of data. * * The harmonic mean is the reciprocal of the arithmetic mean of the * reciprocals of the data. It can be used for averaging ratios or * rates, for example speeds. * * Suppose a car travels 40 km/hr for 5 km and then speeds-up to * 60 km/hr for another 5 km. What is the average speed? * * >>> harmonic_mean([40, 60]) * 48.0 * * Suppose a car travels 40 km/hr for 5 km, and when traffic clears, * speeds-up to 60 km/hr for the remaining 30 km of the journey. What * is the average speed? * * >>> harmonic_mean([40, 60], weights=[5, 30]) * 56.0 * * If ``data`` is empty, or any element is less than zero, * ``harmonic_mean`` will raise ``StatisticsError``. * */ function harmonic_mean(data, weights?): Promise function harmonic_mean$({ data, weights }: { data, weights?}): Promise /** * Return the median (middle value) of numeric data. * * When the number of data points is odd, return the middle data point. * When the number of data points is even, the median is interpolated by * taking the average of the two middle values: * * >>> median([1, 3, 5]) * 3 * >>> median([1, 3, 5, 7]) * 4.0 * * */ function median(data): Promise function median$({ data }): Promise /** * Return the low median of numeric data. * * When the number of data points is odd, the middle value is returned. * When it is even, the smaller of the two middle values is returned. * * >>> median_low([1, 3, 5]) * 3 * >>> median_low([1, 3, 5, 7]) * 3 * * */ function median_low(data): Promise function median_low$({ data }): Promise /** * Return the high median of data. * * When the number of data points is odd, the middle value is returned. * When it is even, the larger of the two middle values is returned. * * >>> median_high([1, 3, 5]) * 3 * >>> median_high([1, 3, 5, 7]) * 5 * * */ function median_high(data): Promise function median_high$({ data }): Promise /** * Return the 50th percentile (median) of grouped continuous data. * * >>> median_grouped([1, 2, 2, 3, 4, 4, 4, 4, 4, 5]) * 3.7 * >>> median_grouped([52, 52, 53, 54]) * 52.5 * * This calculates the median as the 50th percentile, and should be * used when your data is continuous and grouped. In the above example, * the values 1, 2, 3, etc. actually represent the midpoint of classes * 0.5-1.5, 1.5-2.5, 2.5-3.5, etc. The middle value falls somewhere in * class 3.5-4.5, and interpolation is used to estimate it. * * Optional argument ``interval`` represents the class interval, and * defaults to 1. Changing the class interval naturally will change the * interpolated 50th percentile value: * * >>> median_grouped([1, 3, 3, 5, 7], interval=1) * 3.25 * >>> median_grouped([1, 3, 3, 5, 7], interval=2) * 3.5 * * This function does not check whether the data points are at least * ``interval`` apart. * */ function median_grouped(data, interval?): Promise function median_grouped$({ data, interval }: { data, interval?}): Promise /** * Return the most common data point from discrete or nominal data. * * ``mode`` assumes discrete data, and returns a single value. This is the * standard treatment of the mode as commonly taught in schools: * * >>> mode([1, 1, 2, 3, 3, 3, 3, 4]) * 3 * * This also works with nominal (non-numeric) data: * * >>> mode(["red", "blue", "blue", "red", "green", "red", "red"]) * 'red' * * If there are multiple modes with same frequency, return the first one * encountered: * * >>> mode(['red', 'red', 'green', 'blue', 'blue']) * 'red' * * If *data* is empty, ``mode``, raises StatisticsError. * * */ function mode(data): Promise function mode$({ data }): Promise /** * Return a list of the most frequently occurring values. * * Will return more than one result if there are multiple modes * or an empty list if *data* is empty. * * >>> multimode('aabbbbbbbbcc') * ['b'] * >>> multimode('aabbbbccddddeeffffgg') * ['b', 'd', 'f'] * >>> multimode('') * [] * */ function multimode(data): Promise function multimode$({ data }): Promise /** * Divide *data* into *n* continuous intervals with equal probability. * * Returns a list of (n - 1) cut points separating the intervals. * * Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles. * Set *n* to 100 for percentiles which gives the 99 cuts points that * separate *data* in to 100 equal sized groups. * * The *data* can be any iterable containing sample. * The cut points are linearly interpolated between data points. * * If *method* is set to *inclusive*, *data* is treated as population * data. The minimum value is treated as the 0th percentile and the * maximum value is treated as the 100th percentile. * */ function quantiles(data): Promise function quantiles$({ data }): Promise /** * Return the sample variance of data. * * data should be an iterable of Real-valued numbers, with at least two * values. The optional argument xbar, if given, should be the mean of * the data. If it is missing or None, the mean is automatically calculated. * * Use this function when your data is a sample from a population. To * calculate the variance from the entire population, see ``pvariance``. * * Examples: * * >>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5] * >>> variance(data) * 1.3720238095238095 * * If you have already calculated the mean of your data, you can pass it as * the optional second argument ``xbar`` to avoid recalculating it: * * >>> m = mean(data) * >>> variance(data, m) * 1.3720238095238095 * * This function does not check that ``xbar`` is actually the mean of * ``data``. Giving arbitrary values for ``xbar`` may lead to invalid or * impossible results. * * Decimals and Fractions are supported: * * >>> from decimal import Decimal as D * >>> variance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")]) * Decimal('31.01875') * * >>> from fractions import Fraction as F * >>> variance([F(1, 6), F(1, 2), F(5, 3)]) * Fraction(67, 108) * * */ function variance(data, xbar?): Promise function variance$({ data, xbar }: { data, xbar?}): Promise /** * Return the population variance of ``data``. * * data should be a sequence or iterable of Real-valued numbers, with at least one * value. The optional argument mu, if given, should be the mean of * the data. If it is missing or None, the mean is automatically calculated. * * Use this function to calculate the variance from the entire population. * To estimate the variance from a sample, the ``variance`` function is * usually a better choice. * * Examples: * * >>> data = [0.0, 0.25, 0.25, 1.25, 1.5, 1.75, 2.75, 3.25] * >>> pvariance(data) * 1.25 * * If you have already calculated the mean of the data, you can pass it as * the optional second argument to avoid recalculating it: * * >>> mu = mean(data) * >>> pvariance(data, mu) * 1.25 * * Decimals and Fractions are supported: * * >>> from decimal import Decimal as D * >>> pvariance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")]) * Decimal('24.815') * * >>> from fractions import Fraction as F * >>> pvariance([F(1, 4), F(5, 4), F(1, 2)]) * Fraction(13, 72) * * */ function pvariance(data, mu?): Promise function pvariance$({ data, mu }: { data, mu?}): Promise /** * Return the square root of the sample variance. * * See ``variance`` for arguments and other details. * * >>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75]) * 1.0810874155219827 * * */ function stdev(data, xbar?): Promise function stdev$({ data, xbar }: { data, xbar?}): Promise /** * Return the square root of the population variance. * * See ``pvariance`` for arguments and other details. * * >>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75]) * 0.986893273527251 * * */ function pstdev(data, mu?): Promise function pstdev$({ data, mu }: { data, mu?}): Promise /** * Covariance * * Return the sample covariance of two inputs *x* and *y*. Covariance * is a measure of the joint variability of two inputs. * * >>> x = [1, 2, 3, 4, 5, 6, 7, 8, 9] * >>> y = [1, 2, 3, 1, 2, 3, 1, 2, 3] * >>> covariance(x, y) * 0.75 * >>> z = [9, 8, 7, 6, 5, 4, 3, 2, 1] * >>> covariance(x, z) * -7.5 * >>> covariance(z, x) * -7.5 * * */ function covariance(x, y): Promise function covariance$({ x, y }): Promise /** * Pearson's correlation coefficient * * Return the Pearson's correlation coefficient for two inputs. Pearson's * correlation coefficient *r* takes values between -1 and +1. It measures the * strength and direction of the linear relationship, where +1 means very * strong, positive linear relationship, -1 very strong, negative linear * relationship, and 0 no linear relationship. * * >>> x = [1, 2, 3, 4, 5, 6, 7, 8, 9] * >>> y = [9, 8, 7, 6, 5, 4, 3, 2, 1] * >>> correlation(x, x) * 1.0 * >>> correlation(x, y) * -1.0 * * */ function correlation(x, y): Promise function correlation$({ x, y }): Promise /** * Slope and intercept for simple linear regression. * * Return the slope and intercept of simple linear regression * parameters estimated using ordinary least squares. Simple linear * regression describes relationship between an independent variable * *x* and a dependent variable *y* in terms of linear function: * * y = slope * x + intercept + noise * * where *slope* and *intercept* are the regression parameters that are * estimated, and noise represents the variability of the data that was * not explained by the linear regression (it is equal to the * difference between predicted and actual values of the dependent * variable). * * The parameters are returned as a named tuple. * * >>> x = [1, 2, 3, 4, 5] * >>> noise = NormalDist().samples(5, seed=42) * >>> y = [3 * x[i] + 2 + noise[i] for i in range(5)] * >>> linear_regression(x, y) #doctest: +ELLIPSIS * LinearRegression(slope=3.09078914170..., intercept=1.75684970486...) * * */ function linear_regression(x, y): Promise function linear_regression$({ x, y }): Promise interface IStatisticsError { } /** * Normal distribution of a random variable */ /** * NormalDist where mu is the mean and sigma is the standard deviation. */ function NormalDist(mu?, sigma?): Promise function NormalDist$({ mu, sigma }: { mu?, sigma?}): Promise interface INormalDist { /** * Make a normal distribution instance from sample data. */ from_samples(data): Promise from_samples$({ data }): Promise /** * Generate *n* samples for a given mean and standard deviation. */ samples(n): Promise samples$({ n }): Promise /** * Probability density function. P(x <= X < x+dx) / dx */ pdf(x): Promise pdf$({ x }): Promise /** * Cumulative distribution function. P(X <= x) */ cdf(x): Promise cdf$({ x }): Promise /** * Inverse cumulative distribution function. x : P(X <= x) = p * * Finds the value of the random variable such that the probability of * the variable being less than or equal to that value equals the given * probability. * * This function is also called the percent point function or quantile * function. * */ inv_cdf(p): Promise inv_cdf$({ p }): Promise /** * Divide into *n* continuous intervals with equal probability. * * Returns a list of (n - 1) cut points separating the intervals. * * Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles. * Set *n* to 100 for percentiles which gives the 99 cuts points that * separate the normal distribution in to 100 equal sized groups. * */ quantiles(n?): Promise quantiles$({ n }: { n?}): Promise /** * Compute the overlapping coefficient (OVL) between two normal distributions. * * Measures the agreement between two normal probability distributions. * Returns a value between 0.0 and 1.0 giving the overlapping area in * the two underlying probability density functions. * * >>> N1 = NormalDist(2.4, 1.6) * >>> N2 = NormalDist(3.2, 2.0) * >>> N1.overlap(N2) * 0.8035050657330205 * */ overlap(other): Promise overlap$({ other }): Promise /** * Compute the Standard Score. (x - mean) / stdev * * Describes *x* in terms of the number of standard deviations * above or below the mean of the normal distribution. * */ zscore(x): Promise zscore$({ x }): Promise /** * Arithmetic mean of the normal distribution. */ mean(): Promise mean$($: {}): Promise /** * Return the median of the normal distribution */ median(): Promise median$($: {}): Promise /** * Return the mode of the normal distribution * * The mode is the value x where which the probability density * function (pdf) takes its maximum value. * */ mode(): Promise mode$($: {}): Promise /** * Standard deviation of the normal distribution. */ stdev(): Promise stdev$($: {}): Promise /** * Square of the standard deviation. */ variance(): Promise variance$($: {}): Promise } let LinearRegression: Promise } declare module tarfile { var _ /** * Convert a string to a null-terminated bytes object. * */ function stn(s, length, encoding, errors): Promise function stn$({ s, length, encoding, errors }): Promise /** * Convert a null-terminated bytes object to a string. * */ function nts(s, encoding, errors): Promise function nts$({ s, encoding, errors }): Promise /** * Convert a number field to a python number. * */ function nti(s): Promise function nti$({ s }): Promise /** * Convert a python number to a number field. * */ function itn(n, digits?, format?): Promise function itn$({ n, digits, format }: { n, digits?, format?}): Promise /** * Calculate the checksum for a member's header by summing up all * characters except for the chksum field which is treated as if * it was filled with spaces. According to the GNU tar sources, * some tars (Sun and NeXT) calculate chksum with signed char, * which will be different if there are chars in the buffer with * the high bit set. So we calculate two checksums, unsigned and * signed. * */ function calc_chksums(buf): Promise function calc_chksums$({ buf }): Promise /** * Copy length bytes from fileobj src to fileobj dst. * If length is None, copy the entire content. * */ function copyfileobj(src, dst, length?, exception?, bufsize?): Promise function copyfileobj$({ src, dst, length, exception, bufsize }: { src, dst, length?, exception?, bufsize?}): Promise /** * Return True if name points to a tar archive that we * are able to handle, else return False. * * 'name' should be a string, file, or file-like object. * */ function is_tarfile(name): Promise function is_tarfile$({ name }): Promise function main(): Promise function main$($: {}): Promise /** * Base exception. */ interface ITarError { } /** * General exception for extract errors. */ interface IExtractError extends ITarError { } /** * Exception for unreadable tar archives. */ interface IReadError extends ITarError { } /** * Exception for unavailable compression methods. */ interface ICompressionError extends ITarError { } /** * Exception for unsupported operations on stream-like TarFiles. */ interface IStreamError extends ITarError { } /** * Base exception for header errors. */ interface IHeaderError extends ITarError { } /** * Exception for empty headers. */ interface IEmptyHeaderError extends IHeaderError { } /** * Exception for truncated headers. */ interface ITruncatedHeaderError extends IHeaderError { } /** * Exception for end of file headers. */ interface IEOFHeaderError extends IHeaderError { } /** * Exception for invalid headers. */ interface IInvalidHeaderError extends IHeaderError { } /** * Exception for missing and invalid extended headers. */ interface ISubsequentHeaderError extends IHeaderError { } /** * Low-level file object. Supports reading and writing. * It is used instead of a regular file object for streaming * access. * */ interface I_LowLevelFile { close(): Promise close$($: {}): Promise read(size): Promise read$({ size }): Promise write(s): Promise write$({ s }): Promise } /** * Class that serves as an adapter between TarFile and * a stream-like object. The stream-like object only * needs to have a read() or write() method and is accessed * blockwise. Use of gzip or bzip2 compression is possible. * A stream-like object could be for example: sys.stdin, * sys.stdout, a socket, a tape device etc. * * _Stream is intended to be used only internally. * */ interface I_Stream { /** * Write string s to the stream. * */ write(s): Promise write$({ s }): Promise /** * Close the _Stream object. No operation should be * done on it afterwards. * */ close(): Promise close$($: {}): Promise /** * Return the stream's file pointer position. * */ tell(): Promise tell$($: {}): Promise /** * Set the stream's file pointer to pos. Negative seeking * is forbidden. * */ seek(pos?): Promise seek$({ pos }: { pos?}): Promise /** * Return the next size number of bytes from the stream. */ read(size): Promise read$({ size }): Promise } /** * Small proxy class that enables transparent compression * detection for the Stream interface (mode 'r|*'). * */ interface I_StreamProxy { read(size): Promise read$({ size }): Promise getcomptype(): Promise getcomptype$($: {}): Promise close(): Promise close$($: {}): Promise } /** * A thin wrapper around an existing file object that * provides a part of its data as an individual file * object. * */ interface I_FileInFile { flush(): Promise flush$($: {}): Promise readable(): Promise readable$($: {}): Promise writable(): Promise writable$($: {}): Promise seekable(): Promise seekable$($: {}): Promise /** * Return the current file position. * */ tell(): Promise tell$($: {}): Promise /** * Seek to a position in the file. * */ seek(position, whence?): Promise seek$({ position, whence }: { position, whence?}): Promise /** * Read data from the file. * */ read(size?): Promise read$({ size }: { size?}): Promise readinto(b): Promise readinto$({ b }): Promise close(): Promise close$($: {}): Promise } function ExFileObject(tarfile, tarinfo): Promise function ExFileObject$({ tarfile, tarinfo }): Promise interface IExFileObject { } /** * Informational class which holds the details about an * archive member given by a tar header block. * TarInfo objects are returned by TarFile.getmember(), * TarFile.getmembers() and TarFile.gettarinfo() and are * usually created internally. * */ /** * Construct a TarInfo object. name is the optional name * of the member. * */ function TarInfo(name?): Promise function TarInfo$({ name }: { name?}): Promise interface ITarInfo { /** * In pax headers, "name" is called "path". */ path(): Promise path$($: {}): Promise path(name): Promise path$({ name }): Promise /** * In pax headers, "linkname" is called "linkpath". */ linkpath(): Promise linkpath$($: {}): Promise linkpath(linkname): Promise linkpath$({ linkname }): Promise /** * Return the TarInfo's attributes as a dictionary. * */ get_info(): Promise get_info$($: {}): Promise /** * Return a tar header as a string of 512 byte blocks. * */ tobuf(format?, encoding?, errors?): Promise tobuf$({ format, encoding, errors }: { format?, encoding?, errors?}): Promise /** * Return the object as a ustar header block. * */ create_ustar_header(info, encoding, errors): Promise create_ustar_header$({ info, encoding, errors }): Promise /** * Return the object as a GNU header block sequence. * */ create_gnu_header(info, encoding, errors): Promise create_gnu_header$({ info, encoding, errors }): Promise /** * Return the object as a ustar header block. If it cannot be * represented this way, prepend a pax extended header sequence * with supplement information. * */ create_pax_header(info, encoding): Promise create_pax_header$({ info, encoding }): Promise /** * Return the object as a pax global header block sequence. * */ create_pax_global_header(pax_headers): Promise create_pax_global_header$({ pax_headers }): Promise /** * Construct a TarInfo object from a 512 byte bytes object. * */ frombuf(buf, encoding, errors): Promise frombuf$({ buf, encoding, errors }): Promise /** * Return the next TarInfo object from TarFile object * tarfile. * */ fromtarfile(tarfile): Promise fromtarfile$({ tarfile }): Promise /** * Return True if the Tarinfo object is a regular file. */ isreg(): Promise isreg$($: {}): Promise /** * Return True if the Tarinfo object is a regular file. */ isfile(): Promise isfile$($: {}): Promise /** * Return True if it is a directory. */ isdir(): Promise isdir$($: {}): Promise /** * Return True if it is a symbolic link. */ issym(): Promise issym$($: {}): Promise /** * Return True if it is a hard link. */ islnk(): Promise islnk$($: {}): Promise /** * Return True if it is a character device. */ ischr(): Promise ischr$($: {}): Promise /** * Return True if it is a block device. */ isblk(): Promise isblk$($: {}): Promise /** * Return True if it is a FIFO. */ isfifo(): Promise isfifo$($: {}): Promise issparse(): Promise issparse$($: {}): Promise /** * Return True if it is one of character device, block device or FIFO. */ isdev(): Promise isdev$($: {}): Promise } /** * The TarFile Class provides an interface to tar archives. * */ /** * Open an (uncompressed) tar archive `name'. `mode' is either 'r' to * read from an existing archive, 'a' to append data to an existing * file or 'w' to create a new file overwriting an existing one. `mode' * defaults to 'r'. * If `fileobj' is given, it is used for reading or writing data. If it * can be determined, `mode' is overridden by `fileobj's mode. * `fileobj' is not closed, when TarFile is closed. * */ function TarFile(name?, mode?, fileobj?, format?, tarinfo?, dereference?, ignore_zeros?, encoding?, errors?, pax_headers?, debug?, errorlevel?, copybufsize?): Promise function TarFile$({ name, mode, fileobj, format, tarinfo, dereference, ignore_zeros, encoding, errors, pax_headers, debug, errorlevel, copybufsize }: { name?, mode?, fileobj?, format?, tarinfo?, dereference?, ignore_zeros?, encoding?, errors?, pax_headers?, debug?, errorlevel?, copybufsize?}): Promise interface ITarFile { /** * Open a tar archive for reading, writing or appending. Return * an appropriate TarFile class. * * mode: * 'r' or 'r:*' open for reading with transparent compression * 'r:' open for reading exclusively uncompressed * 'r:gz' open for reading with gzip compression * 'r:bz2' open for reading with bzip2 compression * 'r:xz' open for reading with lzma compression * 'a' or 'a:' open for appending, creating the file if necessary * 'w' or 'w:' open for writing without compression * 'w:gz' open for writing with gzip compression * 'w:bz2' open for writing with bzip2 compression * 'w:xz' open for writing with lzma compression * * 'x' or 'x:' create a tarfile exclusively without compression, raise * an exception if the file is already created * 'x:gz' create a gzip compressed tarfile, raise an exception * if the file is already created * 'x:bz2' create a bzip2 compressed tarfile, raise an exception * if the file is already created * 'x:xz' create an lzma compressed tarfile, raise an exception * if the file is already created * * 'r|*' open a stream of tar blocks with transparent compression * 'r|' open an uncompressed stream of tar blocks for reading * 'r|gz' open a gzip compressed stream of tar blocks * 'r|bz2' open a bzip2 compressed stream of tar blocks * 'r|xz' open an lzma compressed stream of tar blocks * 'w|' open an uncompressed stream for writing * 'w|gz' open a gzip compressed stream for writing * 'w|bz2' open a bzip2 compressed stream for writing * 'w|xz' open an lzma compressed stream for writing * */ open(name?, mode?, fileobj?, bufsize?): Promise open$({ name, mode, fileobj, bufsize }: { name?, mode?, fileobj?, bufsize?}): Promise /** * Open uncompressed tar archive name for reading or writing. * */ taropen(name, mode?, fileobj?): Promise taropen$({ name, mode, fileobj }: { name, mode?, fileobj?}): Promise /** * Open gzip compressed tar archive name for reading or writing. * Appending is not allowed. * */ gzopen(name, mode?, fileobj?, compresslevel?): Promise gzopen$({ name, mode, fileobj, compresslevel }: { name, mode?, fileobj?, compresslevel?}): Promise /** * Open bzip2 compressed tar archive name for reading or writing. * Appending is not allowed. * */ bz2open(name, mode?, fileobj?, compresslevel?): Promise bz2open$({ name, mode, fileobj, compresslevel }: { name, mode?, fileobj?, compresslevel?}): Promise /** * Open lzma compressed tar archive name for reading or writing. * Appending is not allowed. * */ xzopen(name, mode?, fileobj?, preset?): Promise xzopen$({ name, mode, fileobj, preset }: { name, mode?, fileobj?, preset?}): Promise /** * Close the TarFile. In write-mode, two finishing zero blocks are * appended to the archive. * */ close(): Promise close$($: {}): Promise /** * Return a TarInfo object for member `name'. If `name' can not be * found in the archive, KeyError is raised. If a member occurs more * than once in the archive, its last occurrence is assumed to be the * most up-to-date version. * */ getmember(name): Promise getmember$({ name }): Promise /** * Return the members of the archive as a list of TarInfo objects. The * list has the same order as the members in the archive. * */ getmembers(): Promise getmembers$($: {}): Promise /** * Return the members of the archive as a list of their names. It has * the same order as the list returned by getmembers(). * */ getnames(): Promise getnames$($: {}): Promise /** * Create a TarInfo object from the result of os.stat or equivalent * on an existing file. The file is either named by `name', or * specified as a file object `fileobj' with a file descriptor. If * given, `arcname' specifies an alternative name for the file in the * archive, otherwise, the name is taken from the 'name' attribute of * 'fileobj', or the 'name' argument. The name should be a text * string. * */ gettarinfo(name?, arcname?, fileobj?): Promise gettarinfo$({ name, arcname, fileobj }: { name?, arcname?, fileobj?}): Promise /** * Print a table of contents to sys.stdout. If `verbose' is False, only * the names of the members are printed. If it is True, an `ls -l'-like * output is produced. `members' is optional and must be a subset of the * list returned by getmembers(). * */ list(verbose?: boolean): Promise list$({ verbose }: { verbose?}): Promise /** * Add the file `name' to the archive. `name' may be any type of file * (directory, fifo, symbolic link, etc.). If given, `arcname' * specifies an alternative name for the file in the archive. * Directories are added recursively by default. This can be avoided by * setting `recursive' to False. `filter' is a function * that expects a TarInfo object argument and returns the changed * TarInfo object, if it returns None the TarInfo object will be * excluded from the archive. * */ add(name, arcname?, recursive?: boolean): Promise add$({ name, arcname, recursive }: { name, arcname?, recursive?}): Promise /** * Add the TarInfo object `tarinfo' to the archive. If `fileobj' is * given, it should be a binary file, and tarinfo.size bytes are read * from it and added to the archive. You can create TarInfo objects * directly, or by using gettarinfo(). * */ addfile(tarinfo, fileobj?): Promise addfile$({ tarinfo, fileobj }: { tarinfo, fileobj?}): Promise /** * Extract all members from the archive to the current working * directory and set owner, modification time and permissions on * directories afterwards. `path' specifies a different directory * to extract to. `members' is optional and must be a subset of the * list returned by getmembers(). If `numeric_owner` is True, only * the numbers for user/group names are used and not the names. * */ extractall(path?, members?): Promise extractall$({ path, members }: { path?, members?}): Promise /** * Extract a member from the archive to the current working directory, * using its full name. Its file information is extracted as accurately * as possible. `member' may be a filename or a TarInfo object. You can * specify a different directory using `path'. File attributes (owner, * mtime, mode) are set unless `set_attrs' is False. If `numeric_owner` * is True, only the numbers for user/group names are used and not * the names. * */ extract(member, path?, set_attrs?: boolean): Promise extract$({ member, path, set_attrs }: { member, path?, set_attrs?}): Promise /** * Extract a member from the archive as a file object. `member' may be * a filename or a TarInfo object. If `member' is a regular file or * a link, an io.BufferedReader object is returned. For all other * existing members, None is returned. If `member' does not appear * in the archive, KeyError is raised. * */ extractfile(member): Promise extractfile$({ member }): Promise /** * Make a directory called targetpath. * */ makedir(tarinfo, targetpath): Promise makedir$({ tarinfo, targetpath }): Promise /** * Make a file called targetpath. * */ makefile(tarinfo, targetpath): Promise makefile$({ tarinfo, targetpath }): Promise /** * Make a file from a TarInfo object with an unknown type * at targetpath. * */ makeunknown(tarinfo, targetpath): Promise makeunknown$({ tarinfo, targetpath }): Promise /** * Make a fifo called targetpath. * */ makefifo(tarinfo, targetpath): Promise makefifo$({ tarinfo, targetpath }): Promise /** * Make a character or block device called targetpath. * */ makedev(tarinfo, targetpath): Promise makedev$({ tarinfo, targetpath }): Promise /** * Make a (symbolic) link called targetpath. If it cannot be created * (platform limitation), we try to make a copy of the referenced file * instead of a link. * */ makelink(tarinfo, targetpath): Promise makelink$({ tarinfo, targetpath }): Promise /** * Set owner of targetpath according to tarinfo. If numeric_owner * is True, use .gid/.uid instead of .gname/.uname. If numeric_owner * is False, fall back to .gid/.uid when the search based on name * fails. * */ chown(tarinfo, targetpath, numeric_owner): Promise chown$({ tarinfo, targetpath, numeric_owner }): Promise /** * Set file permissions of targetpath according to tarinfo. * */ chmod(tarinfo, targetpath): Promise chmod$({ tarinfo, targetpath }): Promise /** * Set modification time of targetpath according to tarinfo. * */ utime(tarinfo, targetpath): Promise utime$({ tarinfo, targetpath }): Promise /** * Return the next member of the archive as a TarInfo object, when * TarFile is opened for reading. Return None if there is no more * available. * */ next(): Promise next$($: {}): Promise debug dereference ignore_zeros errorlevel format encoding errors tarinfo fileobject OPEN_METH } let version: Promise let symlink_exception: Promise let NUL: Promise let BLOCKSIZE: Promise let RECORDSIZE: Promise let GNU_MAGIC: Promise let POSIX_MAGIC: Promise let LENGTH_NAME: Promise let LENGTH_LINK: Promise let LENGTH_PREFIX: Promise let REGTYPE: Promise let AREGTYPE: Promise let LNKTYPE: Promise let SYMTYPE: Promise let CHRTYPE: Promise let BLKTYPE: Promise let DIRTYPE: Promise let FIFOTYPE: Promise let CONTTYPE: Promise let GNUTYPE_LONGNAME: Promise let GNUTYPE_LONGLINK: Promise let GNUTYPE_SPARSE: Promise let XHDTYPE: Promise let XGLTYPE: Promise let SOLARIS_XHDTYPE: Promise let USTAR_FORMAT: Promise let GNU_FORMAT: Promise let PAX_FORMAT: Promise let DEFAULT_FORMAT: Promise let SUPPORTED_TYPES: Promise let REGULAR_TYPES: Promise let GNU_TYPES: Promise let PAX_FIELDS: Promise let PAX_NAME_FIELDS: Promise let PAX_NUMBER_FIELDS: Promise let ENCODING: Promise } declare module threading { var _ /** * Set a profile function for all threads started from the threading module. * * The func will be passed to sys.setprofile() for each thread, before its * run() method is called. * * */ function setprofile(func): Promise function setprofile$({ func }): Promise /** * Get the profiler function as set by threading.setprofile(). */ function getprofile(): Promise function getprofile$($: {}): Promise /** * Set a trace function for all threads started from the threading module. * * The func will be passed to sys.settrace() for each thread, before its run() * method is called. * * */ function settrace(func): Promise function settrace$({ func }): Promise /** * Get the trace function as set by threading.settrace(). */ function gettrace(): Promise function gettrace$($: {}): Promise /** * Factory function that returns a new reentrant lock. * * A reentrant lock must be released by the thread that acquired it. Once a * thread has acquired a reentrant lock, the same thread may acquire it again * without blocking; the thread must release it once for each time it has * acquired it. * * */ function RLock(): Promise function RLock$($: {}): Promise /** * Return the current Thread object, corresponding to the caller's thread of control. * * If the caller's thread of control was not created through the threading * module, a dummy thread object with limited functionality is returned. * * */ function current_thread(): Promise function current_thread$($: {}): Promise /** * Return the current Thread object, corresponding to the caller's thread of control. * * This function is deprecated, use current_thread() instead. * * */ function currentThread(): Promise function currentThread$($: {}): Promise /** * Return the number of Thread objects currently alive. * * The returned count is equal to the length of the list returned by * enumerate(). * * */ function active_count(): Promise function active_count$($: {}): Promise /** * Return the number of Thread objects currently alive. * * This function is deprecated, use active_count() instead. * * */ function activeCount(): Promise function activeCount$($: {}): Promise /** * Return a list of all Thread objects currently alive. * * The list includes daemonic threads, dummy thread objects created by * current_thread(), and the main thread. It excludes terminated threads and * threads that have not yet been started. * * */ function enumerate(): Promise function enumerate$($: {}): Promise /** * Return the main thread object. * * In normal conditions, the main thread is the thread from which the * Python interpreter was started. * */ function main_thread(): Promise function main_thread$($: {}): Promise /** * This class implements reentrant lock objects. * * A reentrant lock must be released by the thread that acquired it. Once a * thread has acquired a reentrant lock, the same thread may acquire it * again without blocking; the thread must release it once for each time it * has acquired it. * * */ interface I_RLock { /** * Acquire a lock, blocking or non-blocking. * * When invoked without arguments: if this thread already owns the lock, * increment the recursion level by one, and return immediately. Otherwise, * if another thread owns the lock, block until the lock is unlocked. Once * the lock is unlocked (not owned by any thread), then grab ownership, set * the recursion level to one, and return. If more than one thread is * blocked waiting until the lock is unlocked, only one at a time will be * able to grab ownership of the lock. There is no return value in this * case. * * When invoked with the blocking argument set to true, do the same thing * as when called without arguments, and return true. * * When invoked with the blocking argument set to false, do not block. If a * call without an argument would block, return false immediately; * otherwise, do the same thing as when called without arguments, and * return true. * * When invoked with the floating-point timeout argument set to a positive * value, block for at most the number of seconds specified by timeout * and as long as the lock cannot be acquired. Return true if the lock has * been acquired, false if the timeout has elapsed. * * */ acquire(blocking?: boolean, timeout?): Promise acquire$({ blocking, timeout }: { blocking?, timeout?}): Promise /** * Release a lock, decrementing the recursion level. * * If after the decrement it is zero, reset the lock to unlocked (not owned * by any thread), and if any other threads are blocked waiting for the * lock to become unlocked, allow exactly one of them to proceed. If after * the decrement the recursion level is still nonzero, the lock remains * locked and owned by the calling thread. * * Only call this method when the calling thread owns the lock. A * RuntimeError is raised if this method is called when the lock is * unlocked. * * There is no return value. * * */ release(): Promise release$($: {}): Promise } /** * Class that implements a condition variable. * * A condition variable allows one or more threads to wait until they are * notified by another thread. * * If the lock argument is given and not None, it must be a Lock or RLock * object, and it is used as the underlying lock. Otherwise, a new RLock object * is created and used as the underlying lock. * * */ function Condition(lock?): Promise function Condition$({ lock }: { lock?}): Promise interface ICondition { /** * Wait until notified or until a timeout occurs. * * If the calling thread has not acquired the lock when this method is * called, a RuntimeError is raised. * * This method releases the underlying lock, and then blocks until it is * awakened by a notify() or notify_all() call for the same condition * variable in another thread, or until the optional timeout occurs. Once * awakened or timed out, it re-acquires the lock and returns. * * When the timeout argument is present and not None, it should be a * floating point number specifying a timeout for the operation in seconds * (or fractions thereof). * * When the underlying lock is an RLock, it is not released using its * release() method, since this may not actually unlock the lock when it * was acquired multiple times recursively. Instead, an internal interface * of the RLock class is used, which really unlocks it even when it has * been recursively acquired several times. Another internal interface is * then used to restore the recursion level when the lock is reacquired. * * */ wait(timeout?): Promise wait$({ timeout }: { timeout?}): Promise /** * Wait until a condition evaluates to True. * * predicate should be a callable which result will be interpreted as a * boolean value. A timeout may be provided giving the maximum time to * wait. * * */ wait_for(predicate, timeout?): Promise wait_for$({ predicate, timeout }: { predicate, timeout?}): Promise /** * Wake up one or more threads waiting on this condition, if any. * * If the calling thread has not acquired the lock when this method is * called, a RuntimeError is raised. * * This method wakes up at most n of the threads waiting for the condition * variable; it is a no-op if no threads are waiting. * * */ notify(n?): Promise notify$({ n }: { n?}): Promise /** * Wake up all threads waiting on this condition. * * If the calling thread has not acquired the lock when this method * is called, a RuntimeError is raised. * * */ notify_all(): Promise notify_all$($: {}): Promise /** * Wake up all threads waiting on this condition. * * This method is deprecated, use notify_all() instead. * * */ notifyAll(): Promise notifyAll$($: {}): Promise } /** * This class implements semaphore objects. * * Semaphores manage a counter representing the number of release() calls minus * the number of acquire() calls, plus an initial value. The acquire() method * blocks if necessary until it can return without making the counter * negative. If not given, value defaults to 1. * * */ function Semaphore(value?): Promise function Semaphore$({ value }: { value?}): Promise interface ISemaphore { /** * Acquire a semaphore, decrementing the internal counter by one. * * When invoked without arguments: if the internal counter is larger than * zero on entry, decrement it by one and return immediately. If it is zero * on entry, block, waiting until some other thread has called release() to * make it larger than zero. This is done with proper interlocking so that * if multiple acquire() calls are blocked, release() will wake exactly one * of them up. The implementation may pick one at random, so the order in * which blocked threads are awakened should not be relied on. There is no * return value in this case. * * When invoked with blocking set to true, do the same thing as when called * without arguments, and return true. * * When invoked with blocking set to false, do not block. If a call without * an argument would block, return false immediately; otherwise, do the * same thing as when called without arguments, and return true. * * When invoked with a timeout other than None, it will block for at * most timeout seconds. If acquire does not complete successfully in * that interval, return false. Return true otherwise. * * */ acquire(blocking?: boolean, timeout?): Promise acquire$({ blocking, timeout }: { blocking?, timeout?}): Promise /** * Release a semaphore, incrementing the internal counter by one or more. * * When the counter is zero on entry and another thread is waiting for it * to become larger than zero again, wake up that thread. * * */ release(n?): Promise release$({ n }: { n?}): Promise } /** * Implements a bounded semaphore. * * A bounded semaphore checks to make sure its current value doesn't exceed its * initial value. If it does, ValueError is raised. In most situations * semaphores are used to guard resources with limited capacity. * * If the semaphore is released too many times it's a sign of a bug. If not * given, value defaults to 1. * * Like regular semaphores, bounded semaphores manage a counter representing * the number of release() calls minus the number of acquire() calls, plus an * initial value. The acquire() method blocks if necessary until it can return * without making the counter negative. If not given, value defaults to 1. * * */ function BoundedSemaphore(value?): Promise function BoundedSemaphore$({ value }: { value?}): Promise interface IBoundedSemaphore extends ISemaphore { /** * Release a semaphore, incrementing the internal counter by one or more. * * When the counter is zero on entry and another thread is waiting for it * to become larger than zero again, wake up that thread. * * If the number of releases exceeds the number of acquires, * raise a ValueError. * * */ release(n?): Promise release$({ n }: { n?}): Promise } /** * Class implementing event objects. * * Events manage a flag that can be set to true with the set() method and reset * to false with the clear() method. The wait() method blocks until the flag is * true. The flag is initially false. * * */ function Event(): Promise function Event$({ }): Promise interface IEvent { /** * Return true if and only if the internal flag is true. */ is_set(): Promise is_set$($: {}): Promise /** * Return true if and only if the internal flag is true. * * This method is deprecated, use notify_all() instead. * * */ isSet(): Promise isSet$($: {}): Promise /** * Set the internal flag to true. * * All threads waiting for it to become true are awakened. Threads * that call wait() once the flag is true will not block at all. * * */ set(): Promise set$($: {}): Promise /** * Reset the internal flag to false. * * Subsequently, threads calling wait() will block until set() is called to * set the internal flag to true again. * * */ clear(): Promise clear$($: {}): Promise /** * Block until the internal flag is true. * * If the internal flag is true on entry, return immediately. Otherwise, * block until another thread calls set() to set the flag to true, or until * the optional timeout occurs. * * When the timeout argument is present and not None, it should be a * floating point number specifying a timeout for the operation in seconds * (or fractions thereof). * * This method returns the internal flag on exit, so it will always return * True except if a timeout is given and the operation times out. * * */ wait(timeout?): Promise wait$({ timeout }: { timeout?}): Promise } /** * Implements a Barrier. * * Useful for synchronizing a fixed number of threads at known synchronization * points. Threads block on 'wait()' and are simultaneously awoken once they * have all made that call. * * */ /** * Create a barrier, initialised to 'parties' threads. * * 'action' is a callable which, when supplied, will be called by one of * the threads after they have all entered the barrier and just prior to * releasing them all. If a 'timeout' is provided, it is used as the * default for all subsequent 'wait()' calls. * * */ function Barrier(parties, action?, timeout?): Promise function Barrier$({ parties, action, timeout }: { parties, action?, timeout?}): Promise interface IBarrier { /** * Wait for the barrier. * * When the specified number of threads have started waiting, they are all * simultaneously awoken. If an 'action' was provided for the barrier, one * of the threads will have executed that callback prior to returning. * Returns an individual index number from 0 to 'parties-1'. * * */ wait(timeout?): Promise wait$({ timeout }: { timeout?}): Promise /** * Reset the barrier to the initial state. * * Any threads currently waiting will get the BrokenBarrier exception * raised. * * */ reset(): Promise reset$($: {}): Promise /** * Place the barrier into a 'broken' state. * * Useful in case of error. Any currently waiting threads and threads * attempting to 'wait()' will have BrokenBarrierError raised. * * */ abort(): Promise abort$($: {}): Promise /** * Return the number of threads required to trip the barrier. */ parties(): Promise parties$($: {}): Promise /** * Return the number of threads currently waiting at the barrier. */ n_waiting(): Promise n_waiting$($: {}): Promise /** * Return True if the barrier is in a broken state. */ broken(): Promise broken$($: {}): Promise } interface IBrokenBarrierError { } /** * A class that represents a thread of control. * * This class can be safely subclassed in a limited fashion. There are two ways * to specify the activity: by passing a callable object to the constructor, or * by overriding the run() method in a subclass. * * */ /** * This constructor should always be called with keyword arguments. Arguments are: * * *group* should be None; reserved for future extension when a ThreadGroup * class is implemented. * * *target* is the callable object to be invoked by the run() * method. Defaults to None, meaning nothing is called. * * *name* is the thread name. By default, a unique name is constructed of * the form "Thread-N" where N is a small decimal number. * * *args* is the argument tuple for the target invocation. Defaults to (). * * *kwargs* is a dictionary of keyword arguments for the target * invocation. Defaults to {}. * * If a subclass overrides the constructor, it must make sure to invoke * the base class constructor (Thread.__init__()) before doing anything * else to the thread. * * */ function Thread(group?, target?, name?, args?, kwargs?): Promise function Thread$({ group, target, name, args, kwargs }: { group?, target?, name?, args?, kwargs?}): Promise interface IThread { /** * Start the thread's activity. * * It must be called at most once per thread object. It arranges for the * object's run() method to be invoked in a separate thread of control. * * This method will raise a RuntimeError if called more than once on the * same thread object. * * */ start(): Promise start$($: {}): Promise /** * Method representing the thread's activity. * * You may override this method in a subclass. The standard run() method * invokes the callable object passed to the object's constructor as the * target argument, if any, with sequential and keyword arguments taken * from the args and kwargs arguments, respectively. * * */ run(): Promise run$($: {}): Promise /** * Wait until the thread terminates. * * This blocks the calling thread until the thread whose join() method is * called terminates -- either normally or through an unhandled exception * or until the optional timeout occurs. * * When the timeout argument is present and not None, it should be a * floating point number specifying a timeout for the operation in seconds * (or fractions thereof). As join() always returns None, you must call * is_alive() after join() to decide whether a timeout happened -- if the * thread is still alive, the join() call timed out. * * When the timeout argument is not present or None, the operation will * block until the thread terminates. * * A thread can be join()ed many times. * * join() raises a RuntimeError if an attempt is made to join the current * thread as that would cause a deadlock. It is also an error to join() a * thread before it has been started and attempts to do so raises the same * exception. * * */ join(timeout?): Promise join$({ timeout }: { timeout?}): Promise /** * A string used for identification purposes only. * * It has no semantics. Multiple threads may be given the same name. The * initial name is set by the constructor. * * */ name(): Promise name$($: {}): Promise name(name): Promise name$({ name }): Promise /** * Thread identifier of this thread or None if it has not been started. * * This is a nonzero integer. See the get_ident() function. Thread * identifiers may be recycled when a thread exits and another thread is * created. The identifier is available even after the thread has exited. * * */ ident(): Promise ident$($: {}): Promise /** * Return whether the thread is alive. * * This method returns True just before the run() method starts until just * after the run() method terminates. See also the module function * enumerate(). * * */ is_alive(): Promise is_alive$($: {}): Promise /** * A boolean value indicating whether this thread is a daemon thread. * * This must be set before start() is called, otherwise RuntimeError is * raised. Its initial value is inherited from the creating thread; the * main thread is not a daemon thread and therefore all threads created in * the main thread default to daemon = False. * * The entire Python program exits when only daemon threads are left. * * */ daemon(): Promise daemon$($: {}): Promise daemon(daemonic): Promise daemon$({ daemonic }): Promise /** * Return whether this thread is a daemon. * * This method is deprecated, use the daemon attribute instead. * * */ isDaemon(): Promise isDaemon$($: {}): Promise /** * Set whether this thread is a daemon. * * This method is deprecated, use the .daemon property instead. * * */ setDaemon(daemonic): Promise setDaemon$({ daemonic }): Promise /** * Return a string used for identification purposes only. * * This method is deprecated, use the name attribute instead. * * */ getName(): Promise getName$($: {}): Promise /** * Set the name string for this thread. * * This method is deprecated, use the name attribute instead. * * */ setName(name): Promise setName$({ name }): Promise } /** * Call a function after a specified number of seconds: * * t = Timer(30.0, f, args=None, kwargs=None) * t.start() * t.cancel() # stop the timer's action if it's still waiting * * */ function Timer(interval, func, args?, kwargs?): Promise function Timer$({ interval, func, args, kwargs }: { interval, func, args?, kwargs?}): Promise interface ITimer extends IThread { /** * Stop the timer if it hasn't finished yet. */ cancel(): Promise cancel$($: {}): Promise run(): Promise run$($: {}): Promise } interface I_MainThread extends IThread { } interface I_DummyThread extends IThread { is_alive(): Promise is_alive$($: {}): Promise join(timeout?): Promise join$({ timeout }: { timeout?}): Promise } let get_ident: Promise let get_native_id: Promise let ThreadError: Promise let TIMEOUT_MAX: Promise let Lock: Promise } declare module tkinter { var _ /** * Inhibit setting of default root window. * * Call this function to inhibit that the first instance of * Tk is used for windows without an explicit parent window. * */ function NoDefaultRoot(): Promise function NoDefaultRoot$($: {}): Promise /** * Run the main loop of Tcl. */ function mainloop(n?): Promise function mainloop$({ n }: { n?}): Promise /** * Convert Tcl object to True or False. */ function getboolean(s): Promise function getboolean$({ s }): Promise function Tcl(screenName?, baseName?, className?, useTk?: boolean): Promise function Tcl$({ screenName, baseName, className, useTk }: { screenName?, baseName?, className?, useTk?}): Promise function image_names(): Promise function image_names$($: {}): Promise function image_types(): Promise function image_types$($: {}): Promise interface IEventType { KeyPress Key KeyRelease ButtonPress Button ButtonRelease Motion Enter Leave FocusIn FocusOut Keymap Expose GraphicsExpose NoExpose Visibility Create Destroy Unmap Map MapRequest Reparent Configure ConfigureRequest Gravity ResizeRequest Circulate CirculateRequest Property SelectionClear SelectionRequest Selection Colormap ClientMessage Mapping VirtualEvent Activate Deactivate MouseWheel } /** * Container for the properties of an event. * * Instances of this type are generated if one of the following events occurs: * * KeyPress, KeyRelease - for keyboard events * ButtonPress, ButtonRelease, Motion, Enter, Leave, MouseWheel - for mouse events * Visibility, Unmap, Map, Expose, FocusIn, FocusOut, Circulate, * Colormap, Gravity, Reparent, Property, Destroy, Activate, * Deactivate - for window events. * * If a callback function for one of these events is registered * using bind, bind_all, bind_class, or tag_bind, the callback is * called with an Event as first argument. It will have the * following attributes (in braces are the event types for which * the attribute is valid): * * serial - serial number of event * num - mouse button pressed (ButtonPress, ButtonRelease) * focus - whether the window has the focus (Enter, Leave) * height - height of the exposed window (Configure, Expose) * width - width of the exposed window (Configure, Expose) * keycode - keycode of the pressed key (KeyPress, KeyRelease) * state - state of the event as a number (ButtonPress, ButtonRelease, * Enter, KeyPress, KeyRelease, * Leave, Motion) * state - state as a string (Visibility) * time - when the event occurred * x - x-position of the mouse * y - y-position of the mouse * x_root - x-position of the mouse on the screen * (ButtonPress, ButtonRelease, KeyPress, KeyRelease, Motion) * y_root - y-position of the mouse on the screen * (ButtonPress, ButtonRelease, KeyPress, KeyRelease, Motion) * char - pressed character (KeyPress, KeyRelease) * send_event - see X/Windows documentation * keysym - keysym of the event as a string (KeyPress, KeyRelease) * keysym_num - keysym of the event as a number (KeyPress, KeyRelease) * type - type of the event as a number * widget - widget in which the event occurred * delta - delta of wheel movement (MouseWheel) * */ interface IEvent { } /** * Class to define value holders for e.g. buttons. * * Subclasses StringVar, IntVar, DoubleVar, BooleanVar are specializations * that constrain the type of the value returned from get(). */ /** * Construct a variable * * MASTER can be given as master widget. * VALUE is an optional value (defaults to "") * NAME is an optional Tcl name (defaults to PY_VARnum). * * If NAME matches an existing variable and VALUE is omitted * then the existing value is retained. * */ function Variable(master?, value?, name?): Promise function Variable$({ master, value, name }: { master?, value?, name?}): Promise interface IVariable { /** * Set the variable to VALUE. */ set(value): Promise set$({ value }): Promise /** * Return value of variable. */ get(): Promise get$($: {}): Promise /** * Define a trace callback for the variable. * * Mode is one of "read", "write", "unset", or a list or tuple of * such strings. * Callback must be a function which is called when the variable is * read, written or unset. * * Return the name of the callback. * */ trace_add(mode, callback): Promise trace_add$({ mode, callback }): Promise /** * Delete the trace callback for a variable. * * Mode is one of "read", "write", "unset" or a list or tuple of * such strings. Must be same as were specified in trace_add(). * cbname is the name of the callback returned from trace_add(). * */ trace_remove(mode, cbname): Promise trace_remove$({ mode, cbname }): Promise /** * Return all trace callback information. */ trace_info(): Promise trace_info$($: {}): Promise /** * Define a trace callback for the variable. * * MODE is one of "r", "w", "u" for read, write, undefine. * CALLBACK must be a function which is called when * the variable is read, written or undefined. * * Return the name of the callback. * * This deprecated method wraps a deprecated Tcl method that will * likely be removed in the future. Use trace_add() instead. * */ trace_variable(mode, callback): Promise trace_variable$({ mode, callback }): Promise /** * Delete the trace callback for a variable. * * MODE is one of "r", "w", "u" for read, write, undefine. * CBNAME is the name of the callback returned from trace_variable or trace. * * This deprecated method wraps a deprecated Tcl method that will * likely be removed in the future. Use trace_remove() instead. * */ trace_vdelete(mode, cbname): Promise trace_vdelete$({ mode, cbname }): Promise /** * Return all trace callback information. * * This deprecated method wraps a deprecated Tcl method that will * likely be removed in the future. Use trace_info() instead. * */ trace_vinfo(): Promise trace_vinfo$($: {}): Promise initialize trace } /** * Value holder for strings variables. */ /** * Construct a string variable. * * MASTER can be given as master widget. * VALUE is an optional value (defaults to "") * NAME is an optional Tcl name (defaults to PY_VARnum). * * If NAME matches an existing variable and VALUE is omitted * then the existing value is retained. * */ function StringVar(master?, value?, name?): Promise function StringVar$({ master, value, name }: { master?, value?, name?}): Promise interface IStringVar extends IVariable { /** * Return value of variable as string. */ get(): Promise get$($: {}): Promise } /** * Value holder for integer variables. */ /** * Construct an integer variable. * * MASTER can be given as master widget. * VALUE is an optional value (defaults to 0) * NAME is an optional Tcl name (defaults to PY_VARnum). * * If NAME matches an existing variable and VALUE is omitted * then the existing value is retained. * */ function IntVar(master?, value?, name?): Promise function IntVar$({ master, value, name }: { master?, value?, name?}): Promise interface IIntVar extends IVariable { /** * Return the value of the variable as an integer. */ get(): Promise get$($: {}): Promise } /** * Value holder for float variables. */ /** * Construct a float variable. * * MASTER can be given as master widget. * VALUE is an optional value (defaults to 0.0) * NAME is an optional Tcl name (defaults to PY_VARnum). * * If NAME matches an existing variable and VALUE is omitted * then the existing value is retained. * */ function DoubleVar(master?, value?, name?): Promise function DoubleVar$({ master, value, name }: { master?, value?, name?}): Promise interface IDoubleVar extends IVariable { /** * Return the value of the variable as a float. */ get(): Promise get$($: {}): Promise } /** * Value holder for boolean variables. */ /** * Construct a boolean variable. * * MASTER can be given as master widget. * VALUE is an optional value (defaults to False) * NAME is an optional Tcl name (defaults to PY_VARnum). * * If NAME matches an existing variable and VALUE is omitted * then the existing value is retained. * */ function BooleanVar(master?, value?, name?): Promise function BooleanVar$({ master, value, name }: { master?, value?, name?}): Promise interface IBooleanVar extends IVariable { /** * Set the variable to VALUE. */ set(value): Promise set$({ value }): Promise /** * Return the value of the variable as a bool. */ get(): Promise get$($: {}): Promise } /** * Internal class. * * Base class which defines methods common for interior widgets. */ interface IMisc { /** * Internal function. * * Delete all Tcl commands created for * this widget in the Tcl interpreter. */ destroy(): Promise destroy$($: {}): Promise /** * Internal function. * * Delete the Tcl command provided in NAME. */ deletecommand(name): Promise deletecommand$({ name }): Promise /** * Set Tcl internal variable, whether the look and feel * should adhere to Motif. * * A parameter of 1 means adhere to Motif (e.g. no color * change if mouse passes over slider). * Returns the set value. */ tk_strictMotif(boolean?): Promise tk_strictMotif$({ boolean }: { boolean?}): Promise /** * Change the color scheme to light brown as used in Tk 3.6 and before. */ tk_bisque(): Promise tk_bisque$($: {}): Promise /** * Set a new color scheme for all widget elements. * * A single color as argument will cause that all colors of Tk * widget elements are derived from this. * Alternatively several keyword parameters and its associated * colors can be given. The following keywords are valid: * activeBackground, foreground, selectColor, * activeForeground, highlightBackground, selectBackground, * background, highlightColor, selectForeground, * disabledForeground, insertBackground, troughColor. */ tk_setPalette(): Promise tk_setPalette$($: {}): Promise /** * Wait until the variable is modified. * * A parameter of type IntVar, StringVar, DoubleVar or * BooleanVar must be given. */ wait_variable(name?): Promise wait_variable$({ name }: { name?}): Promise /** * Wait until a WIDGET is destroyed. * * If no parameter is given self is used. */ wait_window(window?): Promise wait_window$({ window }: { window?}): Promise /** * Wait until the visibility of a WIDGET changes * (e.g. it appears). * * If no parameter is given self is used. */ wait_visibility(window?): Promise wait_visibility$({ window }: { window?}): Promise /** * Set Tcl variable NAME to VALUE. */ setvar(name?, value?): Promise setvar$({ name, value }: { name?, value?}): Promise /** * Return value of Tcl variable NAME. */ getvar(name?): Promise getvar$({ name }: { name?}): Promise getint(s): Promise getint$({ s }): Promise getdouble(s): Promise getdouble$({ s }): Promise /** * Return a boolean value for Tcl boolean values true and false given as parameter. */ getboolean(s): Promise getboolean$({ s }): Promise /** * Direct input focus to this widget. * * If the application currently does not have the focus * this widget will get the focus if the application gets * the focus through the window manager. */ focus_set(): Promise focus_set$($: {}): Promise /** * Direct input focus to this widget even if the * application does not have the focus. Use with * caution! */ focus_force(): Promise focus_force$($: {}): Promise /** * Return the widget which has currently the focus in the * application. * * Use focus_displayof to allow working with several * displays. Return None if application does not have * the focus. */ focus_get(): Promise focus_get$($: {}): Promise /** * Return the widget which has currently the focus on the * display where this widget is located. * * Return None if the application does not have the focus. */ focus_displayof(): Promise focus_displayof$($: {}): Promise /** * Return the widget which would have the focus if top level * for this widget gets the focus from the window manager. */ focus_lastfor(): Promise focus_lastfor$($: {}): Promise /** * The widget under mouse will get automatically focus. Can not * be disabled easily. */ tk_focusFollowsMouse(): Promise tk_focusFollowsMouse$($: {}): Promise /** * Return the next widget in the focus order which follows * widget which has currently the focus. * * The focus order first goes to the next child, then to * the children of the child recursively and then to the * next sibling which is higher in the stacking order. A * widget is omitted if it has the takefocus resource set * to 0. */ tk_focusNext(): Promise tk_focusNext$($: {}): Promise /** * Return previous widget in the focus order. See tk_focusNext for details. */ tk_focusPrev(): Promise tk_focusPrev$($: {}): Promise /** * Call function once after given time. * * MS specifies the time in milliseconds. FUNC gives the * function which shall be called. Additional parameters * are given as parameters to the function call. Return * identifier to cancel scheduling with after_cancel. */ after(ms, func?): Promise after$({ ms, func }: { ms, func?}): Promise /** * Call FUNC once if the Tcl main loop has no event to * process. * * Return an identifier to cancel the scheduling with * after_cancel. */ after_idle(func): Promise after_idle$({ func }): Promise /** * Cancel scheduling of function identified with ID. * * Identifier returned by after or after_idle must be * given as first parameter. * */ after_cancel(id): Promise after_cancel$({ id }): Promise /** * Ring a display's bell. */ bell(displayof?): Promise bell$({ displayof }: { displayof?}): Promise /** * Retrieve data from the clipboard on window's display. * * The window keyword defaults to the root window of the Tkinter * application. * * The type keyword specifies the form in which the data is * to be returned and should be an atom name such as STRING * or FILE_NAME. Type defaults to STRING, except on X11, where the default * is to try UTF8_STRING and fall back to STRING. * * This command is equivalent to: * * selection_get(CLIPBOARD) * */ clipboard_get(): Promise clipboard_get$($: {}): Promise /** * Clear the data in the Tk clipboard. * * A widget specified for the optional displayof keyword * argument specifies the target display. */ clipboard_clear(): Promise clipboard_clear$($: {}): Promise /** * Append STRING to the Tk clipboard. * * A widget specified at the optional displayof keyword * argument specifies the target display. The clipboard * can be retrieved with selection_get. */ clipboard_append(string): Promise clipboard_append$({ string }): Promise /** * Return widget which has currently the grab in this application * or None. */ grab_current(): Promise grab_current$($: {}): Promise /** * Release grab for this widget if currently set. */ grab_release(): Promise grab_release$($: {}): Promise /** * Set grab for this widget. * * A grab directs all events to this and descendant * widgets in the application. */ grab_set(): Promise grab_set$($: {}): Promise /** * Set global grab for this widget. * * A global grab directs all events to this and * descendant widgets on the display. Use with caution - * other applications do not get events anymore. */ grab_set_global(): Promise grab_set_global$($: {}): Promise /** * Return None, "local" or "global" if this widget has * no, a local or a global grab. */ grab_status(): Promise grab_status$($: {}): Promise /** * Set a VALUE (second parameter) for an option * PATTERN (first parameter). * * An optional third parameter gives the numeric priority * (defaults to 80). */ option_add(pattern, value, priority?): Promise option_add$({ pattern, value, priority }: { pattern, value, priority?}): Promise /** * Clear the option database. * * It will be reloaded if option_add is called. */ option_clear(): Promise option_clear$($: {}): Promise /** * Return the value for an option NAME for this widget * with CLASSNAME. * * Values with higher priority override lower values. */ option_get(name, className): Promise option_get$({ name, className }): Promise /** * Read file FILENAME into the option database. * * An optional second parameter gives the numeric * priority. */ option_readfile(fileName, priority?): Promise option_readfile$({ fileName, priority }: { fileName, priority?}): Promise /** * Clear the current X selection. */ selection_clear(): Promise selection_clear$($: {}): Promise /** * Return the contents of the current X selection. * * A keyword parameter selection specifies the name of * the selection and defaults to PRIMARY. A keyword * parameter displayof specifies a widget on the display * to use. A keyword parameter type specifies the form of data to be * fetched, defaulting to STRING except on X11, where UTF8_STRING is tried * before STRING. */ selection_get(): Promise selection_get$($: {}): Promise /** * Specify a function COMMAND to call if the X * selection owned by this widget is queried by another * application. * * This function must return the contents of the * selection. The function will be called with the * arguments OFFSET and LENGTH which allows the chunking * of very long selections. The following keyword * parameters can be provided: * selection - name of the selection (default PRIMARY), * type - type of the selection (e.g. STRING, FILE_NAME). */ selection_handle(command): Promise selection_handle$({ command }): Promise /** * Become owner of X selection. * * A keyword parameter selection specifies the name of * the selection (default PRIMARY). */ selection_own(): Promise selection_own$($: {}): Promise /** * Return owner of X selection. * * The following keyword parameter can * be provided: * selection - name of the selection (default PRIMARY), * type - type of the selection (e.g. STRING, FILE_NAME). */ selection_own_get(): Promise selection_own_get$($: {}): Promise /** * Send Tcl command CMD to different interpreter INTERP to be executed. */ send(interp, cmd): Promise send$({ interp, cmd }): Promise /** * Lower this widget in the stacking order. */ lower(belowThis?): Promise lower$({ belowThis }: { belowThis?}): Promise /** * Raise this widget in the stacking order. */ tkraise(aboveThis?): Promise tkraise$({ aboveThis }: { aboveThis?}): Promise /** * Return integer which represents atom NAME. */ winfo_atom(name, displayof?): Promise winfo_atom$({ name, displayof }: { name, displayof?}): Promise /** * Return name of atom with identifier ID. */ winfo_atomname(id, displayof?): Promise winfo_atomname$({ id, displayof }: { id, displayof?}): Promise /** * Return number of cells in the colormap for this widget. */ winfo_cells(): Promise winfo_cells$($: {}): Promise /** * Return a list of all widgets which are children of this widget. */ winfo_children(): Promise winfo_children$($: {}): Promise /** * Return window class name of this widget. */ winfo_class(): Promise winfo_class$($: {}): Promise /** * Return True if at the last color request the colormap was full. */ winfo_colormapfull(): Promise winfo_colormapfull$($: {}): Promise /** * Return the widget which is at the root coordinates ROOTX, ROOTY. */ winfo_containing(rootX, rootY, displayof?): Promise winfo_containing$({ rootX, rootY, displayof }: { rootX, rootY, displayof?}): Promise /** * Return the number of bits per pixel. */ winfo_depth(): Promise winfo_depth$($: {}): Promise /** * Return true if this widget exists. */ winfo_exists(): Promise winfo_exists$($: {}): Promise /** * Return the number of pixels for the given distance NUMBER * (e.g. "3c") as float. */ winfo_fpixels(number): Promise winfo_fpixels$({ number }): Promise /** * Return geometry string for this widget in the form "widthxheight+X+Y". */ winfo_geometry(): Promise winfo_geometry$($: {}): Promise /** * Return height of this widget. */ winfo_height(): Promise winfo_height$($: {}): Promise /** * Return identifier ID for this widget. */ winfo_id(): Promise winfo_id$($: {}): Promise /** * Return the name of all Tcl interpreters for this display. */ winfo_interps(displayof?): Promise winfo_interps$({ displayof }: { displayof?}): Promise /** * Return true if this widget is mapped. */ winfo_ismapped(): Promise winfo_ismapped$($: {}): Promise /** * Return the window manager name for this widget. */ winfo_manager(): Promise winfo_manager$($: {}): Promise /** * Return the name of this widget. */ winfo_name(): Promise winfo_name$($: {}): Promise /** * Return the name of the parent of this widget. */ winfo_parent(): Promise winfo_parent$($: {}): Promise /** * Return the pathname of the widget given by ID. */ winfo_pathname(id, displayof?): Promise winfo_pathname$({ id, displayof }: { id, displayof?}): Promise /** * Rounded integer value of winfo_fpixels. */ winfo_pixels(number): Promise winfo_pixels$({ number }): Promise /** * Return the x coordinate of the pointer on the root window. */ winfo_pointerx(): Promise winfo_pointerx$($: {}): Promise /** * Return a tuple of x and y coordinates of the pointer on the root window. */ winfo_pointerxy(): Promise winfo_pointerxy$($: {}): Promise /** * Return the y coordinate of the pointer on the root window. */ winfo_pointery(): Promise winfo_pointery$($: {}): Promise /** * Return requested height of this widget. */ winfo_reqheight(): Promise winfo_reqheight$($: {}): Promise /** * Return requested width of this widget. */ winfo_reqwidth(): Promise winfo_reqwidth$($: {}): Promise /** * Return a tuple of integer RGB values in range(65536) for color in this widget. */ winfo_rgb(color): Promise winfo_rgb$({ color }): Promise /** * Return x coordinate of upper left corner of this widget on the * root window. */ winfo_rootx(): Promise winfo_rootx$($: {}): Promise /** * Return y coordinate of upper left corner of this widget on the * root window. */ winfo_rooty(): Promise winfo_rooty$($: {}): Promise /** * Return the screen name of this widget. */ winfo_screen(): Promise winfo_screen$($: {}): Promise /** * Return the number of the cells in the colormap of the screen * of this widget. */ winfo_screencells(): Promise winfo_screencells$($: {}): Promise /** * Return the number of bits per pixel of the root window of the * screen of this widget. */ winfo_screendepth(): Promise winfo_screendepth$($: {}): Promise /** * Return the number of pixels of the height of the screen of this widget * in pixel. */ winfo_screenheight(): Promise winfo_screenheight$($: {}): Promise /** * Return the number of pixels of the height of the screen of * this widget in mm. */ winfo_screenmmheight(): Promise winfo_screenmmheight$($: {}): Promise /** * Return the number of pixels of the width of the screen of * this widget in mm. */ winfo_screenmmwidth(): Promise winfo_screenmmwidth$($: {}): Promise /** * Return one of the strings directcolor, grayscale, pseudocolor, * staticcolor, staticgray, or truecolor for the default * colormodel of this screen. */ winfo_screenvisual(): Promise winfo_screenvisual$($: {}): Promise /** * Return the number of pixels of the width of the screen of * this widget in pixel. */ winfo_screenwidth(): Promise winfo_screenwidth$($: {}): Promise /** * Return information of the X-Server of the screen of this widget in * the form "XmajorRminor vendor vendorVersion". */ winfo_server(): Promise winfo_server$($: {}): Promise /** * Return the toplevel widget of this widget. */ winfo_toplevel(): Promise winfo_toplevel$($: {}): Promise /** * Return true if the widget and all its higher ancestors are mapped. */ winfo_viewable(): Promise winfo_viewable$($: {}): Promise /** * Return one of the strings directcolor, grayscale, pseudocolor, * staticcolor, staticgray, or truecolor for the * colormodel of this widget. */ winfo_visual(): Promise winfo_visual$($: {}): Promise /** * Return the X identifier for the visual for this widget. */ winfo_visualid(): Promise winfo_visualid$($: {}): Promise /** * Return a list of all visuals available for the screen * of this widget. * * Each item in the list consists of a visual name (see winfo_visual), a * depth and if includeids is true is given also the X identifier. */ winfo_visualsavailable(includeids?: boolean): Promise winfo_visualsavailable$({ includeids }: { includeids?}): Promise /** * Return the height of the virtual root window associated with this * widget in pixels. If there is no virtual root window return the * height of the screen. */ winfo_vrootheight(): Promise winfo_vrootheight$($: {}): Promise /** * Return the width of the virtual root window associated with this * widget in pixel. If there is no virtual root window return the * width of the screen. */ winfo_vrootwidth(): Promise winfo_vrootwidth$($: {}): Promise /** * Return the x offset of the virtual root relative to the root * window of the screen of this widget. */ winfo_vrootx(): Promise winfo_vrootx$($: {}): Promise /** * Return the y offset of the virtual root relative to the root * window of the screen of this widget. */ winfo_vrooty(): Promise winfo_vrooty$($: {}): Promise /** * Return the width of this widget. */ winfo_width(): Promise winfo_width$($: {}): Promise /** * Return the x coordinate of the upper left corner of this widget * in the parent. */ winfo_x(): Promise winfo_x$($: {}): Promise /** * Return the y coordinate of the upper left corner of this widget * in the parent. */ winfo_y(): Promise winfo_y$($: {}): Promise /** * Enter event loop until all pending events have been processed by Tcl. */ update(): Promise update$($: {}): Promise /** * Enter event loop until all idle callbacks have been called. This * will update the display of windows but not process events caused by * the user. */ update_idletasks(): Promise update_idletasks$($: {}): Promise /** * Set or get the list of bindtags for this widget. * * With no argument return the list of all bindtags associated with * this widget. With a list of strings as argument the bindtags are * set to this list. The bindtags determine in which order events are * processed (see bind). */ bindtags(tagList?): Promise bindtags$({ tagList }: { tagList?}): Promise /** * Bind to this widget at event SEQUENCE a call to function FUNC. * * SEQUENCE is a string of concatenated event * patterns. An event pattern is of the form * where MODIFIER is one * of Control, Mod2, M2, Shift, Mod3, M3, Lock, Mod4, M4, * Button1, B1, Mod5, M5 Button2, B2, Meta, M, Button3, * B3, Alt, Button4, B4, Double, Button5, B5 Triple, * Mod1, M1. TYPE is one of Activate, Enter, Map, * ButtonPress, Button, Expose, Motion, ButtonRelease * FocusIn, MouseWheel, Circulate, FocusOut, Property, * Colormap, Gravity Reparent, Configure, KeyPress, Key, * Unmap, Deactivate, KeyRelease Visibility, Destroy, * Leave and DETAIL is the button number for ButtonPress, * ButtonRelease and DETAIL is the Keysym for KeyPress and * KeyRelease. Examples are * for pressing Control and mouse button 1 or * for pressing A and the Alt key (KeyPress can be omitted). * An event pattern can also be a virtual event of the form * <> where AString can be arbitrary. This * event can be generated by event_generate. * If events are concatenated they must appear shortly * after each other. * * FUNC will be called if the event sequence occurs with an * instance of Event as argument. If the return value of FUNC is * "break" no further bound function is invoked. * * An additional boolean parameter ADD specifies whether FUNC will * be called additionally to the other bound function or whether * it will replace the previous function. * * Bind will return an identifier to allow deletion of the bound function with * unbind without memory leak. * * If FUNC or SEQUENCE is omitted the bound function or list * of bound events are returned. */ bind(sequence?, func?, add?): Promise bind$({ sequence, func, add }: { sequence?, func?, add?}): Promise /** * Unbind for this widget for event SEQUENCE the * function identified with FUNCID. */ unbind(sequence, funcid?): Promise unbind$({ sequence, funcid }: { sequence, funcid?}): Promise /** * Bind to all widgets at an event SEQUENCE a call to function FUNC. * An additional boolean parameter ADD specifies whether FUNC will * be called additionally to the other bound function or whether * it will replace the previous function. See bind for the return value. */ bind_all(sequence?, func?, add?): Promise bind_all$({ sequence, func, add }: { sequence?, func?, add?}): Promise /** * Unbind for all widgets for event SEQUENCE all functions. */ unbind_all(sequence): Promise unbind_all$({ sequence }): Promise /** * Bind to widgets with bindtag CLASSNAME at event * SEQUENCE a call of function FUNC. An additional * boolean parameter ADD specifies whether FUNC will be * called additionally to the other bound function or * whether it will replace the previous function. See bind for * the return value. */ bind_class(className, sequence?, func?, add?): Promise bind_class$({ className, sequence, func, add }: { className, sequence?, func?, add?}): Promise /** * Unbind for all widgets with bindtag CLASSNAME for event SEQUENCE * all functions. */ unbind_class(className, sequence): Promise unbind_class$({ className, sequence }): Promise /** * Call the mainloop of Tk. */ mainloop(n?): Promise mainloop$({ n }: { n?}): Promise /** * Quit the Tcl interpreter. All widgets will be destroyed. */ quit(): Promise quit$($: {}): Promise /** * Return the Tkinter instance of a widget identified by * its Tcl name NAME. */ nametowidget(name): Promise nametowidget$({ name }): Promise /** * Configure resources of a widget. * * The values for resources are specified as keyword * arguments. To get an overview about * the allowed keyword arguments call the method keys. * */ configure(cnf?): Promise configure$({ cnf }: { cnf?}): Promise /** * Return the resource value for a KEY given as string. */ cget(key): Promise cget$({ key }): Promise /** * Return a list of all resource names of this widget. */ keys(): Promise keys$($: {}): Promise /** * Set or get the status for propagation of geometry information. * * A boolean argument specifies whether the geometry information * of the slaves will determine the size of this widget. If no argument * is given the current setting will be returned. * */ pack_propagate(flag?): Promise pack_propagate$({ flag }: { flag?}): Promise /** * Return a list of all slaves of this widget * in its packing order. */ pack_slaves(): Promise pack_slaves$($: {}): Promise /** * Return a list of all slaves of this widget * in its packing order. */ place_slaves(): Promise place_slaves$($: {}): Promise /** * The anchor value controls how to place the grid within the * master when no row/column has any weight. * * The default anchor is nw. */ grid_anchor(anchor?): Promise grid_anchor$({ anchor }: { anchor?}): Promise /** * Return a tuple of integer coordinates for the bounding * box of this widget controlled by the geometry manager grid. * * If COLUMN, ROW is given the bounding box applies from * the cell with row and column 0 to the specified * cell. If COL2 and ROW2 are given the bounding box * starts at that cell. * * The returned integers specify the offset of the upper left * corner in the master widget and the width and height. * */ grid_bbox(column?, row?, col2?, row2?): Promise grid_bbox$({ column, row, col2, row2 }: { column?, row?, col2?, row2?}): Promise /** * Configure column INDEX of a grid. * * Valid resources are minsize (minimum size of the column), * weight (how much does additional space propagate to this column) * and pad (how much space to let additionally). */ grid_columnconfigure(index, cnf?): Promise grid_columnconfigure$({ index, cnf }: { index, cnf?}): Promise /** * Return a tuple of column and row which identify the cell * at which the pixel at position X and Y inside the master * widget is located. */ grid_location(x, y): Promise grid_location$({ x, y }): Promise /** * Set or get the status for propagation of geometry information. * * A boolean argument specifies whether the geometry information * of the slaves will determine the size of this widget. If no argument * is given, the current setting will be returned. * */ grid_propagate(flag?): Promise grid_propagate$({ flag }: { flag?}): Promise /** * Configure row INDEX of a grid. * * Valid resources are minsize (minimum size of the row), * weight (how much does additional space propagate to this row) * and pad (how much space to let additionally). */ grid_rowconfigure(index, cnf?): Promise grid_rowconfigure$({ index, cnf }: { index, cnf?}): Promise /** * Return a tuple of the number of column and rows in the grid. */ grid_size(): Promise grid_size$($: {}): Promise /** * Return a list of all slaves of this widget * in its packing order. */ grid_slaves(row?, column?): Promise grid_slaves$({ row, column }: { row?, column?}): Promise /** * Bind a virtual event VIRTUAL (of the form <>) * to an event SEQUENCE such that the virtual event is triggered * whenever SEQUENCE occurs. */ event_add(virtual): Promise event_add$({ virtual }): Promise /** * Unbind a virtual event VIRTUAL from SEQUENCE. */ event_delete(virtual): Promise event_delete$({ virtual }): Promise /** * Generate an event SEQUENCE. Additional * keyword arguments specify parameter of the event * (e.g. x, y, rootx, rooty). */ event_generate(sequence): Promise event_generate$({ sequence }): Promise /** * Return a list of all virtual events or the information * about the SEQUENCE bound to the virtual event VIRTUAL. */ event_info(virtual?): Promise event_info$({ virtual }: { virtual?}): Promise /** * Return a list of all existing image names. */ image_names(): Promise image_names$($: {}): Promise /** * Return a list of all available image types (e.g. photo bitmap). */ image_types(): Promise image_types$($: {}): Promise waitvar focus lift register config propagate slaves anchor bbox columnconfigure rowconfigure size } /** * Internal class. Stores function to call when some user * defined Tcl function is called e.g. after an event occurred. */ /** * Store FUNC, SUBST and WIDGET as members. */ function CallWrapper(func, subst, widget): Promise function CallWrapper$({ func, subst, widget }): Promise interface ICallWrapper { } /** * Mix-in class for querying and changing the horizontal position * of a widget's window. */ interface IXView { /** * Query and change the horizontal position of the view. */ xview(): Promise xview$($: {}): Promise /** * Adjusts the view in the window so that FRACTION of the * total width of the canvas is off-screen to the left. */ xview_moveto(fraction): Promise xview_moveto$({ fraction }): Promise /** * Shift the x-view according to NUMBER which is measured in "units" * or "pages" (WHAT). */ xview_scroll(number, what): Promise xview_scroll$({ number, what }): Promise } /** * Mix-in class for querying and changing the vertical position * of a widget's window. */ interface IYView { /** * Query and change the vertical position of the view. */ yview(): Promise yview$($: {}): Promise /** * Adjusts the view in the window so that FRACTION of the * total height of the canvas is off-screen to the top. */ yview_moveto(fraction): Promise yview_moveto$({ fraction }): Promise /** * Shift the y-view according to NUMBER which is measured in * "units" or "pages" (WHAT). */ yview_scroll(number, what): Promise yview_scroll$({ number, what }): Promise } /** * Provides functions for the communication with the window manager. */ interface IWm { /** * Instruct the window manager to set the aspect ratio (width/height) * of this widget to be between MINNUMER/MINDENOM and MAXNUMER/MAXDENOM. Return a tuple * of the actual values if no argument is given. */ wm_aspect(minNumer?, minDenom?, maxNumer?, maxDenom?): Promise wm_aspect$({ minNumer, minDenom, maxNumer, maxDenom }: { minNumer?, minDenom?, maxNumer?, maxDenom?}): Promise /** * This subcommand returns or sets platform specific attributes * * The first form returns a list of the platform specific flags and * their values. The second form returns the value for the specific * option. The third form sets one or more of the values. The values * are as follows: * * On Windows, -disabled gets or sets whether the window is in a * disabled state. -toolwindow gets or sets the style of the window * to toolwindow (as defined in the MSDN). -topmost gets or sets * whether this is a topmost window (displays above all other * windows). * * On Macintosh, XXXXX * * On Unix, there are currently no special attribute values. * */ wm_attributes(): Promise wm_attributes$($: {}): Promise /** * Store NAME in WM_CLIENT_MACHINE property of this widget. Return * current value. */ wm_client(name?): Promise wm_client$({ name }: { name?}): Promise /** * Store list of window names (WLIST) into WM_COLORMAPWINDOWS property * of this widget. This list contains windows whose colormaps differ from their * parents. Return current list of widgets if WLIST is empty. */ wm_colormapwindows(): Promise wm_colormapwindows$($: {}): Promise /** * Store VALUE in WM_COMMAND property. It is the command * which shall be used to invoke the application. Return current * command if VALUE is None. */ wm_command(value?): Promise wm_command$({ value }: { value?}): Promise /** * Deiconify this widget. If it was never mapped it will not be mapped. * On Windows it will raise this widget and give it the focus. */ wm_deiconify(): Promise wm_deiconify$($: {}): Promise /** * Set focus model to MODEL. "active" means that this widget will claim * the focus itself, "passive" means that the window manager shall give * the focus. Return current focus model if MODEL is None. */ wm_focusmodel(model?): Promise wm_focusmodel$({ model }: { model?}): Promise /** * The window will be unmapped from the screen and will no longer * be managed by wm. toplevel windows will be treated like frame * windows once they are no longer managed by wm, however, the menu * option configuration will be remembered and the menus will return * once the widget is managed again. */ wm_forget(window): Promise wm_forget$({ window }): Promise /** * Return identifier for decorative frame of this widget if present. */ wm_frame(): Promise wm_frame$($: {}): Promise /** * Set geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return * current value if None is given. */ wm_geometry(newGeometry?): Promise wm_geometry$({ newGeometry }: { newGeometry?}): Promise /** * Instruct the window manager that this widget shall only be * resized on grid boundaries. WIDTHINC and HEIGHTINC are the width and * height of a grid unit in pixels. BASEWIDTH and BASEHEIGHT are the * number of grid units requested in Tk_GeometryRequest. */ wm_grid(baseWidth?, baseHeight?, widthInc?, heightInc?): Promise wm_grid$({ baseWidth, baseHeight, widthInc, heightInc }: { baseWidth?, baseHeight?, widthInc?, heightInc?}): Promise /** * Set the group leader widgets for related widgets to PATHNAME. Return * the group leader of this widget if None is given. */ wm_group(pathName?): Promise wm_group$({ pathName }: { pathName?}): Promise /** * Set bitmap for the iconified widget to BITMAP. Return * the bitmap if None is given. * * Under Windows, the DEFAULT parameter can be used to set the icon * for the widget and any descendents that don't have an icon set * explicitly. DEFAULT can be the relative path to a .ico file * (example: root.iconbitmap(default='myicon.ico') ). See Tk * documentation for more information. */ wm_iconbitmap(bitmap?, def?): Promise wm_iconbitmap$({ bitmap, def }: { bitmap?, def?}): Promise /** * Display widget as icon. */ wm_iconify(): Promise wm_iconify$($: {}): Promise /** * Set mask for the icon bitmap of this widget. Return the * mask if None is given. */ wm_iconmask(bitmap?): Promise wm_iconmask$({ bitmap }: { bitmap?}): Promise /** * Set the name of the icon for this widget. Return the name if * None is given. */ wm_iconname(newName?): Promise wm_iconname$({ newName }: { newName?}): Promise /** * Sets the titlebar icon for this window based on the named photo * images passed through args. If default is True, this is applied to * all future created toplevels as well. * * The data in the images is taken as a snapshot at the time of * invocation. If the images are later changed, this is not reflected * to the titlebar icons. Multiple images are accepted to allow * different images sizes to be provided. The window manager may scale * provided icons to an appropriate size. * * On Windows, the images are packed into a Windows icon structure. * This will override an icon specified to wm_iconbitmap, and vice * versa. * * On X, the images are arranged into the _NET_WM_ICON X property, * which most modern window managers support. An icon specified by * wm_iconbitmap may exist simultaneously. * * On Macintosh, this currently does nothing. */ wm_iconphoto(def?: boolean): Promise wm_iconphoto$({ def }: { def?}): Promise /** * Set the position of the icon of this widget to X and Y. Return * a tuple of the current values of X and X if None is given. */ wm_iconposition(x?, y?): Promise wm_iconposition$({ x, y }: { x?, y?}): Promise /** * Set widget PATHNAME to be displayed instead of icon. Return the current * value if None is given. */ wm_iconwindow(pathName?): Promise wm_iconwindow$({ pathName }: { pathName?}): Promise /** * The widget specified will become a stand alone top-level window. * The window will be decorated with the window managers title bar, * etc. */ wm_manage(widget): Promise wm_manage$({ widget }): Promise /** * Set max WIDTH and HEIGHT for this widget. If the window is gridded * the values are given in grid units. Return the current values if None * is given. */ wm_maxsize(width?, height?): Promise wm_maxsize$({ width, height }: { width?, height?}): Promise /** * Set min WIDTH and HEIGHT for this widget. If the window is gridded * the values are given in grid units. Return the current values if None * is given. */ wm_minsize(width?, height?): Promise wm_minsize$({ width, height }: { width?, height?}): Promise /** * Instruct the window manager to ignore this widget * if BOOLEAN is given with 1. Return the current value if None * is given. */ wm_overrideredirect(boolean?): Promise wm_overrideredirect$({ boolean }: { boolean?}): Promise /** * Instruct the window manager that the position of this widget shall * be defined by the user if WHO is "user", and by its own policy if WHO is * "program". */ wm_positionfrom(who?): Promise wm_positionfrom$({ who }: { who?}): Promise /** * Bind function FUNC to command NAME for this widget. * Return the function bound to NAME if None is given. NAME could be * e.g. "WM_SAVE_YOURSELF" or "WM_DELETE_WINDOW". */ wm_protocol(name?, func?): Promise wm_protocol$({ name, func }: { name?, func?}): Promise /** * Instruct the window manager whether this width can be resized * in WIDTH or HEIGHT. Both values are boolean values. */ wm_resizable(width?, height?): Promise wm_resizable$({ width, height }: { width?, height?}): Promise /** * Instruct the window manager that the size of this widget shall * be defined by the user if WHO is "user", and by its own policy if WHO is * "program". */ wm_sizefrom(who?): Promise wm_sizefrom$({ who }: { who?}): Promise /** * Query or set the state of this widget as one of normal, icon, * iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only). */ wm_state(newstate?): Promise wm_state$({ newstate }: { newstate?}): Promise /** * Set the title of this widget. */ wm_title(string?): Promise wm_title$({ string }: { string?}): Promise /** * Instruct the window manager that this widget is transient * with regard to widget MASTER. */ wm_transient(master?): Promise wm_transient$({ master }: { master?}): Promise /** * Withdraw this widget from the screen such that it is unmapped * and forgotten by the window manager. Re-draw it with wm_deiconify. */ wm_withdraw(): Promise wm_withdraw$($: {}): Promise aspect attributes client colormapwindows command deiconify focusmodel forget frame geometry grid group iconbitmap iconify iconmask iconname iconphoto iconposition iconwindow manage maxsize minsize overrideredirect positionfrom protocol resizable sizefrom state title transient withdraw } /** * Toplevel widget of Tk which represents mostly the main window * of an application. It has an associated Tcl interpreter. */ /** * Return a new Toplevel widget on screen SCREENNAME. A new Tcl interpreter will * be created. BASENAME will be used for the identification of the profile file (see * readprofile). * It is constructed from sys.argv[0] without extensions if None is given. CLASSNAME * is the name of the widget class. */ function Tk(screenName?, baseName?, className?, useTk?: boolean, sync?: boolean, use?): Promise function Tk$({ screenName, baseName, className, useTk, sync, use }: { screenName?, baseName?, className?, useTk?, sync?, use?}): Promise interface ITk extends IMisc, IWm { loadtk(): Promise loadtk$($: {}): Promise /** * Destroy this and all descendants widgets. This will * end the application of this Tcl interpreter. */ destroy(): Promise destroy$($: {}): Promise /** * Internal function. It reads BASENAME.tcl and CLASSNAME.tcl into * the Tcl Interpreter and calls exec on the contents of BASENAME.py and * CLASSNAME.py if such a file exists in the home directory. */ readprofile(baseName, className): Promise readprofile$({ baseName, className }): Promise /** * Report callback exception on sys.stderr. * * Applications may want to override this internal function, and * should when sys.stderr is None. */ report_callback_exception(exc, val, tb): Promise report_callback_exception$({ exc, val, tb }): Promise } /** * Geometry manager Pack. * * Base class to use the methods pack_* in every widget. */ interface IPack { /** * Pack a widget in the parent widget. Use as options: * after=widget - pack it after you have packed widget * anchor=NSEW (or subset) - position widget according to * given direction * before=widget - pack it before you will pack widget * expand=bool - expand widget if parent size grows * fill=NONE or X or Y or BOTH - fill widget if widget grows * in=master - use master to contain this widget * in_=master - see 'in' option description * ipadx=amount - add internal padding in x direction * ipady=amount - add internal padding in y direction * padx=amount - add padding in x direction * pady=amount - add padding in y direction * side=TOP or BOTTOM or LEFT or RIGHT - where to add this widget. * */ pack_configure(cnf?): Promise pack_configure$({ cnf }: { cnf?}): Promise /** * Unmap this widget and do not use it for the packing order. */ pack_forget(): Promise pack_forget$($: {}): Promise /** * Return information about the packing options * for this widget. */ pack_info(): Promise pack_info$($: {}): Promise pack info } /** * Geometry manager Place. * * Base class to use the methods place_* in every widget. */ interface IPlace { /** * Place a widget in the parent widget. Use as options: * in=master - master relative to which the widget is placed * in_=master - see 'in' option description * x=amount - locate anchor of this widget at position x of master * y=amount - locate anchor of this widget at position y of master * relx=amount - locate anchor of this widget between 0.0 and 1.0 * relative to width of master (1.0 is right edge) * rely=amount - locate anchor of this widget between 0.0 and 1.0 * relative to height of master (1.0 is bottom edge) * anchor=NSEW (or subset) - position anchor according to given direction * width=amount - width of this widget in pixel * height=amount - height of this widget in pixel * relwidth=amount - width of this widget between 0.0 and 1.0 * relative to width of master (1.0 is the same width * as the master) * relheight=amount - height of this widget between 0.0 and 1.0 * relative to height of master (1.0 is the same * height as the master) * bordermode="inside" or "outside" - whether to take border width of * master widget into account * */ place_configure(cnf?): Promise place_configure$({ cnf }: { cnf?}): Promise /** * Unmap this widget. */ place_forget(): Promise place_forget$($: {}): Promise /** * Return information about the placing options * for this widget. */ place_info(): Promise place_info$($: {}): Promise place } /** * Geometry manager Grid. * * Base class to use the methods grid_* in every widget. */ interface IGrid { /** * Position a widget in the parent widget in a grid. Use as options: * column=number - use cell identified with given column (starting with 0) * columnspan=number - this widget will span several columns * in=master - use master to contain this widget * in_=master - see 'in' option description * ipadx=amount - add internal padding in x direction * ipady=amount - add internal padding in y direction * padx=amount - add padding in x direction * pady=amount - add padding in y direction * row=number - use cell identified with given row (starting with 0) * rowspan=number - this widget will span several rows * sticky=NSEW - if cell is larger on which sides will this * widget stick to the cell boundary * */ grid_configure(cnf?): Promise grid_configure$({ cnf }: { cnf?}): Promise /** * Unmap this widget. */ grid_forget(): Promise grid_forget$($: {}): Promise /** * Unmap this widget but remember the grid options. */ grid_remove(): Promise grid_remove$($: {}): Promise /** * Return information about the options * for positioning this widget in a grid. */ grid_info(): Promise grid_info$($: {}): Promise location } /** * Internal class. */ /** * Construct a widget with the parent widget MASTER, a name WIDGETNAME * and appropriate options. */ function BaseWidget(master, widgetName, cnf?, kw?, extra?): Promise function BaseWidget$({ master, widgetName, cnf, kw, extra }: { master, widgetName, cnf?, kw?, extra?}): Promise interface IBaseWidget extends IMisc { /** * Destroy this and all descendants widgets. */ destroy(): Promise destroy$($: {}): Promise } /** * Internal class. * * Base class for a widget which can be positioned with the geometry managers * Pack, Place or Grid. */ interface IWidget extends IBaseWidget, IPack, IPlace, IGrid { } /** * Toplevel widget, e.g. for dialogs. */ /** * Construct a toplevel widget with the parent MASTER. * * Valid resource names: background, bd, bg, borderwidth, class, * colormap, container, cursor, height, highlightbackground, * highlightcolor, highlightthickness, menu, relief, screen, takefocus, * use, visual, width. */ function Toplevel(master?, cnf?): Promise function Toplevel$({ master, cnf }: { master?, cnf?}): Promise interface IToplevel extends IBaseWidget, IWm { } /** * Button widget. */ /** * Construct a button widget with the parent MASTER. * * STANDARD OPTIONS * * activebackground, activeforeground, anchor, * background, bitmap, borderwidth, cursor, * disabledforeground, font, foreground * highlightbackground, highlightcolor, * highlightthickness, image, justify, * padx, pady, relief, repeatdelay, * repeatinterval, takefocus, text, * textvariable, underline, wraplength * * WIDGET-SPECIFIC OPTIONS * * command, compound, default, height, * overrelief, state, width * */ function Button(master?, cnf?): Promise function Button$({ master, cnf }: { master?, cnf?}): Promise interface IButton extends IWidget { /** * Flash the button. * * This is accomplished by redisplaying * the button several times, alternating between active and * normal colors. At the end of the flash the button is left * in the same normal/active state as when the command was * invoked. This command is ignored if the button's state is * disabled. * */ flash(): Promise flash$($: {}): Promise /** * Invoke the command associated with the button. * * The return value is the return value from the command, * or an empty string if there is no command associated with * the button. This command is ignored if the button's state * is disabled. * */ invoke(): Promise invoke$($: {}): Promise } /** * Canvas widget to display graphical elements like lines or text. */ /** * Construct a canvas widget with the parent MASTER. * * Valid resource names: background, bd, bg, borderwidth, closeenough, * confine, cursor, height, highlightbackground, highlightcolor, * highlightthickness, insertbackground, insertborderwidth, * insertofftime, insertontime, insertwidth, offset, relief, * scrollregion, selectbackground, selectborderwidth, selectforeground, * state, takefocus, width, xscrollcommand, xscrollincrement, * yscrollcommand, yscrollincrement. */ function Canvas(master?, cnf?): Promise function Canvas$({ master, cnf }: { master?, cnf?}): Promise interface ICanvas extends IWidget, IXView, IYView { /** * Internal function. */ addtag(): Promise addtag$($: {}): Promise /** * Add tag NEWTAG to all items above TAGORID. */ addtag_above(newtag, tagOrId): Promise addtag_above$({ newtag, tagOrId }): Promise /** * Add tag NEWTAG to all items. */ addtag_all(newtag): Promise addtag_all$({ newtag }): Promise /** * Add tag NEWTAG to all items below TAGORID. */ addtag_below(newtag, tagOrId): Promise addtag_below$({ newtag, tagOrId }): Promise /** * Add tag NEWTAG to item which is closest to pixel at X, Y. * If several match take the top-most. * All items closer than HALO are considered overlapping (all are * closests). If START is specified the next below this tag is taken. */ addtag_closest(newtag, x, y, halo?, start?): Promise addtag_closest$({ newtag, x, y, halo, start }: { newtag, x, y, halo?, start?}): Promise /** * Add tag NEWTAG to all items in the rectangle defined * by X1,Y1,X2,Y2. */ addtag_enclosed(newtag, x1, y1, x2, y2): Promise addtag_enclosed$({ newtag, x1, y1, x2, y2 }): Promise /** * Add tag NEWTAG to all items which overlap the rectangle * defined by X1,Y1,X2,Y2. */ addtag_overlapping(newtag, x1, y1, x2, y2): Promise addtag_overlapping$({ newtag, x1, y1, x2, y2 }): Promise /** * Add tag NEWTAG to all items with TAGORID. */ addtag_withtag(newtag, tagOrId): Promise addtag_withtag$({ newtag, tagOrId }): Promise /** * Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle * which encloses all items with tags specified as arguments. */ bbox(): Promise bbox$($: {}): Promise /** * Unbind for all items with TAGORID for event SEQUENCE the * function identified with FUNCID. */ tag_unbind(tagOrId, sequence, funcid?): Promise tag_unbind$({ tagOrId, sequence, funcid }: { tagOrId, sequence, funcid?}): Promise /** * Bind to all items with TAGORID at event SEQUENCE a call to function FUNC. * * An additional boolean parameter ADD specifies whether FUNC will be * called additionally to the other bound function or whether it will * replace the previous function. See bind for the return value. */ tag_bind(tagOrId, sequence?, func?, add?): Promise tag_bind$({ tagOrId, sequence, func, add }: { tagOrId, sequence?, func?, add?}): Promise /** * Return the canvas x coordinate of pixel position SCREENX rounded * to nearest multiple of GRIDSPACING units. */ canvasx(screenx, gridspacing?): Promise canvasx$({ screenx, gridspacing }: { screenx, gridspacing?}): Promise /** * Return the canvas y coordinate of pixel position SCREENY rounded * to nearest multiple of GRIDSPACING units. */ canvasy(screeny, gridspacing?): Promise canvasy$({ screeny, gridspacing }: { screeny, gridspacing?}): Promise /** * Return a list of coordinates for the item given in ARGS. */ coords(): Promise coords$($: {}): Promise /** * Create arc shaped region with coordinates x1,y1,x2,y2. */ create_arc(): Promise create_arc$($: {}): Promise /** * Create bitmap with coordinates x1,y1. */ create_bitmap(): Promise create_bitmap$($: {}): Promise /** * Create image item with coordinates x1,y1. */ create_image(): Promise create_image$($: {}): Promise /** * Create line with coordinates x1,y1,...,xn,yn. */ create_line(): Promise create_line$($: {}): Promise /** * Create oval with coordinates x1,y1,x2,y2. */ create_oval(): Promise create_oval$($: {}): Promise /** * Create polygon with coordinates x1,y1,...,xn,yn. */ create_polygon(): Promise create_polygon$($: {}): Promise /** * Create rectangle with coordinates x1,y1,x2,y2. */ create_rectangle(): Promise create_rectangle$($: {}): Promise /** * Create text with coordinates x1,y1. */ create_text(): Promise create_text$($: {}): Promise /** * Create window with coordinates x1,y1,x2,y2. */ create_window(): Promise create_window$($: {}): Promise /** * Delete characters of text items identified by tag or id in ARGS (possibly * several times) from FIRST to LAST character (including). */ dchars(): Promise dchars$($: {}): Promise /** * Delete items identified by all tag or ids contained in ARGS. */ delete(): Promise delete$($: {}): Promise /** * Delete tag or id given as last arguments in ARGS from items * identified by first argument in ARGS. */ dtag(): Promise dtag$($: {}): Promise /** * Internal function. */ find(): Promise find$($: {}): Promise /** * Return items above TAGORID. */ find_above(tagOrId): Promise find_above$({ tagOrId }): Promise /** * Return all items. */ find_all(): Promise find_all$($: {}): Promise /** * Return all items below TAGORID. */ find_below(tagOrId): Promise find_below$({ tagOrId }): Promise /** * Return item which is closest to pixel at X, Y. * If several match take the top-most. * All items closer than HALO are considered overlapping (all are * closest). If START is specified the next below this tag is taken. */ find_closest(x, y, halo?, start?): Promise find_closest$({ x, y, halo, start }: { x, y, halo?, start?}): Promise /** * Return all items in rectangle defined * by X1,Y1,X2,Y2. */ find_enclosed(x1, y1, x2, y2): Promise find_enclosed$({ x1, y1, x2, y2 }): Promise /** * Return all items which overlap the rectangle * defined by X1,Y1,X2,Y2. */ find_overlapping(x1, y1, x2, y2): Promise find_overlapping$({ x1, y1, x2, y2 }): Promise /** * Return all items with TAGORID. */ find_withtag(tagOrId): Promise find_withtag$({ tagOrId }): Promise /** * Set focus to the first item specified in ARGS. */ focus(): Promise focus$($: {}): Promise /** * Return tags associated with the first item specified in ARGS. */ gettags(): Promise gettags$($: {}): Promise /** * Set cursor at position POS in the item identified by TAGORID. * In ARGS TAGORID must be first. */ icursor(): Promise icursor$($: {}): Promise /** * Return position of cursor as integer in item specified in ARGS. */ index(): Promise index$($: {}): Promise /** * Insert TEXT in item TAGORID at position POS. ARGS must * be TAGORID POS TEXT. */ insert(): Promise insert$($: {}): Promise /** * Return the resource value for an OPTION for item TAGORID. */ itemcget(tagOrId, option): Promise itemcget$({ tagOrId, option }): Promise /** * Configure resources of an item TAGORID. * * The values for resources are specified as keyword * arguments. To get an overview about * the allowed keyword arguments call the method without arguments. * */ itemconfigure(tagOrId, cnf?): Promise itemconfigure$({ tagOrId, cnf }: { tagOrId, cnf?}): Promise /** * Lower an item TAGORID given in ARGS * (optional below another item). */ tag_lower(): Promise tag_lower$($: {}): Promise /** * Move an item TAGORID given in ARGS. */ move(): Promise move$($: {}): Promise /** * Move the items given by TAGORID in the canvas coordinate * space so that the first coordinate pair of the bottommost * item with tag TAGORID is located at position (X,Y). * X and Y may be the empty string, in which case the * corresponding coordinate will be unchanged. All items matching * TAGORID remain in the same positions relative to each other. */ moveto(tagOrId, x?, y?): Promise moveto$({ tagOrId, x, y }: { tagOrId, x?, y?}): Promise /** * Print the contents of the canvas to a postscript * file. Valid options: colormap, colormode, file, fontmap, * height, pageanchor, pageheight, pagewidth, pagex, pagey, * rotate, width, x, y. */ postscript(cnf?): Promise postscript$({ cnf }: { cnf?}): Promise /** * Raise an item TAGORID given in ARGS * (optional above another item). */ tag_raise(): Promise tag_raise$($: {}): Promise /** * Scale item TAGORID with XORIGIN, YORIGIN, XSCALE, YSCALE. */ scale(): Promise scale$($: {}): Promise /** * Remember the current X, Y coordinates. */ scan_mark(x, y): Promise scan_mark$({ x, y }): Promise /** * Adjust the view of the canvas to GAIN times the * difference between X and Y and the coordinates given in * scan_mark. */ scan_dragto(x, y, gain?): Promise scan_dragto$({ x, y, gain }: { x, y, gain?}): Promise /** * Adjust the end of the selection near the cursor of an item TAGORID to index. */ select_adjust(tagOrId, index): Promise select_adjust$({ tagOrId, index }): Promise /** * Clear the selection if it is in this widget. */ select_clear(): Promise select_clear$($: {}): Promise /** * Set the fixed end of a selection in item TAGORID to INDEX. */ select_from(tagOrId, index): Promise select_from$({ tagOrId, index }): Promise /** * Return the item which has the selection. */ select_item(): Promise select_item$($: {}): Promise /** * Set the variable end of a selection in item TAGORID to INDEX. */ select_to(tagOrId, index): Promise select_to$({ tagOrId, index }): Promise /** * Return the type of the item TAGORID. */ type(tagOrId): Promise type$({ tagOrId }): Promise itemconfig } /** * Checkbutton widget which is either in on- or off-state. */ /** * Construct a checkbutton widget with the parent MASTER. * * Valid resource names: activebackground, activeforeground, anchor, * background, bd, bg, bitmap, borderwidth, command, cursor, * disabledforeground, fg, font, foreground, height, * highlightbackground, highlightcolor, highlightthickness, image, * indicatoron, justify, offvalue, onvalue, padx, pady, relief, * selectcolor, selectimage, state, takefocus, text, textvariable, * underline, variable, width, wraplength. */ function Checkbutton(master?, cnf?): Promise function Checkbutton$({ master, cnf }: { master?, cnf?}): Promise interface ICheckbutton extends IWidget { /** * Put the button in off-state. */ deselect(): Promise deselect$($: {}): Promise /** * Flash the button. */ flash(): Promise flash$($: {}): Promise /** * Toggle the button and invoke a command if given as resource. */ invoke(): Promise invoke$($: {}): Promise /** * Put the button in on-state. */ select(): Promise select$($: {}): Promise /** * Toggle the button. */ toggle(): Promise toggle$($: {}): Promise } /** * Entry widget which allows displaying simple text. */ /** * Construct an entry widget with the parent MASTER. * * Valid resource names: background, bd, bg, borderwidth, cursor, * exportselection, fg, font, foreground, highlightbackground, * highlightcolor, highlightthickness, insertbackground, * insertborderwidth, insertofftime, insertontime, insertwidth, * invalidcommand, invcmd, justify, relief, selectbackground, * selectborderwidth, selectforeground, show, state, takefocus, * textvariable, validate, validatecommand, vcmd, width, * xscrollcommand. */ function Entry(master?, cnf?): Promise function Entry$({ master, cnf }: { master?, cnf?}): Promise interface IEntry extends IWidget, IXView { /** * Delete text from FIRST to LAST (not included). */ delete(first, last?): Promise delete$({ first, last }: { first, last?}): Promise /** * Return the text. */ get(): Promise get$($: {}): Promise /** * Insert cursor at INDEX. */ icursor(index): Promise icursor$({ index }): Promise /** * Return position of cursor. */ index(index): Promise index$({ index }): Promise /** * Insert STRING at INDEX. */ insert(index, string): Promise insert$({ index, string }): Promise /** * Remember the current X, Y coordinates. */ scan_mark(x): Promise scan_mark$({ x }): Promise /** * Adjust the view of the canvas to 10 times the * difference between X and Y and the coordinates given in * scan_mark. */ scan_dragto(x): Promise scan_dragto$({ x }): Promise /** * Adjust the end of the selection near the cursor to INDEX. */ selection_adjust(index): Promise selection_adjust$({ index }): Promise /** * Clear the selection if it is in this widget. */ selection_clear(): Promise selection_clear$($: {}): Promise /** * Set the fixed end of a selection to INDEX. */ selection_from(index): Promise selection_from$({ index }): Promise /** * Return True if there are characters selected in the entry, False * otherwise. */ selection_present(): Promise selection_present$($: {}): Promise /** * Set the selection from START to END (not included). */ selection_range(start, end): Promise selection_range$({ start, end }): Promise /** * Set the variable end of a selection to INDEX. */ selection_to(index): Promise selection_to$({ index }): Promise select_present select_range } /** * Frame widget which may contain other widgets and can have a 3D border. */ /** * Construct a frame widget with the parent MASTER. * * Valid resource names: background, bd, bg, borderwidth, class, * colormap, container, cursor, height, highlightbackground, * highlightcolor, highlightthickness, relief, takefocus, visual, width. */ function Frame(master?, cnf?): Promise