From e32cabe575ee3c5921faa71200e4ffe397ef4ba8 Mon Sep 17 00:00:00 2001 From: splincode Date: Sun, 26 Nov 2023 01:07:32 +0300 Subject: [PATCH] feat(tsconfig): add `ngDevMode` type --- .../tsconfig/@types/ng-dev-mode/index.d.ts | 19 +++++++++++++++++++ projects/tsconfig/tsconfig.json | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 projects/tsconfig/@types/ng-dev-mode/index.d.ts diff --git a/projects/tsconfig/@types/ng-dev-mode/index.d.ts b/projects/tsconfig/@types/ng-dev-mode/index.d.ts new file mode 100644 index 00000000..9174a818 --- /dev/null +++ b/projects/tsconfig/@types/ng-dev-mode/index.d.ts @@ -0,0 +1,19 @@ +/** + * Values of ngDevMode + * Depending on the current state of the application, ngDevMode may have one of several values. + * + * For convenience, the “truthy” value which enables dev mode is also an object which contains + * Angular’s performance counters. This is not necessary, but cuts down on boilerplate for the + * perf counters. + * + * ngDevMode may also be set to false. This can happen in one of a few ways: + * - The user explicitly sets `window.ngDevMode = false` somewhere in their app. + * - The user calls `enableProdMode()`. + * - The URL contains a `ngDevMode=false` text. + * Finally, ngDevMode may not have been defined at all. + * + * + * This will be provided through Terser global definitions by Angular CLI. This will + * help to tree-shake away the code unneeded for production bundles. + */ +declare const ngDevMode: boolean | {} | undefined | null; diff --git a/projects/tsconfig/tsconfig.json b/projects/tsconfig/tsconfig.json index 28f87955..9aecd7e8 100644 --- a/projects/tsconfig/tsconfig.json +++ b/projects/tsconfig/tsconfig.json @@ -29,7 +29,7 @@ "target": "es2015", "module": "es2020", "lib": ["es2017", "es2018.asynciterable", "dom"], - "typeRoots": ["node_modules/@types", "scripts/types"], + "typeRoots": ["node_modules/@types", "node_modules/@taiga-ui/tsconfig/@types"], "types": ["ng-dev-mode", "node"], "skipLibCheck": true, "downlevelIteration": true,