@tsonic/nodejs 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,11 +37,11 @@ export interface ClientRequest$instance extends EventEmitter {
37
37
  readonly protocol: string;
38
38
  abort(): void;
39
39
  end(chunk?: string, encoding?: string, callback?: Action): Task;
40
- getHeader(name: string): string;
40
+ getHeader(name: string): string | undefined;
41
41
  getHeaderNames(): string[];
42
42
  removeHeader(name: string): void;
43
43
  setHeader(name: string, value: string): void;
44
- setTimeout(msecs: int, callback?: Action): ClientRequest;
44
+ setTimeout(msecs: int, callback?: Action | undefined): ClientRequest;
45
45
  write(chunk: string, encoding?: string, callback?: Action): boolean;
46
46
  }
47
47
 
@@ -60,13 +60,13 @@ export interface IncomingMessage$instance extends EventEmitter {
60
60
  readonly method: string;
61
61
  readonly statusCode: Nullable<System_Internal.Int32>;
62
62
  readonly statusMessage: string;
63
- readonly url: string;
63
+ readonly url: string | undefined;
64
64
  destroy(): void;
65
65
  onClose(callback: Action): void;
66
66
  onData(callback: Action<System_Internal.String>): void;
67
67
  onEnd(callback: Action): void;
68
68
  readAll(): Task<System_Internal.String>;
69
- setTimeout(msecs: int, callback?: Action): IncomingMessage;
69
+ setTimeout(msecs: int, callback?: Action | undefined): IncomingMessage;
70
70
  }
71
71
 
72
72
 
@@ -78,8 +78,8 @@ export const IncomingMessage: {
78
78
  export type IncomingMessage = IncomingMessage$instance;
79
79
 
80
80
  export interface RequestOptions$instance {
81
- agent: unknown;
82
- auth: string;
81
+ agent: unknown | undefined;
82
+ auth: string | undefined;
83
83
  headers: Dictionary<System_Internal.String, System_Internal.String>;
84
84
  host: string;
85
85
  hostname: string;
@@ -106,15 +106,15 @@ export interface Server$instance extends EventEmitter {
106
106
  requestTimeout: int;
107
107
  timeout: int;
108
108
  address(): AddressInfo;
109
- close(callback?: Action): Server;
109
+ close(callback?: Action | undefined): Server;
110
110
  listen(port: int, hostname?: string, backlog?: Nullable<System_Internal.Int32>, callback?: Action): Server;
111
- listen(port: int, callback?: Action): Server;
112
- setTimeout(msecs: int, callback?: Action): Server;
111
+ listen(port: int, callback?: Action | undefined): Server;
112
+ setTimeout(msecs: int, callback?: Action | undefined): Server;
113
113
  }
114
114
 
115
115
 
116
116
  export const Server: {
117
- new(requestListener: Action<IncomingMessage, ServerResponse>): Server;
117
+ new(requestListener: Action<IncomingMessage, ServerResponse> | undefined): Server;
118
118
  };
119
119
 
120
120
 
@@ -127,15 +127,15 @@ export interface ServerResponse$instance extends EventEmitter {
127
127
  statusMessage: string;
128
128
  end(chunk?: string, encoding?: string, callback?: Action): Task;
129
129
  flushHeaders(): Task;
130
- getHeader(name: string): string;
130
+ getHeader(name: string): string | undefined;
131
131
  getHeaderNames(): string[];
132
132
  getHeaders(): Dictionary<System_Internal.String, System_Internal.String>;
133
133
  hasHeader(name: string): boolean;
134
134
  removeHeader(name: string): void;
135
135
  setHeader(name: string, value: string): ServerResponse;
136
- setTimeout(msecs: int, callback?: Action): ServerResponse;
137
- write(chunk: string, encoding?: string, callback?: Action): Task<System_Internal.Boolean>;
138
- writeHead(statusCode: int, statusMessage?: string, headers?: Dictionary<System_Internal.String, System_Internal.String>): ServerResponse;
136
+ setTimeout(msecs: int, callback?: Action | undefined): ServerResponse;
137
+ write(chunk: string, encoding?: string | undefined, callback?: Action | undefined): Task<System_Internal.Boolean>;
138
+ writeHead(statusCode: int, statusMessage?: string | undefined, headers?: Dictionary<System_Internal.String, System_Internal.String> | undefined): ServerResponse;
139
139
  writeHead(statusCode: int, headers: Dictionary<System_Internal.String, System_Internal.String>): ServerResponse;
140
140
  }
141
141
 
@@ -163,13 +163,13 @@ export abstract class http$instance {
163
163
  static globalAgent_maxFreeSockets: int;
164
164
  static globalAgent_timeout: int;
165
165
  static maxHeaderSize: int;
166
- static createServer(requestListener?: Action<IncomingMessage, ServerResponse>): Server;
167
- static get_(options: RequestOptions, callback?: Action<IncomingMessage>): ClientRequest;
168
- static get_(url: string, callback?: Action<IncomingMessage>): ClientRequest;
169
- static request(options: RequestOptions, callback?: Action<IncomingMessage>): ClientRequest;
170
- static request(url: string, callback?: Action<IncomingMessage>): ClientRequest;
166
+ static createServer(requestListener?: Action<IncomingMessage, ServerResponse> | undefined): Server;
167
+ static get_(options: RequestOptions, callback?: Action<IncomingMessage> | undefined): ClientRequest;
168
+ static get_(url: string, callback?: Action<IncomingMessage> | undefined): ClientRequest;
169
+ static request(options: RequestOptions, callback?: Action<IncomingMessage> | undefined): ClientRequest;
170
+ static request(url: string, callback?: Action<IncomingMessage> | undefined): ClientRequest;
171
171
  static validateHeaderName(name: string): void;
172
- static validateHeaderValue(name: string, value: unknown): void;
172
+ static validateHeaderValue(name: string, value: unknown | undefined): void;
173
173
  }
174
174
 
175
175
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsonic/nodejs",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "TypeScript type definitions for Node.js CLR library",
5
5
  "type": "module",
6
6
  "keywords": [