From: Dmitry Volyntsev Date: Wed, 7 Jun 2023 04:33:46 +0000 (-0700) Subject: Types: removed descryption for methods removed in 4df790f42ce7. X-Git-Tag: 0.8.0~25 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=28e838841d1b5bf2ad63e2839c497d629822f51f;p=njs.git Types: removed descryption for methods removed in 4df790f42ce7. Since the disctinction between byte strings and ordinary strings is eliminated the NjsByteString type is also removed. --- diff --git a/test/ts/test.ts b/test/ts/test.ts index 13b1157a..8a135c20 100644 --- a/test/ts/test.ts +++ b/test/ts/test.ts @@ -5,20 +5,9 @@ import xml from 'xml'; import zlib from 'zlib'; async function http_module(r: NginxHTTPRequest) { - var bs: NjsByteString; var s: string; var vod: void; - // builtin string vs NjsByteString - - s = 'ordinary string'; - bs = String.bytesFrom('000000', 'hex'); - var bs2: NjsByteString | null = s.toBytes(); - bs = s.toUTF8(); - bs.fromBytes(undefined, undefined); - - s = bs + ''; - // r.uri if (r.uri == '/') { @@ -26,14 +15,13 @@ async function http_module(r: NginxHTTPRequest) { // r.args - bs = r.args.x; - bs = r.args[1]; - var s2: string | null = r.args.x.fromUTF8(); + s = r.args.x; + s = r.args[1]; s = r.args.x + ''; // r.headersIn - r.headersIn['Accept']?.fromBytes() == 'dddd'; + r.headersIn['Accept'] == 'dddd'; // r.headersOut @@ -50,7 +38,7 @@ async function http_module(r: NginxHTTPRequest) { // r.log - r.log(bs); + r.log(s); r.log(Buffer.from("abc")); r.log(r.headersOut['Connection'] ?? ''); @@ -155,7 +143,7 @@ async function fs_module() { await fs.promises.rmdir('d/e/f', {recursive: false}); } -function qs_module(str: NjsByteString) { +function qs_module(str: string) { var o; var s:string; @@ -163,7 +151,7 @@ function qs_module(str: NjsByteString) { s = qs.stringify(o); } -function xml_module(str: NjsByteString) { +function xml_module(str: string) { let doc; let node; let children, selectedChildren; @@ -195,7 +183,7 @@ function xml_module(str: NjsByteString) { node.$tags = [node, node]; } -function zlib_module(str: NjsByteString) { +function zlib_module(str: string) { zlib.deflateRawSync(str, {level: zlib.constants.Z_BEST_COMPRESSION, memLevel: 9}); zlib.deflateSync(str, {strategy: zlib.constants.Z_RLE}); @@ -203,7 +191,7 @@ function zlib_module(str: NjsByteString) { zlib.inflateSync(str, {chunkSize: 2048}); } -function crypto_module(str: NjsByteString) { +function crypto_module(str: string) { var h; var b:Buffer; var s:string; diff --git a/ts/ngx_core.d.ts b/ts/ngx_core.d.ts index edf8672f..02aa6a41 100644 --- a/ts/ngx_core.d.ts +++ b/ts/ngx_core.d.ts @@ -1,4 +1,4 @@ -type NgxHeaders = Headers | Object | [NjsFixedSizeArray<2, NjsStringLike>]; +type NgxHeaders = Headers | Object | [NjsFixedSizeArray<2, string>]; declare class Headers { /** @@ -8,7 +8,7 @@ declare class Headers { * @param value A value of the header. * @since 0.7.10 */ - append(name:NjsStringLike, value: NjsStringLike): void; + append(name:string, value: string): void; /** * Headers constructors. * @@ -16,38 +16,38 @@ declare class Headers { * @returns returns Headers object. * @since 0.7.10 */ - constructor(init?: Object | [NjsFixedSizeArray<2, NjsStringLike>]); + constructor(init?: Object | [NjsFixedSizeArray<2, string>]); /** * Deletes a header from the Headers object. * @param name A name of the header to be deleted. * @since 0.7.10 */ - delete(name:NjsStringLike): void; + delete(name:string): void; /** * Returns a string containing the values of all headers * with the specified name separated by a comma and a space. * @param name A name of the header. */ - get(name:NjsStringLike): NjsByteString; + get(name:string): string; /** * Returns an array containing the values of all headers * with the specified name. * @param name A name of the header. */ - getAll(name:NjsStringLike): Array; + getAll(name:string): Array; /** * Executes a provided function once for each key/value * pair in the Headers object. * @param fn the function to be envoked. * @since 0.7.10 */ - forEach(fn:(name: NjsStringLike, value: NjsStringLike) => void): void; + forEach(fn:(name: string, value: string) => void): void; /** * Returns a boolean value indicating whether a header with * the specified name exists. * @param name A name of the header. */ - has(name:NjsStringLike): boolean; + has(name:string): boolean; /** * Sets a new value for an existing header inside the Headers object, * or adds the header if it does not already exist. @@ -55,14 +55,14 @@ declare class Headers { * @param value A value of the header. * @since 0.7.10 */ - set(name:NjsStringLike, value: NjsStringLike): void; + set(name:string, value: string): void; } interface NgxRequestOptions { /** * Request body, by default is empty. */ - body?: NjsStringLike; + body?: string; /** * Cache mode, by default is "default". */ @@ -78,7 +78,7 @@ interface NgxRequestOptions { /** * Request method, by default the GET method is used. */ - method?: NjsStringLike; + method?: string; /** * Mode, by default is "no-cors". */ @@ -97,7 +97,7 @@ declare class Request { /** * Cache mode. */ - readonly cache: NjsByteString; + readonly cache: string; /** * Request constructors. * @@ -105,11 +105,11 @@ declare class Request { * @returns returns Request object. * @since 0.7.10 */ - constructor(input: NjsStringLike | Request, options?: NgxRequestOptions); + constructor(input: string | Request, options?: NgxRequestOptions); /** * Credentials. */ - readonly credentials: NjsByteString; + readonly credentials: string; /** * Returns a Promise that resolves with an result of applying of * JSON.parse() to a body. @@ -122,15 +122,15 @@ declare class Request { /** * Request mode. */ - readonly mode: NjsByteString; + readonly mode: string; /** * Returns a Promise that resolves with an body as String. */ - text(): Promise; + text(): Promise; /** * Request url. */ - readonly url: NjsByteString; + readonly url: string; } interface NgxResponseOptions { @@ -145,7 +145,7 @@ interface NgxResponseOptions { /** * Response status test, '' by default. */ - statusText?: NjsStringLike; + statusText?: string; } declare class Response { @@ -165,7 +165,7 @@ declare class Response { * @returns returns Response object. * @since 0.7.10 */ - constructor(body?: NjsStringLike, options?: NgxResponseOptions); + constructor(body?: string, options?: NgxResponseOptions); /** * Takes a Response stream and reads it to completion. * Returns a Promise that resolves with the result of @@ -193,27 +193,27 @@ declare class Response { /** * The status message corresponding to the status code. */ - readonly statusText: NjsByteString; + readonly statusText: string; /** * Takes a Response stream and reads it to completion. * Returns a Promise that resolves with a string. */ - text(): Promise; + text(): Promise; /** * The type of the response. */ - readonly type: NjsByteString; + readonly type: string; /** * Response url. */ - readonly url: NjsByteString; + readonly url: string; } interface NgxFetchOptions { /** * Request body, by default is empty. */ - body?: NjsStringLike, + body?: string, /** * The buffer size for reading the response, by default is 16384 (4096 before 0.7.4). * Nginx specific. @@ -233,7 +233,7 @@ interface NgxFetchOptions { /** * Request method, by default the GET method is used. */ - method?: NjsStringLike; + method?: string; /** * Enables or disables verification of the HTTPS server certificate, * by default is true. diff --git a/ts/ngx_http_js_module.d.ts b/ts/ngx_http_js_module.d.ts index 811d2cb5..e99d484b 100644 --- a/ts/ngx_http_js_module.d.ts +++ b/ts/ngx_http_js_module.d.ts @@ -2,235 +2,235 @@ /// interface NginxHTTPArgs { - readonly [prop: string]: NjsByteString; + readonly [prop: string]: string; } interface NginxHeadersIn { // common request headers - readonly 'Accept'?: NjsByteString; - readonly 'Accept-Charset'?: NjsByteString; - readonly 'Accept-Encoding'?: NjsByteString; - readonly 'Accept-Language'?: NjsByteString; - readonly 'Authorization'?: NjsByteString; - readonly 'Cache-Control'?: NjsByteString; - readonly 'Connection'?: NjsByteString; - readonly 'Content-Length'?: NjsByteString; - readonly 'Content-Type'?: NjsByteString; - readonly 'Cookie'?: NjsByteString; - readonly 'Date'?: NjsByteString; - readonly 'Expect'?: NjsByteString; - readonly 'Forwarded'?: NjsByteString; - readonly 'From'?: NjsByteString; - readonly 'Host'?: NjsByteString; - readonly 'If-Match'?: NjsByteString; - readonly 'If-Modified-Since'?: NjsByteString; - readonly 'If-None-Match'?: NjsByteString; - readonly 'If-Range'?: NjsByteString; - readonly 'If-Unmodified-Since'?: NjsByteString; - readonly 'Max-Forwards'?: NjsByteString; - readonly 'Origin'?: NjsByteString; - readonly 'Pragma'?: NjsByteString; - readonly 'Proxy-Authorization'?: NjsByteString; - readonly 'Range'?: NjsByteString; - readonly 'Referer'?: NjsByteString; - readonly 'TE'?: NjsByteString; - readonly 'User-Agent'?: NjsByteString; - readonly 'Upgrade'?: NjsByteString; - readonly 'Via'?: NjsByteString; - readonly 'Warning'?: NjsByteString; - readonly 'X-Forwarded-For'?: NjsByteString; + readonly 'Accept'?: string; + readonly 'Accept-Charset'?: string; + readonly 'Accept-Encoding'?: string; + readonly 'Accept-Language'?: string; + readonly 'Authorization'?: string; + readonly 'Cache-Control'?: string; + readonly 'Connection'?: string; + readonly 'Content-Length'?: string; + readonly 'Content-Type'?: string; + readonly 'Cookie'?: string; + readonly 'Date'?: string; + readonly 'Expect'?: string; + readonly 'Forwarded'?: string; + readonly 'From'?: string; + readonly 'Host'?: string; + readonly 'If-Match'?: string; + readonly 'If-Modified-Since'?: string; + readonly 'If-None-Match'?: string; + readonly 'If-Range'?: string; + readonly 'If-Unmodified-Since'?: string; + readonly 'Max-Forwards'?: string; + readonly 'Origin'?: string; + readonly 'Pragma'?: string; + readonly 'Proxy-Authorization'?: string; + readonly 'Range'?: string; + readonly 'Referer'?: string; + readonly 'TE'?: string; + readonly 'User-Agent'?: string; + readonly 'Upgrade'?: string; + readonly 'Via'?: string; + readonly 'Warning'?: string; + readonly 'X-Forwarded-For'?: string; - readonly [prop: string]: NjsByteString | undefined; + readonly [prop: string]: string | undefined; } interface NginxHeadersOut { // common response headers - 'Age'?: NjsStringLike; - 'Allow'?: NjsStringLike; - 'Alt-Svc'?: NjsStringLike; - 'Cache-Control'?: NjsStringLike; - 'Connection'?: NjsStringLike; - 'Content-Disposition'?: NjsStringLike; - 'Content-Encoding'?: NjsStringLike; - 'Content-Language'?: NjsStringLike; - 'Content-Length'?: NjsStringLike; - 'Content-Location'?: NjsStringLike; - 'Content-Range'?: NjsStringLike; - 'Content-Type'?: NjsStringLike; - 'Date'?: NjsStringLike; - 'ETag'?: NjsStringLike; - 'Expires'?: NjsStringLike; - 'Last-Modified'?: NjsStringLike; - 'Link'?: NjsStringLike; - 'Location'?: NjsStringLike; - 'Pragma'?: NjsStringLike; - 'Proxy-Authenticate'?: NjsStringLike; - 'Retry-After'?: NjsStringLike; - 'Server'?: NjsStringLike; - 'Trailer'?: NjsStringLike; - 'Transfer-Encoding'?: NjsStringLike; - 'Upgrade'?: NjsStringLike; - 'Vary'?: NjsStringLike; - 'Via'?: NjsStringLike; - 'Warning'?: NjsStringLike; - 'WWW-Authenticate'?: NjsStringLike; + 'Age'?: string; + 'Allow'?: string; + 'Alt-Svc'?: string; + 'Cache-Control'?: string; + 'Connection'?: string; + 'Content-Disposition'?: string; + 'Content-Encoding'?: string; + 'Content-Language'?: string; + 'Content-Length'?: string; + 'Content-Location'?: string; + 'Content-Range'?: string; + 'Content-Type'?: string; + 'Date'?: string; + 'ETag'?: string; + 'Expires'?: string; + 'Last-Modified'?: string; + 'Link'?: string; + 'Location'?: string; + 'Pragma'?: string; + 'Proxy-Authenticate'?: string; + 'Retry-After'?: string; + 'Server'?: string; + 'Trailer'?: string; + 'Transfer-Encoding'?: string; + 'Upgrade'?: string; + 'Vary'?: string; + 'Via'?: string; + 'Warning'?: string; + 'WWW-Authenticate'?: string; - 'Set-Cookie'?: NjsStringLike[]; + 'Set-Cookie'?: string[]; - [prop: string]: NjsStringLike | NjsStringLike[] | undefined; + [prop: string]: string | string[] | undefined; } interface NginxVariables { - readonly 'ancient_browser'?: NjsByteString; - readonly 'arg_'?: NjsByteString; - readonly 'args'?: NjsByteString; - readonly 'binary_remote_addr'?: NjsByteString; - readonly 'body_bytes_sent'?: NjsByteString; - readonly 'bytes_received'?: NjsByteString; - readonly 'bytes_sent'?: NjsByteString; - readonly 'connection'?: NjsByteString; - readonly 'connection_requests'?: NjsByteString; - readonly 'connections_active'?: NjsByteString; - readonly 'connections_reading'?: NjsByteString; - readonly 'connections_waiting'?: NjsByteString; - readonly 'connections_writing'?: NjsByteString; - readonly 'content_length'?: NjsByteString; - readonly 'content_type'?: NjsByteString; - readonly 'cookie_'?: NjsByteString; - readonly 'date_gmt'?: NjsByteString; - readonly 'date_local'?: NjsByteString; - readonly 'document_root'?: NjsByteString; - readonly 'document_uri'?: NjsByteString; - readonly 'fastcgi_path_info'?: NjsByteString; - readonly 'fastcgi_script_name'?: NjsByteString; - readonly 'geoip_area_code'?: NjsByteString; - readonly 'geoip_city'?: NjsByteString; - readonly 'geoip_city_continent_code'?: NjsByteString; - readonly 'geoip_city_country_code'?: NjsByteString; - readonly 'geoip_city_country_code3'?: NjsByteString; - readonly 'geoip_city_country_name'?: NjsByteString; - readonly 'geoip_country_code'?: NjsByteString; - readonly 'geoip_country_code3'?: NjsByteString; - readonly 'geoip_country_name'?: NjsByteString; - readonly 'geoip_dma_code'?: NjsByteString; - readonly 'geoip_latitude'?: NjsByteString; - readonly 'geoip_longitude'?: NjsByteString; - readonly 'geoip_org'?: NjsByteString; - readonly 'geoip_postal_code'?: NjsByteString; - readonly 'geoip_region'?: NjsByteString; - readonly 'geoip_region_name'?: NjsByteString; - readonly 'gzip_ratio'?: NjsByteString; - readonly 'host'?: NjsByteString; - readonly 'hostname'?: NjsByteString; - readonly 'http2'?: NjsByteString; - readonly 'http_'?: NjsByteString; - readonly 'https'?: NjsByteString; - readonly 'invalid_referer'?: NjsByteString; - readonly 'is_args'?: NjsByteString; - readonly 'jwt_claim_'?: NjsByteString; - readonly 'jwt_header_'?: NjsByteString; - readonly 'limit_conn_status'?: NjsByteString; - readonly 'limit_rate'?: NjsByteString; - readonly 'limit_req_status'?: NjsByteString; - readonly 'memcached_key'?: NjsByteString; - readonly 'modern_browser'?: NjsByteString; - readonly 'msec'?: NjsByteString; - readonly 'msie'?: NjsByteString; - readonly 'nginx_version'?: NjsByteString; - readonly 'pid'?: NjsByteString; - readonly 'pipe'?: NjsByteString; - readonly 'protocol'?: NjsByteString; - readonly 'proxy_add_x_forwarded_for'?: NjsByteString; - readonly 'proxy_host'?: NjsByteString; - readonly 'proxy_port'?: NjsByteString; - readonly 'proxy_protocol_addr'?: NjsByteString; - readonly 'proxy_protocol_port'?: NjsByteString; - readonly 'proxy_protocol_server_addr'?: NjsByteString; - readonly 'proxy_protocol_server_port'?: NjsByteString; - readonly 'query_string'?: NjsByteString; - readonly 'realip_remote_addr'?: NjsByteString; - readonly 'realip_remote_port'?: NjsByteString; - readonly 'realpath_root'?: NjsByteString; - readonly 'remote_addr'?: NjsByteString; - readonly 'remote_port'?: NjsByteString; - readonly 'remote_user'?: NjsByteString; - readonly 'request'?: NjsByteString; - readonly 'request_body'?: NjsByteString; - readonly 'request_body_file'?: NjsByteString; - readonly 'request_completion'?: NjsByteString; - readonly 'request_filename'?: NjsByteString; - readonly 'request_id'?: NjsByteString; - readonly 'request_length'?: NjsByteString; - readonly 'request_method'?: NjsByteString; - readonly 'request_time'?: NjsByteString; - readonly 'request_uri'?: NjsByteString; - readonly 'scheme'?: NjsByteString; - readonly 'secure_link'?: NjsByteString; - readonly 'secure_link_expires'?: NjsByteString; - readonly 'sent_http_'?: NjsByteString; - readonly 'sent_trailer_'?: NjsByteString; - readonly 'server_addr'?: NjsByteString; - readonly 'server_name'?: NjsByteString; - readonly 'server_port'?: NjsByteString; - readonly 'server_protocol'?: NjsByteString; - readonly 'session_log_binary_id'?: NjsByteString; - readonly 'session_log_id'?: NjsByteString; - readonly 'session_time'?: NjsByteString; - readonly 'slice_range'?: NjsByteString; - readonly 'spdy'?: NjsByteString; - readonly 'spdy_request_priority'?: NjsByteString; - readonly 'ssl_cipher'?: NjsByteString; - readonly 'ssl_ciphers'?: NjsByteString; - readonly 'ssl_client_cert'?: NjsByteString; - readonly 'ssl_client_escaped_cert'?: NjsByteString; - readonly 'ssl_client_fingerprint'?: NjsByteString; - readonly 'ssl_client_i_dn'?: NjsByteString; - readonly 'ssl_client_i_dn_legacy'?: NjsByteString; - readonly 'ssl_client_raw_cert'?: NjsByteString; - readonly 'ssl_client_s_dn'?: NjsByteString; - readonly 'ssl_client_s_dn_legacy'?: NjsByteString; - readonly 'ssl_client_serial'?: NjsByteString; - readonly 'ssl_client_v_end'?: NjsByteString; - readonly 'ssl_client_v_remain'?: NjsByteString; - readonly 'ssl_client_v_start'?: NjsByteString; - readonly 'ssl_client_verify'?: NjsByteString; - readonly 'ssl_curves'?: NjsByteString; - readonly 'ssl_early_data'?: NjsByteString; - readonly 'ssl_preread_alpn_protocols'?: NjsByteString; - readonly 'ssl_preread_protocol'?: NjsByteString; - readonly 'ssl_preread_server_name'?: NjsByteString; - readonly 'ssl_protocol'?: NjsByteString; - readonly 'ssl_server_name'?: NjsByteString; - readonly 'ssl_session_id'?: NjsByteString; - readonly 'ssl_session_reused'?: NjsByteString; - readonly 'status'?: NjsByteString; - readonly 'tcpinfo_rtt'?: NjsByteString; - readonly 'tcpinfo_rttvar'?: NjsByteString; - readonly 'tcpinfo_snd_cwnd'?: NjsByteString; - readonly 'tcpinfo_rcv_space'?: NjsByteString; - readonly 'time_iso8601'?: NjsByteString; - readonly 'time_local'?: NjsByteString; - readonly 'uid_got'?: NjsByteString; - readonly 'uid_reset'?: NjsByteString; - readonly 'uid_set'?: NjsByteString; - readonly 'upstream_addr'?: NjsByteString; - readonly 'upstream_bytes_received'?: NjsByteString; - readonly 'upstream_bytes_sent'?: NjsByteString; - readonly 'upstream_cache_status'?: NjsByteString; - readonly 'upstream_connect_time'?: NjsByteString; - readonly 'upstream_cookie_'?: NjsByteString; - readonly 'upstream_first_byte_time'?: NjsByteString; - readonly 'upstream_header_time'?: NjsByteString; - readonly 'upstream_http_'?: NjsByteString; - readonly 'upstream_queue_time'?: NjsByteString; - readonly 'upstream_response_length'?: NjsByteString; - readonly 'upstream_response_time'?: NjsByteString; - readonly 'upstream_session_time'?: NjsByteString; - readonly 'upstream_status'?: NjsByteString; - readonly 'upstream_trailer_'?: NjsByteString; - readonly 'uri'?: NjsByteString; + readonly 'ancient_browser'?: string; + readonly 'arg_'?: string; + readonly 'args'?: string; + readonly 'binary_remote_addr'?: string; + readonly 'body_bytes_sent'?: string; + readonly 'bytes_received'?: string; + readonly 'bytes_sent'?: string; + readonly 'connection'?: string; + readonly 'connection_requests'?: string; + readonly 'connections_active'?: string; + readonly 'connections_reading'?: string; + readonly 'connections_waiting'?: string; + readonly 'connections_writing'?: string; + readonly 'content_length'?: string; + readonly 'content_type'?: string; + readonly 'cookie_'?: string; + readonly 'date_gmt'?: string; + readonly 'date_local'?: string; + readonly 'document_root'?: string; + readonly 'document_uri'?: string; + readonly 'fastcgi_path_info'?: string; + readonly 'fastcgi_script_name'?: string; + readonly 'geoip_area_code'?: string; + readonly 'geoip_city'?: string; + readonly 'geoip_city_continent_code'?: string; + readonly 'geoip_city_country_code'?: string; + readonly 'geoip_city_country_code3'?: string; + readonly 'geoip_city_country_name'?: string; + readonly 'geoip_country_code'?: string; + readonly 'geoip_country_code3'?: string; + readonly 'geoip_country_name'?: string; + readonly 'geoip_dma_code'?: string; + readonly 'geoip_latitude'?: string; + readonly 'geoip_longitude'?: string; + readonly 'geoip_org'?: string; + readonly 'geoip_postal_code'?: string; + readonly 'geoip_region'?: string; + readonly 'geoip_region_name'?: string; + readonly 'gzip_ratio'?: string; + readonly 'host'?: string; + readonly 'hostname'?: string; + readonly 'http2'?: string; + readonly 'http_'?: string; + readonly 'https'?: string; + readonly 'invalid_referer'?: string; + readonly 'is_args'?: string; + readonly 'jwt_claim_'?: string; + readonly 'jwt_header_'?: string; + readonly 'limit_conn_status'?: string; + readonly 'limit_rate'?: string; + readonly 'limit_req_status'?: string; + readonly 'memcached_key'?: string; + readonly 'modern_browser'?: string; + readonly 'msec'?: string; + readonly 'msie'?: string; + readonly 'nginx_version'?: string; + readonly 'pid'?: string; + readonly 'pipe'?: string; + readonly 'protocol'?: string; + readonly 'proxy_add_x_forwarded_for'?: string; + readonly 'proxy_host'?: string; + readonly 'proxy_port'?: string; + readonly 'proxy_protocol_addr'?: string; + readonly 'proxy_protocol_port'?: string; + readonly 'proxy_protocol_server_addr'?: string; + readonly 'proxy_protocol_server_port'?: string; + readonly 'query_string'?: string; + readonly 'realip_remote_addr'?: string; + readonly 'realip_remote_port'?: string; + readonly 'realpath_root'?: string; + readonly 'remote_addr'?: string; + readonly 'remote_port'?: string; + readonly 'remote_user'?: string; + readonly 'request'?: string; + readonly 'request_body'?: string; + readonly 'request_body_file'?: string; + readonly 'request_completion'?: string; + readonly 'request_filename'?: string; + readonly 'request_id'?: string; + readonly 'request_length'?: string; + readonly 'request_method'?: string; + readonly 'request_time'?: string; + readonly 'request_uri'?: string; + readonly 'scheme'?: string; + readonly 'secure_link'?: string; + readonly 'secure_link_expires'?: string; + readonly 'sent_http_'?: string; + readonly 'sent_trailer_'?: string; + readonly 'server_addr'?: string; + readonly 'server_name'?: string; + readonly 'server_port'?: string; + readonly 'server_protocol'?: string; + readonly 'session_log_binary_id'?: string; + readonly 'session_log_id'?: string; + readonly 'session_time'?: string; + readonly 'slice_range'?: string; + readonly 'spdy'?: string; + readonly 'spdy_request_priority'?: string; + readonly 'ssl_cipher'?: string; + readonly 'ssl_ciphers'?: string; + readonly 'ssl_client_cert'?: string; + readonly 'ssl_client_escaped_cert'?: string; + readonly 'ssl_client_fingerprint'?: string; + readonly 'ssl_client_i_dn'?: string; + readonly 'ssl_client_i_dn_legacy'?: string; + readonly 'ssl_client_raw_cert'?: string; + readonly 'ssl_client_s_dn'?: string; + readonly 'ssl_client_s_dn_legacy'?: string; + readonly 'ssl_client_serial'?: string; + readonly 'ssl_client_v_end'?: string; + readonly 'ssl_client_v_remain'?: string; + readonly 'ssl_client_v_start'?: string; + readonly 'ssl_client_verify'?: string; + readonly 'ssl_curves'?: string; + readonly 'ssl_early_data'?: string; + readonly 'ssl_preread_alpn_protocols'?: string; + readonly 'ssl_preread_protocol'?: string; + readonly 'ssl_preread_server_name'?: string; + readonly 'ssl_protocol'?: string; + readonly 'ssl_server_name'?: string; + readonly 'ssl_session_id'?: string; + readonly 'ssl_session_reused'?: string; + readonly 'status'?: string; + readonly 'tcpinfo_rtt'?: string; + readonly 'tcpinfo_rttvar'?: string; + readonly 'tcpinfo_snd_cwnd'?: string; + readonly 'tcpinfo_rcv_space'?: string; + readonly 'time_iso8601'?: string; + readonly 'time_local'?: string; + readonly 'uid_got'?: string; + readonly 'uid_reset'?: string; + readonly 'uid_set'?: string; + readonly 'upstream_addr'?: string; + readonly 'upstream_bytes_received'?: string; + readonly 'upstream_bytes_sent'?: string; + readonly 'upstream_cache_status'?: string; + readonly 'upstream_connect_time'?: string; + readonly 'upstream_cookie_'?: string; + readonly 'upstream_first_byte_time'?: string; + readonly 'upstream_header_time'?: string; + readonly 'upstream_http_'?: string; + readonly 'upstream_queue_time'?: string; + readonly 'upstream_response_length'?: string; + readonly 'upstream_response_time'?: string; + readonly 'upstream_session_time'?: string; + readonly 'upstream_status'?: string; + readonly 'upstream_trailer_'?: string; + readonly 'uri'?: string; - [prop: string]: NjsStringLike | undefined; + [prop: string]: string | undefined; } /** @@ -244,11 +244,11 @@ interface NginxSubrequestOptions { /** * Arguments string, by default an empty string is used. */ - args?: NjsStringLike, + args?: string, /** * Request body, by default the request body of the parent request object is used. */ - body?: NjsStringLike, + body?: string, /** * HTTP method, by default the GET method is used. */ @@ -316,7 +316,7 @@ interface NginxHTTPRequest { /** * HTTP protocol version. */ - readonly httpVersion: NjsByteString; + readonly httpVersion: string; /** * Performs an internal redirect to the specified uri. * If the uri starts with the “@” prefix, it is considered a named location. @@ -333,7 +333,7 @@ interface NginxHTTPRequest { /** * HTTP method. */ - readonly method: NjsByteString; + readonly method: string; /** * Parent for subrequest object. */ @@ -342,17 +342,17 @@ interface NginxHTTPRequest { * An array of key-value pairs exactly as they were received from the client. * @since 0.4.1 */ - readonly rawHeadersIn: [NjsFixedSizeArray<2, NjsStringLike>]; + readonly rawHeadersIn: [NjsFixedSizeArray<2, string>]; /** * An array of key-value pairs of response headers. * Header field names are not converted to lower case, duplicate field values are not merged. * @since 0.4.1 */ - readonly rawHeadersOut: [NjsFixedSizeArray<2, NjsStringLike>]; + readonly rawHeadersOut: [NjsFixedSizeArray<2, string>]; /** * Client address. */ - readonly remoteAddress: NjsByteString; + readonly remoteAddress: string; /** * Client request body if it has not been written to a temporary file. * To ensure that the client request body is in memory, its size should be @@ -370,7 +370,7 @@ interface NginxHTTPRequest { * @see requestBuffer * @since 0.5.0 */ - readonly requestText?: NjsByteString; + readonly requestText?: string; /** * The same as `requestBuffer`, but returns a string. * @@ -380,7 +380,7 @@ interface NginxHTTPRequest { * @see requestText * @deprecated Use `requestText` or `requestBuffer` instead. */ - readonly requestBody?: NjsByteString; + readonly requestBody?: string; /** * Subrequest response body. The size of response body is limited by * the subrequest_output_buffer_size directive. @@ -395,7 +395,7 @@ interface NginxHTTPRequest { * * @see responseBuffer */ - readonly responseText?: NjsByteString; + readonly responseText?: string; /** * The same as `responseBuffer`, but returns a string. * @@ -405,7 +405,7 @@ interface NginxHTTPRequest { * @see responseText * @deprecated Use `responseText` or `responseBuffer` instead. */ - readonly responseBody?: NjsByteString; + readonly responseBody?: string; /** * Sends the entire response with the specified status to the client. * It is possible to specify either a redirect URL (for codes 301, 302, 303, 307, and 308) @@ -457,7 +457,7 @@ interface NginxHTTPRequest { /** * Current URI in request, normalized. */ - readonly uri: NjsByteString; + readonly uri: string; /** * nginx variables as Buffers. * diff --git a/ts/ngx_stream_js_module.d.ts b/ts/ngx_stream_js_module.d.ts index 849ffce0..b3c13033 100644 --- a/ts/ngx_stream_js_module.d.ts +++ b/ts/ngx_stream_js_module.d.ts @@ -2,72 +2,72 @@ /// interface NginxStreamVariables { - readonly 'binary_remote_addr'?: NjsByteString; - readonly 'bytes_received'?: NjsByteString; - readonly 'bytes_sent'?: NjsByteString; - readonly 'connection'?: NjsByteString; - readonly 'geoip_area_code'?: NjsByteString; - readonly 'geoip_city'?: NjsByteString; - readonly 'geoip_city_continent_code'?: NjsByteString; - readonly 'geoip_city_country_code'?: NjsByteString; - readonly 'geoip_city_country_code3'?: NjsByteString; - readonly 'geoip_city_country_name'?: NjsByteString; - readonly 'geoip_country_code'?: NjsByteString; - readonly 'geoip_country_code3'?: NjsByteString; - readonly 'geoip_country_name'?: NjsByteString; - readonly 'geoip_dma_code'?: NjsByteString; - readonly 'geoip_latitude'?: NjsByteString; - readonly 'geoip_longitude'?: NjsByteString; - readonly 'geoip_org'?: NjsByteString; - readonly 'geoip_postal_code'?: NjsByteString; - readonly 'geoip_region'?: NjsByteString; - readonly 'geoip_region_name'?: NjsByteString; - readonly 'hostname'?: NjsByteString; - readonly 'limit_conn_status'?: NjsByteString; - readonly 'msec'?: NjsByteString; - readonly 'nginx_version'?: NjsByteString; - readonly 'pid'?: NjsByteString; - readonly 'proxy_add_x_forwarded_for'?: NjsByteString; - readonly 'proxy_host'?: NjsByteString; - readonly 'proxy_port'?: NjsByteString; - readonly 'proxy_protocol_addr'?: NjsByteString; - readonly 'proxy_protocol_port'?: NjsByteString; - readonly 'proxy_protocol_server_addr'?: NjsByteString; - readonly 'proxy_protocol_server_port'?: NjsByteString; - readonly 'realip_remote_addr'?: NjsByteString; - readonly 'realip_remote_port'?: NjsByteString; - readonly 'remote_addr'?: NjsByteString; - readonly 'remote_port'?: NjsByteString; - readonly 'server_addr'?: NjsByteString; - readonly 'server_port'?: NjsByteString; - readonly 'ssl_cipher'?: NjsByteString; - readonly 'ssl_ciphers'?: NjsByteString; - readonly 'ssl_client_cert'?: NjsByteString; - readonly 'ssl_client_escaped_cert'?: NjsByteString; - readonly 'ssl_client_fingerprint'?: NjsByteString; - readonly 'ssl_client_i_dn'?: NjsByteString; - readonly 'ssl_client_raw_cert'?: NjsByteString; - readonly 'ssl_client_s_dn'?: NjsByteString; - readonly 'ssl_client_s_dn_legacy'?: NjsByteString; - readonly 'ssl_client_serial'?: NjsByteString; - readonly 'ssl_client_v_end'?: NjsByteString; - readonly 'ssl_client_v_remain'?: NjsByteString; - readonly 'ssl_client_v_start'?: NjsByteString; - readonly 'ssl_client_verify'?: NjsByteString; - readonly 'ssl_curves'?: NjsByteString; - readonly 'ssl_early_data'?: NjsByteString; - readonly 'ssl_preread_alpn_protocols'?: NjsByteString; - readonly 'ssl_preread_protocol'?: NjsByteString; - readonly 'ssl_preread_server_name'?: NjsByteString; - readonly 'ssl_protocol'?: NjsByteString; - readonly 'ssl_server_name'?: NjsByteString; - readonly 'ssl_session_id'?: NjsByteString; - readonly 'ssl_session_reused'?: NjsByteString; - readonly 'status'?: NjsByteString; - readonly 'time_iso8601'?: NjsByteString; - readonly 'time_local'?: NjsByteString; + readonly 'binary_remote_addr'?: string; + readonly 'bytes_received'?: string; + readonly 'bytes_sent'?: string; + readonly 'connection'?: string; + readonly 'geoip_area_code'?: string; + readonly 'geoip_city'?: string; + readonly 'geoip_city_continent_code'?: string; + readonly 'geoip_city_country_code'?: string; + readonly 'geoip_city_country_code3'?: string; + readonly 'geoip_city_country_name'?: string; + readonly 'geoip_country_code'?: string; + readonly 'geoip_country_code3'?: string; + readonly 'geoip_country_name'?: string; + readonly 'geoip_dma_code'?: string; + readonly 'geoip_latitude'?: string; + readonly 'geoip_longitude'?: string; + readonly 'geoip_org'?: string; + readonly 'geoip_postal_code'?: string; + readonly 'geoip_region'?: string; + readonly 'geoip_region_name'?: string; + readonly 'hostname'?: string; + readonly 'limit_conn_status'?: string; + readonly 'msec'?: string; + readonly 'nginx_version'?: string; + readonly 'pid'?: string; + readonly 'proxy_add_x_forwarded_for'?: string; + readonly 'proxy_host'?: string; + readonly 'proxy_port'?: string; + readonly 'proxy_protocol_addr'?: string; + readonly 'proxy_protocol_port'?: string; + readonly 'proxy_protocol_server_addr'?: string; + readonly 'proxy_protocol_server_port'?: string; + readonly 'realip_remote_addr'?: string; + readonly 'realip_remote_port'?: string; + readonly 'remote_addr'?: string; + readonly 'remote_port'?: string; + readonly 'server_addr'?: string; + readonly 'server_port'?: string; + readonly 'ssl_cipher'?: string; + readonly 'ssl_ciphers'?: string; + readonly 'ssl_client_cert'?: string; + readonly 'ssl_client_escaped_cert'?: string; + readonly 'ssl_client_fingerprint'?: string; + readonly 'ssl_client_i_dn'?: string; + readonly 'ssl_client_raw_cert'?: string; + readonly 'ssl_client_s_dn'?: string; + readonly 'ssl_client_s_dn_legacy'?: string; + readonly 'ssl_client_serial'?: string; + readonly 'ssl_client_v_end'?: string; + readonly 'ssl_client_v_remain'?: string; + readonly 'ssl_client_v_start'?: string; + readonly 'ssl_client_verify'?: string; + readonly 'ssl_curves'?: string; + readonly 'ssl_early_data'?: string; + readonly 'ssl_preread_alpn_protocols'?: string; + readonly 'ssl_preread_protocol'?: string; + readonly 'ssl_preread_server_name'?: string; + readonly 'ssl_protocol'?: string; + readonly 'ssl_server_name'?: string; + readonly 'ssl_session_id'?: string; + readonly 'ssl_session_reused'?: string; + readonly 'status'?: string; + readonly 'time_iso8601'?: string; + readonly 'time_local'?: string; - [prop: string]: NjsByteString | undefined; + [prop: string]: string | undefined; } /** @@ -165,13 +165,13 @@ interface NginxStreamRequest { * @see off() */ on(event: "upload" | "download", - callback: (data: NjsByteString, flags: NginxStreamCallbackFlags) => void): void; + callback: (data: string, flags: NginxStreamCallbackFlags) => void): void; on(event: "upstream" | "downstream", callback: (data: Buffer, flags: NginxStreamCallbackFlags) => void): void; /** * Client address. */ - readonly remoteAddress: NjsByteString; + readonly remoteAddress: string; /** * Adds data to the chain of data chunks that will be forwarded in * the forward direction: in download callback to a client; in upload diff --git a/ts/njs_core.d.ts b/ts/njs_core.d.ts index 22af1e92..0e286f93 100644 --- a/ts/njs_core.d.ts +++ b/ts/njs_core.d.ts @@ -5,63 +5,6 @@ type NjsFixedSizeArray = N extends 0 ? never[] : { length: N; } & ReadonlyArray; - -interface StringConstructor { - /** - * Creates a byte string from an encoded string. - * - * @deprecated will be removed in the future. - */ - bytesFrom(bytes: string, encoding: Exclude): NjsByteString; - /** - * Creates a byte string from an array that contains octets. - * - * @deprecated will be removed in the future. - */ - bytesFrom(bytes: Array): NjsByteString; -} - -interface String { - /** - * Serializes a Unicode string with code points up to 255 - * into a byte string, otherwise, null is returned. - * - * @deprecated will be removed in the future. - */ - toBytes(start?: number, end?: number): NjsByteString | null; - /** - * Serializes a Unicode string to a byte string using UTF8 encoding. - * - * @deprecated will be removed in the future. - */ - toUTF8(start?: number, end?: number): NjsByteString; -} - -type NjsByteString = string & { - /** - * Returns a new Unicode string from a byte string where each byte is replaced - * with a corresponding Unicode code point. - * - * @deprecated will be removed in the future. - */ - fromBytes(start?: number, end?: number): string; - /** - * Converts a byte string containing a valid UTF8 string into a Unicode string, - * otherwise null is returned. - * - * @deprecated will be removed in the future. - */ - fromUTF8(start?: number, end?: number): string | null; - /** - * Encodes a byte string to hex, base64, or base64url. - * - * @deprecated will be removed in the future. - */ - toString(encoding: Exclude): string; -}; - -type NjsStringLike = string | NjsByteString; - type TypedArray = | Uint8Array | Uint8ClampedArray @@ -86,7 +29,7 @@ declare class Buffer extends Uint8Array { * @param encoding The character encoding used for call to `buf.fill(fill, encoding)` while * initalizing. Defaults to`'utf8'`. */ - static alloc(size: number, fill?: NjsStringLike | Uint8Array | number, encoding?: BufferEncoding): Buffer; + static alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer; /** * The same as `Buffer.alloc()`, with the difference that the memory allocated for the buffer * is not initialized, the contents of the new buffer is unknown and may contain sensitive data. @@ -102,7 +45,7 @@ declare class Buffer extends Uint8Array { * @param encoding The character encoding used to evaluate `value` if `value` is a `string`. * Defaults to `'utf8'`. */ - static byteLength(value: NjsStringLike | Buffer | TypedArray | DataView | ArrayBuffer, encoding?: BufferEncoding): number; + static byteLength(value: string | Buffer | TypedArray | DataView | ArrayBuffer, encoding?: BufferEncoding): number; /** * Compares `buffer1` with `buffer2` when sorting arrays of buffer instances. @@ -153,7 +96,7 @@ declare class Buffer extends Uint8Array { * * @param obj An object supporting `valueOf()`. */ - static from(obj: { valueOf(): NjsStringLike | object }, byteOffset?: number, length?: number): Buffer; + static from(obj: { valueOf(): string | object }, byteOffset?: number, length?: number): Buffer; /** * Creates a new `Buffer` with a string `str`. * @@ -161,7 +104,7 @@ declare class Buffer extends Uint8Array { * @param encoding The character encoding to be used when converting a string into bytes. * Defaults to `'utf8'`. */ - static from(str: NjsStringLike, encoding?: BufferEncoding): Buffer; + static from(str: string, encoding?: BufferEncoding): Buffer; /** * Returns true if the `obj` is a `Buffer`. @@ -175,7 +118,7 @@ declare class Buffer extends Uint8Array { * * @param encoding The string to test. */ - static isEncoding(encoding: NjsStringLike): encoding is BufferEncoding; + static isEncoding(encoding: string): encoding is BufferEncoding; /** * The underlying `ArrayBuffer` object based on which this `Buffer` object is created. @@ -255,7 +198,7 @@ declare class Buffer extends Uint8Array { * @param end Where to stop filling this buffer (not inclusive). Defaults to `buf.length`. * @param encoding The encoding for `value` if `value` is a `string`. Defaults to `'utf8'`. */ - fill(value: NjsStringLike | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; + fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; /** * Equivalent to `buf.indexOf() !== -1`, returns `true` if the `value` was found in this buffer. @@ -264,7 +207,7 @@ declare class Buffer extends Uint8Array { * @param byteOffset Where to begin search in this buffer. Defaults to `0`. * @param encoding The encoding for `value` if `value` is a `string`. Defaults to `'utf8'`. */ - includes(value: NjsStringLike | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): boolean; + includes(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): boolean; /** * Returns an integer which is the index of the first occurrence of `value` in this buffer, @@ -274,7 +217,7 @@ declare class Buffer extends Uint8Array { * @param byteOffset Where to begin search in this buffer. Defaults to `0`. * @param encoding The encoding for `value` if `value` is a `string`. Defaults to `'utf8'`. */ - indexOf(value: NjsStringLike | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; + indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; /** * The same as `buf.indexOf()`, except the last occurrence of the `value` is found instead of * the first occurrence. If the `value` is an empty `string` or empty `Buffer`, `byteOffset` @@ -284,7 +227,7 @@ declare class Buffer extends Uint8Array { * @param byteOffset Where to begin search in this buffer. Defaults to `0`. * @param encoding The encoding for `value` if `value` is a `string`. Defaults to `'utf8'`. */ - lastIndexOf(value: NjsStringLike | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; + lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; /** * Reads the `byteLength` from this buffer at the specified `offset` and interprets the result @@ -467,9 +410,9 @@ declare class Buffer extends Uint8Array { * @param encoding The character encoding of `str`. Defaults to `'utf8'`. * @return Offset plus the number of bytes written. */ - write(str: NjsStringLike, encoding?: BufferEncoding): number; - write(str: NjsStringLike, offset: number, encoding?: BufferEncoding): number; - write(str: NjsStringLike, offset: number, length: number, encoding?: BufferEncoding): number; + write(str: string, encoding?: BufferEncoding): number; + write(str: string, offset: number, encoding?: BufferEncoding): number; + write(str: string, offset: number, length: number, encoding?: BufferEncoding): number; /** * Writes `byteLength` bytes of `value` to this buffer at the specified `offset` as big-endian. @@ -600,7 +543,7 @@ declare class Buffer extends Uint8Array { writeFloatLE(value: number, offset?: number): number; } -type NjsStringOrBuffer = NjsStringLike | Buffer | DataView | TypedArray | ArrayBuffer; +type NjsStringOrBuffer = string | Buffer | DataView | TypedArray | ArrayBuffer; type NjsBuffer = Buffer | DataView | TypedArray; // Global objects @@ -628,7 +571,7 @@ interface NjsGlobal { declare const njs: NjsGlobal; interface NjsEnv { - readonly [prop: string]: NjsByteString; + readonly [prop: string]: string; } interface NjsProcess { diff --git a/ts/njs_modules/fs.d.ts b/ts/njs_modules/fs.d.ts index 72c13f42..ff168567 100644 --- a/ts/njs_modules/fs.d.ts +++ b/ts/njs_modules/fs.d.ts @@ -461,7 +461,7 @@ declare module "fs" { * Defaults to 'utf8'. */ write(buffer: NjsBuffer, offset: number, length?: number, position?: number | null): Promise; - write(buffer: NjsStringLike, position?: number | null, encoding?: FileEncoding): Promise; + write(buffer: string, position?: number | null, encoding?: FileEncoding): Promise; } interface NjsFS { @@ -612,7 +612,7 @@ declare module "fs" { * Defaults to 'utf8'. */ readSync(fd: number, buffer: NjsBuffer, offset: number, length?: number, position?: number | null): number; - readSync(fd: number, string: NjsStringLike, position?: number | null, encoding?: FileEncoding): number; + readSync(fd: number, string: string, position?: number | null, encoding?: FileEncoding): number; /** * Synchronously computes the canonical pathname by resolving `.`, `..` and symbolic links using @@ -709,7 +709,7 @@ declare module "fs" { * Defaults to 'utf8'. */ writeSync(fd: number, buffer: NjsBuffer, offset: number, length?: number, position?: number | null): number; - writeSync(fd: number, string: NjsStringLike, position?: number | null, encoding?: FileEncoding): number; + writeSync(fd: number, string: string, position?: number | null, encoding?: FileEncoding): number; } const fs: NjsFS; diff --git a/ts/njs_modules/querystring.d.ts b/ts/njs_modules/querystring.d.ts index 4058f5a1..d4229fdf 100644 --- a/ts/njs_modules/querystring.d.ts +++ b/ts/njs_modules/querystring.d.ts @@ -7,7 +7,7 @@ declare module "querystring" { } export interface ParsedUrlQueryInput { - [key: string]: NjsStringLike | number | boolean | NjsStringLike[] | number[] | boolean[] | null | undefined; + [key: string]: string | number | boolean | string[] | number[] | boolean[] | null | undefined; } interface ParseOptions { @@ -15,7 +15,7 @@ declare module "querystring" { * Function used to decode percent-encoded characters in the query string. * Defaults to `querystring.unescape()`. */ - decodeURIComponent?: (str: NjsStringLike) => string; + decodeURIComponent?: (str: string) => string; /** * The maximum number of keys to parse; defaults to `1000`. @@ -29,7 +29,7 @@ declare module "querystring" { * The function to use when converting URL-unsafe characters to percent-encoding in the * query string; defaults to `querystring.escape()`. */ - encodeURIComponent?: (str: NjsStringLike) => string; + encodeURIComponent?: (str: string) => string; } interface QueryString { @@ -40,7 +40,7 @@ declare module "querystring" { * @param str The query string to escape. * @return The escaped query string. */ - escape(str: NjsStringLike): string; + escape(str: string): string; /** * Parses the query string URL and returns an object. @@ -55,12 +55,12 @@ declare module "querystring" { * @param options An object optionally specifying `decodeURIComponent` function and `maxKeys` number. * @return An object containing the components of the query string. */ - parse(query: NjsStringLike, separator?: NjsStringLike, equal?: NjsStringLike, options?: ParseOptions): ParsedUrlQuery; + parse(query: string, separator?: string, equal?: string, options?: ParseOptions): ParsedUrlQuery; /** * An alias for `querystring.parse()`. */ - decode(query: NjsStringLike, separator?: NjsStringLike, equal?: NjsStringLike, options?: ParseOptions): ParsedUrlQuery; + decode(query: string, separator?: string, equal?: string, options?: ParseOptions): ParsedUrlQuery; /** * Serializes an object and returns a URL query string. @@ -75,12 +75,12 @@ declare module "querystring" { * @param options An object optionally specifying `encodeURIComponent` function. * @return A query string. */ - stringify(obj: ParsedUrlQueryInput, separator?: NjsStringLike, equal?: NjsStringLike, options?: StringifyOptions): string; + stringify(obj: ParsedUrlQueryInput, separator?: string, equal?: string, options?: StringifyOptions): string; /** * An alias for `querystring.stringify()`. */ - encode(obj: ParsedUrlQueryInput, separator?: NjsStringLike, equal?: NjsStringLike, options?: StringifyOptions): string; + encode(obj: ParsedUrlQueryInput, separator?: string, equal?: string, options?: StringifyOptions): string; /** * Performs decoding of URL percent-encoded characters of the string `str`, returns an @@ -90,7 +90,7 @@ declare module "querystring" { * @param str An escaped query string. * @return An unescaped string. */ - unescape(str: NjsStringLike): string; + unescape(str: string): string; } const querystring: QueryString; diff --git a/ts/njs_modules/xml.d.ts b/ts/njs_modules/xml.d.ts index 9dbca1fb..7b064f76 100644 --- a/ts/njs_modules/xml.d.ts +++ b/ts/njs_modules/xml.d.ts @@ -140,7 +140,7 @@ declare module "xml" { * @param src a string or a buffer with an XML document. * @return A XMLDoc wrapper object representing the parsed XML document. */ - parse(src: NjsStringLike): XMLDoc; + parse(src: string): XMLDoc; /** * Canonicalizes root_node and its children according to diff --git a/ts/njs_shell.d.ts b/ts/njs_shell.d.ts index e8180258..9022c776 100644 --- a/ts/njs_shell.d.ts +++ b/ts/njs_shell.d.ts @@ -4,8 +4,8 @@ interface Console { log(...args: any[]): void; dump(...args: any[]): void; - time(label?: NjsStringLike): void; - timeEnd(label?: NjsStringLike): void; + time(label?: string): void; + timeEnd(label?: string): void; } declare const console: Console;