UNPKG

@react-gnome/gjs-esm-types

Version:

TypeScript module declarations for GJS ESM modules.

1,784 lines (1,753 loc) 499 kB
/* * Type Definitions for Gjs (https://gjs.guide/) * * These type definitions are automatically generated, do not edit them by hand. * If you found a bug fix it in ts-for-gir itself or create a bug report on https://github.com/gjsify/ts-for-gjs */ import type Gio from "gi://Gio?version=2.0"; import type GObject from "gi://GObject?version=2.0"; import type GLib from "gi://GLib?version=2.0"; declare module "gi://Soup?version=2.4" { /** * The supported address families. */ enum AddressFamily { /** * an invalid %SoupAddress */ INVALID, /** * an IPv4 address */ IPV4, /** * an IPv6 address */ IPV6, } enum CacheResponse { FRESH, NEEDS_VALIDATION, STALE, } /** * The type of cache; this affects what kinds of responses will be * saved. */ enum CacheType { /** * a single-user cache */ SINGLE_USER, /** * a shared cache */ SHARED, } enum ConnectionState { NEW, CONNECTING, IDLE, IN_USE, REMOTE_DISCONNECTED, DISCONNECTED, } /** * The policy for accepting or rejecting cookies returned in * responses. */ enum CookieJarAcceptPolicy { /** * accept all cookies unconditionally. */ ALWAYS, /** * reject all cookies unconditionally. */ NEVER, /** * accept all cookies set by * the main document loaded in the application using libsoup. An * example of the most common case, web browsers, would be: If * http://www.example.com is the page loaded, accept all cookies set * by example.com, but if a resource from http://www.third-party.com * is loaded from that page reject any cookie that it could try to * set. For libsoup to be able to tell apart first party cookies from * the rest, the application must call soup_message_set_first_party() * on each outgoing #SoupMessage, setting the #SoupURI of the main * document. If no first party is set in a message when this policy is * in effect, cookies will be assumed to be third party by default. */ NO_THIRD_PARTY, /** * accept all cookies * set by the main document loaded in the application using libsoup, and * from domains that have previously set at least one cookie when loaded * as the main document. An example of the most common case, web browsers, * would be: if http://www.example.com is the page loaded, accept all * cookies set by example.com, but if a resource from http://www.third-party.com * is loaded from that page, reject any cookie that it could try to * set unless it already has a cookie in the cookie jar. For libsoup to * be able to tell apart first party cookies from the rest, the * application must call soup_message_set_first_party() on each outgoing * #SoupMessage, setting the #SoupURI of the main document. If no first * party is set in a message when this policy is in effect, cookies will * be assumed to be third party by default. Since 2.72. */ GRANDFATHERED_THIRD_PARTY, } /** * Date formats that soup_date_to_string() can use. * * `SOUP_DATE_HTTP` and `SOUP_DATE_COOKIE` always coerce the time to * UTC. `SOUP_DATE_ISO8`601_XMLRPC uses the time as given, ignoring the * offset completely. `SOUP_DATE_RFC2`822 and the other ISO 8601 * variants use the local time, appending the offset information if * available. * * This enum may be extended with more values in future releases. */ enum DateFormat { /** * RFC 1123 format, used by the HTTP "Date" header. Eg * "Sun, 06 Nov 1994 08:49:37 GMT" */ HTTP, /** * The format for the "Expires" timestamp in the * Netscape cookie specification. Eg, "Sun, 06-Nov-1994 08:49:37 GMT". */ COOKIE, /** * RFC 2822 format, eg "Sun, 6 Nov 1994 09:49:37 -0100" */ RFC2822, /** * ISO 8601 date/time with no optional * punctuation. Eg, "19941106T094937-0100". */ ISO8601_COMPACT, /** * ISO 8601 date/time with all optional * punctuation. Eg, "1994-11-06T09:49:37-01:00". */ ISO8601_FULL, /** * An alias for `SOUP_DATE_ISO8`601_FULL. */ ISO8601, /** * ISO 8601 date/time as used by XML-RPC. * Eg, "19941106T09:49:37". */ ISO8601_XMLRPC, } /** * How a message body is encoded for transport */ enum Encoding { /** * unknown / error */ UNRECOGNIZED, /** * no body is present (which is not the same as a * 0-length body, and only occurs in certain places) */ NONE, /** * Content-Length encoding */ CONTENT_LENGTH, /** * Response body ends when the connection is closed */ EOF, /** * chunked encoding (currently only supported * for response) */ CHUNKED, /** * multipart/byteranges (Reserved for future * use: NOT CURRENTLY IMPLEMENTED) */ BYTERANGES, } /** * Indicates the HTTP protocol version being used. */ enum HTTPVersion { /** * HTTP 1.0 (RFC 1945) */ HTTP_1_0, /** * HTTP 1.1 (RFC 2616) */ HTTP_1_1, } enum KnownStatusCode { NONE, CANCELLED, CANT_RESOLVE, CANT_RESOLVE_PROXY, CANT_CONNECT, CANT_CONNECT_PROXY, SSL_FAILED, IO_ERROR, MALFORMED, TRY_AGAIN, TOO_MANY_REDIRECTS, TLS_FAILED, CONTINUE, SWITCHING_PROTOCOLS, PROCESSING, OK, CREATED, ACCEPTED, NON_AUTHORITATIVE, NO_CONTENT, RESET_CONTENT, PARTIAL_CONTENT, MULTI_STATUS, MULTIPLE_CHOICES, MOVED_PERMANENTLY, FOUND, MOVED_TEMPORARILY, SEE_OTHER, NOT_MODIFIED, USE_PROXY, NOT_APPEARING_IN_THIS_PROTOCOL, TEMPORARY_REDIRECT, BAD_REQUEST, UNAUTHORIZED, PAYMENT_REQUIRED, FORBIDDEN, NOT_FOUND, METHOD_NOT_ALLOWED, NOT_ACCEPTABLE, PROXY_AUTHENTICATION_REQUIRED, PROXY_UNAUTHORIZED, REQUEST_TIMEOUT, CONFLICT, GONE, LENGTH_REQUIRED, PRECONDITION_FAILED, REQUEST_ENTITY_TOO_LARGE, REQUEST_URI_TOO_LONG, UNSUPPORTED_MEDIA_TYPE, REQUESTED_RANGE_NOT_SATISFIABLE, INVALID_RANGE, EXPECTATION_FAILED, UNPROCESSABLE_ENTITY, LOCKED, FAILED_DEPENDENCY, INTERNAL_SERVER_ERROR, NOT_IMPLEMENTED, BAD_GATEWAY, SERVICE_UNAVAILABLE, GATEWAY_TIMEOUT, HTTP_VERSION_NOT_SUPPORTED, INSUFFICIENT_STORAGE, NOT_EXTENDED, } /** * Describes the level of logging output to provide. */ enum LoggerLogLevel { /** * No logging */ NONE, /** * Log the Request-Line or Status-Line and * the Soup-Debug pseudo-headers */ MINIMAL, /** * Log the full request/response headers */ HEADERS, /** * Log the full headers and request/response * bodies. */ BODY, } /** * Describes how #SoupBuffer should use the data passed in by the * caller. * * See also soup_buffer_new_with_owner(), which allows to you create a * buffer containing data which is owned by another object. */ enum MemoryUse { /** * The memory is statically allocated and * constant; libsoup can use the passed-in buffer directly and not * need to worry about it being modified or freed. */ STATIC, /** * The caller has allocated the memory for the * #SoupBuffer's use; libsoup will assume ownership of it and free it * (with g_free()) when it is done with it. */ TAKE, /** * The passed-in data belongs to the caller; the * #SoupBuffer will copy it into new memory, leaving the caller free * to reuse the original memory. */ COPY, /** * The passed-in data belongs to the caller, * but will remain valid for the lifetime of the #SoupBuffer. The * difference between this and `SOUP_MEMORY_STATIC` is that if you copy * a `SOUP_MEMORY_TEMPORARY` buffer, it will make a copy of the memory * as well, rather than reusing the original memory. */ TEMPORARY, } /** * Value passed to soup_message_headers_new() to set certain default * behaviors. */ enum MessageHeadersType { /** * request headers */ REQUEST, /** * response headers */ RESPONSE, /** * multipart body part headers */ MULTIPART, } /** * Priorities that can be set on a #SoupMessage to instruct the * message queue to process it before any other message with lower * priority. */ enum MessagePriority { /** * The lowest priority, the messages * with this priority will be the last ones to be attended. */ VERY_LOW, /** * Use this for low priority messages, a * #SoupMessage with the default priority will be processed first. */ LOW, /** * The default priotity, this is the * priority assigned to the #SoupMessage by default. */ NORMAL, /** * High priority, a #SoupMessage with * this priority will be processed before the ones with the default * priority. */ HIGH, /** * The highest priority, use this * for very urgent #SoupMessage as they will be the first ones to be * attended. */ VERY_HIGH, } /** * A #SoupRequest error. */ enum RequestError { /** * the URI could not be parsed */ BAD_URI, /** * the URI scheme is not * supported by this #SoupSession */ UNSUPPORTED_URI_SCHEME, /** * the server's response could not * be parsed */ PARSING, /** * the server's response was in an * unsupported format */ ENCODING, } enum RequesterError { BAD_URI, UNSUPPORTED_URI_SCHEME, } enum SameSitePolicy { /** * The cookie is exposed with both cross-site and same-site requests */ NONE, /** * The cookie is withheld on cross-site requests but exposed on cross-site navigations */ LAX, /** * The cookie is only exposed for same-site requests */ STRICT, } /** * Return value from the #SoupSocket IO methods. */ enum SocketIOStatus { /** * Success */ OK, /** * Cannot read/write any more at this time */ WOULD_BLOCK, /** * End of file */ EOF, /** * Other error */ ERROR, } /** * These represent the known HTTP status code values, plus various * network and internal errors. * * Note that no libsoup functions take or return this type directly; * any function that works with status codes will accept unrecognized * status codes as well. * * Prior to 2.44 this type was called * <literal>SoupKnownStatusCode</literal>, but the individual values * have always had the names they have now. */ enum Status { /** * No status available. (Eg, the message has not * been sent yet) */ NONE, /** * Message was cancelled locally */ CANCELLED, /** * Unable to resolve destination host name */ CANT_RESOLVE, /** * Unable to resolve proxy host name */ CANT_RESOLVE_PROXY, /** * Unable to connect to remote host */ CANT_CONNECT, /** * Unable to connect to proxy */ CANT_CONNECT_PROXY, /** * SSL/TLS negotiation failed */ SSL_FAILED, /** * A network error occurred, or the other end * closed the connection unexpectedly */ IO_ERROR, /** * Malformed data (usually a programmer error) */ MALFORMED, /** * Used internally */ TRY_AGAIN, /** * There were too many redirections */ TOO_MANY_REDIRECTS, /** * Used internally */ TLS_FAILED, /** * 100 Continue (HTTP) */ CONTINUE, /** * 101 Switching Protocols (HTTP) */ SWITCHING_PROTOCOLS, /** * 102 Processing (WebDAV) */ PROCESSING, /** * 200 Success (HTTP). Also used by many lower-level * soup routines to indicate success. */ OK, /** * 201 Created (HTTP) */ CREATED, /** * 202 Accepted (HTTP) */ ACCEPTED, /** * 203 Non-Authoritative Information * (HTTP) */ NON_AUTHORITATIVE, /** * 204 No Content (HTTP) */ NO_CONTENT, /** * 205 Reset Content (HTTP) */ RESET_CONTENT, /** * 206 Partial Content (HTTP) */ PARTIAL_CONTENT, /** * 207 Multi-Status (WebDAV) */ MULTI_STATUS, /** * 300 Multiple Choices (HTTP) */ MULTIPLE_CHOICES, /** * 301 Moved Permanently (HTTP) */ MOVED_PERMANENTLY, /** * 302 Found (HTTP) */ FOUND, /** * 302 Moved Temporarily (old name, * RFC 2068) */ MOVED_TEMPORARILY, /** * 303 See Other (HTTP) */ SEE_OTHER, /** * 304 Not Modified (HTTP) */ NOT_MODIFIED, /** * 305 Use Proxy (HTTP) */ USE_PROXY, /** * 306 [Unused] (HTTP) */ NOT_APPEARING_IN_THIS_PROTOCOL, /** * 307 Temporary Redirect (HTTP) */ TEMPORARY_REDIRECT, PERMANENT_REDIRECT, /** * 400 Bad Request (HTTP) */ BAD_REQUEST, /** * 401 Unauthorized (HTTP) */ UNAUTHORIZED, /** * 402 Payment Required (HTTP) */ PAYMENT_REQUIRED, /** * 403 Forbidden (HTTP) */ FORBIDDEN, /** * 404 Not Found (HTTP) */ NOT_FOUND, /** * 405 Method Not Allowed (HTTP) */ METHOD_NOT_ALLOWED, /** * 406 Not Acceptable (HTTP) */ NOT_ACCEPTABLE, /** * 407 Proxy Authentication * Required (HTTP) */ PROXY_AUTHENTICATION_REQUIRED, /** * shorter alias for * %SOUP_STATUS_PROXY_AUTHENTICATION_REQUIRED */ PROXY_UNAUTHORIZED, /** * 408 Request Timeout (HTTP) */ REQUEST_TIMEOUT, /** * 409 Conflict (HTTP) */ CONFLICT, /** * 410 Gone (HTTP) */ GONE, /** * 411 Length Required (HTTP) */ LENGTH_REQUIRED, /** * 412 Precondition Failed (HTTP) */ PRECONDITION_FAILED, /** * 413 Request Entity Too Large * (HTTP) */ REQUEST_ENTITY_TOO_LARGE, /** * 414 Request-URI Too Long (HTTP) */ REQUEST_URI_TOO_LONG, /** * 415 Unsupported Media Type * (HTTP) */ UNSUPPORTED_MEDIA_TYPE, /** * 416 Requested Range * Not Satisfiable (HTTP) */ REQUESTED_RANGE_NOT_SATISFIABLE, /** * shorter alias for * %SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE */ INVALID_RANGE, /** * 417 Expectation Failed (HTTP) */ EXPECTATION_FAILED, /** * 422 Unprocessable Entity * (WebDAV) */ UNPROCESSABLE_ENTITY, /** * 423 Locked (WebDAV) */ LOCKED, /** * 424 Failed Dependency (WebDAV) */ FAILED_DEPENDENCY, /** * 500 Internal Server Error * (HTTP) */ INTERNAL_SERVER_ERROR, /** * 501 Not Implemented (HTTP) */ NOT_IMPLEMENTED, /** * 502 Bad Gateway (HTTP) */ BAD_GATEWAY, /** * 503 Service Unavailable (HTTP) */ SERVICE_UNAVAILABLE, /** * 504 Gateway Timeout (HTTP) */ GATEWAY_TIMEOUT, /** * 505 HTTP Version Not * Supported (HTTP) */ HTTP_VERSION_NOT_SUPPORTED, /** * 507 Insufficient Storage * (WebDAV) */ INSUFFICIENT_STORAGE, /** * 510 Not Extended (RFC 2774) */ NOT_EXTENDED, } /** * Error codes for %SOUP_TLD_ERROR. */ enum TLDError { /** * A hostname was syntactically * invalid. */ INVALID_HOSTNAME, /** * The passed-in "hostname" was * actually an IP address (and thus has no base domain or * public suffix). */ IS_IP_ADDRESS, /** * The passed-in hostname * did not have enough components. Eg, calling * soup_tld_get_base_domain() on <literal>"co.uk"</literal>. */ NOT_ENOUGH_DOMAINS, /** * The passed-in hostname has * no recognized public suffix. */ NO_BASE_DOMAIN, NO_PSL_DATA, } /** * Pre-defined close codes that can be passed to * soup_websocket_connection_close() or received from * soup_websocket_connection_get_close_code(). (However, other codes * are also allowed.) */ enum WebsocketCloseCode { /** * a normal, non-error close */ NORMAL, /** * the client/server is going away */ GOING_AWAY, /** * a protocol error occurred */ PROTOCOL_ERROR, /** * the endpoint received data * of a type that it does not support. */ UNSUPPORTED_DATA, /** * reserved value indicating that * no close code was present; must not be sent. */ NO_STATUS, /** * reserved value indicating that * the connection was closed abnormally; must not be sent. */ ABNORMAL, /** * the endpoint received data that * was invalid (eg, non-UTF-8 data in a text message). */ BAD_DATA, /** * generic error code * indicating some sort of policy violation. */ POLICY_VIOLATION, /** * the endpoint received a message * that is too big to process. */ TOO_BIG, /** * the client is closing the * connection because the server failed to negotiate a required * extension. */ NO_EXTENSION, /** * the server is closing the * connection because it was unable to fulfill the request. */ SERVER_ERROR, /** * reserved value indicating that * the TLS handshake failed; must not be sent. */ TLS_HANDSHAKE, } /** * The type of a #SoupWebsocketConnection. */ enum WebsocketConnectionType { /** * unknown/invalid connection */ UNKNOWN, /** * a client-side connection */ CLIENT, /** * a server-side connection */ SERVER, } /** * The type of data contained in a #SoupWebsocketConnection::message * signal. */ enum WebsocketDataType { /** * UTF-8 text */ TEXT, /** * binary data */ BINARY, } /** * WebSocket-related errors. */ enum WebsocketError { /** * a generic error */ FAILED, /** * attempted to handshake with a * server that does not appear to understand WebSockets. */ NOT_WEBSOCKET, /** * the WebSocket handshake failed * because some detail was invalid (eg, incorrect accept key). */ BAD_HANDSHAKE, /** * the WebSocket handshake failed * because the "Origin" header was not an allowed value. */ BAD_ORIGIN, } /** * The state of the WebSocket connection. */ enum WebsocketState { /** * the connection is ready to send messages */ OPEN, /** * the connection is in the process of * closing down; messages may be received, but not sent */ CLOSING, /** * the connection is completely closed down */ CLOSED, } enum XMLRPCError { ARGUMENTS, RETVAL, } /** * Pre-defined XML-RPC fault codes from <ulink * url="http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php">http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php</ulink>. * These are an extension, not part of the XML-RPC spec; you can't * assume servers will use them. */ enum XMLRPCFault { /** * request was not * well-formed */ PARSE_ERROR_NOT_WELL_FORMED, /** * request was in * an unsupported encoding */ PARSE_ERROR_UNSUPPORTED_ENCODING, /** * request contained an invalid character */ PARSE_ERROR_INVALID_CHARACTER_FOR_ENCODING, /** * request was not * valid XML-RPC */ SERVER_ERROR_INVALID_XML_RPC, /** * method * not found */ SERVER_ERROR_REQUESTED_METHOD_NOT_FOUND, /** * invalid * parameters */ SERVER_ERROR_INVALID_METHOD_PARAMETERS, /** * internal * error */ SERVER_ERROR_INTERNAL_XML_RPC_ERROR, /** * start of reserved range for * application error codes */ APPLICATION_ERROR, /** * start of reserved range for * system error codes */ SYSTEM_ERROR, /** * start of reserved range for * transport error codes */ TRANSPORT_ERROR, } enum Cacheability { CACHEABLE, UNCACHEABLE, INVALIDATES, VALIDATES, } /** * Represents the parsed value of the "Expect" header. * @bitfield */ enum Expectation { /** * any unrecognized expectation */ UNRECOGNIZED, /** * "100-continue" */ CONTINUE, } /** * Various flags that can be set on a #SoupMessage to alter its * behavior. * @bitfield */ enum MessageFlags { /** * The session should not follow redirect * (3xx) responses received by this message. */ NO_REDIRECT, /** * The caller will rebuild the request * body if the message is restarted; see * soup_message_body_set_accumulate() for more details. */ CAN_REBUILD, /** * Deprecated: equivalent to calling * soup_message_body_set_accumulate() on the incoming message body * (ie, #SoupMessage:response_body for a client-side request), * passing %FALSE. */ OVERWRITE_CHUNKS, /** * Set by #SoupContentDecoder to * indicate that it has removed the Content-Encoding on a message (and * so headers such as Content-Length may no longer accurately describe * the body). */ CONTENT_DECODED, /** * if set after an https response * has been received, indicates that the server's SSL certificate is * trusted according to the session's CA. */ CERTIFICATE_TRUSTED, /** * Requests that the message should be * sent on a newly-created connection, not reusing an existing * persistent connection. Note that messages with non-idempotent * #SoupMessage:method<!-- -->s behave this way by default, unless * #SOUP_MESSAGE_IDEMPOTENT is set. */ NEW_CONNECTION, /** * The message is considered idempotent, * regardless its #SoupMessage:method, and allows reuse of existing * idle connections, instead of always requiring a new one, unless * #SOUP_MESSAGE_NEW_CONNECTION is set. */ IDEMPOTENT, /** * Request that a new connection is * created for the message if there aren't idle connections available * and it's not possible to create new connections due to any of the * connection limits has been reached. If a dedicated connection is * eventually created for this message, it will be dropped when the * message finishes. Since 2.50 */ IGNORE_CONNECTION_LIMITS, /** * The #SoupAuthManager should not use * the credentials cache for this message, neither to use cached credentials * to automatically authenticate this message nor to cache the credentials * after the message is successfully authenticated. This applies to both server * and proxy authentication. Note that #SoupSession::authenticate signal will * be emitted, if you want to disable authentication for a message use * soup_message_disable_feature() passing #SOUP_TYPE_AUTH_MANAGER instead. Since 2.58 */ DO_NOT_USE_AUTH_CACHE, } /** * Options to pass to soup_server_listen(), etc. * * %SOUP_SERVER_LISTEN_IPV4_ONLY and %SOUP_SERVER_LISTEN_IPV6_ONLY * only make sense with soup_server_listen_all() and * soup_server_listen_local(), not plain soup_server_listen() (which * simply listens on whatever kind of socket you give it). And you * cannot specify both of them in a single call. * @bitfield */ enum ServerListenOptions { /** * Listen for https connections rather * than plain http. */ HTTPS, /** * Only listen on IPv4 interfaces. */ IPV4_ONLY, /** * Only listen on IPv6 interfaces. */ IPV6_ONLY, } /** * This can be passed to any #SoupAddress method that expects a port, * to indicate that you don't care what port is used. */ const ADDRESS_ANY_PORT: number; /** * Alias for the #SoupAddress:family property. (The * #SoupAddressFamily for this address.) */ const ADDRESS_FAMILY: string | null; /** * Alias for the #SoupAddress:name property. (The hostname for * this address.) */ const ADDRESS_NAME: string | null; /** * An alias for the #SoupAddress:physical property. (The * stringified IP address for this address.) */ const ADDRESS_PHYSICAL: string | null; /** * An alias for the #SoupAddress:port property. (The port for * this address.) */ const ADDRESS_PORT: string | null; /** * Alias for the #SoupAddress:protocol property. (The URI scheme * used with this address.) */ const ADDRESS_PROTOCOL: string | null; /** * An alias for the #SoupAddress:sockaddr property. (A pointer * to the struct sockaddr for this address.) */ const ADDRESS_SOCKADDR: string | null; /** * Alias for the #SoupAuthDomain:add-path property. (Shortcut * for calling soup_auth_domain_add_path().) */ const AUTH_DOMAIN_ADD_PATH: string | null; /** * Alias for the #SoupAuthDomainBasic:auth-callback property. * (The #SoupAuthDomainBasicAuthCallback.) */ const AUTH_DOMAIN_BASIC_AUTH_CALLBACK: string | null; /** * Alias for the #SoupAuthDomainBasic:auth-data property. * (The data to pass to the #SoupAuthDomainBasicAuthCallback.) */ const AUTH_DOMAIN_BASIC_AUTH_DATA: string | null; /** * Alias for the #SoupAuthDomainDigest:auth-callback property. * (The #SoupAuthDomainDigestAuthCallback.) */ const AUTH_DOMAIN_DIGEST_AUTH_CALLBACK: string | null; /** * Alias for the #SoupAuthDomainDigest:auth-callback property. * (The #SoupAuthDomainDigestAuthCallback.) */ const AUTH_DOMAIN_DIGEST_AUTH_DATA: string | null; /** * Alias for the #SoupAuthDomain:filter property. (The * #SoupAuthDomainFilter for the domain.) */ const AUTH_DOMAIN_FILTER: string | null; /** * Alias for the #SoupAuthDomain:filter-data property. (Data * to pass to the #SoupAuthDomainFilter.) */ const AUTH_DOMAIN_FILTER_DATA: string | null; /** * Alias for the #SoupAuthDomain:generic-auth-callback property. * (The #SoupAuthDomainGenericAuthCallback.) */ const AUTH_DOMAIN_GENERIC_AUTH_CALLBACK: string | null; /** * Alias for the #SoupAuthDomain:generic-auth-data property. * (The data to pass to the #SoupAuthDomainGenericAuthCallback.) */ const AUTH_DOMAIN_GENERIC_AUTH_DATA: string | null; /** * Alias for the #SoupAuthDomain:proxy property. (Whether or * not this is a proxy auth domain.) */ const AUTH_DOMAIN_PROXY: string | null; /** * Alias for the #SoupAuthDomain:realm property. (The realm of * this auth domain.) */ const AUTH_DOMAIN_REALM: string | null; /** * Alias for the #SoupAuthDomain:remove-path property. * (Shortcut for calling soup_auth_domain_remove_path().) */ const AUTH_DOMAIN_REMOVE_PATH: string | null; /** * An alias for the #SoupAuth:host property. (The * host being authenticated to.) */ const AUTH_HOST: string | null; /** * An alias for the #SoupAuth:is-authenticated property. * (Whether or not the auth has been authenticated.) */ const AUTH_IS_AUTHENTICATED: string | null; /** * An alias for the #SoupAuth:is-for-proxy property. (Whether * or not the auth is for a proxy server.) */ const AUTH_IS_FOR_PROXY: string | null; /** * An alias for the #SoupAuth:realm property. (The * authentication realm.) */ const AUTH_REALM: string | null; /** * An alias for the #SoupAuth:scheme-name property. (The * authentication scheme name.) */ const AUTH_SCHEME_NAME: string | null; const CHAR_HTTP_CTL: number; const CHAR_HTTP_SEPARATOR: number; const CHAR_URI_GEN_DELIMS: number; const CHAR_URI_PERCENT_ENCODED: number; const CHAR_URI_SUB_DELIMS: number; /** * Alias for the #SoupCookieJar:accept-policy property. */ const COOKIE_JAR_ACCEPT_POLICY: string | null; /** * Alias for the #SoupCookieJarDB:filename property. (The * cookie-storage filename.) */ const COOKIE_JAR_DB_FILENAME: string | null; /** * Alias for the #SoupCookieJar:read-only property. (Whether * or not the cookie jar is read-only.) */ const COOKIE_JAR_READ_ONLY: string | null; /** * Alias for the #SoupCookieJarText:filename property. (The * cookie-storage filename.) */ const COOKIE_JAR_TEXT_FILENAME: string | null; /** * A constant corresponding to 1 day, for use with soup_cookie_new() * and soup_cookie_set_max_age(). */ const COOKIE_MAX_AGE_ONE_DAY: number; /** * A constant corresponding to 1 hour, for use with soup_cookie_new() * and soup_cookie_set_max_age(). */ const COOKIE_MAX_AGE_ONE_HOUR: number; /** * A constant corresponding to 1 week, for use with soup_cookie_new() * and soup_cookie_set_max_age(). */ const COOKIE_MAX_AGE_ONE_WEEK: number; /** * A constant corresponding to 1 year, for use with soup_cookie_new() * and soup_cookie_set_max_age(). */ const COOKIE_MAX_AGE_ONE_YEAR: number; /** * A macro containing the value * <literal>"multipart/form-data"</literal>; the MIME type used for * posting form data that contains files to be uploaded. */ const FORM_MIME_TYPE_MULTIPART: string | null; /** * A macro containing the value * <literal>"application/x-www-form-urlencoded"</literal>; the default * MIME type for POSTing HTML form data. */ const FORM_MIME_TYPE_URLENCODED: string | null; const HSTS_ENFORCER_DB_FILENAME: string | null; const HSTS_POLICY_MAX_AGE_PAST: number; /** * Alias for the #SoupLogger:level property, qv. */ const LOGGER_LEVEL: string | null; /** * Alias for the #SoupLogger:max-body-size property, qv. */ const LOGGER_MAX_BODY_SIZE: string | null; /** * Like soup_get_major_version(), but from the headers used at * application compile time, rather than from the library linked * against at application run time. */ const MAJOR_VERSION: number; /** * Alias for the #SoupMessage:first-party property. (The * #SoupURI loaded in the application when the message was * queued.) */ const MESSAGE_FIRST_PARTY: string | null; /** * Alias for the #SoupMessage:flags property. (The message's * #SoupMessageFlags.) */ const MESSAGE_FLAGS: string | null; /** * Alias for the #SoupMessage:http-version property. (The * message's #SoupHTTPVersion.) */ const MESSAGE_HTTP_VERSION: string | null; const MESSAGE_IS_TOP_LEVEL_NAVIGATION: string | null; /** * Alias for the #SoupMessage:method property. (The message's * HTTP method.) */ const MESSAGE_METHOD: string | null; /** * Sets the priority of the #SoupMessage. See * soup_message_set_priority() for further details. */ const MESSAGE_PRIORITY: string | null; /** * Alias for the #SoupMessage:reason-phrase property. (The * message's HTTP response reason phrase.) */ const MESSAGE_REASON_PHRASE: string | null; /** * Alias for the #SoupMessage:request-body property. (The * message's HTTP request body.) */ const MESSAGE_REQUEST_BODY: string | null; /** * Alias for the #SoupMessage:request-body-data property. (The * message's HTTP request body, as a #GBytes.) */ const MESSAGE_REQUEST_BODY_DATA: string | null; /** * Alias for the #SoupMessage:request-headers property. (The * message's HTTP request headers.) */ const MESSAGE_REQUEST_HEADERS: string | null; /** * Alias for the #SoupMessage:response-body property. (The * message's HTTP response body.) */ const MESSAGE_RESPONSE_BODY: string | null; /** * Alias for the #SoupMessage:response-body-data property. (The * message's HTTP response body, as a #GBytes.) */ const MESSAGE_RESPONSE_BODY_DATA: string | null; /** * Alias for the #SoupMessage:response-headers property. (The * message's HTTP response headers.) */ const MESSAGE_RESPONSE_HEADERS: string | null; /** * Alias for the #SoupMessage:server-side property. (%TRUE if * the message was created by #SoupServer.) */ const MESSAGE_SERVER_SIDE: string | null; const MESSAGE_SITE_FOR_COOKIES: string | null; /** * Alias for the #SoupMessage:status-code property. (The * message's HTTP response status code.) */ const MESSAGE_STATUS_CODE: string | null; /** * Alias for the #SoupMessage:tls-certificate property. (The * TLS certificate associated with the message, if any.) */ const MESSAGE_TLS_CERTIFICATE: string | null; /** * Alias for the #SoupMessage:tls-errors property. (The * verification errors on #SoupMessage:tls-certificate.) */ const MESSAGE_TLS_ERRORS: string | null; /** * Alias for the #SoupMessage:uri property. (The message's * #SoupURI.) */ const MESSAGE_URI: string | null; /** * Like soup_get_micro_version(), but from the headers used at * application compile time, rather than from the library linked * against at application run time. */ const MICRO_VERSION: number; /** * Like soup_get_minor_version(), but from the headers used at * application compile time, rather than from the library linked * against at application run time. */ const MINOR_VERSION: number; /** * Alias for the #SoupRequest:session property, qv. */ const REQUEST_SESSION: string | null; /** * Alias for the #SoupRequest:uri property, qv. */ const REQUEST_URI: string | null; /** * Alias for the deprecated #SoupServer:async-context * property, qv. */ const SERVER_ASYNC_CONTEXT: string | null; /** * Alias for the #SoupServer:https-aliases property, qv. */ const SERVER_HTTPS_ALIASES: string | null; /** * Alias for the #SoupServer:http-aliases property, qv. */ const SERVER_HTTP_ALIASES: string | null; /** * Alias for the #SoupServer:interface property, qv. */ const SERVER_INTERFACE: string | null; /** * Alias for the deprecated #SoupServer:port property, qv. */ const SERVER_PORT: string | null; /** * Alias for the #SoupServer:raw-paths property. (If %TRUE, * percent-encoding in the Request-URI path will not be * automatically decoded.) */ const SERVER_RAW_PATHS: string | null; /** * Alias for the #SoupServer:server-header property, qv. */ const SERVER_SERVER_HEADER: string | null; /** * Alias for the #SoupServer:ssl-cert-file property, qv. */ const SERVER_SSL_CERT_FILE: string | null; /** * Alias for the #SoupServer:ssl-key-file property, qv. */ const SERVER_SSL_KEY_FILE: string | null; /** * Alias for the #SoupServer:tls-certificate property, qv. */ const SERVER_TLS_CERTIFICATE: string | null; /** * Alias for the #SoupSession:accept-language property, qv. */ const SESSION_ACCEPT_LANGUAGE: string | null; /** * Alias for the #SoupSession:accept-language-auto property, qv. */ const SESSION_ACCEPT_LANGUAGE_AUTO: string | null; /** * Alias for the #SoupSession:async-context property, qv. */ const SESSION_ASYNC_CONTEXT: string | null; /** * Alias for the #SoupSession:https-aliases property, qv. */ const SESSION_HTTPS_ALIASES: string | null; /** * Alias for the #SoupSession:http-aliases property, qv. */ const SESSION_HTTP_ALIASES: string | null; /** * Alias for the #SoupSession:idle-timeout property, qv. */ const SESSION_IDLE_TIMEOUT: string | null; /** * Alias for the #SoupSession:local-address property, qv. */ const SESSION_LOCAL_ADDRESS: string | null; /** * Alias for the #SoupSession:max-conns property, qv. */ const SESSION_MAX_CONNS: string | null; /** * Alias for the #SoupSession:max-conns-per-host property, qv. */ const SESSION_MAX_CONNS_PER_HOST: string | null; /** * Alias for the #SoupSession:proxy-resolver property, qv. */ const SESSION_PROXY_RESOLVER: string | null; /** * Alias for the #SoupSession:proxy-uri property, qv. */ const SESSION_PROXY_URI: string | null; /** * Alias for the #SoupSession:ssl-ca-file property, qv. */ const SESSION_SSL_CA_FILE: string | null; /** * Alias for the #SoupSession:ssl-strict property, qv. */ const SESSION_SSL_STRICT: string | null; /** * Alias for the #SoupSession:ssl-use-system-ca-file property, * qv. */ const SESSION_SSL_USE_SYSTEM_CA_FILE: string | null; /** * Alias for the #SoupSession:timeout property, qv. */ const SESSION_TIMEOUT: string | null; /** * Alias for the #SoupSession:tls-database property, qv. */ const SESSION_TLS_DATABASE: string | null; /** * Alias for the #SoupSession:tls-interaction property, qv. */ const SESSION_TLS_INTERACTION: string | null; /** * Alias for the #SoupSession:user-agent property, qv. */ const SESSION_USER_AGENT: string | null; /** * Alias for the #SoupSession:use-ntlm property, qv. */ const SESSION_USE_NTLM: string | null; /** * Alias for the #SoupSession:use-thread-context property, qv. */ const SESSION_USE_THREAD_CONTEXT: string | null; /** * Alias for the #SoupSocket:async-context property. (The * socket's #GMainContext.) */ const SOCKET_ASYNC_CONTEXT: string | null; /** * Alias for the #SoupSocket:non-blocking property. (Whether * or not the socket uses non-blocking I/O.) */ const SOCKET_FLAG_NONBLOCKING: string | null; /** * Alias for the #SoupSocket:is-server property, qv. */ const SOCKET_IS_SERVER: string | null; /** * Alias for the #SoupSocket:local-address property. (Address * of local end of socket.) */ const SOCKET_LOCAL_ADDRESS: string | null; /** * Alias for the #SoupSocket:remote-address property. (Address * of remote end of socket.) */ const SOCKET_REMOTE_ADDRESS: string | null; /** * Alias for the #SoupSocket:ssl-creds property. * (SSL credential information.) */ const SOCKET_SSL_CREDENTIALS: string | null; /** * Alias for the #SoupSocket:ssl-fallback property. */ const SOCKET_SSL_FALLBACK: string | null; /** * Alias for the #SoupSocket:ssl-strict property. */ const SOCKET_SSL_STRICT: string | null; /** * Alias for the #SoupSocket:timeout property. (The timeout * in seconds for blocking socket I/O operations.) */ const SOCKET_TIMEOUT: string | null; /** * Alias for the #SoupSocket:tls-certificate * property. Note that this property's value is only useful * if the socket is for a TLS connection, and only reliable * after some data has been transferred to or from it. */ const SOCKET_TLS_CERTIFICATE: string | null; /** * Alias for the #SoupSocket:tls-errors * property. Note that this property's value is only useful * if the socket is for a TLS connection, and only reliable * after some data has been transferred to or from it. */ const SOCKET_TLS_ERRORS: string | null; /** * Alias for the #SoupSocket:trusted-certificate * property. */ const SOCKET_TRUSTED_CERTIFICATE: string | null; /** * Alias for the #SoupSocket:use-thread-context property. (Use * g_main_context_get_thread_default()) */ const SOCKET_USE_THREAD_CONTEXT: string | null; /** * A macro that should be defined by the user prior to including * libsoup.h. The definition should be one of the predefined libsoup * version macros: %SOUP_VERSION_2_24, %SOUP_VERSION_2_26, ... * * This macro defines the earliest version of libsoup that the package * is required to be able to compile against. * * If the compiler is configured to warn about the use of deprecated * functions, then using functions that were deprecated in version * %SOUP_VERSION_MIN_REQUIRED or earlier will cause warnings (but * using functions deprecated in later releases will not). */ const VERSION_MIN_REQUIRED: number; /** * Like SOUP_CHECK_VERSION, but the check for soup_check_version is * at runtime instead of compile time. This is useful for compiling * against older versions of libsoup, but using features from newer * versions. * @param major the major version to check * @param minor the minor version to check * @param micro the micro version to check * @returns %TRUE if the version of the libsoup currently loaded is the same as or newer than the passed-in version. */ function check_version(major: number, minor: number, micro: number): boolean; /** * Parses `header` and returns a #SoupCookie. (If `header` contains * multiple cookies, only the first one will be parsed.) * * If `header` does not have "path" or "domain" attributes, they will * be defaulted from `origin`. If `origin` is %NULL, path will default * to "/", but domain will be left as %NULL. Note that this is not a * valid state for a #SoupCookie, and you will need to fill in some * appropriate string for the domain if you want to actually make use * of the cookie. * @param header a cookie string (eg, the value of a Set-Cookie header) * @param origin origin of the cookie, or %NULL * @returns a new #SoupCookie, or %NULL if it could not be parsed, or contained an illegal "domain" attribute for a cookie originating from @origin. */ function cookie_parse(header: string | null, origin: URI): Cookie | null; /** * Parses `msg'`s Cookie request header and returns a #GSList of * #SoupCookie<!-- -->s. As the "Cookie" header, unlike "Set-Cookie", * only contains cookie names and values, none of the other * #SoupCookie fields will be filled in. (Thus, you can't generally * pass a cookie returned from this method directly to * soup_cookies_to_response().) * @param msg a #SoupMessage containing a "Cookie" request header * @returns a #GSList of #SoupCookie<!-- -->s, which can be freed with soup_cookies_free(). */ function cookies_from_request(msg: Message): Cookie[]; /** * Parses `msg'`s Set-Cookie response headers and returns a #GSList of * #SoupCookie<!-- -->s. Cookies that do not specify "path" or * "domain" attributes will have their values defaulted from `msg`. * @param msg a #SoupMessage containing a "Set-Cookie" response header * @returns a #GSList of #SoupCookie<!-- -->s, which can be freed with soup_cookies_free(). */ function cookies_from_response(msg: Message): Cookie[]; /** * Serializes a #GSList of #SoupCookie into a string suitable for * setting as the value of the "Cookie" header. * @param cookies a #GSList of #SoupCookie * @returns the serialization of @cookies */ function cookies_to_cookie_header(cookies: Cookie[]): string | null; /** * Adds the name and value of each cookie in `cookies` to `msg'`s * "Cookie" request. (If `msg` already has a "Cookie" request header, * these cookies will be appended to the cookies already present. Be * careful that you do not append the same cookies twice, eg, when * requeuing a message.) * @param cookies a #GSList of #SoupCookie * @param msg a #SoupMessage */ function cookies_to_request(cookies: Cookie[], msg: Message): void; /** * Appends a "Set-Cookie" response header to `msg` for each cookie in * `cookies`. (This is in addition to any other "Set-Cookie" headers * `msg` may already have.) * @param cookies a #GSList of #SoupCookie * @param msg a #SoupMessage */ function cookies_to_response(cookies: Cookie[], msg: Message): void; /** * Decodes `form,` which is an urlencoded dataset as defined in the * HTML 4.01 spec. * @param encoded_form data of type "application/x-www-form-urlencoded" * @returns a hash table containing the name/value pairs from @encoded_form, which you can free with g_hash_table_destroy(). */ function form_decode(encoded_form: string | null): GLib.HashTable; /** * Decodes the "multipart/form-data" request in `msg;` this is a * convenience method for the case when you have a single file upload * control in a form. (Or when you don't have any file upload * controls, but are still using "multipart/form-data" anyway.) Pass * the name of the file upload control in `file_control_name,` and * soup_form_decode_multipart() will extract the uploaded file data * into `filename,` `content_type,` and `file`. All of the other form * control data will be returned (as strings, as with * soup_form_decode()) in the returned #GHashTable. * * You may pass %NULL for `filename,` `content_type` and/or `file` if you do not * care about those fields. soup_form_decode_multipart() may also * return %NULL in those fields if the client did not provide that * information. You must free the returned filename and content-type * with g_free(), and the returned file data with soup_buffer_free(). * * If you have a form with more than one file upload control, you will * need to decode it manually, using soup_multipart_new_from_message() * and soup_multipart_get_part(). * @param msg a #SoupMessage containing a "multipart/form-data" request body * @param file_control_name the name of the HTML file upload control, or %NULL * @returns a hash table containing the name/value pairs (other than @file_control_name) from @msg, which you can free with g_hash_table_destroy(). On error, it will return %NULL. */ function form_decode_multipart( msg: Message, file_control_name: string | null ): [ /* returnType */ GLib.HashTable | null, /* filename */ string | null, /* content_type */ string | null, /* file */ Buffer ]; /** * Encodes `form_data_set` into a value of type * "application/x-www-form-urlencoded", as defined in the HTML 4.01 * spec. Unlike soup_form_encode_hash(), this preserves the ordering * of the form elements, which may be required in some situations. * @param form_data_set a datalist containing name/value pairs * @returns the encoded form */ function form_encode_datalist(form_data_set: GLib.Data): string | null; /** * Encodes `form_data_set` into a value of type * "application/x-www-form-urlencoded", as defined in the HTML 4.01 * spec. * * Note that the HTML spec states that "The control names/values are * listed in the order they appear in the document." Since this method * takes a hash table, it cannot enforce that; if you care about the * ordering of the form fields, use soup_form_encode_datalist(). * @param form_data_set a hash table containing name/value pairs (as strings) * @returns the encoded form */ function form_encode_hash(form_data_set: GLib.HashTable): string | null; /** * Creates a new %SoupMessage and sets it up to send `form_data_set` to * `uri` via `method,` as with soup_form_request_new(). * @param method the HTTP method, either "GET" or "POST" * @param uri the URI to send the form data to * @param form_data_set the data to send to `uri` * @returns the new %SoupMessage */ function form_request_new_from_datalist( method: string | null, uri: string | null, form_data_set: GLib.Data ): Message; /** * Creates a new %SoupMessage and sets it up to send `form_data_set` to * `uri` via `method,` as with soup_form_request_new(). * @param method the HTTP method, either "GET" or "POST" * @param uri the URI to send the form data to * @param form_data_set the data to send to `uri` * @returns the new %SoupMessage */ function form_request_new_from_hash( method: string | null, uri: string | null, form_data_set: GLib.HashTable ): Message; /** * Creates a new %SoupMessage and sets it up to send `multipart` to * `uri` via POST. * * To send a <literal>"multipart/form-data"</literal> POST, first * create a #SoupMultipart, using %SOUP_FORM_MIME_TYPE_MULTIPART as * the MIME type. Then use soup_multipart_append_form_string() and * soup_multipart_append_form_file() to add the value of each form * control to the multipart. (These are just convenience methods, and * you can use soup_multipart_append_part() if you need greater * control over the part headers.) Finally, call * soup_form_request_new_from_multipart() to serialize the multipart * structure and create a #SoupMessage. * @param uri the URI to send the form data to * @param multipart a "multipart/form-data" #SoupMultipart * @returns the new %SoupMessage */ function form_request_new_from_multipart( uri: string | null, multipart: Multipart ): Message; /** * Returns the major version number of the libsoup library. * (e.g. in libsoup version 2.42.0 this is 2.) * * This function is in the library, so it represents the libsoup library * your code is running against. Contrast with the #SOUP_MAJOR_VERSION * macro, which represents the major version of the libsoup headers you * have included when compiling your code. * @returns the major version number of the libsoup library */ function get_major_version(): number; /** * Returns the micro version number of the libsoup library. * (e.g. in libsoup version 2.42.0 this is 0.) * * This function is in the library, so it represents the libsoup l