diff --git a/extensions/api.d.ts b/extensions/api.d.ts index 863519e20..b78b72f41 100644 --- a/extensions/api.d.ts +++ b/extensions/api.d.ts @@ -1,4 +1,5 @@ import type { RequestHandler } from 'express'; +import type helpers from '../src/backend/src/helpers.js'; declare global { namespace Express { @@ -25,10 +26,17 @@ type RouterMethods = { }; } +type CoreRuntimeModule = { + util: { + helpers: typeof helpers, + } +} + interface Extension extends RouterMethods { // import(module: 'core'): { // UserActorType: typeof UserActorType; // }; + import(module: 'core'): CoreRuntimeModule; import(module: string): any; } diff --git a/extensions/jsconfig.json b/extensions/jsconfig.json index 0da51fce3..04ce18e6c 100644 --- a/extensions/jsconfig.json +++ b/extensions/jsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "ES2020", - "module": "CommonJS", + "module": "esnext", "moduleResolution": "node", "baseUrl": ".", "paths": { diff --git a/extensions/tsconfig.json b/extensions/tsconfig.json index 187f89a33..f531272af 100644 --- a/extensions/tsconfig.json +++ b/extensions/tsconfig.json @@ -1,9 +1,11 @@ { "compilerOptions": { "target": "ES2020", - "module": "CommonJS", + "allowJs": true, + "module": "esnext", "moduleResolution": "node", "baseUrl": ".", + "outDir": "/dev/null", "paths": { "../src/*": ["../src/*"] },