Open
Description
Keywords: Automatic Type Acquisition, npm
I would like to produce a TypeScript playground using a particular version of a package. The suggestion is to support npm:
package specifiers in import
, like Deno does.
import { IInstruction, address } from 'npm:@solana/web3.js@2';
// @ts-expect-error
const ix: IInstruction = {
keys: [],
programAddress: address('abc'),
}
Output
import { address } from 'npm:@solana/web3.js@2';
// @ts-expect-error
const ix = {
keys: [],
programAddress: address('abc'),
};
Compiler Options
{
"compilerOptions": {
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"strictBindCallApply": true,
"noImplicitThis": true,
"noImplicitReturns": true,
"alwaysStrict": true,
"esModuleInterop": true,
"declaration": true,
"target": "ES2017",
"jsx": "react",
"module": "ESNext",
"moduleResolution": "node"
}
}
Playground Link: Provided
Adjacent to #3202.
Metadata
Metadata
Assignees
Labels
No labels