@tsonic/frontend 0.0.63 → 0.0.64
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/dist/.tsbuildinfo +1 -1
- package/dist/graph/extraction/imports.d.ts.map +1 -1
- package/dist/graph/extraction/imports.js +10 -2
- package/dist/graph/extraction/imports.js.map +1 -1
- package/dist/ir/binding-resolution.test.js +248 -0
- package/dist/ir/binding-resolution.test.js.map +1 -1
- package/dist/ir/builder/imports.d.ts.map +1 -1
- package/dist/ir/builder/imports.js +8 -1
- package/dist/ir/builder/imports.js.map +1 -1
- package/dist/ir/builder.test.js +137 -0
- package/dist/ir/builder.test.js.map +1 -1
- package/dist/ir/converters/expressions/access/access-converter.d.ts.map +1 -1
- package/dist/ir/converters/expressions/access/access-converter.js +1 -1
- package/dist/ir/converters/expressions/access/access-converter.js.map +1 -1
- package/dist/ir/converters/expressions/access/binding-resolution.d.ts +2 -2
- package/dist/ir/converters/expressions/access/binding-resolution.d.ts.map +1 -1
- package/dist/ir/converters/expressions/access/binding-resolution.js +64 -1
- package/dist/ir/converters/expressions/access/binding-resolution.js.map +1 -1
- package/dist/ir/program-context.d.ts +5 -0
- package/dist/ir/program-context.d.ts.map +1 -1
- package/dist/ir/program-context.js +1 -0
- package/dist/ir/program-context.js.map +1 -1
- package/dist/ir/type-system/internal/type-converter/orchestrator.d.ts.map +1 -1
- package/dist/ir/type-system/internal/type-converter/orchestrator.js +12 -5
- package/dist/ir/type-system/internal/type-converter/orchestrator.js.map +1 -1
- package/dist/ir/type-system/internal/universe/clr-type-parser.d.ts.map +1 -1
- package/dist/ir/type-system/internal/universe/clr-type-parser.js +66 -0
- package/dist/ir/type-system/internal/universe/clr-type-parser.js.map +1 -1
- package/dist/ir/type-system/internal/universe/clr-type-parser.test.d.ts +2 -0
- package/dist/ir/type-system/internal/universe/clr-type-parser.test.d.ts.map +1 -0
- package/dist/ir/type-system/internal/universe/clr-type-parser.test.js +55 -0
- package/dist/ir/type-system/internal/universe/clr-type-parser.test.js.map +1 -0
- package/dist/ir/type-system/type-system-inference.d.ts.map +1 -1
- package/dist/ir/type-system/type-system-inference.js +38 -0
- package/dist/ir/type-system/type-system-inference.js.map +1 -1
- package/dist/ir/validation/anonymous-type-lowering-pass.d.ts.map +1 -1
- package/dist/ir/validation/anonymous-type-lowering-pass.js +34 -0
- package/dist/ir/validation/anonymous-type-lowering-pass.js.map +1 -1
- package/dist/ir/validation/anonymous-type-lowering-regressions.test.d.ts +2 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions.test.d.ts.map +1 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions.test.js +121 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions.test.js.map +1 -0
- package/dist/ir/validation/numeric-invariants.test.js +29 -0
- package/dist/ir/validation/numeric-invariants.test.js.map +1 -1
- package/dist/ir/validation/numeric-proof-pass.d.ts.map +1 -1
- package/dist/ir/validation/numeric-proof-pass.js +21 -0
- package/dist/ir/validation/numeric-proof-pass.js.map +1 -1
- package/dist/program/creation.d.ts.map +1 -1
- package/dist/program/creation.js +104 -13
- package/dist/program/creation.js.map +1 -1
- package/dist/program/creation.test.js +133 -1
- package/dist/program/creation.test.js.map +1 -1
- package/dist/program/diagnostics.d.ts +1 -1
- package/dist/program/diagnostics.d.ts.map +1 -1
- package/dist/program/diagnostics.js +47 -2
- package/dist/program/diagnostics.js.map +1 -1
- package/dist/program/diagnostics.test.d.ts +2 -0
- package/dist/program/diagnostics.test.d.ts.map +1 -0
- package/dist/program/diagnostics.test.js +58 -0
- package/dist/program/diagnostics.test.js.map +1 -0
- package/dist/program/types.d.ts +2 -0
- package/dist/program/types.d.ts.map +1 -1
- package/dist/resolver/import-resolution.d.ts +2 -0
- package/dist/resolver/import-resolution.d.ts.map +1 -1
- package/dist/resolver/import-resolution.js +12 -4
- package/dist/resolver/import-resolution.js.map +1 -1
- package/dist/resolver/node-module-aliases.d.ts +6 -0
- package/dist/resolver/node-module-aliases.d.ts.map +1 -0
- package/dist/resolver/node-module-aliases.js +164 -0
- package/dist/resolver/node-module-aliases.js.map +1 -0
- package/dist/resolver/node-module-aliases.test.d.ts +2 -0
- package/dist/resolver/node-module-aliases.test.d.ts.map +1 -0
- package/dist/resolver/node-module-aliases.test.js +64 -0
- package/dist/resolver/node-module-aliases.test.js.map +1 -0
- package/dist/resolver.test.js +103 -0
- package/dist/resolver.test.js.map +1 -1
- package/dist/surface/js-surface-shims.d.ts +3 -0
- package/dist/surface/js-surface-shims.d.ts.map +1 -0
- package/dist/surface/js-surface-shims.js +332 -0
- package/dist/surface/js-surface-shims.js.map +1 -0
- package/dist/surface/js-surface-shims.test.d.ts +2 -0
- package/dist/surface/js-surface-shims.test.d.ts.map +1 -0
- package/dist/surface/js-surface-shims.test.js +53 -0
- package/dist/surface/js-surface-shims.test.js.map +1 -0
- package/dist/surface/profiles.d.ts +10 -0
- package/dist/surface/profiles.d.ts.map +1 -0
- package/dist/surface/profiles.js +65 -0
- package/dist/surface/profiles.js.map +1 -0
- package/dist/surface/profiles.test.d.ts +2 -0
- package/dist/surface/profiles.test.d.ts.map +1 -0
- package/dist/surface/profiles.test.js +44 -0
- package/dist/surface/profiles.test.js.map +1 -0
- package/dist/validation/imports.d.ts.map +1 -1
- package/dist/validation/imports.js +28 -5
- package/dist/validation/imports.js.map +1 -1
- package/dist/validation/imports.test.js +102 -3
- package/dist/validation/imports.test.js.map +1 -1
- package/package.json +1 -1
package/dist/resolver.test.js
CHANGED
|
@@ -7,6 +7,7 @@ import * as path from "node:path";
|
|
|
7
7
|
import * as fs from "node:fs";
|
|
8
8
|
import * as os from "node:os";
|
|
9
9
|
import { resolveImport, getNamespaceFromPath, getClassNameFromPath, } from "./resolver.js";
|
|
10
|
+
import { BindingRegistry } from "./program/bindings.js";
|
|
10
11
|
describe("Module Resolver", () => {
|
|
11
12
|
describe("resolveImport", () => {
|
|
12
13
|
const tempDir = path.join(os.tmpdir(), "tsonic-test");
|
|
@@ -67,6 +68,108 @@ describe("Module Resolver", () => {
|
|
|
67
68
|
expect(result.error.message).to.include("Cannot find module");
|
|
68
69
|
}
|
|
69
70
|
});
|
|
71
|
+
it("should resolve node: aliases to canonical nodejs binding in nodejs surface", () => {
|
|
72
|
+
const bindings = new BindingRegistry();
|
|
73
|
+
bindings.addBindings("/test/nodejs-bindings.json", {
|
|
74
|
+
bindings: {
|
|
75
|
+
"@tsonic/nodejs/index.js": {
|
|
76
|
+
kind: "module",
|
|
77
|
+
assembly: "nodejs",
|
|
78
|
+
type: "nodejs.fs",
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
const result = resolveImport("node:fs", path.join(tempDir, "src", "index.ts"), sourceRoot, {
|
|
83
|
+
bindings,
|
|
84
|
+
surface: "nodejs",
|
|
85
|
+
});
|
|
86
|
+
expect(result.ok).to.equal(true);
|
|
87
|
+
if (result.ok) {
|
|
88
|
+
expect(result.value.isLocal).to.equal(false);
|
|
89
|
+
expect(result.value.isClr).to.equal(false);
|
|
90
|
+
expect(result.value.resolvedClrType).to.equal("nodejs.fs");
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
it("should resolve extended node aliases in nodejs surface", () => {
|
|
94
|
+
const bindings = new BindingRegistry();
|
|
95
|
+
bindings.addBindings("/test/nodejs-bindings.json", {
|
|
96
|
+
bindings: {
|
|
97
|
+
"@tsonic/nodejs/index.js": {
|
|
98
|
+
kind: "module",
|
|
99
|
+
assembly: "nodejs",
|
|
100
|
+
type: "nodejs.url",
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
const result = resolveImport("node:url", path.join(tempDir, "src", "index.ts"), sourceRoot, {
|
|
105
|
+
bindings,
|
|
106
|
+
surface: "nodejs",
|
|
107
|
+
});
|
|
108
|
+
expect(result.ok).to.equal(true);
|
|
109
|
+
if (result.ok) {
|
|
110
|
+
expect(result.value.resolvedClrType).to.equal("nodejs.url");
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
it("should resolve bare node module aliases in nodejs surface", () => {
|
|
114
|
+
const bindings = new BindingRegistry();
|
|
115
|
+
bindings.addBindings("/test/nodejs-bindings.json", {
|
|
116
|
+
bindings: {
|
|
117
|
+
"@tsonic/nodejs/index.js": {
|
|
118
|
+
kind: "module",
|
|
119
|
+
assembly: "nodejs",
|
|
120
|
+
type: "nodejs.path",
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
const result = resolveImport("path", path.join(tempDir, "src", "index.ts"), sourceRoot, {
|
|
125
|
+
bindings,
|
|
126
|
+
surface: "nodejs",
|
|
127
|
+
});
|
|
128
|
+
expect(result.ok).to.equal(true);
|
|
129
|
+
if (result.ok) {
|
|
130
|
+
expect(result.value.resolvedClrType).to.equal("nodejs.path");
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
it("should reject node aliases in js surface", () => {
|
|
134
|
+
const bindings = new BindingRegistry();
|
|
135
|
+
bindings.addBindings("/test/nodejs-bindings.json", {
|
|
136
|
+
bindings: {
|
|
137
|
+
"@tsonic/nodejs/index.js": {
|
|
138
|
+
kind: "module",
|
|
139
|
+
assembly: "nodejs",
|
|
140
|
+
type: "nodejs.fs",
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
const result = resolveImport("node:fs", path.join(tempDir, "src", "index.ts"), sourceRoot, {
|
|
145
|
+
bindings,
|
|
146
|
+
surface: "js",
|
|
147
|
+
});
|
|
148
|
+
expect(result.ok).to.equal(false);
|
|
149
|
+
if (!result.ok) {
|
|
150
|
+
expect(result.error.code).to.equal("TSN1004");
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
it("should reject node aliases outside nodejs surface", () => {
|
|
154
|
+
const bindings = new BindingRegistry();
|
|
155
|
+
bindings.addBindings("/test/nodejs-bindings.json", {
|
|
156
|
+
bindings: {
|
|
157
|
+
"@tsonic/nodejs/index.js": {
|
|
158
|
+
kind: "module",
|
|
159
|
+
assembly: "nodejs",
|
|
160
|
+
type: "nodejs.fs",
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
const result = resolveImport("node:fs", path.join(tempDir, "src", "index.ts"), sourceRoot, {
|
|
165
|
+
bindings,
|
|
166
|
+
surface: "clr",
|
|
167
|
+
});
|
|
168
|
+
expect(result.ok).to.equal(false);
|
|
169
|
+
if (!result.ok) {
|
|
170
|
+
expect(result.error.code).to.equal("TSN1004");
|
|
171
|
+
}
|
|
172
|
+
});
|
|
70
173
|
});
|
|
71
174
|
describe("getNamespaceFromPath", () => {
|
|
72
175
|
it("should generate namespace from directory structure", () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.test.js","sourceRoot":"","sources":["../src/resolver.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"resolver.test.js","sourceRoot":"","sources":["../src/resolver.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,eAAe,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;IAEH,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;QACpC,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;YAClD,MAAM,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC9D,MAAM,CAAC,oBAAoB,CAAC,4BAA4B,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CACjE,aAAa,CACd,CAAC;YACF,MAAM,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC3D,MAAM,CAAC,oBAAoB,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YACvE,MAAM,CAAC,oBAAoB,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const JS_SURFACE_GLOBALS_SHIMS = "\nimport type { int, long, double } from \"@tsonic/core/types.js\";\nimport type { List } from \"@tsonic/dotnet/System.Collections.Generic.js\";\n\ndeclare global {\n interface String {\n readonly length: int;\n toUpperCase(): string;\n toLowerCase(): string;\n trim(): string;\n trimStart(): string;\n trimEnd(): string;\n substring(start: int, end?: int): string;\n slice(start: int, end?: int): string;\n indexOf(searchString: string, position?: int): int;\n lastIndexOf(searchString: string, position?: int): int;\n startsWith(searchString: string, position?: int): boolean;\n endsWith(searchString: string, endPosition?: int): boolean;\n includes(searchString: string, position?: int): boolean;\n replace(searchValue: string, replaceValue: string): string;\n replaceAll(searchValue: string, replaceValue: string): string;\n repeat(count: int): string;\n padStart(targetLength: int, padString?: string): string;\n padEnd(targetLength: int, padString?: string): string;\n charAt(index: int): string;\n charCodeAt(index: int): int;\n split(separator: string, limit?: int): List<string>;\n at(index: int): string;\n concat(...strings: string[]): string;\n localeCompare(compareString: string): int;\n match(pattern: string | RegExp): List<string> | undefined;\n search(pattern: string | RegExp): int;\n }\n\n interface Array<T> {\n readonly length: int;\n at(index: int): T;\n concat(...items: T[]): T[];\n every(callback: (value: T) => boolean): boolean;\n filter(callback: (value: T) => boolean): T[];\n filter(callback: (value: T, index: int) => boolean): T[];\n find(callback: (value: T) => boolean): T | undefined;\n find(callback: (value: T, index: int) => boolean): T | undefined;\n findIndex(callback: (value: T) => boolean): int;\n findIndex(callback: (value: T, index: int) => boolean): int;\n findLast(callback: (value: T) => boolean): T | undefined;\n findLast(callback: (value: T, index: int) => boolean): T | undefined;\n findLastIndex(callback: (value: T) => boolean): int;\n findLastIndex(callback: (value: T, index: int) => boolean): int;\n flat(depth?: int): unknown[];\n forEach(callback: (value: T) => void): void;\n forEach(callback: (value: T, index: int) => void): void;\n includes(searchElement: T): boolean;\n includes(searchElement: T, fromIndex?: int): boolean;\n indexOf(searchElement: T, fromIndex?: int): int;\n join(separator?: string): string;\n lastIndexOf(searchElement: T, fromIndex?: int): int;\n map<TResult>(callback: (value: T) => TResult): TResult[];\n map<TResult>(callback: (value: T, index: int) => TResult): TResult[];\n reduce(callback: (previousValue: T, currentValue: T) => T): T;\n reduce<TResult>(\n callback: (previousValue: TResult, currentValue: T) => TResult,\n initialValue: TResult\n ): TResult;\n reduceRight<TResult>(\n callback: (previousValue: TResult, currentValue: T) => TResult,\n initialValue: TResult\n ): TResult;\n slice(start?: int, end?: int): T[];\n some(callback: (value: T) => boolean): boolean;\n }\n\n interface ReadonlyArray<T> {\n readonly length: int;\n at(index: int): T;\n concat(...items: T[]): T[];\n every(callback: (value: T) => boolean): boolean;\n filter(callback: (value: T) => boolean): T[];\n filter(callback: (value: T, index: int) => boolean): T[];\n find(callback: (value: T) => boolean): T | undefined;\n find(callback: (value: T, index: int) => boolean): T | undefined;\n findIndex(callback: (value: T) => boolean): int;\n findIndex(callback: (value: T, index: int) => boolean): int;\n findLast(callback: (value: T) => boolean): T | undefined;\n findLast(callback: (value: T, index: int) => boolean): T | undefined;\n findLastIndex(callback: (value: T) => boolean): int;\n findLastIndex(callback: (value: T, index: int) => boolean): int;\n flat(depth?: int): unknown[];\n forEach(callback: (value: T) => void): void;\n forEach(callback: (value: T, index: int) => void): void;\n includes(searchElement: T): boolean;\n includes(searchElement: T, fromIndex?: int): boolean;\n indexOf(searchElement: T, fromIndex?: int): int;\n join(separator?: string): string;\n lastIndexOf(searchElement: T, fromIndex?: int): int;\n map<TResult>(callback: (value: T) => TResult): TResult[];\n map<TResult>(callback: (value: T, index: int) => TResult): TResult[];\n reduce(callback: (previousValue: T, currentValue: T) => T): T;\n reduce<TResult>(\n callback: (previousValue: TResult, currentValue: T) => TResult,\n initialValue: TResult\n ): TResult;\n reduceRight<TResult>(\n callback: (previousValue: TResult, currentValue: T) => TResult,\n initialValue: TResult\n ): TResult;\n slice(start?: int, end?: int): T[];\n some(callback: (value: T) => boolean): boolean;\n }\n\n interface Console {\n log(...data: unknown[]): void;\n error(...data: unknown[]): void;\n warn(...data: unknown[]): void;\n info(...data: unknown[]): void;\n debug(...data: unknown[]): void;\n }\n\n const console: Console;\n\n interface Date {\n toString(): string;\n toDateString(): string;\n toTimeString(): string;\n toISOString(): string;\n toUTCString(): string;\n valueOf(): long;\n getTime(): long;\n getFullYear(): int;\n getMonth(): int;\n getDate(): int;\n getDay(): int;\n getHours(): int;\n getMinutes(): int;\n getSeconds(): int;\n getMilliseconds(): int;\n setTime(time: long): long;\n setFullYear(year: int, month?: int, date?: int): long;\n setMonth(month: int, date?: int): long;\n setDate(date: int): long;\n setHours(hours: int, minutes?: int, seconds?: int, ms?: int): long;\n setMinutes(minutes: int, seconds?: int, ms?: int): long;\n setSeconds(seconds: int, ms?: int): long;\n setMilliseconds(ms: int): long;\n }\n\n interface DateConstructor {\n new (): Date;\n new (value: string | number | long): Date;\n new (year: int, monthIndex: int, date?: int): Date;\n now(): long;\n parse(s: string): long;\n UTC(year: int, monthIndex: int, date?: int): long;\n }\n\n const Date: DateConstructor;\n\n interface JSON {\n parse<T = unknown>(text: string): T;\n stringify(\n value: unknown,\n replacer?: ((this: unknown, key: string, value: unknown) => unknown) | readonly (number | string)[] | null,\n space?: string | number | int\n ): string;\n }\n\n const JSON: JSON;\n\n interface Math {\n readonly E: double;\n readonly LN10: double;\n readonly LN2: double;\n readonly LOG2E: double;\n readonly LOG10E: double;\n readonly PI: double;\n readonly SQRT1_2: double;\n readonly SQRT2: double;\n abs(x: double): double;\n acos(x: double): double;\n asin(x: double): double;\n atan(x: double): double;\n atan2(y: double, x: double): double;\n ceil(x: double): double;\n cos(x: double): double;\n exp(x: double): double;\n floor(x: double): double;\n log(x: double): double;\n max(...values: double[]): double;\n min(...values: double[]): double;\n pow(x: double, y: double): double;\n random(): double;\n round(x: double): double;\n sin(x: double): double;\n sqrt(x: double): double;\n tan(x: double): double;\n trunc(x: double): double;\n }\n\n const Math: Math;\n\n interface RegExpMatchArray extends Array<string> {\n index?: int;\n input?: string;\n }\n\n interface RegExp {\n exec(string: string): RegExpMatchArray | null;\n test(string: string): boolean;\n readonly source: string;\n readonly global: boolean;\n readonly ignoreCase: boolean;\n readonly multiline: boolean;\n lastIndex: int;\n }\n\n interface RegExpConstructor {\n new (pattern: string | RegExp, flags?: string): RegExp;\n (pattern: string | RegExp, flags?: string): RegExp;\n }\n\n const RegExp: RegExpConstructor;\n\n interface Map<K, V> {\n readonly size: int;\n clear(): void;\n delete(key: K): boolean;\n forEach(\n callbackfn: (value: V, key: K, map: Map<K, V>) => void,\n thisArg?: unknown\n ): void;\n get(key: K): V | undefined;\n has(key: K): boolean;\n set(key: K, value: V): this;\n entries(): IterableIterator<[K, V]>;\n keys(): IterableIterator<K>;\n values(): IterableIterator<V>;\n [Symbol.iterator](): IterableIterator<[K, V]>;\n }\n\n interface MapConstructor {\n new (): Map<unknown, unknown>;\n new <K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;\n }\n\n const Map: MapConstructor;\n\n interface Set<T> {\n readonly size: int;\n add(value: T): this;\n clear(): void;\n delete(value: T): boolean;\n forEach(\n callbackfn: (value: T, value2: T, set: Set<T>) => void,\n thisArg?: unknown\n ): void;\n has(value: T): boolean;\n entries(): IterableIterator<[T, T]>;\n keys(): IterableIterator<T>;\n values(): IterableIterator<T>;\n [Symbol.iterator](): IterableIterator<T>;\n }\n\n interface SetConstructor {\n new (): Set<unknown>;\n new <T = unknown>(values?: readonly T[] | null): Set<T>;\n }\n\n const Set: SetConstructor;\n\n function parseInt(str: string, radix?: int): long | undefined;\n function parseFloat(str: string): double;\n function isFinite(value: double): boolean;\n function isNaN(value: double): boolean;\n function setTimeout(\n handler: (...args: unknown[]) => void,\n timeout?: int,\n ...args: unknown[]\n ): int;\n function clearTimeout(id: int): void;\n function setInterval(\n handler: (...args: unknown[]) => void,\n timeout?: int,\n ...args: unknown[]\n ): int;\n function clearInterval(id: int): void;\n}\n\nexport {};\n";
|
|
2
|
+
export declare const JS_SURFACE_NODE_MODULE_SHIMS = "\ndeclare module \"node:assert\" { export { assert } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"assert\" { export { assert } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:buffer\" { export { buffer } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"buffer\" { export { buffer } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:child_process\" { export { child_process } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"child_process\" { export { child_process } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:crypto\" { export { crypto } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"crypto\" { export { crypto } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:dgram\" { export { dgram } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"dgram\" { export { dgram } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:dns\" { export { dns } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"dns\" { export { dns } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:events\" { export { events } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"events\" { export { events } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:fs\" { export { fs } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"fs\" { export { fs } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:net\" { export { net } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"net\" { export { net } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:os\" { export { os } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"os\" { export { os } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:path\" { export { path } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"path\" { export { path } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:process\" { export { process } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"process\" { export { process } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:querystring\" { export { querystring } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"querystring\" { export { querystring } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:readline\" { export { readline } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"readline\" { export { readline } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:stream\" { export { stream } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"stream\" { export { stream } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:timers\" { export { timers } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"timers\" { export { timers } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:tls\" { export { tls } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"tls\" { export { tls } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:url\" { export { url } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"url\" { export { url } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:util\" { export { util } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"util\" { export { util } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"node:zlib\" { export { zlib } from \"@tsonic/nodejs/index.js\"; }\ndeclare module \"zlib\" { export { zlib } from \"@tsonic/nodejs/index.js\"; }\n";
|
|
3
|
+
//# sourceMappingURL=js-surface-shims.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-surface-shims.d.ts","sourceRoot":"","sources":["../../src/surface/js-surface-shims.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,wmTAgSpC,CAAC;AAEF,eAAO,MAAM,4BAA4B,mzGAyCxC,CAAC"}
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
export const JS_SURFACE_GLOBALS_SHIMS = `
|
|
2
|
+
import type { int, long, double } from "@tsonic/core/types.js";
|
|
3
|
+
import type { List } from "@tsonic/dotnet/System.Collections.Generic.js";
|
|
4
|
+
|
|
5
|
+
declare global {
|
|
6
|
+
interface String {
|
|
7
|
+
readonly length: int;
|
|
8
|
+
toUpperCase(): string;
|
|
9
|
+
toLowerCase(): string;
|
|
10
|
+
trim(): string;
|
|
11
|
+
trimStart(): string;
|
|
12
|
+
trimEnd(): string;
|
|
13
|
+
substring(start: int, end?: int): string;
|
|
14
|
+
slice(start: int, end?: int): string;
|
|
15
|
+
indexOf(searchString: string, position?: int): int;
|
|
16
|
+
lastIndexOf(searchString: string, position?: int): int;
|
|
17
|
+
startsWith(searchString: string, position?: int): boolean;
|
|
18
|
+
endsWith(searchString: string, endPosition?: int): boolean;
|
|
19
|
+
includes(searchString: string, position?: int): boolean;
|
|
20
|
+
replace(searchValue: string, replaceValue: string): string;
|
|
21
|
+
replaceAll(searchValue: string, replaceValue: string): string;
|
|
22
|
+
repeat(count: int): string;
|
|
23
|
+
padStart(targetLength: int, padString?: string): string;
|
|
24
|
+
padEnd(targetLength: int, padString?: string): string;
|
|
25
|
+
charAt(index: int): string;
|
|
26
|
+
charCodeAt(index: int): int;
|
|
27
|
+
split(separator: string, limit?: int): List<string>;
|
|
28
|
+
at(index: int): string;
|
|
29
|
+
concat(...strings: string[]): string;
|
|
30
|
+
localeCompare(compareString: string): int;
|
|
31
|
+
match(pattern: string | RegExp): List<string> | undefined;
|
|
32
|
+
search(pattern: string | RegExp): int;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface Array<T> {
|
|
36
|
+
readonly length: int;
|
|
37
|
+
at(index: int): T;
|
|
38
|
+
concat(...items: T[]): T[];
|
|
39
|
+
every(callback: (value: T) => boolean): boolean;
|
|
40
|
+
filter(callback: (value: T) => boolean): T[];
|
|
41
|
+
filter(callback: (value: T, index: int) => boolean): T[];
|
|
42
|
+
find(callback: (value: T) => boolean): T | undefined;
|
|
43
|
+
find(callback: (value: T, index: int) => boolean): T | undefined;
|
|
44
|
+
findIndex(callback: (value: T) => boolean): int;
|
|
45
|
+
findIndex(callback: (value: T, index: int) => boolean): int;
|
|
46
|
+
findLast(callback: (value: T) => boolean): T | undefined;
|
|
47
|
+
findLast(callback: (value: T, index: int) => boolean): T | undefined;
|
|
48
|
+
findLastIndex(callback: (value: T) => boolean): int;
|
|
49
|
+
findLastIndex(callback: (value: T, index: int) => boolean): int;
|
|
50
|
+
flat(depth?: int): unknown[];
|
|
51
|
+
forEach(callback: (value: T) => void): void;
|
|
52
|
+
forEach(callback: (value: T, index: int) => void): void;
|
|
53
|
+
includes(searchElement: T): boolean;
|
|
54
|
+
includes(searchElement: T, fromIndex?: int): boolean;
|
|
55
|
+
indexOf(searchElement: T, fromIndex?: int): int;
|
|
56
|
+
join(separator?: string): string;
|
|
57
|
+
lastIndexOf(searchElement: T, fromIndex?: int): int;
|
|
58
|
+
map<TResult>(callback: (value: T) => TResult): TResult[];
|
|
59
|
+
map<TResult>(callback: (value: T, index: int) => TResult): TResult[];
|
|
60
|
+
reduce(callback: (previousValue: T, currentValue: T) => T): T;
|
|
61
|
+
reduce<TResult>(
|
|
62
|
+
callback: (previousValue: TResult, currentValue: T) => TResult,
|
|
63
|
+
initialValue: TResult
|
|
64
|
+
): TResult;
|
|
65
|
+
reduceRight<TResult>(
|
|
66
|
+
callback: (previousValue: TResult, currentValue: T) => TResult,
|
|
67
|
+
initialValue: TResult
|
|
68
|
+
): TResult;
|
|
69
|
+
slice(start?: int, end?: int): T[];
|
|
70
|
+
some(callback: (value: T) => boolean): boolean;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface ReadonlyArray<T> {
|
|
74
|
+
readonly length: int;
|
|
75
|
+
at(index: int): T;
|
|
76
|
+
concat(...items: T[]): T[];
|
|
77
|
+
every(callback: (value: T) => boolean): boolean;
|
|
78
|
+
filter(callback: (value: T) => boolean): T[];
|
|
79
|
+
filter(callback: (value: T, index: int) => boolean): T[];
|
|
80
|
+
find(callback: (value: T) => boolean): T | undefined;
|
|
81
|
+
find(callback: (value: T, index: int) => boolean): T | undefined;
|
|
82
|
+
findIndex(callback: (value: T) => boolean): int;
|
|
83
|
+
findIndex(callback: (value: T, index: int) => boolean): int;
|
|
84
|
+
findLast(callback: (value: T) => boolean): T | undefined;
|
|
85
|
+
findLast(callback: (value: T, index: int) => boolean): T | undefined;
|
|
86
|
+
findLastIndex(callback: (value: T) => boolean): int;
|
|
87
|
+
findLastIndex(callback: (value: T, index: int) => boolean): int;
|
|
88
|
+
flat(depth?: int): unknown[];
|
|
89
|
+
forEach(callback: (value: T) => void): void;
|
|
90
|
+
forEach(callback: (value: T, index: int) => void): void;
|
|
91
|
+
includes(searchElement: T): boolean;
|
|
92
|
+
includes(searchElement: T, fromIndex?: int): boolean;
|
|
93
|
+
indexOf(searchElement: T, fromIndex?: int): int;
|
|
94
|
+
join(separator?: string): string;
|
|
95
|
+
lastIndexOf(searchElement: T, fromIndex?: int): int;
|
|
96
|
+
map<TResult>(callback: (value: T) => TResult): TResult[];
|
|
97
|
+
map<TResult>(callback: (value: T, index: int) => TResult): TResult[];
|
|
98
|
+
reduce(callback: (previousValue: T, currentValue: T) => T): T;
|
|
99
|
+
reduce<TResult>(
|
|
100
|
+
callback: (previousValue: TResult, currentValue: T) => TResult,
|
|
101
|
+
initialValue: TResult
|
|
102
|
+
): TResult;
|
|
103
|
+
reduceRight<TResult>(
|
|
104
|
+
callback: (previousValue: TResult, currentValue: T) => TResult,
|
|
105
|
+
initialValue: TResult
|
|
106
|
+
): TResult;
|
|
107
|
+
slice(start?: int, end?: int): T[];
|
|
108
|
+
some(callback: (value: T) => boolean): boolean;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
interface Console {
|
|
112
|
+
log(...data: unknown[]): void;
|
|
113
|
+
error(...data: unknown[]): void;
|
|
114
|
+
warn(...data: unknown[]): void;
|
|
115
|
+
info(...data: unknown[]): void;
|
|
116
|
+
debug(...data: unknown[]): void;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const console: Console;
|
|
120
|
+
|
|
121
|
+
interface Date {
|
|
122
|
+
toString(): string;
|
|
123
|
+
toDateString(): string;
|
|
124
|
+
toTimeString(): string;
|
|
125
|
+
toISOString(): string;
|
|
126
|
+
toUTCString(): string;
|
|
127
|
+
valueOf(): long;
|
|
128
|
+
getTime(): long;
|
|
129
|
+
getFullYear(): int;
|
|
130
|
+
getMonth(): int;
|
|
131
|
+
getDate(): int;
|
|
132
|
+
getDay(): int;
|
|
133
|
+
getHours(): int;
|
|
134
|
+
getMinutes(): int;
|
|
135
|
+
getSeconds(): int;
|
|
136
|
+
getMilliseconds(): int;
|
|
137
|
+
setTime(time: long): long;
|
|
138
|
+
setFullYear(year: int, month?: int, date?: int): long;
|
|
139
|
+
setMonth(month: int, date?: int): long;
|
|
140
|
+
setDate(date: int): long;
|
|
141
|
+
setHours(hours: int, minutes?: int, seconds?: int, ms?: int): long;
|
|
142
|
+
setMinutes(minutes: int, seconds?: int, ms?: int): long;
|
|
143
|
+
setSeconds(seconds: int, ms?: int): long;
|
|
144
|
+
setMilliseconds(ms: int): long;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
interface DateConstructor {
|
|
148
|
+
new (): Date;
|
|
149
|
+
new (value: string | number | long): Date;
|
|
150
|
+
new (year: int, monthIndex: int, date?: int): Date;
|
|
151
|
+
now(): long;
|
|
152
|
+
parse(s: string): long;
|
|
153
|
+
UTC(year: int, monthIndex: int, date?: int): long;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const Date: DateConstructor;
|
|
157
|
+
|
|
158
|
+
interface JSON {
|
|
159
|
+
parse<T = unknown>(text: string): T;
|
|
160
|
+
stringify(
|
|
161
|
+
value: unknown,
|
|
162
|
+
replacer?: ((this: unknown, key: string, value: unknown) => unknown) | readonly (number | string)[] | null,
|
|
163
|
+
space?: string | number | int
|
|
164
|
+
): string;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const JSON: JSON;
|
|
168
|
+
|
|
169
|
+
interface Math {
|
|
170
|
+
readonly E: double;
|
|
171
|
+
readonly LN10: double;
|
|
172
|
+
readonly LN2: double;
|
|
173
|
+
readonly LOG2E: double;
|
|
174
|
+
readonly LOG10E: double;
|
|
175
|
+
readonly PI: double;
|
|
176
|
+
readonly SQRT1_2: double;
|
|
177
|
+
readonly SQRT2: double;
|
|
178
|
+
abs(x: double): double;
|
|
179
|
+
acos(x: double): double;
|
|
180
|
+
asin(x: double): double;
|
|
181
|
+
atan(x: double): double;
|
|
182
|
+
atan2(y: double, x: double): double;
|
|
183
|
+
ceil(x: double): double;
|
|
184
|
+
cos(x: double): double;
|
|
185
|
+
exp(x: double): double;
|
|
186
|
+
floor(x: double): double;
|
|
187
|
+
log(x: double): double;
|
|
188
|
+
max(...values: double[]): double;
|
|
189
|
+
min(...values: double[]): double;
|
|
190
|
+
pow(x: double, y: double): double;
|
|
191
|
+
random(): double;
|
|
192
|
+
round(x: double): double;
|
|
193
|
+
sin(x: double): double;
|
|
194
|
+
sqrt(x: double): double;
|
|
195
|
+
tan(x: double): double;
|
|
196
|
+
trunc(x: double): double;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const Math: Math;
|
|
200
|
+
|
|
201
|
+
interface RegExpMatchArray extends Array<string> {
|
|
202
|
+
index?: int;
|
|
203
|
+
input?: string;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
interface RegExp {
|
|
207
|
+
exec(string: string): RegExpMatchArray | null;
|
|
208
|
+
test(string: string): boolean;
|
|
209
|
+
readonly source: string;
|
|
210
|
+
readonly global: boolean;
|
|
211
|
+
readonly ignoreCase: boolean;
|
|
212
|
+
readonly multiline: boolean;
|
|
213
|
+
lastIndex: int;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
interface RegExpConstructor {
|
|
217
|
+
new (pattern: string | RegExp, flags?: string): RegExp;
|
|
218
|
+
(pattern: string | RegExp, flags?: string): RegExp;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const RegExp: RegExpConstructor;
|
|
222
|
+
|
|
223
|
+
interface Map<K, V> {
|
|
224
|
+
readonly size: int;
|
|
225
|
+
clear(): void;
|
|
226
|
+
delete(key: K): boolean;
|
|
227
|
+
forEach(
|
|
228
|
+
callbackfn: (value: V, key: K, map: Map<K, V>) => void,
|
|
229
|
+
thisArg?: unknown
|
|
230
|
+
): void;
|
|
231
|
+
get(key: K): V | undefined;
|
|
232
|
+
has(key: K): boolean;
|
|
233
|
+
set(key: K, value: V): this;
|
|
234
|
+
entries(): IterableIterator<[K, V]>;
|
|
235
|
+
keys(): IterableIterator<K>;
|
|
236
|
+
values(): IterableIterator<V>;
|
|
237
|
+
[Symbol.iterator](): IterableIterator<[K, V]>;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
interface MapConstructor {
|
|
241
|
+
new (): Map<unknown, unknown>;
|
|
242
|
+
new <K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const Map: MapConstructor;
|
|
246
|
+
|
|
247
|
+
interface Set<T> {
|
|
248
|
+
readonly size: int;
|
|
249
|
+
add(value: T): this;
|
|
250
|
+
clear(): void;
|
|
251
|
+
delete(value: T): boolean;
|
|
252
|
+
forEach(
|
|
253
|
+
callbackfn: (value: T, value2: T, set: Set<T>) => void,
|
|
254
|
+
thisArg?: unknown
|
|
255
|
+
): void;
|
|
256
|
+
has(value: T): boolean;
|
|
257
|
+
entries(): IterableIterator<[T, T]>;
|
|
258
|
+
keys(): IterableIterator<T>;
|
|
259
|
+
values(): IterableIterator<T>;
|
|
260
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
interface SetConstructor {
|
|
264
|
+
new (): Set<unknown>;
|
|
265
|
+
new <T = unknown>(values?: readonly T[] | null): Set<T>;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const Set: SetConstructor;
|
|
269
|
+
|
|
270
|
+
function parseInt(str: string, radix?: int): long | undefined;
|
|
271
|
+
function parseFloat(str: string): double;
|
|
272
|
+
function isFinite(value: double): boolean;
|
|
273
|
+
function isNaN(value: double): boolean;
|
|
274
|
+
function setTimeout(
|
|
275
|
+
handler: (...args: unknown[]) => void,
|
|
276
|
+
timeout?: int,
|
|
277
|
+
...args: unknown[]
|
|
278
|
+
): int;
|
|
279
|
+
function clearTimeout(id: int): void;
|
|
280
|
+
function setInterval(
|
|
281
|
+
handler: (...args: unknown[]) => void,
|
|
282
|
+
timeout?: int,
|
|
283
|
+
...args: unknown[]
|
|
284
|
+
): int;
|
|
285
|
+
function clearInterval(id: int): void;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export {};
|
|
289
|
+
`;
|
|
290
|
+
export const JS_SURFACE_NODE_MODULE_SHIMS = `
|
|
291
|
+
declare module "node:assert" { export { assert } from "@tsonic/nodejs/index.js"; }
|
|
292
|
+
declare module "assert" { export { assert } from "@tsonic/nodejs/index.js"; }
|
|
293
|
+
declare module "node:buffer" { export { buffer } from "@tsonic/nodejs/index.js"; }
|
|
294
|
+
declare module "buffer" { export { buffer } from "@tsonic/nodejs/index.js"; }
|
|
295
|
+
declare module "node:child_process" { export { child_process } from "@tsonic/nodejs/index.js"; }
|
|
296
|
+
declare module "child_process" { export { child_process } from "@tsonic/nodejs/index.js"; }
|
|
297
|
+
declare module "node:crypto" { export { crypto } from "@tsonic/nodejs/index.js"; }
|
|
298
|
+
declare module "crypto" { export { crypto } from "@tsonic/nodejs/index.js"; }
|
|
299
|
+
declare module "node:dgram" { export { dgram } from "@tsonic/nodejs/index.js"; }
|
|
300
|
+
declare module "dgram" { export { dgram } from "@tsonic/nodejs/index.js"; }
|
|
301
|
+
declare module "node:dns" { export { dns } from "@tsonic/nodejs/index.js"; }
|
|
302
|
+
declare module "dns" { export { dns } from "@tsonic/nodejs/index.js"; }
|
|
303
|
+
declare module "node:events" { export { events } from "@tsonic/nodejs/index.js"; }
|
|
304
|
+
declare module "events" { export { events } from "@tsonic/nodejs/index.js"; }
|
|
305
|
+
declare module "node:fs" { export { fs } from "@tsonic/nodejs/index.js"; }
|
|
306
|
+
declare module "fs" { export { fs } from "@tsonic/nodejs/index.js"; }
|
|
307
|
+
declare module "node:net" { export { net } from "@tsonic/nodejs/index.js"; }
|
|
308
|
+
declare module "net" { export { net } from "@tsonic/nodejs/index.js"; }
|
|
309
|
+
declare module "node:os" { export { os } from "@tsonic/nodejs/index.js"; }
|
|
310
|
+
declare module "os" { export { os } from "@tsonic/nodejs/index.js"; }
|
|
311
|
+
declare module "node:path" { export { path } from "@tsonic/nodejs/index.js"; }
|
|
312
|
+
declare module "path" { export { path } from "@tsonic/nodejs/index.js"; }
|
|
313
|
+
declare module "node:process" { export { process } from "@tsonic/nodejs/index.js"; }
|
|
314
|
+
declare module "process" { export { process } from "@tsonic/nodejs/index.js"; }
|
|
315
|
+
declare module "node:querystring" { export { querystring } from "@tsonic/nodejs/index.js"; }
|
|
316
|
+
declare module "querystring" { export { querystring } from "@tsonic/nodejs/index.js"; }
|
|
317
|
+
declare module "node:readline" { export { readline } from "@tsonic/nodejs/index.js"; }
|
|
318
|
+
declare module "readline" { export { readline } from "@tsonic/nodejs/index.js"; }
|
|
319
|
+
declare module "node:stream" { export { stream } from "@tsonic/nodejs/index.js"; }
|
|
320
|
+
declare module "stream" { export { stream } from "@tsonic/nodejs/index.js"; }
|
|
321
|
+
declare module "node:timers" { export { timers } from "@tsonic/nodejs/index.js"; }
|
|
322
|
+
declare module "timers" { export { timers } from "@tsonic/nodejs/index.js"; }
|
|
323
|
+
declare module "node:tls" { export { tls } from "@tsonic/nodejs/index.js"; }
|
|
324
|
+
declare module "tls" { export { tls } from "@tsonic/nodejs/index.js"; }
|
|
325
|
+
declare module "node:url" { export { url } from "@tsonic/nodejs/index.js"; }
|
|
326
|
+
declare module "url" { export { url } from "@tsonic/nodejs/index.js"; }
|
|
327
|
+
declare module "node:util" { export { util } from "@tsonic/nodejs/index.js"; }
|
|
328
|
+
declare module "util" { export { util } from "@tsonic/nodejs/index.js"; }
|
|
329
|
+
declare module "node:zlib" { export { zlib } from "@tsonic/nodejs/index.js"; }
|
|
330
|
+
declare module "zlib" { export { zlib } from "@tsonic/nodejs/index.js"; }
|
|
331
|
+
`;
|
|
332
|
+
//# sourceMappingURL=js-surface-shims.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-surface-shims.js","sourceRoot":"","sources":["../../src/surface/js-surface-shims.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgSvC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyC3C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-surface-shims.test.d.ts","sourceRoot":"","sources":["../../src/surface/js-surface-shims.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { describe, it } from "mocha";
|
|
2
|
+
import { expect } from "chai";
|
|
3
|
+
import { JS_SURFACE_GLOBALS_SHIMS, JS_SURFACE_NODE_MODULE_SHIMS, } from "./js-surface-shims.js";
|
|
4
|
+
describe("JS Surface Shims", () => {
|
|
5
|
+
it("declares required JS runtime globals", () => {
|
|
6
|
+
const requiredGlobals = [
|
|
7
|
+
"interface String",
|
|
8
|
+
"interface Array<T>",
|
|
9
|
+
"interface ReadonlyArray<T>",
|
|
10
|
+
"const console: Console;",
|
|
11
|
+
"const Date: DateConstructor;",
|
|
12
|
+
"const JSON: JSON;",
|
|
13
|
+
"const Math: Math;",
|
|
14
|
+
"const RegExp: RegExpConstructor;",
|
|
15
|
+
"const Map: MapConstructor;",
|
|
16
|
+
"const Set: SetConstructor;",
|
|
17
|
+
"function parseInt(",
|
|
18
|
+
"function parseFloat(",
|
|
19
|
+
"function isFinite(",
|
|
20
|
+
"function isNaN(",
|
|
21
|
+
"function setTimeout(",
|
|
22
|
+
"function setInterval(",
|
|
23
|
+
];
|
|
24
|
+
for (const token of requiredGlobals) {
|
|
25
|
+
expect(JS_SURFACE_GLOBALS_SHIMS).to.include(token);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
it("keeps unsupported mutating Array APIs out of compiler-owned shims", () => {
|
|
29
|
+
expect(JS_SURFACE_GLOBALS_SHIMS).to.not.include("push(");
|
|
30
|
+
expect(JS_SURFACE_GLOBALS_SHIMS).to.not.include("pop(");
|
|
31
|
+
expect(JS_SURFACE_GLOBALS_SHIMS).to.not.include("splice(");
|
|
32
|
+
expect(JS_SURFACE_GLOBALS_SHIMS).to.not.include("shift(");
|
|
33
|
+
expect(JS_SURFACE_GLOBALS_SHIMS).to.not.include("unshift(");
|
|
34
|
+
});
|
|
35
|
+
it("declares node alias modules for both node:* and bare specifiers", () => {
|
|
36
|
+
const requiredNodeAliases = [
|
|
37
|
+
'declare module "node:fs" { export { fs } from "@tsonic/nodejs/index.js"; }',
|
|
38
|
+
'declare module "fs" { export { fs } from "@tsonic/nodejs/index.js"; }',
|
|
39
|
+
'declare module "node:path" { export { path } from "@tsonic/nodejs/index.js"; }',
|
|
40
|
+
'declare module "path" { export { path } from "@tsonic/nodejs/index.js"; }',
|
|
41
|
+
'declare module "node:crypto" { export { crypto } from "@tsonic/nodejs/index.js"; }',
|
|
42
|
+
'declare module "crypto" { export { crypto } from "@tsonic/nodejs/index.js"; }',
|
|
43
|
+
'declare module "node:process" { export { process } from "@tsonic/nodejs/index.js"; }',
|
|
44
|
+
'declare module "process" { export { process } from "@tsonic/nodejs/index.js"; }',
|
|
45
|
+
'declare module "node:os" { export { os } from "@tsonic/nodejs/index.js"; }',
|
|
46
|
+
'declare module "os" { export { os } from "@tsonic/nodejs/index.js"; }',
|
|
47
|
+
];
|
|
48
|
+
for (const alias of requiredNodeAliases) {
|
|
49
|
+
expect(JS_SURFACE_NODE_MODULE_SHIMS).to.include(alias);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=js-surface-shims.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-surface-shims.test.js","sourceRoot":"","sources":["../../src/surface/js-surface-shims.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,uB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AA+E;YAC/E,sFAAsF;YACtF,iFAAiF;YACjF,4EAA4E;YAC5E,uEAAuE;SAC/D,CAAC;QAEX,KAAK,MAAM,KAAK,IAAI,mBAAmB,EAAE,CAAC;YACxC,MAAM,CAAC,4BAA4B,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACzD,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SurfaceMode } from "../program/types.js";
|
|
2
|
+
export type SurfaceCapabilities = {
|
|
3
|
+
readonly mode: SurfaceMode;
|
|
4
|
+
readonly requiredTypeRoots: readonly string[];
|
|
5
|
+
readonly useStandardLib: boolean;
|
|
6
|
+
readonly enableJsBuiltins: boolean;
|
|
7
|
+
readonly enableNodeModuleAliases: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const resolveSurfaceCapabilities: (mode: SurfaceMode | undefined) => SurfaceCapabilities;
|
|
10
|
+
//# sourceMappingURL=profiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../src/surface/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAWvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9C,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;CAC3C,CAAC;AA+DF,eAAO,MAAM,0BAA0B,GACrC,MAAM,WAAW,GAAG,SAAS,KAC5B,mBAcF,CAAC"}
|