typescript-plugin-const-json
v0.1.0
Published
A typescript language service plugin providing support for json files imported as const.
Readme
typescript-plugin-toml
A typescript language service plugin providing support for toml files.

Usage
npm i -D typescript-plugin-const-json # yarn add -D typescript-plugin-const-jsonAnd then add this to tsconfig.json.
{
"compilerOptions": {
"plugins": [{ "name": "typescript-plugin-const-json" }]
}
}If you're using VSCode, switch to workspace version.
.const.json
If the file name ends with .const.json, the typings will become as if you are using as const.
For example it will be like below.
test.toml and test.const.toml
key = 'val'index.ts
import test from './test.toml'
import testConst from './test.const.toml'
type Test = typeof test // { key: string }
type TestConst = typeof testConst // { readonly key: 'val' }