// Warning: vod = r.subrequest('/p/sub9', {detached:true}, reply => r.return(reply.status));
r.subrequest('/p/sub6', 'a=1&b=2').then(reply => r.return(reply.status,
JSON.stringify(JSON.parse(reply.responseBody ?? ''))));
-
}
function fs_module() {
b.equals(b);
}
-function builtins() {
+function njs_object() {
njs.dump('asdf');
njs.version != process.argv[1];
}
+
+function ngx_object() {
+ ngx.log(ngx.INFO, 'asdf');
+ ngx.log(ngx.WARN, Buffer.from('asdf'));
+ ngx.log(ngx.ERR, 'asdf');
+}
--- /dev/null
+interface NgxObject {
+ readonly INFO: number;
+ readonly WARN: number;
+ readonly ERR: number;
+ /**
+ * Writes a string to the error log with the specified level
+ * of logging.
+ * @param level Log level (ngx.INFO, ngx.WARN, ngx.ERR).
+ * @param message Message to log.
+ */
+ log(level: number, message: NjsStringOrBuffer): void;
+}
+
+declare const ngx: NgxObject;
/// <reference path="index.d.ts" />
+/// <reference path="ngx_core.d.ts" />
interface NginxHTTPArgs {
readonly [prop: string]: NjsByteString;
/// <reference path="index.d.ts" />
+/// <reference path="ngx_core.d.ts" />
interface NginxStreamVariables {
readonly 'binary_remote_addr'?: NjsByteString;