@visulima/tsconfig 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1343 @@
1
+ import { WriteJsonOptions } from '@visulima/fs';
2
+
3
+ declare global {
4
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
5
+ interface SymbolConstructor {
6
+ readonly observable: symbol;
7
+ }
8
+ }
9
+
10
+ /**
11
+ Returns a boolean for whether the two given types are equal.
12
+
13
+ @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
14
+ @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
15
+
16
+ Use-cases:
17
+ - If you want to make a conditional branch based on the result of a comparison of two types.
18
+
19
+ @example
20
+ ```
21
+ import type {IsEqual} from 'type-fest';
22
+
23
+ // This type returns a boolean for whether the given array includes the given item.
24
+ // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
25
+ type Includes<Value extends readonly any[], Item> =
26
+ Value extends readonly [Value[0], ...infer rest]
27
+ ? IsEqual<Value[0], Item> extends true
28
+ ? true
29
+ : Includes<rest, Item>
30
+ : false;
31
+ ```
32
+
33
+ @category Type Guard
34
+ @category Utilities
35
+ */
36
+ type IsEqual<A, B> =
37
+ (<G>() => G extends A ? 1 : 2) extends
38
+ (<G>() => G extends B ? 1 : 2)
39
+ ? true
40
+ : false;
41
+
42
+ /**
43
+ Filter out keys from an object.
44
+
45
+ Returns `never` if `Exclude` is strictly equal to `Key`.
46
+ Returns `never` if `Key` extends `Exclude`.
47
+ Returns `Key` otherwise.
48
+
49
+ @example
50
+ ```
51
+ type Filtered = Filter<'foo', 'foo'>;
52
+ //=> never
53
+ ```
54
+
55
+ @example
56
+ ```
57
+ type Filtered = Filter<'bar', string>;
58
+ //=> never
59
+ ```
60
+
61
+ @example
62
+ ```
63
+ type Filtered = Filter<'bar', 'foo'>;
64
+ //=> 'bar'
65
+ ```
66
+
67
+ @see {Except}
68
+ */
69
+ type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
70
+
71
+ type ExceptOptions = {
72
+ /**
73
+ Disallow assigning non-specified properties.
74
+
75
+ Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
76
+
77
+ @default false
78
+ */
79
+ requireExactProps?: boolean;
80
+ };
81
+
82
+ /**
83
+ Create a type from an object type without certain keys.
84
+
85
+ We recommend setting the `requireExactProps` option to `true`.
86
+
87
+ 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.
88
+
89
+ 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)).
90
+
91
+ @example
92
+ ```
93
+ import type {Except} from 'type-fest';
94
+
95
+ type Foo = {
96
+ a: number;
97
+ b: string;
98
+ };
99
+
100
+ type FooWithoutA = Except<Foo, 'a'>;
101
+ //=> {b: string}
102
+
103
+ const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
104
+ //=> errors: 'a' does not exist in type '{ b: string; }'
105
+
106
+ type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
107
+ //=> {a: number} & Partial<Record<"b", never>>
108
+
109
+ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
110
+ //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
111
+ ```
112
+
113
+ @category Object
114
+ */
115
+ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
116
+ [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
117
+ } & (Options['requireExactProps'] extends true
118
+ ? Partial<Record<KeysType, never>>
119
+ : {});
120
+
121
+ declare namespace TsConfigJson {
122
+ namespace CompilerOptions {
123
+ export type JSX =
124
+ | 'preserve'
125
+ | 'react'
126
+ | 'react-jsx'
127
+ | 'react-jsxdev'
128
+ | 'react-native';
129
+
130
+ export type Module =
131
+ | 'CommonJS'
132
+ | 'AMD'
133
+ | 'System'
134
+ | 'UMD'
135
+ | 'ES6'
136
+ | 'ES2015'
137
+ | 'ES2020'
138
+ | 'ES2022'
139
+ | 'ESNext'
140
+ | 'Node16'
141
+ | 'NodeNext'
142
+ | 'Preserve'
143
+ | 'None'
144
+ // Lowercase alternatives
145
+ | 'commonjs'
146
+ | 'amd'
147
+ | 'system'
148
+ | 'umd'
149
+ | 'es6'
150
+ | 'es2015'
151
+ | 'es2020'
152
+ | 'es2022'
153
+ | 'esnext'
154
+ | 'node16'
155
+ | 'nodenext'
156
+ | 'preserve'
157
+ | 'none';
158
+
159
+ export type NewLine =
160
+ | 'CRLF'
161
+ | 'LF'
162
+ // Lowercase alternatives
163
+ | 'crlf'
164
+ | 'lf';
165
+
166
+ export type Target =
167
+ | 'ES3'
168
+ | 'ES5'
169
+ | 'ES6'
170
+ | 'ES2015'
171
+ | 'ES2016'
172
+ | 'ES2017'
173
+ | 'ES2018'
174
+ | 'ES2019'
175
+ | 'ES2020'
176
+ | 'ES2021'
177
+ | 'ES2022'
178
+ | 'ESNext'
179
+ // Lowercase alternatives
180
+ | 'es3'
181
+ | 'es5'
182
+ | 'es6'
183
+ | 'es2015'
184
+ | 'es2016'
185
+ | 'es2017'
186
+ | 'es2018'
187
+ | 'es2019'
188
+ | 'es2020'
189
+ | 'es2021'
190
+ | 'es2022'
191
+ | 'esnext';
192
+
193
+ // eslint-disable-next-line unicorn/prevent-abbreviations
194
+ export type Lib =
195
+ | 'ES5'
196
+ | 'ES6'
197
+ | 'ES7'
198
+ | 'ES2015'
199
+ | 'ES2015.Collection'
200
+ | 'ES2015.Core'
201
+ | 'ES2015.Generator'
202
+ | 'ES2015.Iterable'
203
+ | 'ES2015.Promise'
204
+ | 'ES2015.Proxy'
205
+ | 'ES2015.Reflect'
206
+ | 'ES2015.Symbol.WellKnown'
207
+ | 'ES2015.Symbol'
208
+ | 'ES2016'
209
+ | 'ES2016.Array.Include'
210
+ | 'ES2017'
211
+ | 'ES2017.Intl'
212
+ | 'ES2017.Object'
213
+ | 'ES2017.SharedMemory'
214
+ | 'ES2017.String'
215
+ | 'ES2017.TypedArrays'
216
+ | 'ES2018'
217
+ | 'ES2018.AsyncGenerator'
218
+ | 'ES2018.AsyncIterable'
219
+ | 'ES2018.Intl'
220
+ | 'ES2018.Promise'
221
+ | 'ES2018.Regexp'
222
+ | 'ES2019'
223
+ | 'ES2019.Array'
224
+ | 'ES2019.Object'
225
+ | 'ES2019.String'
226
+ | 'ES2019.Symbol'
227
+ | 'ES2020'
228
+ | 'ES2020.BigInt'
229
+ | 'ES2020.Promise'
230
+ | 'ES2020.String'
231
+ | 'ES2020.Symbol.WellKnown'
232
+ | 'ES2020.SharedMemory'
233
+ | 'ES2020.Intl'
234
+ | 'ES2021'
235
+ | 'ES2021.Promise'
236
+ | 'ES2021.String'
237
+ | 'ES2021.WeakRef'
238
+ | 'ES2022'
239
+ | 'ES2022.Array'
240
+ | 'ES2022.Error'
241
+ | 'ES2022.Intl'
242
+ | 'ES2022.Object'
243
+ | 'ES2022.SharedMemory'
244
+ | 'ES2022.String'
245
+ | 'ES2022.RegExp'
246
+ | 'ESNext'
247
+ | 'ESNext.Array'
248
+ | 'ESNext.AsyncIterable'
249
+ | 'ESNext.BigInt'
250
+ | 'ESNext.Intl'
251
+ | 'ESNext.Promise'
252
+ | 'ESNext.String'
253
+ | 'ESNext.Symbol'
254
+ | 'ESNext.WeakRef'
255
+ | 'DOM'
256
+ | 'DOM.Iterable'
257
+ | 'ScriptHost'
258
+ | 'WebWorker'
259
+ | 'WebWorker.ImportScripts'
260
+ | 'WebWorker.Iterable'
261
+ // Lowercase alternatives
262
+ | 'es5'
263
+ | 'es6'
264
+ | 'es7'
265
+ | 'es2015'
266
+ | 'es2015.collection'
267
+ | 'es2015.core'
268
+ | 'es2015.generator'
269
+ | 'es2015.iterable'
270
+ | 'es2015.promise'
271
+ | 'es2015.proxy'
272
+ | 'es2015.reflect'
273
+ | 'es2015.symbol.wellknown'
274
+ | 'es2015.symbol'
275
+ | 'es2016'
276
+ | 'es2016.array.include'
277
+ | 'es2017'
278
+ | 'es2017.intl'
279
+ | 'es2017.object'
280
+ | 'es2017.sharedmemory'
281
+ | 'es2017.string'
282
+ | 'es2017.typedarrays'
283
+ | 'es2018'
284
+ | 'es2018.asyncgenerator'
285
+ | 'es2018.asynciterable'
286
+ | 'es2018.intl'
287
+ | 'es2018.promise'
288
+ | 'es2018.regexp'
289
+ | 'es2019'
290
+ | 'es2019.array'
291
+ | 'es2019.object'
292
+ | 'es2019.string'
293
+ | 'es2019.symbol'
294
+ | 'es2020'
295
+ | 'es2020.bigint'
296
+ | 'es2020.promise'
297
+ | 'es2020.string'
298
+ | 'es2020.symbol.wellknown'
299
+ | 'es2020.sharedmemory'
300
+ | 'es2020.intl'
301
+ | 'es2021'
302
+ | 'es2021.promise'
303
+ | 'es2021.string'
304
+ | 'es2021.weakref'
305
+ | 'es2022'
306
+ | 'es2022.array'
307
+ | 'es2022.error'
308
+ | 'es2022.intl'
309
+ | 'es2022.object'
310
+ | 'es2022.sharedmemory'
311
+ | 'es2022.string'
312
+ | 'es2022.regexp'
313
+ | 'esnext'
314
+ | 'esnext.array'
315
+ | 'esnext.asynciterable'
316
+ | 'esnext.bigint'
317
+ | 'esnext.intl'
318
+ | 'esnext.promise'
319
+ | 'esnext.string'
320
+ | 'esnext.symbol'
321
+ | 'esnext.weakref'
322
+ | 'dom'
323
+ | 'dom.iterable'
324
+ | 'scripthost'
325
+ | 'webworker'
326
+ | 'webworker.importscripts'
327
+ | 'webworker.iterable';
328
+
329
+ export type Plugin = {
330
+ /**
331
+ Plugin name.
332
+ */
333
+ name: string;
334
+ };
335
+
336
+ export type ImportsNotUsedAsValues =
337
+ | 'remove'
338
+ | 'preserve'
339
+ | 'error';
340
+
341
+ export type FallbackPolling =
342
+ | 'fixedPollingInterval'
343
+ | 'priorityPollingInterval'
344
+ | 'dynamicPriorityPolling'
345
+ | 'fixedInterval'
346
+ | 'priorityInterval'
347
+ | 'dynamicPriority'
348
+ | 'fixedChunkSize';
349
+
350
+ export type WatchDirectory =
351
+ | 'useFsEvents'
352
+ | 'fixedPollingInterval'
353
+ | 'dynamicPriorityPolling'
354
+ | 'fixedChunkSizePolling';
355
+
356
+ export type WatchFile =
357
+ | 'fixedPollingInterval'
358
+ | 'priorityPollingInterval'
359
+ | 'dynamicPriorityPolling'
360
+ | 'useFsEvents'
361
+ | 'useFsEventsOnParentDirectory'
362
+ | 'fixedChunkSizePolling';
363
+
364
+ export type ModuleResolution =
365
+ | 'classic'
366
+ | 'node'
367
+ | 'node10'
368
+ | 'node16'
369
+ | 'nodenext'
370
+ | 'bundler'
371
+ // Pascal-cased alternatives
372
+ | 'Classic'
373
+ | 'Node'
374
+ | 'Node10'
375
+ | 'Node16'
376
+ | 'NodeNext'
377
+ | 'Bundler';
378
+
379
+ export type ModuleDetection =
380
+ | 'auto'
381
+ | 'legacy'
382
+ | 'force';
383
+
384
+ export type IgnoreDeprecations = '5.0';
385
+ }
386
+
387
+ export type CompilerOptions = {
388
+ /**
389
+ The character set of the input files.
390
+
391
+ @default 'utf8'
392
+ @deprecated This option will be removed in TypeScript 5.5.
393
+ */
394
+ charset?: string;
395
+
396
+ /**
397
+ Enables building for project references.
398
+
399
+ @default true
400
+ */
401
+ composite?: boolean;
402
+
403
+ /**
404
+ Generates corresponding d.ts files.
405
+
406
+ @default false
407
+ */
408
+ declaration?: boolean;
409
+
410
+ /**
411
+ Specify output directory for generated declaration files.
412
+ */
413
+ declarationDir?: string;
414
+
415
+ /**
416
+ Show diagnostic information.
417
+
418
+ @default false
419
+ */
420
+ diagnostics?: boolean;
421
+
422
+ /**
423
+ Reduce the number of projects loaded automatically by TypeScript.
424
+
425
+ @default false
426
+ */
427
+ disableReferencedProjectLoad?: boolean;
428
+
429
+ /**
430
+ Enforces using indexed accessors for keys declared using an indexed type.
431
+
432
+ @default false
433
+ */
434
+ noPropertyAccessFromIndexSignature?: boolean;
435
+
436
+ /**
437
+ Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.
438
+
439
+ @default false
440
+ */
441
+ emitBOM?: boolean;
442
+
443
+ /**
444
+ Only emit `.d.ts` declaration files.
445
+
446
+ @default false
447
+ */
448
+ emitDeclarationOnly?: boolean;
449
+
450
+ /**
451
+ Differentiate between undefined and not present when type checking.
452
+
453
+ @default false
454
+ */
455
+ exactOptionalPropertyTypes?: boolean;
456
+
457
+ /**
458
+ Enable incremental compilation.
459
+
460
+ @default `composite`
461
+ */
462
+ incremental?: boolean;
463
+
464
+ /**
465
+ Specify file to store incremental compilation information.
466
+
467
+ @default '.tsbuildinfo'
468
+ */
469
+ tsBuildInfoFile?: string;
470
+
471
+ /**
472
+ Emit a single file with source maps instead of having a separate file.
473
+
474
+ @default false
475
+ */
476
+ inlineSourceMap?: boolean;
477
+
478
+ /**
479
+ Emit the source alongside the sourcemaps within a single file.
480
+
481
+ Requires `--inlineSourceMap` to be set.
482
+
483
+ @default false
484
+ */
485
+ inlineSources?: boolean;
486
+
487
+ /**
488
+ Specify what JSX code is generated.
489
+
490
+ @default 'preserve'
491
+ */
492
+ jsx?: CompilerOptions.JSX;
493
+
494
+ /**
495
+ Specifies the object invoked for `createElement` and `__spread` when targeting `'react'` JSX emit.
496
+
497
+ @default 'React'
498
+ */
499
+ reactNamespace?: string;
500
+
501
+ /**
502
+ Specify the JSX factory function to use when targeting React JSX emit, e.g. `React.createElement` or `h`.
503
+
504
+ @default 'React.createElement'
505
+ */
506
+ jsxFactory?: string;
507
+
508
+ /**
509
+ Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'.
510
+
511
+ @default 'React.Fragment'
512
+ */
513
+ jsxFragmentFactory?: string;
514
+
515
+ /**
516
+ Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.
517
+
518
+ @default 'react'
519
+ */
520
+ jsxImportSource?: string;
521
+
522
+ /**
523
+ Print names of files part of the compilation.
524
+
525
+ @default false
526
+ */
527
+ listFiles?: boolean;
528
+
529
+ /**
530
+ Specifies the location where debugger should locate map files instead of generated locations.
531
+ */
532
+ mapRoot?: string;
533
+
534
+ /**
535
+ 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.
536
+
537
+ @default ['ES3', 'ES5'].includes(target) ? 'CommonJS' : 'ES6'
538
+ */
539
+ module?: CompilerOptions.Module;
540
+
541
+ /**
542
+ Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6).
543
+
544
+ @default ['AMD', 'System', 'ES6'].includes(module) ? 'classic' : 'node'
545
+ */
546
+ moduleResolution?: CompilerOptions.ModuleResolution;
547
+
548
+ /**
549
+ Specifies the end of line sequence to be used when emitting files: 'crlf' (Windows) or 'lf' (Unix).
550
+
551
+ @default 'LF'
552
+ */
553
+ newLine?: CompilerOptions.NewLine;
554
+
555
+ /**
556
+ Do not emit output.
557
+
558
+ @default false
559
+ */
560
+ noEmit?: boolean;
561
+
562
+ /**
563
+ Do not generate custom helper functions like `__extends` in compiled output.
564
+
565
+ @default false
566
+ */
567
+ noEmitHelpers?: boolean;
568
+
569
+ /**
570
+ Do not emit outputs if any type checking errors were reported.
571
+
572
+ @default false
573
+ */
574
+ noEmitOnError?: boolean;
575
+
576
+ /**
577
+ Warn on expressions and declarations with an implied 'any' type.
578
+
579
+ @default false
580
+ */
581
+ noImplicitAny?: boolean;
582
+
583
+ /**
584
+ Raise error on 'this' expressions with an implied any type.
585
+
586
+ @default false
587
+ */
588
+ noImplicitThis?: boolean;
589
+
590
+ /**
591
+ Report errors on unused locals.
592
+
593
+ @default false
594
+ */
595
+ noUnusedLocals?: boolean;
596
+
597
+ /**
598
+ Report errors on unused parameters.
599
+
600
+ @default false
601
+ */
602
+ noUnusedParameters?: boolean;
603
+
604
+ /**
605
+ Do not include the default library file (lib.d.ts).
606
+
607
+ @default false
608
+ */
609
+ noLib?: boolean;
610
+
611
+ /**
612
+ Do not add triple-slash references or module import targets to the list of compiled files.
613
+
614
+ @default false
615
+ */
616
+ noResolve?: boolean;
617
+
618
+ /**
619
+ Disable strict checking of generic signatures in function types.
620
+
621
+ @default false
622
+ @deprecated This option will be removed in TypeScript 5.5.
623
+ */
624
+ noStrictGenericChecks?: boolean;
625
+
626
+ /**
627
+ @deprecated use `skipLibCheck` instead.
628
+ */
629
+ skipDefaultLibCheck?: boolean;
630
+
631
+ /**
632
+ Skip type checking of declaration files.
633
+
634
+ @default false
635
+ */
636
+ skipLibCheck?: boolean;
637
+
638
+ /**
639
+ Concatenate and emit output to single file.
640
+ */
641
+ outFile?: string;
642
+
643
+ /**
644
+ Redirect output structure to the directory.
645
+ */
646
+ outDir?: string;
647
+
648
+ /**
649
+ Do not erase const enum declarations in generated code.
650
+
651
+ @default false
652
+ */
653
+ preserveConstEnums?: boolean;
654
+
655
+ /**
656
+ Do not resolve symlinks to their real path; treat a symlinked file like a real one.
657
+
658
+ @default false
659
+ */
660
+ preserveSymlinks?: boolean;
661
+
662
+ /**
663
+ Keep outdated console output in watch mode instead of clearing the screen.
664
+
665
+ @default false
666
+ */
667
+ preserveWatchOutput?: boolean;
668
+
669
+ /**
670
+ Stylize errors and messages using color and context (experimental).
671
+
672
+ @default true // Unless piping to another program or redirecting output to a file.
673
+ */
674
+ pretty?: boolean;
675
+
676
+ /**
677
+ Do not emit comments to output.
678
+
679
+ @default false
680
+ */
681
+ removeComments?: boolean;
682
+
683
+ /**
684
+ Specifies the root directory of input files.
685
+
686
+ Use to control the output directory structure with `--outDir`.
687
+ */
688
+ rootDir?: string;
689
+
690
+ /**
691
+ Unconditionally emit imports for unresolved files.
692
+
693
+ @default false
694
+ */
695
+ isolatedModules?: boolean;
696
+
697
+ /**
698
+ Generates corresponding '.map' file.
699
+
700
+ @default false
701
+ */
702
+ sourceMap?: boolean;
703
+
704
+ /**
705
+ Specifies the location where debugger should locate TypeScript files instead of source locations.
706
+ */
707
+ sourceRoot?: string;
708
+
709
+ /**
710
+ Suppress excess property checks for object literals.
711
+
712
+ @default false
713
+ @deprecated This option will be removed in TypeScript 5.5.
714
+ */
715
+ suppressExcessPropertyErrors?: boolean;
716
+
717
+ /**
718
+ Suppress noImplicitAny errors for indexing objects lacking index signatures.
719
+
720
+ @default false
721
+ @deprecated This option will be removed in TypeScript 5.5.
722
+ */
723
+ suppressImplicitAnyIndexErrors?: boolean;
724
+
725
+
726
+
727
+ /**
728
+ Specify ECMAScript target version.
729
+
730
+ @default 'es3'
731
+ */
732
+ target?: CompilerOptions.Target;
733
+
734
+ /**
735
+ Default catch clause variables as `unknown` instead of `any`.
736
+
737
+ @default false
738
+ */
739
+ useUnknownInCatchVariables?: boolean;
740
+
741
+ /**
742
+ Watch input files.
743
+
744
+ @default false
745
+ @deprecated Use watchOptions instead.
746
+ */
747
+ watch?: boolean;
748
+
749
+ /**
750
+ Specify the polling strategy to use when the system runs out of or doesn't support native file watchers.
751
+
752
+ @deprecated Use watchOptions.fallbackPolling instead.
753
+ */
754
+ fallbackPolling?: CompilerOptions.FallbackPolling;
755
+
756
+ /**
757
+ Specify the strategy for watching directories under systems that lack recursive file-watching functionality.
758
+
759
+ @default 'useFsEvents'
760
+ @deprecated Use watchOptions.watchDirectory instead.
761
+ */
762
+ watchDirectory?: CompilerOptions.WatchDirectory;
763
+
764
+ /**
765
+ Specify the strategy for watching individual files.
766
+
767
+ @default 'useFsEvents'
768
+ @deprecated Use watchOptions.watchFile instead.
769
+ */
770
+ watchFile?: CompilerOptions.WatchFile;
771
+
772
+ /**
773
+ Enables experimental support for ES7 decorators.
774
+
775
+ @default false
776
+ */
777
+ experimentalDecorators?: boolean;
778
+
779
+ /**
780
+ Emit design-type metadata for decorated declarations in source.
781
+
782
+ @default false
783
+ */
784
+ emitDecoratorMetadata?: boolean;
785
+
786
+ /**
787
+ Do not report errors on unused labels.
788
+
789
+ @default false
790
+ */
791
+ allowUnusedLabels?: boolean;
792
+
793
+ /**
794
+ Report error when not all code paths in function return a value.
795
+
796
+ @default false
797
+ */
798
+ noImplicitReturns?: boolean;
799
+
800
+ /**
801
+ Add `undefined` to a type when accessed using an index.
802
+
803
+ @default false
804
+ */
805
+ noUncheckedIndexedAccess?: boolean;
806
+
807
+ /**
808
+ Report errors for fallthrough cases in switch statement.
809
+
810
+ @default false
811
+ */
812
+ noFallthroughCasesInSwitch?: boolean;
813
+
814
+ /**
815
+ Ensure overriding members in derived classes are marked with an override modifier.
816
+
817
+ @default false
818
+ */
819
+ noImplicitOverride?: boolean;
820
+
821
+ /**
822
+ Do not report errors on unreachable code.
823
+
824
+ @default false
825
+ */
826
+ allowUnreachableCode?: boolean;
827
+
828
+ /**
829
+ Disallow inconsistently-cased references to the same file.
830
+
831
+ @default true
832
+ */
833
+ forceConsistentCasingInFileNames?: boolean;
834
+
835
+ /**
836
+ Emit a v8 CPU profile of the compiler run for debugging.
837
+
838
+ @default 'profile.cpuprofile'
839
+ */
840
+ generateCpuProfile?: string;
841
+
842
+ /**
843
+ Base directory to resolve non-relative module names.
844
+ */
845
+ baseUrl?: string;
846
+
847
+ /**
848
+ Specify path mapping to be computed relative to baseUrl option.
849
+ */
850
+ paths?: Record<string, string[]>;
851
+
852
+ /**
853
+ List of TypeScript language server plugins to load.
854
+ */
855
+ plugins?: CompilerOptions.Plugin[];
856
+
857
+ /**
858
+ Specify list of root directories to be used when resolving modules.
859
+ */
860
+ rootDirs?: string[];
861
+
862
+ /**
863
+ Specify list of directories for type definition files to be included.
864
+ */
865
+ typeRoots?: string[];
866
+
867
+ /**
868
+ Type declaration files to be included in compilation.
869
+ */
870
+ types?: string[];
871
+
872
+ /**
873
+ Enable tracing of the name resolution process.
874
+
875
+ @default false
876
+ */
877
+ traceResolution?: boolean;
878
+
879
+ /**
880
+ Allow javascript files to be compiled.
881
+
882
+ @default false
883
+ */
884
+ allowJs?: boolean;
885
+
886
+ /**
887
+ Do not truncate error messages.
888
+
889
+ @default false
890
+ */
891
+ noErrorTruncation?: boolean;
892
+
893
+ /**
894
+ Allow default imports from modules with no default export. This does not affect code emit, just typechecking.
895
+
896
+ @default module === 'system' || esModuleInterop
897
+ */
898
+ allowSyntheticDefaultImports?: boolean;
899
+
900
+ /**
901
+ Do not emit `'use strict'` directives in module output.
902
+
903
+ @default false
904
+ @deprecated This option will be removed in TypeScript 5.5.
905
+ */
906
+ noImplicitUseStrict?: boolean;
907
+
908
+ /**
909
+ Enable to list all emitted files.
910
+
911
+ @default false
912
+ */
913
+ listEmittedFiles?: boolean;
914
+
915
+ /**
916
+ Disable size limit for JavaScript project.
917
+
918
+ @default false
919
+ */
920
+ disableSizeLimit?: boolean;
921
+
922
+ /**
923
+ List of library files to be included in the compilation.
924
+ */
925
+ lib?: CompilerOptions.Lib[];
926
+
927
+ /**
928
+ Enable strict null checks.
929
+
930
+ @default false
931
+ */
932
+ strictNullChecks?: boolean;
933
+
934
+ /**
935
+ The maximum dependency depth to search under `node_modules` and load JavaScript files. Only applicable with `--allowJs`.
936
+
937
+ @default 0
938
+ */
939
+ maxNodeModuleJsDepth?: number;
940
+
941
+ /**
942
+ Import emit helpers (e.g. `__extends`, `__rest`, etc..) from tslib.
943
+
944
+ @default false
945
+ */
946
+ importHelpers?: boolean;
947
+
948
+ /**
949
+ Specify emit/checking behavior for imports that are only used for types.
950
+
951
+ @default 'remove'
952
+ @deprecated Use `verbatimModuleSyntax` instead.
953
+ */
954
+ importsNotUsedAsValues?: CompilerOptions.ImportsNotUsedAsValues;
955
+
956
+ /**
957
+ Parse in strict mode and emit `'use strict'` for each source file.
958
+
959
+ @default false
960
+ */
961
+ alwaysStrict?: boolean;
962
+
963
+ /**
964
+ Enable all strict type checking options.
965
+
966
+ @default false
967
+ */
968
+ strict?: boolean;
969
+
970
+ /**
971
+ Enable stricter checking of of the `bind`, `call`, and `apply` methods on functions.
972
+
973
+ @default false
974
+ */
975
+ strictBindCallApply?: boolean;
976
+
977
+ /**
978
+ Provide full support for iterables in `for-of`, spread, and destructuring when targeting `ES5` or `ES3`.
979
+
980
+ @default false
981
+ */
982
+ downlevelIteration?: boolean;
983
+
984
+ /**
985
+ Report errors in `.js` files.
986
+
987
+ @default false
988
+ */
989
+ checkJs?: boolean;
990
+
991
+ /**
992
+ Disable bivariant parameter checking for function types.
993
+
994
+ @default false
995
+ */
996
+ strictFunctionTypes?: boolean;
997
+
998
+ /**
999
+ Ensure non-undefined class properties are initialized in the constructor.
1000
+
1001
+ @default false
1002
+ */
1003
+ strictPropertyInitialization?: boolean;
1004
+
1005
+ /**
1006
+ Emit `__importStar` and `__importDefault` helpers for runtime Babel ecosystem compatibility and enable `--allowSyntheticDefaultImports` for typesystem compatibility.
1007
+
1008
+ @default false
1009
+ */
1010
+ esModuleInterop?: boolean;
1011
+
1012
+ /**
1013
+ Allow accessing UMD globals from modules.
1014
+
1015
+ @default false
1016
+ */
1017
+ allowUmdGlobalAccess?: boolean;
1018
+
1019
+ /**
1020
+ Resolve `keyof` to string valued property names only (no numbers or symbols).
1021
+
1022
+ @default false
1023
+ @deprecated This option will be removed in TypeScript 5.5.
1024
+ */
1025
+ keyofStringsOnly?: boolean;
1026
+
1027
+ /**
1028
+ Emit ECMAScript standard class fields.
1029
+
1030
+ @default false
1031
+ */
1032
+ useDefineForClassFields?: boolean;
1033
+
1034
+ /**
1035
+ Generates a sourcemap for each corresponding `.d.ts` file.
1036
+
1037
+ @default false
1038
+ */
1039
+ declarationMap?: boolean;
1040
+
1041
+ /**
1042
+ Include modules imported with `.json` extension.
1043
+
1044
+ @default false
1045
+ */
1046
+ resolveJsonModule?: boolean;
1047
+
1048
+ /**
1049
+ Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it.
1050
+
1051
+ @default false
1052
+ */
1053
+ assumeChangesOnlyAffectDirectDependencies?: boolean;
1054
+
1055
+ /**
1056
+ Output more detailed compiler performance information after building.
1057
+
1058
+ @default false
1059
+ */
1060
+ extendedDiagnostics?: boolean;
1061
+
1062
+ /**
1063
+ Print names of files that are part of the compilation and then stop processing.
1064
+
1065
+ @default false
1066
+ */
1067
+ listFilesOnly?: boolean;
1068
+
1069
+ /**
1070
+ Disable preferring source files instead of declaration files when referencing composite projects.
1071
+
1072
+ @default true if composite, false otherwise
1073
+ */
1074
+ disableSourceOfProjectReferenceRedirect?: boolean;
1075
+
1076
+ /**
1077
+ Opt a project out of multi-project reference checking when editing.
1078
+
1079
+ @default false
1080
+ */
1081
+ disableSolutionSearching?: boolean;
1082
+
1083
+ /**
1084
+ Print names of files which TypeScript sees as a part of your project and the reason they are part of the compilation.
1085
+
1086
+ @default false
1087
+ */
1088
+ explainFiles?: boolean;
1089
+
1090
+ /**
1091
+ Preserve unused imported values in the JavaScript output that would otherwise be removed.
1092
+
1093
+ @default true
1094
+ @deprecated Use `verbatimModuleSyntax` instead.
1095
+ */
1096
+ preserveValueImports?: boolean;
1097
+
1098
+ /**
1099
+ List of file name suffixes to search when resolving a module.
1100
+ */
1101
+ moduleSuffixes?: string[];
1102
+
1103
+ /**
1104
+ Control what method is used to detect module-format JS files.
1105
+
1106
+ @default 'auto'
1107
+ */
1108
+ moduleDetection?: CompilerOptions.ModuleDetection;
1109
+
1110
+ /**
1111
+ Allows TypeScript files to import each other with a TypeScript-specific extension like .ts, .mts, or .tsx.
1112
+
1113
+ @default false
1114
+ */
1115
+ allowImportingTsExtensions?: boolean;
1116
+
1117
+ /**
1118
+ Forces TypeScript to consult the exports field of package.json files if it ever reads from a package in node_modules.
1119
+
1120
+ @default false
1121
+ */
1122
+ resolvePackageJsonExports?: boolean;
1123
+
1124
+ /**
1125
+ 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.
1126
+
1127
+ @default false
1128
+ */
1129
+ resolvePackageJsonImports?: boolean;
1130
+
1131
+ /**
1132
+ Suppress errors for file formats that TypeScript does not understand.
1133
+
1134
+ @default false
1135
+ */
1136
+ allowArbitraryExtensions?: boolean;
1137
+
1138
+ /**
1139
+ List of additional conditions that should succeed when TypeScript resolves from package.json.
1140
+ */
1141
+ customConditions?: string[];
1142
+
1143
+ /**
1144
+ Anything that uses the type modifier is dropped entirely.
1145
+
1146
+ @default false
1147
+ */
1148
+ verbatimModuleSyntax?: boolean;
1149
+
1150
+ /**
1151
+ Suppress deprecation warnings
1152
+ */
1153
+ ignoreDeprecations?: CompilerOptions.IgnoreDeprecations;
1154
+ };
1155
+
1156
+ namespace WatchOptions {
1157
+ export type WatchFileKind =
1158
+ | 'FixedPollingInterval'
1159
+ | 'PriorityPollingInterval'
1160
+ | 'DynamicPriorityPolling'
1161
+ | 'FixedChunkSizePolling'
1162
+ | 'UseFsEvents'
1163
+ | 'UseFsEventsOnParentDirectory';
1164
+
1165
+ export type WatchDirectoryKind =
1166
+ | 'UseFsEvents'
1167
+ | 'FixedPollingInterval'
1168
+ | 'DynamicPriorityPolling'
1169
+ | 'FixedChunkSizePolling';
1170
+
1171
+ export type PollingWatchKind =
1172
+ | 'FixedInterval'
1173
+ | 'PriorityInterval'
1174
+ | 'DynamicPriority'
1175
+ | 'FixedChunkSize';
1176
+ }
1177
+
1178
+ export type WatchOptions = {
1179
+
1180
+ /**
1181
+ Specify the strategy for watching individual files.
1182
+
1183
+ @default 'UseFsEvents'
1184
+ */
1185
+ watchFile?: WatchOptions.WatchFileKind | Lowercase<WatchOptions.WatchFileKind>;
1186
+
1187
+ /**
1188
+ Specify the strategy for watching directories under systems that lack recursive file-watching functionality.
1189
+
1190
+ @default 'UseFsEvents'
1191
+ */
1192
+ watchDirectory?: WatchOptions.WatchDirectoryKind | Lowercase<WatchOptions.WatchDirectoryKind>;
1193
+
1194
+ /**
1195
+ Specify the polling strategy to use when the system runs out of or doesn't support native file watchers.
1196
+ */
1197
+ fallbackPolling?: WatchOptions.PollingWatchKind | Lowercase<WatchOptions.PollingWatchKind>;
1198
+
1199
+ /**
1200
+ Enable synchronous updates on directory watchers for platforms that don't support recursive watching natively.
1201
+ */
1202
+ synchronousWatchDirectory?: boolean;
1203
+
1204
+ /**
1205
+ Specifies a list of directories to exclude from watch
1206
+ */
1207
+ excludeDirectories?: string[];
1208
+
1209
+ /**
1210
+ Specifies a list of files to exclude from watch
1211
+ */
1212
+ excludeFiles?: string[];
1213
+ };
1214
+
1215
+ /**
1216
+ Auto type (.d.ts) acquisition options for this project.
1217
+ */
1218
+ export type TypeAcquisition = {
1219
+ /**
1220
+ Enable auto type acquisition.
1221
+ */
1222
+ enable?: boolean;
1223
+
1224
+ /**
1225
+ Specifies a list of type declarations to be included in auto type acquisition. For example, `['jquery', 'lodash']`.
1226
+ */
1227
+ include?: string[];
1228
+
1229
+ /**
1230
+ Specifies a list of type declarations to be excluded from auto type acquisition. For example, `['jquery', 'lodash']`.
1231
+ */
1232
+ exclude?: string[];
1233
+ };
1234
+
1235
+ export type References = {
1236
+ /**
1237
+ A normalized path on disk.
1238
+ */
1239
+ path: string;
1240
+
1241
+ /**
1242
+ The path as the user originally wrote it.
1243
+ */
1244
+ originalPath?: string;
1245
+
1246
+ /**
1247
+ True if the output of this reference should be prepended to the output of this project.
1248
+
1249
+ Only valid for `--outFile` compilations.
1250
+ @deprecated This option will be removed in TypeScript 5.5.
1251
+ */
1252
+ prepend?: boolean;
1253
+
1254
+ /**
1255
+ True if it is intended that this reference form a circularity.
1256
+ */
1257
+ circular?: boolean;
1258
+ };
1259
+ }
1260
+
1261
+ /**
1262
+ Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7).
1263
+
1264
+ @category File
1265
+ */
1266
+ type TsConfigJson = {
1267
+ /**
1268
+ Instructs the TypeScript compiler how to compile `.ts` files.
1269
+ */
1270
+ compilerOptions?: TsConfigJson.CompilerOptions;
1271
+
1272
+ /**
1273
+ Instructs the TypeScript compiler how to watch files.
1274
+ */
1275
+ watchOptions?: TsConfigJson.WatchOptions;
1276
+
1277
+ /**
1278
+ Auto type (.d.ts) acquisition options for this project.
1279
+ */
1280
+ typeAcquisition?: TsConfigJson.TypeAcquisition;
1281
+
1282
+ /**
1283
+ Enable Compile-on-Save for this project.
1284
+ */
1285
+ compileOnSave?: boolean;
1286
+
1287
+ /**
1288
+ Path to base configuration file to inherit from.
1289
+ */
1290
+ extends?: string | string[];
1291
+
1292
+ /**
1293
+ 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.
1294
+ */
1295
+ files?: string[];
1296
+
1297
+ /**
1298
+ 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.
1299
+
1300
+ Glob patterns require TypeScript version 2.0 or later.
1301
+ */
1302
+ exclude?: string[];
1303
+
1304
+ /**
1305
+ Specifies a list of glob patterns that match files to be included in compilation.
1306
+
1307
+ 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`.
1308
+ */
1309
+ include?: string[];
1310
+
1311
+ /**
1312
+ Referenced projects.
1313
+ */
1314
+ references?: TsConfigJson.References[];
1315
+ };
1316
+
1317
+ type TsConfigJsonResolved = Except<TsConfigJson, "extends">;
1318
+
1319
+ type Options$1 = {
1320
+ cache?: Map<string, TsConfigJsonResolved> | boolean;
1321
+ configFileName?: string;
1322
+ };
1323
+ type TsConfigResult = {
1324
+ config: TsConfigJsonResolved;
1325
+ path: string;
1326
+ };
1327
+ declare const findTsConfig: (cwd?: URL | string, options?: Options$1) => Promise<TsConfigResult>;
1328
+ declare const findTsConfigSync: (cwd?: URL | string, options?: Options$1) => TsConfigResult;
1329
+
1330
+ type Options = {
1331
+ tscCompatible?: boolean;
1332
+ };
1333
+ declare const implicitBaseUrlSymbol: unique symbol;
1334
+ declare const readTsConfig: (tsconfigPath: string, options?: Options) => TsConfigJsonResolved;
1335
+
1336
+ declare const writeTsConfig: (tsConfig: TsConfigJson, options?: WriteJsonOptions & {
1337
+ cwd?: URL | string;
1338
+ }) => Promise<void>;
1339
+ declare const writeTsConfigSync: (tsConfig: TsConfigJson, options?: WriteJsonOptions & {
1340
+ cwd?: URL | string;
1341
+ }) => void;
1342
+
1343
+ export { type TsConfigJsonResolved, type TsConfigResult, findTsConfig, findTsConfigSync, implicitBaseUrlSymbol, readTsConfig, writeTsConfig, writeTsConfigSync };