diff --git a/build/importTypescript.js b/build/importTypescript.js index b1a8847e..1f452411 100644 --- a/build/importTypescript.js +++ b/build/importTypescript.js @@ -134,6 +134,7 @@ export var IndentStyle = ts.IndentStyle; export var ScriptKind = ts.ScriptKind; export var ScriptTarget = ts.ScriptTarget; export var TokenClass = ts.TokenClass; +export var typescript = ts; // END MONACOCHANGE `; fs.writeFileSync( diff --git a/src/typescript/lib/typescriptServices.js b/src/typescript/lib/typescriptServices.js index 342cc974..9470c630 100644 --- a/src/typescript/lib/typescriptServices.js +++ b/src/typescript/lib/typescriptServices.js @@ -160240,4 +160240,5 @@ export var IndentStyle = ts.IndentStyle; export var ScriptKind = ts.ScriptKind; export var ScriptTarget = ts.ScriptTarget; export var TokenClass = ts.TokenClass; +export var typescript = ts; // END MONACOCHANGE diff --git a/src/typescript/tsWorker.ts b/src/typescript/tsWorker.ts index 14f86b79..dac53264 100644 --- a/src/typescript/tsWorker.ts +++ b/src/typescript/tsWorker.ts @@ -496,4 +496,5 @@ export function create(ctx: worker.IWorkerContext, createData: ICreateData): Typ } /** Allows for clients to have access to the same version of TypeScript that the worker uses */ -globalThis.ts = ts; +// @ts-ignore +globalThis.ts = ts.typescript; diff --git a/test/smoke/smoke.test.js b/test/smoke/smoke.test.js index a2f48a72..4ae2ce28 100644 --- a/test/smoke/smoke.test.js +++ b/test/smoke/smoke.test.js @@ -172,6 +172,9 @@ describe(`Smoke Test '${TESTS_TYPE}'`, () => { // check that the TypeScript worker exposes `ts` as a global assert.strictEqual(await tsWorker.evaluate(`typeof ts`), 'object'); + + // check that the TypeScript worker exposes the full `ts` as a global + assert.strictEqual(await tsWorker.evaluate(`typeof ts.optionDeclarations`), 'object'); }); });