Types: added description for "ngx" object.
diff --git a/test/ts/test.ts b/test/ts/test.ts
index 9a079a0..42a6ae8 100644
--- a/test/ts/test.ts
+++ b/test/ts/test.ts
@@ -66,7 +66,6 @@
     // 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() {
@@ -107,7 +106,13 @@
     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');
+}
diff --git a/ts/ngx_core.d.ts b/ts/ngx_core.d.ts
new file mode 100644
index 0000000..258a27f
--- /dev/null
+++ b/ts/ngx_core.d.ts
@@ -0,0 +1,14 @@
+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;
diff --git a/ts/ngx_http_js_module.d.ts b/ts/ngx_http_js_module.d.ts
index 92833d8..239fa52 100644
--- a/ts/ngx_http_js_module.d.ts
+++ b/ts/ngx_http_js_module.d.ts
@@ -1,4 +1,5 @@
 /// <reference path="index.d.ts" />
+/// <reference path="ngx_core.d.ts" />
 
 interface NginxHTTPArgs {
     readonly [prop: string]: NjsByteString;
diff --git a/ts/ngx_stream_js_module.d.ts b/ts/ngx_stream_js_module.d.ts
index 3e01b91..3fedc32 100644
--- a/ts/ngx_stream_js_module.d.ts
+++ b/ts/ngx_stream_js_module.d.ts
@@ -1,4 +1,5 @@
 /// <reference path="index.d.ts" />
+/// <reference path="ngx_core.d.ts" />
 
 interface NginxStreamVariables {
     readonly 'binary_remote_addr'?: NjsByteString;