diff --git a/.gitignore b/.gitignore index f124f4ef24..d075809af6 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ datasources/00_National_Data_Sets.json /error.log /output.log privateserverconfig.json +ts-out/ wwwroot/privateconfig.json deploy/packages/ deploy/work/ diff --git a/.prettierignore b/.prettierignore index 825a640036..c9b354b07f 100644 --- a/.prettierignore +++ b/.prettierignore @@ -20,6 +20,7 @@ datasources/00_National_Data_Sets.json /error.log /output.log privateserverconfig.json +ts-out/ wwwroot/privateconfig.json deploy/packages/ deploy/work/ @@ -43,4 +44,4 @@ wwwroot/*.html ckanext-cesiumpreview -deploy/helm/terria/charts/terriamap/templates/ \ No newline at end of file +deploy/helm/terria/charts/terriamap/templates/ diff --git a/lib/ThirdParty/global.d.ts b/lib/ThirdParty/global.d.ts new file mode 100644 index 0000000000..b3d77b63e3 --- /dev/null +++ b/lib/ThirdParty/global.d.ts @@ -0,0 +1 @@ +declare module "*.html"; diff --git a/lib/ThirdParty/styled-components/index.d.ts b/lib/ThirdParty/styled-components/index.d.ts new file mode 100644 index 0000000000..b8846f9326 --- /dev/null +++ b/lib/ThirdParty/styled-components/index.d.ts @@ -0,0 +1,24 @@ +// Copy of lib/ThirdParty/styled-components from terriajs, but with updated +// import path for terriaTheme. + +// Pull in the css prop type addition to react attributes +/// + +// import your custom theme +import { CSSProp } from "styled-components"; +import { terriaTheme } from "terriajs/lib/ReactViews/StandardUserInterface/StandardTheme"; + +type Theme = typeof terriaTheme; + +declare module "styled-components" { + export interface DefaultTheme extends Theme {} +} + +// See https://github.com/styled-components/styled-components/issues/2528 +// .css isn't included in @types/styled-components because it has to be enabled +// through a babel plugin or macro +declare module "react" { + interface Attributes { + css?: CSSProp; + } +} diff --git a/tsconfig.json b/tsconfig.json index 27a264f8d7..f90bd71492 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,20 @@ { - "extends": "terriajs/tsconfig.json" + "extends": "./node_modules/terriajs/tsconfig", + "compilerOptions": { + "outDir": "ts-out", + "maxNodeModuleJsDepth": 5, + "typeRoots": [ + "./node_modules/", + "./node_modules/@types/", + "./node_modules/terriajs/lib/ThirdParty", + "../node_modules/", + "../node_modules/@types/", + "../../node_modules/", + "../../node_modules/@types/", + "../../../node_modules/", + "../../../node_modules/@types/" + ], + "types": ["global", "terriajs-cesium", "terriajs-cesium-extra"] + }, + "include": ["./lib/**/*", "./buildprocess/**/*"] }