1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324 |
- declare global {
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
- interface SymbolConstructor {
- readonly observable: symbol;
- }
- }
- /**
- Returns a boolean for whether the two given types are equal.
- @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
- @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
- Use-cases:
- - If you want to make a conditional branch based on the result of a comparison of two types.
- @example
- ```
- import type {IsEqual} from 'type-fest';
- // This type returns a boolean for whether the given array includes the given item.
- // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
- type Includes<Value extends readonly any[], Item> =
- Value extends readonly [Value[0], ...infer rest]
- ? IsEqual<Value[0], Item> extends true
- ? true
- : Includes<rest, Item>
- : false;
- ```
- @category Type Guard
- @category Utilities
- */
- type IsEqual<A, B> =
- (<G>() => G extends A ? 1 : 2) extends
- (<G>() => G extends B ? 1 : 2)
- ? true
- : false;
- /**
- Filter out keys from an object.
- Returns `never` if `Exclude` is strictly equal to `Key`.
- Returns `never` if `Key` extends `Exclude`.
- Returns `Key` otherwise.
- @example
- ```
- type Filtered = Filter<'foo', 'foo'>;
- //=> never
- ```
- @example
- ```
- type Filtered = Filter<'bar', string>;
- //=> never
- ```
- @example
- ```
- type Filtered = Filter<'bar', 'foo'>;
- //=> 'bar'
- ```
- @see {Except}
- */
- type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
- type ExceptOptions = {
- /**
- Disallow assigning non-specified properties.
- Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
- @default false
- */
- requireExactProps?: boolean;
- };
- /**
- Create a type from an object type without certain keys.
- We recommend setting the `requireExactProps` option to `true`.
- This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
- This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
- @example
- ```
- import type {Except} from 'type-fest';
- type Foo = {
- a: number;
- b: string;
- };
- type FooWithoutA = Except<Foo, 'a'>;
- //=> {b: string}
- const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
- //=> errors: 'a' does not exist in type '{ b: string; }'
- type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
- //=> {a: number} & Partial<Record<"b", never>>
- const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
- //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
- ```
- @category Object
- */
- type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
- [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
- } & (Options['requireExactProps'] extends true
- ? Partial<Record<KeysType, never>>
- : {});
- declare namespace TsConfigJson {
- namespace CompilerOptions {
- export type JSX =
- | 'preserve'
- | 'react'
- | 'react-jsx'
- | 'react-jsxdev'
- | 'react-native';
- export type Module =
- | 'CommonJS'
- | 'AMD'
- | 'System'
- | 'UMD'
- | 'ES6'
- | 'ES2015'
- | 'ES2020'
- | 'ES2022'
- | 'ESNext'
- | 'Node16'
- | 'NodeNext'
- | 'None'
- // Lowercase alternatives
- | 'commonjs'
- | 'amd'
- | 'system'
- | 'umd'
- | 'es6'
- | 'es2015'
- | 'es2020'
- | 'es2022'
- | 'esnext'
- | 'node16'
- | 'nodenext'
- | 'none';
- export type NewLine =
- | 'CRLF'
- | 'LF'
- // Lowercase alternatives
- | 'crlf'
- | 'lf';
- export type Target =
- | 'ES3'
- | 'ES5'
- | 'ES6'
- | 'ES2015'
- | 'ES2016'
- | 'ES2017'
- | 'ES2018'
- | 'ES2019'
- | 'ES2020'
- | 'ES2021'
- | 'ES2022'
- | 'ESNext'
- // Lowercase alternatives
- | 'es3'
- | 'es5'
- | 'es6'
- | 'es2015'
- | 'es2016'
- | 'es2017'
- | 'es2018'
- | 'es2019'
- | 'es2020'
- | 'es2021'
- | 'es2022'
- | 'esnext';
- export type Lib =
- | 'ES5'
- | 'ES6'
- | 'ES7'
- | 'ES2015'
- | 'ES2015.Collection'
- | 'ES2015.Core'
- | 'ES2015.Generator'
- | 'ES2015.Iterable'
- | 'ES2015.Promise'
- | 'ES2015.Proxy'
- | 'ES2015.Reflect'
- | 'ES2015.Symbol.WellKnown'
- | 'ES2015.Symbol'
- | 'ES2016'
- | 'ES2016.Array.Include'
- | 'ES2017'
- | 'ES2017.Intl'
- | 'ES2017.Object'
- | 'ES2017.SharedMemory'
- | 'ES2017.String'
- | 'ES2017.TypedArrays'
- | 'ES2018'
- | 'ES2018.AsyncGenerator'
- | 'ES2018.AsyncIterable'
- | 'ES2018.Intl'
- | 'ES2018.Promise'
- | 'ES2018.Regexp'
- | 'ES2019'
- | 'ES2019.Array'
- | 'ES2019.Object'
- | 'ES2019.String'
- | 'ES2019.Symbol'
- | 'ES2020'
- | 'ES2020.BigInt'
- | 'ES2020.Promise'
- | 'ES2020.String'
- | 'ES2020.Symbol.WellKnown'
- | 'ES2020.SharedMemory'
- | 'ES2020.Intl'
- | 'ES2021'
- | 'ES2021.Promise'
- | 'ES2021.String'
- | 'ES2021.WeakRef'
- | 'ESNext'
- | 'ESNext.Array'
- | 'ESNext.AsyncIterable'
- | 'ESNext.BigInt'
- | 'ESNext.Intl'
- | 'ESNext.Promise'
- | 'ESNext.String'
- | 'ESNext.Symbol'
- | 'ESNext.WeakRef'
- | 'DOM'
- | 'DOM.Iterable'
- | 'ScriptHost'
- | 'WebWorker'
- | 'WebWorker.ImportScripts'
- | 'WebWorker.Iterable'
- // Lowercase alternatives
- | 'es5'
- | 'es6'
- | 'es7'
- | 'es2015'
- | 'es2015.collection'
- | 'es2015.core'
- | 'es2015.generator'
- | 'es2015.iterable'
- | 'es2015.promise'
- | 'es2015.proxy'
- | 'es2015.reflect'
- | 'es2015.symbol.wellknown'
- | 'es2015.symbol'
- | 'es2016'
- | 'es2016.array.include'
- | 'es2017'
- | 'es2017.intl'
- | 'es2017.object'
- | 'es2017.sharedmemory'
- | 'es2017.string'
- | 'es2017.typedarrays'
- | 'es2018'
- | 'es2018.asyncgenerator'
- | 'es2018.asynciterable'
- | 'es2018.intl'
- | 'es2018.promise'
- | 'es2018.regexp'
- | 'es2019'
- | 'es2019.array'
- | 'es2019.object'
- | 'es2019.string'
- | 'es2019.symbol'
- | 'es2020'
- | 'es2020.bigint'
- | 'es2020.promise'
- | 'es2020.string'
- | 'es2020.symbol.wellknown'
- | 'es2020.sharedmemory'
- | 'es2020.intl'
- | 'es2021'
- | 'es2021.promise'
- | 'es2021.string'
- | 'es2021.weakref'
- | 'esnext'
- | 'esnext.array'
- | 'esnext.asynciterable'
- | 'esnext.bigint'
- | 'esnext.intl'
- | 'esnext.promise'
- | 'esnext.string'
- | 'esnext.symbol'
- | 'esnext.weakref'
- | 'dom'
- | 'dom.iterable'
- | 'scripthost'
- | 'webworker'
- | 'webworker.importscripts'
- | 'webworker.iterable';
- export type Plugin = {
- /**
- Plugin name.
- */
- name: string;
- };
- export type ImportsNotUsedAsValues =
- | 'remove'
- | 'preserve'
- | 'error';
- export type FallbackPolling =
- | 'fixedPollingInterval'
- | 'priorityPollingInterval'
- | 'dynamicPriorityPolling'
- | 'fixedInterval'
- | 'priorityInterval'
- | 'dynamicPriority'
- | 'fixedChunkSize';
- export type WatchDirectory =
- | 'useFsEvents'
- | 'fixedPollingInterval'
- | 'dynamicPriorityPolling'
- | 'fixedChunkSizePolling';
- export type WatchFile =
- | 'fixedPollingInterval'
- | 'priorityPollingInterval'
- | 'dynamicPriorityPolling'
- | 'useFsEvents'
- | 'useFsEventsOnParentDirectory'
- | 'fixedChunkSizePolling';
- export type ModuleResolution =
- | 'classic'
- | 'node'
- | 'node10'
- | 'node16'
- | 'nodenext'
- | 'bundler'
- // Pascal-cased alternatives
- | 'Classic'
- | 'Node'
- | 'Node10'
- | 'Node16'
- | 'NodeNext'
- | 'Bundler';
- export type ModuleDetection =
- | 'auto'
- | 'legacy'
- | 'force';
- export type IgnoreDeprecations = '5.0';
- }
- export type CompilerOptions = {
- /**
- The character set of the input files.
- @default 'utf8'
- @deprecated This option will be removed in TypeScript 5.5.
- */
- charset?: string;
- /**
- Enables building for project references.
- @default true
- */
- composite?: boolean;
- /**
- Generates corresponding d.ts files.
- @default false
- */
- declaration?: boolean;
- /**
- Specify output directory for generated declaration files.
- */
- declarationDir?: string;
- /**
- Show diagnostic information.
- @default false
- */
- diagnostics?: boolean;
- /**
- Reduce the number of projects loaded automatically by TypeScript.
- @default false
- */
- disableReferencedProjectLoad?: boolean;
- /**
- Enforces using indexed accessors for keys declared using an indexed type.
- @default false
- */
- noPropertyAccessFromIndexSignature?: boolean;
- /**
- Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.
- @default false
- */
- emitBOM?: boolean;
- /**
- Only emit `.d.ts` declaration files.
- @default false
- */
- emitDeclarationOnly?: boolean;
- /**
- Differentiate between undefined and not present when type checking.
- @default false
- */
- exactOptionalPropertyTypes?: boolean;
- /**
- Enable incremental compilation.
- @default `composite`
- */
- incremental?: boolean;
- /**
- Specify file to store incremental compilation information.
- @default '.tsbuildinfo'
- */
- tsBuildInfoFile?: string;
- /**
- Emit a single file with source maps instead of having a separate file.
- @default false
- */
- inlineSourceMap?: boolean;
- /**
- Emit the source alongside the sourcemaps within a single file.
- Requires `--inlineSourceMap` to be set.
- @default false
- */
- inlineSources?: boolean;
- /**
- Specify what JSX code is generated.
- @default 'preserve'
- */
- jsx?: CompilerOptions.JSX;
- /**
- Specifies the object invoked for `createElement` and `__spread` when targeting `'react'` JSX emit.
- @default 'React'
- */
- reactNamespace?: string;
- /**
- Specify the JSX factory function to use when targeting React JSX emit, e.g. `React.createElement` or `h`.
- @default 'React.createElement'
- */
- jsxFactory?: string;
- /**
- Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'.
- @default 'React.Fragment'
- */
- jsxFragmentFactory?: string;
- /**
- Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.
- @default 'react'
- */
- jsxImportSource?: string;
- /**
- Print names of files part of the compilation.
- @default false
- */
- listFiles?: boolean;
- /**
- Specifies the location where debugger should locate map files instead of generated locations.
- */
- mapRoot?: string;
- /**
- Specify module code generation: 'None', 'CommonJS', 'AMD', 'System', 'UMD', 'ES6', 'ES2015' or 'ESNext'. Only 'AMD' and 'System' can be used in conjunction with `--outFile`. 'ES6' and 'ES2015' values may be used when targeting 'ES5' or lower.
- @default ['ES3', 'ES5'].includes(target) ? 'CommonJS' : 'ES6'
- */
- module?: CompilerOptions.Module;
- /**
- Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6).
- @default ['AMD', 'System', 'ES6'].includes(module) ? 'classic' : 'node'
- */
- moduleResolution?: CompilerOptions.ModuleResolution;
- /**
- Specifies the end of line sequence to be used when emitting files: 'crlf' (Windows) or 'lf' (Unix).
- @default 'LF'
- */
- newLine?: CompilerOptions.NewLine;
- /**
- Do not emit output.
- @default false
- */
- noEmit?: boolean;
- /**
- Do not generate custom helper functions like `__extends` in compiled output.
- @default false
- */
- noEmitHelpers?: boolean;
- /**
- Do not emit outputs if any type checking errors were reported.
- @default false
- */
- noEmitOnError?: boolean;
- /**
- Warn on expressions and declarations with an implied 'any' type.
- @default false
- */
- noImplicitAny?: boolean;
- /**
- Raise error on 'this' expressions with an implied any type.
- @default false
- */
- noImplicitThis?: boolean;
- /**
- Report errors on unused locals.
- @default false
- */
- noUnusedLocals?: boolean;
- /**
- Report errors on unused parameters.
- @default false
- */
- noUnusedParameters?: boolean;
- /**
- Do not include the default library file (lib.d.ts).
- @default false
- */
- noLib?: boolean;
- /**
- Do not add triple-slash references or module import targets to the list of compiled files.
- @default false
- */
- noResolve?: boolean;
- /**
- Disable strict checking of generic signatures in function types.
- @default false
- @deprecated This option will be removed in TypeScript 5.5.
- */
- noStrictGenericChecks?: boolean;
- /**
- @deprecated use `skipLibCheck` instead.
- */
- skipDefaultLibCheck?: boolean;
- /**
- Skip type checking of declaration files.
- @default false
- */
- skipLibCheck?: boolean;
- /**
- Concatenate and emit output to single file.
- */
- outFile?: string;
- /**
- Redirect output structure to the directory.
- */
- outDir?: string;
- /**
- Do not erase const enum declarations in generated code.
- @default false
- */
- preserveConstEnums?: boolean;
- /**
- Do not resolve symlinks to their real path; treat a symlinked file like a real one.
- @default false
- */
- preserveSymlinks?: boolean;
- /**
- Keep outdated console output in watch mode instead of clearing the screen.
- @default false
- */
- preserveWatchOutput?: boolean;
- /**
- Stylize errors and messages using color and context (experimental).
- @default true // Unless piping to another program or redirecting output to a file.
- */
- pretty?: boolean;
- /**
- Do not emit comments to output.
- @default false
- */
- removeComments?: boolean;
- /**
- Specifies the root directory of input files.
- Use to control the output directory structure with `--outDir`.
- */
- rootDir?: string;
- /**
- Unconditionally emit imports for unresolved files.
- @default false
- */
- isolatedModules?: boolean;
- /**
- Generates corresponding '.map' file.
- @default false
- */
- sourceMap?: boolean;
- /**
- Specifies the location where debugger should locate TypeScript files instead of source locations.
- */
- sourceRoot?: string;
- /**
- Suppress excess property checks for object literals.
- @default false
- @deprecated This option will be removed in TypeScript 5.5.
- */
- suppressExcessPropertyErrors?: boolean;
- /**
- Suppress noImplicitAny errors for indexing objects lacking index signatures.
- @default false
- @deprecated This option will be removed in TypeScript 5.5.
- */
- suppressImplicitAnyIndexErrors?: boolean;
- /**
- Do not emit declarations for code that has an `@internal` annotation.
- */
- stripInternal?: boolean;
- /**
- Specify ECMAScript target version.
- @default 'es3'
- */
- target?: CompilerOptions.Target;
- /**
- Default catch clause variables as `unknown` instead of `any`.
- @default false
- */
- useUnknownInCatchVariables?: boolean;
- /**
- Watch input files.
- @default false
- @deprecated Use watchOptions instead.
- */
- watch?: boolean;
- /**
- Specify the polling strategy to use when the system runs out of or doesn't support native file watchers.
- @deprecated Use watchOptions.fallbackPolling instead.
- */
- fallbackPolling?: CompilerOptions.FallbackPolling;
- /**
- Specify the strategy for watching directories under systems that lack recursive file-watching functionality.
- @default 'useFsEvents'
- @deprecated Use watchOptions.watchDirectory instead.
- */
- watchDirectory?: CompilerOptions.WatchDirectory;
- /**
- Specify the strategy for watching individual files.
- @default 'useFsEvents'
- @deprecated Use watchOptions.watchFile instead.
- */
- watchFile?: CompilerOptions.WatchFile;
- /**
- Enables experimental support for ES7 decorators.
- @default false
- */
- experimentalDecorators?: boolean;
- /**
- Emit design-type metadata for decorated declarations in source.
- @default false
- */
- emitDecoratorMetadata?: boolean;
- /**
- Do not report errors on unused labels.
- @default false
- */
- allowUnusedLabels?: boolean;
- /**
- Report error when not all code paths in function return a value.
- @default false
- */
- noImplicitReturns?: boolean;
- /**
- Add `undefined` to a type when accessed using an index.
- @default false
- */
- noUncheckedIndexedAccess?: boolean;
- /**
- Report errors for fallthrough cases in switch statement.
- @default false
- */
- noFallthroughCasesInSwitch?: boolean;
- /**
- Ensure overriding members in derived classes are marked with an override modifier.
- @default false
- */
- noImplicitOverride?: boolean;
- /**
- Do not report errors on unreachable code.
- @default false
- */
- allowUnreachableCode?: boolean;
- /**
- Disallow inconsistently-cased references to the same file.
- @default true
- */
- forceConsistentCasingInFileNames?: boolean;
- /**
- Emit a v8 CPU profile of the compiler run for debugging.
- @default 'profile.cpuprofile'
- */
- generateCpuProfile?: string;
- /**
- Base directory to resolve non-relative module names.
- */
- baseUrl?: string;
- /**
- Specify path mapping to be computed relative to baseUrl option.
- */
- paths?: Record<string, string[]>;
- /**
- List of TypeScript language server plugins to load.
- */
- plugins?: CompilerOptions.Plugin[];
- /**
- Specify list of root directories to be used when resolving modules.
- */
- rootDirs?: string[];
- /**
- Specify list of directories for type definition files to be included.
- */
- typeRoots?: string[];
- /**
- Type declaration files to be included in compilation.
- */
- types?: string[];
- /**
- Enable tracing of the name resolution process.
- @default false
- */
- traceResolution?: boolean;
- /**
- Allow javascript files to be compiled.
- @default false
- */
- allowJs?: boolean;
- /**
- Do not truncate error messages.
- @default false
- */
- noErrorTruncation?: boolean;
- /**
- Allow default imports from modules with no default export. This does not affect code emit, just typechecking.
- @default module === 'system' || esModuleInterop
- */
- allowSyntheticDefaultImports?: boolean;
- /**
- Do not emit `'use strict'` directives in module output.
- @default false
- @deprecated This option will be removed in TypeScript 5.5.
- */
- noImplicitUseStrict?: boolean;
- /**
- Enable to list all emitted files.
- @default false
- */
- listEmittedFiles?: boolean;
- /**
- Disable size limit for JavaScript project.
- @default false
- */
- disableSizeLimit?: boolean;
- /**
- List of library files to be included in the compilation.
- */
- lib?: CompilerOptions.Lib[];
- /**
- Enable strict null checks.
- @default false
- */
- strictNullChecks?: boolean;
- /**
- The maximum dependency depth to search under `node_modules` and load JavaScript files. Only applicable with `--allowJs`.
- @default 0
- */
- maxNodeModuleJsDepth?: number;
- /**
- Import emit helpers (e.g. `__extends`, `__rest`, etc..) from tslib.
- @default false
- */
- importHelpers?: boolean;
- /**
- Specify emit/checking behavior for imports that are only used for types.
- @default 'remove'
- @deprecated Use `verbatimModuleSyntax` instead.
- */
- importsNotUsedAsValues?: CompilerOptions.ImportsNotUsedAsValues;
- /**
- Parse in strict mode and emit `'use strict'` for each source file.
- @default false
- */
- alwaysStrict?: boolean;
- /**
- Enable all strict type checking options.
- @default false
- */
- strict?: boolean;
- /**
- Enable stricter checking of of the `bind`, `call`, and `apply` methods on functions.
- @default false
- */
- strictBindCallApply?: boolean;
- /**
- Provide full support for iterables in `for-of`, spread, and destructuring when targeting `ES5` or `ES3`.
- @default false
- */
- downlevelIteration?: boolean;
- /**
- Report errors in `.js` files.
- @default false
- */
- checkJs?: boolean;
- /**
- Disable bivariant parameter checking for function types.
- @default false
- */
- strictFunctionTypes?: boolean;
- /**
- Ensure non-undefined class properties are initialized in the constructor.
- @default false
- */
- strictPropertyInitialization?: boolean;
- /**
- Emit `__importStar` and `__importDefault` helpers for runtime Babel ecosystem compatibility and enable `--allowSyntheticDefaultImports` for typesystem compatibility.
- @default false
- */
- esModuleInterop?: boolean;
- /**
- Allow accessing UMD globals from modules.
- @default false
- */
- allowUmdGlobalAccess?: boolean;
- /**
- Resolve `keyof` to string valued property names only (no numbers or symbols).
- @default false
- @deprecated This option will be removed in TypeScript 5.5.
- */
- keyofStringsOnly?: boolean;
- /**
- Emit ECMAScript standard class fields.
- @default false
- */
- useDefineForClassFields?: boolean;
- /**
- Generates a sourcemap for each corresponding `.d.ts` file.
- @default false
- */
- declarationMap?: boolean;
- /**
- Include modules imported with `.json` extension.
- @default false
- */
- resolveJsonModule?: boolean;
- /**
- Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it.
- @default false
- */
- assumeChangesOnlyAffectDirectDependencies?: boolean;
- /**
- Output more detailed compiler performance information after building.
- @default false
- */
- extendedDiagnostics?: boolean;
- /**
- Print names of files that are part of the compilation and then stop processing.
- @default false
- */
- listFilesOnly?: boolean;
- /**
- Disable preferring source files instead of declaration files when referencing composite projects.
- @default true if composite, false otherwise
- */
- disableSourceOfProjectReferenceRedirect?: boolean;
- /**
- Opt a project out of multi-project reference checking when editing.
- @default false
- */
- disableSolutionSearching?: boolean;
- /**
- Print names of files which TypeScript sees as a part of your project and the reason they are part of the compilation.
- @default false
- */
- explainFiles?: boolean;
- /**
- Preserve unused imported values in the JavaScript output that would otherwise be removed.
- @default true
- @deprecated Use `verbatimModuleSyntax` instead.
- */
- preserveValueImports?: boolean;
- /**
- List of file name suffixes to search when resolving a module.
- */
- moduleSuffixes?: string[];
- /**
- Control what method is used to detect module-format JS files.
- @default 'auto'
- */
- moduleDetection?: CompilerOptions.ModuleDetection;
- /**
- Allows TypeScript files to import each other with a TypeScript-specific extension like .ts, .mts, or .tsx.
- @default false
- */
- allowImportingTsExtensions?: boolean;
- /**
- Forces TypeScript to consult the exports field of package.json files if it ever reads from a package in node_modules.
- @default false
- */
- resolvePackageJsonExports?: boolean;
- /**
- Forces TypeScript to consult the imports field of package.json files when performing a lookup that starts with # from a file whose ancestor directory contains a package.json.
- @default false
- */
- resolvePackageJsonImports?: boolean;
- /**
- Suppress errors for file formats that TypeScript does not understand.
- @default false
- */
- allowArbitraryExtensions?: boolean;
- /**
- List of additional conditions that should succeed when TypeScript resolves from package.json.
- */
- customConditions?: string[];
- /**
- Anything that uses the type modifier is dropped entirely.
- @default false
- */
- verbatimModuleSyntax?: boolean;
- /**
- Suppress deprecation warnings
- */
- ignoreDeprecations?: CompilerOptions.IgnoreDeprecations;
- };
- namespace WatchOptions {
- export type WatchFileKind =
- | 'FixedPollingInterval'
- | 'PriorityPollingInterval'
- | 'DynamicPriorityPolling'
- | 'FixedChunkSizePolling'
- | 'UseFsEvents'
- | 'UseFsEventsOnParentDirectory';
- export type WatchDirectoryKind =
- | 'UseFsEvents'
- | 'FixedPollingInterval'
- | 'DynamicPriorityPolling'
- | 'FixedChunkSizePolling';
- export type PollingWatchKind =
- | 'FixedInterval'
- | 'PriorityInterval'
- | 'DynamicPriority'
- | 'FixedChunkSize';
- }
- export type WatchOptions = {
- /**
- Specify the strategy for watching individual files.
- @default 'UseFsEvents'
- */
- watchFile?: WatchOptions.WatchFileKind | Lowercase<WatchOptions.WatchFileKind>;
- /**
- Specify the strategy for watching directories under systems that lack recursive file-watching functionality.
- @default 'UseFsEvents'
- */
- watchDirectory?: WatchOptions.WatchDirectoryKind | Lowercase<WatchOptions.WatchDirectoryKind>;
- /**
- Specify the polling strategy to use when the system runs out of or doesn't support native file watchers.
- */
- fallbackPolling?: WatchOptions.PollingWatchKind | Lowercase<WatchOptions.PollingWatchKind>;
- /**
- Enable synchronous updates on directory watchers for platforms that don't support recursive watching natively.
- */
- synchronousWatchDirectory?: boolean;
- /**
- Specifies a list of directories to exclude from watch
- */
- excludeDirectories?: string[];
- /**
- Specifies a list of files to exclude from watch
- */
- excludeFiles?: string[];
- };
- /**
- Auto type (.d.ts) acquisition options for this project.
- */
- export type TypeAcquisition = {
- /**
- Enable auto type acquisition.
- */
- enable?: boolean;
- /**
- Specifies a list of type declarations to be included in auto type acquisition. For example, `['jquery', 'lodash']`.
- */
- include?: string[];
- /**
- Specifies a list of type declarations to be excluded from auto type acquisition. For example, `['jquery', 'lodash']`.
- */
- exclude?: string[];
- };
- export type References = {
- /**
- A normalized path on disk.
- */
- path: string;
- /**
- The path as the user originally wrote it.
- */
- originalPath?: string;
- /**
- True if the output of this reference should be prepended to the output of this project.
- Only valid for `--outFile` compilations.
- @deprecated This option will be removed in TypeScript 5.5.
- */
- prepend?: boolean;
- /**
- True if it is intended that this reference form a circularity.
- */
- circular?: boolean;
- };
- }
- /**
- Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7).
- @category File
- */
- type TsConfigJson = {
- /**
- Instructs the TypeScript compiler how to compile `.ts` files.
- */
- compilerOptions?: TsConfigJson.CompilerOptions;
- /**
- Instructs the TypeScript compiler how to watch files.
- */
- watchOptions?: TsConfigJson.WatchOptions;
- /**
- Auto type (.d.ts) acquisition options for this project.
- */
- typeAcquisition?: TsConfigJson.TypeAcquisition;
- /**
- Enable Compile-on-Save for this project.
- */
- compileOnSave?: boolean;
- /**
- Path to base configuration file to inherit from.
- */
- extends?: string | string[];
- /**
- If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. When a `files` property is specified, only those files and those specified by `include` are included.
- */
- files?: string[];
- /**
- Specifies a list of files to be excluded from compilation. The `exclude` property only affects the files included via the `include` property and not the `files` property.
- Glob patterns require TypeScript version 2.0 or later.
- */
- exclude?: string[];
- /**
- Specifies a list of glob patterns that match files to be included in compilation.
- If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`.
- */
- include?: string[];
- /**
- Referenced projects.
- */
- references?: TsConfigJson.References[];
- };
- type TsConfigJsonResolved = Except<TsConfigJson, 'extends'>;
- type TsConfigResult = {
- /**
- * The path to the tsconfig.json file
- */
- path: string;
- /**
- * The resolved tsconfig.json file
- */
- config: TsConfigJsonResolved;
- };
- declare const getTsconfig: (searchPath?: string, configName?: string, cache?: Map<string, any>) => TsConfigResult | null;
- declare const parseTsconfig: (tsconfigPath: string, cache?: Map<string, any>) => TsConfigJsonResolved;
- /**
- * Reference:
- * https://github.com/microsoft/TypeScript/blob/3ccbe804f850f40d228d3c875be952d94d39aa1d/src/compiler/moduleNameResolver.ts#L2465
- */
- declare const createPathsMatcher: (tsconfig: TsConfigResult) => ((specifier: string) => string[]) | null;
- type FileMatcher = (filePath: string) => (TsConfigJsonResolved | undefined);
- declare const createFilesMatcher: ({ config, path: tsconfigPath, }: TsConfigResult, caseSensitivePaths?: boolean) => FileMatcher;
- export { FileMatcher, TsConfigJson, TsConfigJsonResolved, TsConfigResult, createFilesMatcher, createPathsMatcher, getTsconfig, parseTsconfig };
|