Skip to content

Instantly share code, notes, and snippets.

@JoshuaKGoldberg
Created May 2, 2019 12:59
Show Gist options
  • Select an option

  • Save JoshuaKGoldberg/cb2f23a239e3b1b32f72d224934bec4f to your computer and use it in GitHub Desktop.

Select an option

Save JoshuaKGoldberg/cb2f23a239e3b1b32f72d224934bec4f to your computer and use it in GitHub Desktop.
Wrapping and exporting an ambient @types module
// webpack/assets/javascripts/my-esri
// This file should be in that path 👆 but Gists don't allow subpaths...
// I'm not super sure this works the way I want it to
// In theory, this /// include should only import the types into *this* file's context, not the ambient context
// 🤷
/// <reference path="../../../node_modules/@types/esri/index.d.ts" />
export const Esri = window.Esri;
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"baseUrl": ".",
"esModuleInterop": true,
"experimentalDecorators": true,
"jsx": "react",
"lib": ["esnext", "dom", "dom.iterable"],
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"paths": {
"*": [
"webpack/assets/javascripts/*",
"node_modules/*"
]
},
"pretty": true,
"sourceMap": true,
"strict": true,
"target": "esnext",
},
"include": [
"./webpack/**/*",
"./node_modules/*enzyme*/lib/index.d.ts"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment