You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am uncertain where to raise this issue, as npm package @types/systemjs is not maintained here, but was hoping that @joeldenning would have visibility here.
When building for a Node target, and and importing system-node.cjs, and including @types/systemjs as a dependency.
import SystemNode from 'systemjs/dist/system-node.cjs'
Then systemjs/dist/system-node.cjs it not recognized as a typescript module and is untyped. Additionally the Typescript types that do exist do not include applyImportMap which is only available in system-node.cjs.
Are there examples that could be cited which demonstrate the usage of TS types with system-node.cjs ?
The text was updated successfully, but these errors were encountered:
tbrannam
changed the title
Definitelytypes types for system-node.cjs
Definitelytyped types for system-node.cjs
Nov 23, 2023
So the simplest thing I could come up with looks like this in a local file
system-node.d.ts
/// <reference types="systemjs" />
declare module 'systemjs/dist/system-node.cjs' {
type SystemJS = typeof System & {
constructor: new () => SystemJS
}
const _System: SystemJS
export { _System as System }
export function applyImportMap(
system: typeof System,
importMap: System.ImportMap
): void
}
// if using Webpack and referencing the module context in a SystemJS Module
declare const __system_context__: System.Context
Question
I am uncertain where to raise this issue, as npm package
@types/systemjs
is not maintained here, but was hoping that @joeldenning would have visibility here.When building for a Node target, and and importing system-node.cjs, and including
@types/systemjs
as a dependency.Then
systemjs/dist/system-node.cjs
it not recognized as a typescript module and is untyped. Additionally the Typescript types that do exist do not includeapplyImportMap
which is only available insystem-node.cjs
.Are there examples that could be cited which demonstrate the usage of TS types with
system-node.cjs
?The text was updated successfully, but these errors were encountered: