@aligent/cdk-prerender-proxy 0.2.5-experimental → 0.2.5-experimental2
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.
- package/lib/error-response-construct.d.ts +0 -1
- package/lib/error-response-construct.js +4 -5
- package/lib/handlers/cache-control.ts +21 -0
- package/lib/handlers/error-response.ts +51 -0
- package/lib/handlers/node_modules/.package-lock.json +55 -0
- package/lib/handlers/node_modules/@types/aws-lambda/LICENSE +21 -0
- package/lib/handlers/node_modules/@types/aws-lambda/README.md +16 -0
- package/lib/handlers/node_modules/@types/aws-lambda/common/api-gateway.d.ts +79 -0
- package/lib/handlers/node_modules/@types/aws-lambda/common/cloudfront.d.ts +79 -0
- package/lib/handlers/node_modules/@types/aws-lambda/handler.d.ts +171 -0
- package/lib/handlers/node_modules/@types/aws-lambda/index.d.ts +85 -0
- package/lib/handlers/node_modules/@types/aws-lambda/package.json +210 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/alb.d.ts +48 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/api-gateway-authorizer.d.ts +174 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/api-gateway-proxy.d.ts +187 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/appsync-resolver.d.ts +51 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudformation-custom-resource.d.ts +68 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudfront-request.d.ts +20 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudfront-response.d.ts +21 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudwatch-events.d.ts +8 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudwatch-logs.d.ts +37 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codebuild-cloudwatch-state.d.ts +104 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-action.d.ts +31 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-pipeline.d.ts +32 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-stage.d.ts +23 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch.d.ts +11 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline.d.ts +55 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/_common.d.ts +41 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/create-auth-challenge.d.ts +22 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-email-sender.d.ts +86 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-message.d.ts +44 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/define-auth-challenge.d.ts +21 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/index.d.ts +119 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-authentication.d.ts +15 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-confirmation.d.ts +22 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-authentication.d.ts +15 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-signup.d.ts +31 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-token-generation.d.ts +45 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/user-migration.d.ts +39 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/verify-auth-challenge-response.d.ts +20 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/connect-contact-flow.d.ts +65 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/dynamodb-stream.d.ts +45 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/eventbridge.d.ts +18 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/iot.d.ts +28 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/kinesis-firehose-transformation.d.ts +45 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/kinesis-stream.d.ts +28 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/lex.d.ts +116 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/msk.d.ts +21 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/s3-batch.d.ts +41 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/s3.d.ts +60 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/ses.d.ts +103 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/sns.d.ts +38 -0
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/sqs.d.ts +46 -0
- package/lib/handlers/node_modules/@types/node/LICENSE +21 -0
- package/lib/handlers/node_modules/@types/node/README.md +16 -0
- package/lib/handlers/node_modules/@types/node/assert/strict.d.ts +4 -0
- package/lib/handlers/node_modules/@types/node/assert.d.ts +124 -0
- package/lib/handlers/node_modules/@types/node/async_hooks.d.ts +226 -0
- package/lib/handlers/node_modules/@types/node/base.d.ts +19 -0
- package/lib/handlers/node_modules/@types/node/buffer.d.ts +84 -0
- package/lib/handlers/node_modules/@types/node/child_process.d.ts +526 -0
- package/lib/handlers/node_modules/@types/node/cluster.d.ts +262 -0
- package/lib/handlers/node_modules/@types/node/console.d.ts +133 -0
- package/lib/handlers/node_modules/@types/node/constants.d.ts +13 -0
- package/lib/handlers/node_modules/@types/node/crypto.d.ts +1580 -0
- package/lib/handlers/node_modules/@types/node/dgram.d.ts +141 -0
- package/lib/handlers/node_modules/@types/node/diagnostic_channel.d.ts +34 -0
- package/lib/handlers/node_modules/@types/node/dns/promises.d.ts +97 -0
- package/lib/handlers/node_modules/@types/node/dns.d.ts +322 -0
- package/lib/handlers/node_modules/@types/node/domain.d.ts +24 -0
- package/lib/handlers/node_modules/@types/node/events.d.ts +93 -0
- package/lib/handlers/node_modules/@types/node/fs/promises.d.ts +592 -0
- package/lib/handlers/node_modules/@types/node/fs.d.ts +2239 -0
- package/lib/handlers/node_modules/@types/node/globals.d.ts +655 -0
- package/lib/handlers/node_modules/@types/node/globals.global.d.ts +1 -0
- package/lib/handlers/node_modules/@types/node/http.d.ts +434 -0
- package/lib/handlers/node_modules/@types/node/http2.d.ts +976 -0
- package/lib/handlers/node_modules/@types/node/https.d.ts +36 -0
- package/lib/handlers/node_modules/@types/node/index.d.ts +58 -0
- package/lib/handlers/node_modules/@types/node/inspector.d.ts +3041 -0
- package/lib/handlers/node_modules/@types/node/module.d.ts +52 -0
- package/lib/handlers/node_modules/@types/node/net.d.ts +326 -0
- package/lib/handlers/node_modules/@types/node/os.d.ts +239 -0
- package/lib/handlers/node_modules/@types/node/package.json +232 -0
- package/lib/handlers/node_modules/@types/node/path.d.ts +163 -0
- package/lib/handlers/node_modules/@types/node/perf_hooks.d.ts +310 -0
- package/lib/handlers/node_modules/@types/node/process.d.ts +461 -0
- package/lib/handlers/node_modules/@types/node/punycode.d.ts +75 -0
- package/lib/handlers/node_modules/@types/node/querystring.d.ts +28 -0
- package/lib/handlers/node_modules/@types/node/readline.d.ts +192 -0
- package/lib/handlers/node_modules/@types/node/repl.d.ts +395 -0
- package/lib/handlers/node_modules/@types/node/stream/promises.d.ts +67 -0
- package/lib/handlers/node_modules/@types/node/stream.d.ts +471 -0
- package/lib/handlers/node_modules/@types/node/string_decoder.d.ts +7 -0
- package/lib/handlers/node_modules/@types/node/timers/promises.d.ts +21 -0
- package/lib/handlers/node_modules/@types/node/timers.d.ts +27 -0
- package/lib/handlers/node_modules/@types/node/tls.d.ts +793 -0
- package/lib/handlers/node_modules/@types/node/trace_events.d.ts +61 -0
- package/lib/handlers/node_modules/@types/node/ts3.6/assert.d.ts +98 -0
- package/lib/handlers/node_modules/@types/node/ts3.6/base.d.ts +68 -0
- package/lib/handlers/node_modules/@types/node/ts3.6/index.d.ts +7 -0
- package/lib/handlers/node_modules/@types/node/tty.d.ts +66 -0
- package/lib/handlers/node_modules/@types/node/url.d.ts +116 -0
- package/lib/handlers/node_modules/@types/node/util/types.d.ts +53 -0
- package/lib/handlers/node_modules/@types/node/util.d.ts +156 -0
- package/lib/handlers/node_modules/@types/node/v8.d.ts +198 -0
- package/lib/handlers/node_modules/@types/node/vm.d.ts +152 -0
- package/lib/handlers/node_modules/@types/node/wasi.d.ts +86 -0
- package/lib/handlers/node_modules/@types/node/worker_threads.d.ts +282 -0
- package/lib/handlers/node_modules/@types/node/zlib.d.ts +361 -0
- package/lib/handlers/node_modules/axios/CHANGELOG.md +685 -0
- package/lib/handlers/node_modules/axios/LICENSE +19 -0
- package/lib/handlers/node_modules/axios/README.md +800 -0
- package/lib/handlers/node_modules/axios/UPGRADE_GUIDE.md +162 -0
- package/lib/handlers/node_modules/axios/dist/axios.js +1756 -0
- package/lib/handlers/node_modules/axios/dist/axios.map +1 -0
- package/lib/handlers/node_modules/axios/dist/axios.min.js +3 -0
- package/lib/handlers/node_modules/axios/dist/axios.min.map +1 -0
- package/lib/handlers/node_modules/axios/index.d.ts +161 -0
- package/lib/handlers/node_modules/axios/index.js +1 -0
- package/lib/handlers/node_modules/axios/lib/adapters/README.md +37 -0
- package/lib/handlers/node_modules/axios/lib/adapters/http.js +303 -0
- package/lib/handlers/node_modules/axios/lib/adapters/xhr.js +179 -0
- package/lib/handlers/node_modules/axios/lib/axios.js +56 -0
- package/lib/handlers/node_modules/axios/lib/cancel/Cancel.js +19 -0
- package/lib/handlers/node_modules/axios/lib/cancel/CancelToken.js +57 -0
- package/lib/handlers/node_modules/axios/lib/cancel/isCancel.js +5 -0
- package/lib/handlers/node_modules/axios/lib/core/Axios.js +95 -0
- package/lib/handlers/node_modules/axios/lib/core/InterceptorManager.js +52 -0
- package/lib/handlers/node_modules/axios/lib/core/README.md +7 -0
- package/lib/handlers/node_modules/axios/lib/core/buildFullPath.js +20 -0
- package/lib/handlers/node_modules/axios/lib/core/createError.js +18 -0
- package/lib/handlers/node_modules/axios/lib/core/dispatchRequest.js +79 -0
- package/lib/handlers/node_modules/axios/lib/core/enhanceError.js +42 -0
- package/lib/handlers/node_modules/axios/lib/core/mergeConfig.js +87 -0
- package/lib/handlers/node_modules/axios/lib/core/settle.js +25 -0
- package/lib/handlers/node_modules/axios/lib/core/transformData.js +20 -0
- package/lib/handlers/node_modules/axios/lib/defaults.js +98 -0
- package/lib/handlers/node_modules/axios/lib/helpers/README.md +7 -0
- package/lib/handlers/node_modules/axios/lib/helpers/bind.js +11 -0
- package/lib/handlers/node_modules/axios/lib/helpers/buildURL.js +70 -0
- package/lib/handlers/node_modules/axios/lib/helpers/combineURLs.js +14 -0
- package/lib/handlers/node_modules/axios/lib/helpers/cookies.js +53 -0
- package/lib/handlers/node_modules/axios/lib/helpers/deprecatedMethod.js +24 -0
- package/lib/handlers/node_modules/axios/lib/helpers/isAbsoluteURL.js +14 -0
- package/lib/handlers/node_modules/axios/lib/helpers/isAxiosError.js +11 -0
- package/lib/handlers/node_modules/axios/lib/helpers/isURLSameOrigin.js +68 -0
- package/lib/handlers/node_modules/axios/lib/helpers/normalizeHeaderName.js +12 -0
- package/lib/handlers/node_modules/axios/lib/helpers/parseHeaders.js +53 -0
- package/lib/handlers/node_modules/axios/lib/helpers/spread.js +27 -0
- package/lib/handlers/node_modules/axios/lib/utils.js +351 -0
- package/lib/handlers/node_modules/axios/package.json +86 -0
- package/lib/handlers/node_modules/buffer-from/LICENSE +21 -0
- package/lib/handlers/node_modules/buffer-from/index.js +69 -0
- package/lib/handlers/node_modules/buffer-from/package.json +19 -0
- package/lib/handlers/node_modules/buffer-from/readme.md +69 -0
- package/lib/handlers/node_modules/follow-redirects/LICENSE +18 -0
- package/lib/handlers/node_modules/follow-redirects/README.md +148 -0
- package/lib/handlers/node_modules/follow-redirects/debug.js +14 -0
- package/lib/handlers/node_modules/follow-redirects/http.js +1 -0
- package/lib/handlers/node_modules/follow-redirects/https.js +1 -0
- package/lib/handlers/node_modules/follow-redirects/index.js +531 -0
- package/lib/handlers/node_modules/follow-redirects/package.json +59 -0
- package/lib/handlers/node_modules/source-map/CHANGELOG.md +301 -0
- package/lib/handlers/node_modules/source-map/LICENSE +28 -0
- package/lib/handlers/node_modules/source-map/README.md +742 -0
- package/lib/handlers/node_modules/source-map/dist/source-map.debug.js +3234 -0
- package/lib/handlers/node_modules/source-map/dist/source-map.js +3233 -0
- package/lib/handlers/node_modules/source-map/dist/source-map.min.js +2 -0
- package/lib/handlers/node_modules/source-map/dist/source-map.min.js.map +1 -0
- package/lib/handlers/node_modules/source-map/lib/array-set.js +121 -0
- package/lib/handlers/node_modules/source-map/lib/base64-vlq.js +140 -0
- package/lib/handlers/node_modules/source-map/lib/base64.js +67 -0
- package/lib/handlers/node_modules/source-map/lib/binary-search.js +111 -0
- package/lib/handlers/node_modules/source-map/lib/mapping-list.js +79 -0
- package/lib/handlers/node_modules/source-map/lib/quick-sort.js +114 -0
- package/lib/handlers/node_modules/source-map/lib/source-map-consumer.js +1145 -0
- package/lib/handlers/node_modules/source-map/lib/source-map-generator.js +425 -0
- package/lib/handlers/node_modules/source-map/lib/source-node.js +413 -0
- package/lib/handlers/node_modules/source-map/lib/util.js +488 -0
- package/lib/handlers/node_modules/source-map/package.json +73 -0
- package/lib/handlers/node_modules/source-map/source-map.d.ts +98 -0
- package/lib/handlers/node_modules/source-map/source-map.js +8 -0
- package/lib/handlers/node_modules/source-map-support/LICENSE.md +21 -0
- package/lib/handlers/node_modules/source-map-support/README.md +284 -0
- package/lib/handlers/node_modules/source-map-support/browser-source-map-support.js +114 -0
- package/lib/handlers/node_modules/source-map-support/package.json +31 -0
- package/lib/handlers/node_modules/source-map-support/register.js +1 -0
- package/lib/handlers/node_modules/source-map-support/source-map-support.js +604 -0
- package/lib/handlers/package-lock.json +108 -0
- package/lib/handlers/package.json +13 -0
- package/lib/handlers/prerender-check.ts +27 -0
- package/lib/handlers/prerender.ts +43 -0
- package/lib/handlers/tsconfig.json +24 -0
- package/lib/prerender-cf-cache-control-construct.d.ts +0 -1
- package/lib/prerender-cf-cache-control-construct.js +4 -5
- package/lib/prerender-check-construct.d.ts +0 -1
- package/lib/prerender-check-construct.js +4 -5
- package/lib/prerender-construct.d.ts +0 -1
- package/lib/prerender-construct.js +4 -5
- package/package.json +3 -3
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
declare module 'v8' {
|
|
2
|
+
import { Readable } from 'stream';
|
|
3
|
+
|
|
4
|
+
interface HeapSpaceInfo {
|
|
5
|
+
space_name: string;
|
|
6
|
+
space_size: number;
|
|
7
|
+
space_used_size: number;
|
|
8
|
+
space_available_size: number;
|
|
9
|
+
physical_space_size: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */
|
|
13
|
+
type DoesZapCodeSpaceFlag = 0 | 1;
|
|
14
|
+
|
|
15
|
+
interface HeapInfo {
|
|
16
|
+
total_heap_size: number;
|
|
17
|
+
total_heap_size_executable: number;
|
|
18
|
+
total_physical_size: number;
|
|
19
|
+
total_available_size: number;
|
|
20
|
+
used_heap_size: number;
|
|
21
|
+
heap_size_limit: number;
|
|
22
|
+
malloced_memory: number;
|
|
23
|
+
peak_malloced_memory: number;
|
|
24
|
+
does_zap_garbage: DoesZapCodeSpaceFlag;
|
|
25
|
+
number_of_native_contexts: number;
|
|
26
|
+
number_of_detached_contexts: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface HeapCodeStatistics {
|
|
30
|
+
code_and_metadata_size: number;
|
|
31
|
+
bytecode_and_metadata_size: number;
|
|
32
|
+
external_script_source_size: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Returns an integer representing a "version tag" derived from the V8 version, command line flags and detected CPU features.
|
|
37
|
+
* This is useful for determining whether a vm.Script cachedData buffer is compatible with this instance of V8.
|
|
38
|
+
*/
|
|
39
|
+
function cachedDataVersionTag(): number;
|
|
40
|
+
|
|
41
|
+
function getHeapStatistics(): HeapInfo;
|
|
42
|
+
function getHeapSpaceStatistics(): HeapSpaceInfo[];
|
|
43
|
+
function setFlagsFromString(flags: string): void;
|
|
44
|
+
/**
|
|
45
|
+
* Generates a snapshot of the current V8 heap and returns a Readable
|
|
46
|
+
* Stream that may be used to read the JSON serialized representation.
|
|
47
|
+
* This conversation was marked as resolved by joyeecheung
|
|
48
|
+
* This JSON stream format is intended to be used with tools such as
|
|
49
|
+
* Chrome DevTools. The JSON schema is undocumented and specific to the
|
|
50
|
+
* V8 engine, and may change from one version of V8 to the next.
|
|
51
|
+
*/
|
|
52
|
+
function getHeapSnapshot(): Readable;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @param fileName The file path where the V8 heap snapshot is to be
|
|
57
|
+
* saved. If not specified, a file name with the pattern
|
|
58
|
+
* `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be
|
|
59
|
+
* generated, where `{pid}` will be the PID of the Node.js process,
|
|
60
|
+
* `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from
|
|
61
|
+
* the main Node.js thread or the id of a worker thread.
|
|
62
|
+
*/
|
|
63
|
+
function writeHeapSnapshot(fileName?: string): string;
|
|
64
|
+
|
|
65
|
+
function getHeapCodeStatistics(): HeapCodeStatistics;
|
|
66
|
+
|
|
67
|
+
class Serializer {
|
|
68
|
+
/**
|
|
69
|
+
* Writes out a header, which includes the serialization format version.
|
|
70
|
+
*/
|
|
71
|
+
writeHeader(): void;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Serializes a JavaScript value and adds the serialized representation to the internal buffer.
|
|
75
|
+
* This throws an error if value cannot be serialized.
|
|
76
|
+
*/
|
|
77
|
+
writeValue(val: any): boolean;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Returns the stored internal buffer.
|
|
81
|
+
* This serializer should not be used once the buffer is released.
|
|
82
|
+
* Calling this method results in undefined behavior if a previous write has failed.
|
|
83
|
+
*/
|
|
84
|
+
releaseBuffer(): Buffer;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Marks an ArrayBuffer as having its contents transferred out of band.\
|
|
88
|
+
* Pass the corresponding ArrayBuffer in the deserializing context to deserializer.transferArrayBuffer().
|
|
89
|
+
*/
|
|
90
|
+
transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Write a raw 32-bit unsigned integer.
|
|
94
|
+
*/
|
|
95
|
+
writeUint32(value: number): void;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Write a raw 64-bit unsigned integer, split into high and low 32-bit parts.
|
|
99
|
+
*/
|
|
100
|
+
writeUint64(hi: number, lo: number): void;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Write a JS number value.
|
|
104
|
+
*/
|
|
105
|
+
writeDouble(value: number): void;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Write raw bytes into the serializer’s internal buffer.
|
|
109
|
+
* The deserializer will require a way to compute the length of the buffer.
|
|
110
|
+
*/
|
|
111
|
+
writeRawBytes(buffer: NodeJS.TypedArray): void;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* A subclass of `Serializer` that serializes `TypedArray` (in particular `Buffer`) and `DataView` objects as host objects,
|
|
116
|
+
* and only stores the part of their underlying `ArrayBuffers` that they are referring to.
|
|
117
|
+
*/
|
|
118
|
+
class DefaultSerializer extends Serializer {
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
class Deserializer {
|
|
122
|
+
constructor(data: NodeJS.TypedArray);
|
|
123
|
+
/**
|
|
124
|
+
* Reads and validates a header (including the format version).
|
|
125
|
+
* May, for example, reject an invalid or unsupported wire format.
|
|
126
|
+
* In that case, an Error is thrown.
|
|
127
|
+
*/
|
|
128
|
+
readHeader(): boolean;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Deserializes a JavaScript value from the buffer and returns it.
|
|
132
|
+
*/
|
|
133
|
+
readValue(): any;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Marks an ArrayBuffer as having its contents transferred out of band.
|
|
137
|
+
* Pass the corresponding `ArrayBuffer` in the serializing context to serializer.transferArrayBuffer()
|
|
138
|
+
* (or return the id from serializer._getSharedArrayBufferId() in the case of SharedArrayBuffers).
|
|
139
|
+
*/
|
|
140
|
+
transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Reads the underlying wire format version.
|
|
144
|
+
* Likely mostly to be useful to legacy code reading old wire format versions.
|
|
145
|
+
* May not be called before .readHeader().
|
|
146
|
+
*/
|
|
147
|
+
getWireFormatVersion(): number;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Read a raw 32-bit unsigned integer and return it.
|
|
151
|
+
*/
|
|
152
|
+
readUint32(): number;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Read a raw 64-bit unsigned integer and return it as an array [hi, lo] with two 32-bit unsigned integer entries.
|
|
156
|
+
*/
|
|
157
|
+
readUint64(): [number, number];
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Read a JS number value.
|
|
161
|
+
*/
|
|
162
|
+
readDouble(): number;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Read raw bytes from the deserializer’s internal buffer.
|
|
166
|
+
* The length parameter must correspond to the length of the buffer that was passed to serializer.writeRawBytes().
|
|
167
|
+
*/
|
|
168
|
+
readRawBytes(length: number): Buffer;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* A subclass of `Serializer` that serializes `TypedArray` (in particular `Buffer`) and `DataView` objects as host objects,
|
|
173
|
+
* and only stores the part of their underlying `ArrayBuffers` that they are referring to.
|
|
174
|
+
*/
|
|
175
|
+
class DefaultDeserializer extends Deserializer {
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Uses a `DefaultSerializer` to serialize value into a buffer.
|
|
180
|
+
*/
|
|
181
|
+
function serialize(value: any): Buffer;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Uses a `DefaultDeserializer` with default options to read a JS value from a buffer.
|
|
185
|
+
*/
|
|
186
|
+
function deserialize(data: NodeJS.TypedArray): any;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Begins writing coverage report based on the `NODE_V8_COVERAGE` env var.
|
|
190
|
+
* Noop is the env var is not set.
|
|
191
|
+
*/
|
|
192
|
+
function takeCoverage(): void;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Stops writing coverage report.
|
|
196
|
+
*/
|
|
197
|
+
function stopCoverage(): void;
|
|
198
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
declare module 'vm' {
|
|
2
|
+
interface Context extends NodeJS.Dict<any> { }
|
|
3
|
+
interface BaseOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Specifies the filename used in stack traces produced by this script.
|
|
6
|
+
* Default: `''`.
|
|
7
|
+
*/
|
|
8
|
+
filename?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Specifies the line number offset that is displayed in stack traces produced by this script.
|
|
11
|
+
* Default: `0`.
|
|
12
|
+
*/
|
|
13
|
+
lineOffset?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Specifies the column number offset that is displayed in stack traces produced by this script.
|
|
16
|
+
* @default 0
|
|
17
|
+
*/
|
|
18
|
+
columnOffset?: number;
|
|
19
|
+
}
|
|
20
|
+
interface ScriptOptions extends BaseOptions {
|
|
21
|
+
displayErrors?: boolean;
|
|
22
|
+
timeout?: number;
|
|
23
|
+
cachedData?: Buffer;
|
|
24
|
+
/** @deprecated in favor of `script.createCachedData()` */
|
|
25
|
+
produceCachedData?: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface RunningScriptOptions extends BaseOptions {
|
|
28
|
+
/**
|
|
29
|
+
* When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace.
|
|
30
|
+
* Default: `true`.
|
|
31
|
+
*/
|
|
32
|
+
displayErrors?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Specifies the number of milliseconds to execute code before terminating execution.
|
|
35
|
+
* If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer.
|
|
36
|
+
*/
|
|
37
|
+
timeout?: number;
|
|
38
|
+
/**
|
|
39
|
+
* If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received.
|
|
40
|
+
* Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that.
|
|
41
|
+
* If execution is terminated, an `Error` will be thrown.
|
|
42
|
+
* Default: `false`.
|
|
43
|
+
*/
|
|
44
|
+
breakOnSigint?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
|
|
47
|
+
*/
|
|
48
|
+
microtaskMode?: 'afterEvaluate';
|
|
49
|
+
}
|
|
50
|
+
interface CompileFunctionOptions extends BaseOptions {
|
|
51
|
+
/**
|
|
52
|
+
* Provides an optional data with V8's code cache data for the supplied source.
|
|
53
|
+
*/
|
|
54
|
+
cachedData?: Buffer;
|
|
55
|
+
/**
|
|
56
|
+
* Specifies whether to produce new cache data.
|
|
57
|
+
* Default: `false`,
|
|
58
|
+
*/
|
|
59
|
+
produceCachedData?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* The sandbox/context in which the said function should be compiled in.
|
|
62
|
+
*/
|
|
63
|
+
parsingContext?: Context;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling
|
|
67
|
+
*/
|
|
68
|
+
contextExtensions?: Object[];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
interface CreateContextOptions {
|
|
72
|
+
/**
|
|
73
|
+
* Human-readable name of the newly created context.
|
|
74
|
+
* @default 'VM Context i' Where i is an ascending numerical index of the created context.
|
|
75
|
+
*/
|
|
76
|
+
name?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Corresponds to the newly created context for display purposes.
|
|
79
|
+
* The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary),
|
|
80
|
+
* like the value of the `url.origin` property of a URL object.
|
|
81
|
+
* Most notably, this string should omit the trailing slash, as that denotes a path.
|
|
82
|
+
* @default ''
|
|
83
|
+
*/
|
|
84
|
+
origin?: string;
|
|
85
|
+
codeGeneration?: {
|
|
86
|
+
/**
|
|
87
|
+
* If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc)
|
|
88
|
+
* will throw an EvalError.
|
|
89
|
+
* @default true
|
|
90
|
+
*/
|
|
91
|
+
strings?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError.
|
|
94
|
+
* @default true
|
|
95
|
+
*/
|
|
96
|
+
wasm?: boolean;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
|
|
100
|
+
*/
|
|
101
|
+
microtaskMode?: 'afterEvaluate';
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
type MeasureMemoryMode = 'summary' | 'detailed';
|
|
105
|
+
|
|
106
|
+
interface MeasureMemoryOptions {
|
|
107
|
+
/**
|
|
108
|
+
* @default 'summary'
|
|
109
|
+
*/
|
|
110
|
+
mode?: MeasureMemoryMode;
|
|
111
|
+
context?: Context;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
interface MemoryMeasurement {
|
|
115
|
+
total: {
|
|
116
|
+
jsMemoryEstimate: number;
|
|
117
|
+
jsMemoryRange: [number, number];
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
class Script {
|
|
122
|
+
constructor(code: string, options?: ScriptOptions);
|
|
123
|
+
runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any;
|
|
124
|
+
runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any;
|
|
125
|
+
runInThisContext(options?: RunningScriptOptions): any;
|
|
126
|
+
createCachedData(): Buffer;
|
|
127
|
+
cachedDataRejected?: boolean;
|
|
128
|
+
}
|
|
129
|
+
function createContext(sandbox?: Context, options?: CreateContextOptions): Context;
|
|
130
|
+
function isContext(sandbox: Context): boolean;
|
|
131
|
+
function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any;
|
|
132
|
+
function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any;
|
|
133
|
+
function runInThisContext(code: string, options?: RunningScriptOptions | string): any;
|
|
134
|
+
function compileFunction(code: string, params?: ReadonlyArray<string>, options?: CompileFunctionOptions): Function;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Measure the memory known to V8 and used by the current execution context or a specified context.
|
|
138
|
+
*
|
|
139
|
+
* The format of the object that the returned Promise may resolve with is
|
|
140
|
+
* specific to the V8 engine and may change from one version of V8 to the next.
|
|
141
|
+
*
|
|
142
|
+
* The returned result is different from the statistics returned by
|
|
143
|
+
* `v8.getHeapSpaceStatistics()` in that `vm.measureMemory()` measures
|
|
144
|
+
* the memory reachable by V8 from a specific context, while
|
|
145
|
+
* `v8.getHeapSpaceStatistics()` measures the memory used by an instance
|
|
146
|
+
* of V8 engine, which can switch among multiple contexts that reference
|
|
147
|
+
* objects in the heap of one engine.
|
|
148
|
+
*
|
|
149
|
+
* @experimental
|
|
150
|
+
*/
|
|
151
|
+
function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>;
|
|
152
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
declare module 'wasi' {
|
|
2
|
+
interface WASIOptions {
|
|
3
|
+
/**
|
|
4
|
+
* An array of strings that the WebAssembly application will
|
|
5
|
+
* see as command line arguments. The first argument is the virtual path to the
|
|
6
|
+
* WASI command itself.
|
|
7
|
+
*/
|
|
8
|
+
args?: string[];
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* An object similar to `process.env` that the WebAssembly
|
|
12
|
+
* application will see as its environment.
|
|
13
|
+
*/
|
|
14
|
+
env?: object;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This object represents the WebAssembly application's
|
|
18
|
+
* sandbox directory structure. The string keys of `preopens` are treated as
|
|
19
|
+
* directories within the sandbox. The corresponding values in `preopens` are
|
|
20
|
+
* the real paths to those directories on the host machine.
|
|
21
|
+
*/
|
|
22
|
+
preopens?: NodeJS.Dict<string>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* By default, WASI applications terminate the Node.js
|
|
26
|
+
* process via the `__wasi_proc_exit()` function. Setting this option to `true`
|
|
27
|
+
* causes `wasi.start()` to return the exit code rather than terminate the
|
|
28
|
+
* process.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
returnOnExit?: boolean;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The file descriptor used as standard input in the WebAssembly application.
|
|
35
|
+
* @default 0
|
|
36
|
+
*/
|
|
37
|
+
stdin?: number;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The file descriptor used as standard output in the WebAssembly application.
|
|
41
|
+
* @default 1
|
|
42
|
+
*/
|
|
43
|
+
stdout?: number;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The file descriptor used as standard error in the WebAssembly application.
|
|
47
|
+
* @default 2
|
|
48
|
+
*/
|
|
49
|
+
stderr?: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
class WASI {
|
|
53
|
+
constructor(options?: WASIOptions);
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* Attempt to begin execution of `instance` by invoking its `_start()` export.
|
|
57
|
+
* If `instance` does not contain a `_start()` export, then `start()` attempts to
|
|
58
|
+
* invoke the `__wasi_unstable_reactor_start()` export. If neither of those exports
|
|
59
|
+
* is present on `instance`, then `start()` does nothing.
|
|
60
|
+
*
|
|
61
|
+
* `start()` requires that `instance` exports a `WebAssembly.Memory` named
|
|
62
|
+
* `memory`. If `instance` does not have a `memory` export an exception is thrown.
|
|
63
|
+
*
|
|
64
|
+
* If `start()` is called more than once, an exception is thrown.
|
|
65
|
+
*/
|
|
66
|
+
start(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Attempt to initialize `instance` as a WASI reactor by invoking its `_initialize()` export, if it is present.
|
|
70
|
+
* If `instance` contains a `_start()` export, then an exception is thrown.
|
|
71
|
+
*
|
|
72
|
+
* `start()` requires that `instance` exports a `WebAssembly.Memory` named
|
|
73
|
+
* `memory`. If `instance` does not have a `memory` export an exception is thrown.
|
|
74
|
+
*
|
|
75
|
+
* If `initialize()` is called more than once, an exception is thrown.
|
|
76
|
+
*/
|
|
77
|
+
initialize(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Is an object that implements the WASI system call API. This object
|
|
81
|
+
* should be passed as the `wasi_snapshot_preview1` import during the instantiation of a
|
|
82
|
+
* `WebAssembly.Instance`.
|
|
83
|
+
*/
|
|
84
|
+
readonly wasiImport: NodeJS.Dict<any>; // TODO: Narrow to DOM types
|
|
85
|
+
}
|
|
86
|
+
}
|