@typescript-deploys/pr-build 5.5.0-pr-58296-8 → 5.5.0-pr-58299-2

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.
package/lib/lib.dom.d.ts CHANGED
@@ -1293,8 +1293,8 @@ interface PushSubscriptionOptionsInit {
1293
1293
  }
1294
1294
 
1295
1295
  interface QueuingStrategy<T = any> {
1296
- readonly highWaterMark?: number;
1297
- readonly size?: QueuingStrategySize<T>;
1296
+ highWaterMark?: number;
1297
+ size?: QueuingStrategySize<T>;
1298
1298
  }
1299
1299
 
1300
1300
  interface QueuingStrategyInit {
@@ -1303,7 +1303,7 @@ interface QueuingStrategyInit {
1303
1303
  *
1304
1304
  * Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw.
1305
1305
  */
1306
- readonly highWaterMark: number;
1306
+ highWaterMark: number;
1307
1307
  }
1308
1308
 
1309
1309
  interface RTCAnswerOptions extends RTCOfferAnswerOptions {
@@ -6059,9 +6059,9 @@ interface DOMException extends Error {
6059
6059
  */
6060
6060
  readonly code: number;
6061
6061
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
6062
- message: string;
6062
+ readonly message: string;
6063
6063
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
6064
- name: string;
6064
+ readonly name: string;
6065
6065
  readonly INDEX_SIZE_ERR: 1;
6066
6066
  readonly DOMSTRING_SIZE_ERR: 2;
6067
6067
  readonly HIERARCHY_REQUEST_ERR: 3;
@@ -18811,7 +18811,7 @@ interface ReadableStream<R = any> {
18811
18811
 
18812
18812
  declare var ReadableStream: {
18813
18813
  prototype: ReadableStream;
18814
- new(underlyingSource: UnderlyingByteSource, strategy?: { readonly highWaterMark?: number }): ReadableStream<Uint8Array>;
18814
+ new(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number }): ReadableStream<Uint8Array>;
18815
18815
  new<R = any>(underlyingSource: UnderlyingDefaultSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
18816
18816
  new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
18817
18817
  };
@@ -19551,7 +19551,7 @@ interface SVGElementEventMap extends ElementEventMap, GlobalEventHandlersEventMa
19551
19551
  */
19552
19552
  interface SVGElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement {
19553
19553
  /** @deprecated */
19554
- className: any;
19554
+ readonly className: any;
19555
19555
  readonly ownerSVGElement: SVGSVGElement | null;
19556
19556
  readonly viewportElement: SVGElement | null;
19557
19557
  addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -48,7 +48,7 @@ interface Map<K, V> {
48
48
  interface MapConstructor {
49
49
  new (): Map<any, any>;
50
50
  new <K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
51
- prototype: Map<any, any>;
51
+ readonly prototype: Map<any, any>;
52
52
  }
53
53
  declare var Map: MapConstructor;
54
54
 
@@ -82,7 +82,7 @@ interface WeakMap<K extends WeakKey, V> {
82
82
 
83
83
  interface WeakMapConstructor {
84
84
  new <K extends WeakKey = WeakKey, V = any>(entries?: readonly (readonly [K, V])[] | null): WeakMap<K, V>;
85
- prototype: WeakMap<WeakKey, any>;
85
+ readonly prototype: WeakMap<WeakKey, any>;
86
86
  }
87
87
  declare var WeakMap: WeakMapConstructor;
88
88
 
@@ -114,7 +114,7 @@ interface Set<T> {
114
114
 
115
115
  interface SetConstructor {
116
116
  new <T = any>(values?: readonly T[] | null): Set<T>;
117
- prototype: Set<any>;
117
+ readonly prototype: Set<any>;
118
118
  }
119
119
  declare var Set: SetConstructor;
120
120
 
@@ -142,6 +142,6 @@ interface WeakSet<T extends WeakKey> {
142
142
 
143
143
  interface WeakSetConstructor {
144
144
  new <T extends WeakKey = WeakKey>(values?: readonly T[] | null): WeakSet<T>;
145
- prototype: WeakSet<WeakKey>;
145
+ readonly prototype: WeakSet<WeakKey>;
146
146
  }
147
147
  declare var WeakSet: WeakSetConstructor;
@@ -48,7 +48,7 @@ interface GeneratorFunction {
48
48
  /**
49
49
  * A reference to the prototype.
50
50
  */
51
- prototype: Generator;
51
+ readonly prototype: Generator;
52
52
  }
53
53
 
54
54
  interface GeneratorFunctionConstructor {
@@ -73,5 +73,5 @@ interface GeneratorFunctionConstructor {
73
73
  /**
74
74
  * A reference to the prototype.
75
75
  */
76
- prototype: GeneratorFunction;
76
+ readonly prototype: GeneratorFunction;
77
77
  }
@@ -20,7 +20,7 @@ interface PromiseConstructor {
20
20
  /**
21
21
  * A reference to the prototype.
22
22
  */
23
- prototype: Promise<any>;
23
+ readonly prototype: Promise<any>;
24
24
 
25
25
  /**
26
26
  * Creates a new Promise.
@@ -20,7 +20,7 @@ interface SymbolConstructor {
20
20
  /**
21
21
  * A reference to the prototype.
22
22
  */
23
- prototype: Symbol;
23
+ readonly prototype: Symbol;
24
24
 
25
25
  /**
26
26
  * Returns a new unique Symbol value.
@@ -21,7 +21,7 @@ interface ObjectConstructor {
21
21
  * Returns an array of values of the enumerable properties of an object
22
22
  * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
23
23
  */
24
- values<T>(o: { readonly [s: string]: T; } | ArrayLike<T>): T[];
24
+ values<T>(o: { [s: string]: T; } | ArrayLike<T>): T[];
25
25
 
26
26
  /**
27
27
  * Returns an array of values of the enumerable properties of an object
@@ -33,7 +33,7 @@ interface ObjectConstructor {
33
33
  * Returns an array of key/values of the enumerable properties of an object
34
34
  * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
35
35
  */
36
- entries<T>(o: { readonly [s: string]: T; } | ArrayLike<T>): [string, T][];
36
+ entries<T>(o: { [s: string]: T; } | ArrayLike<T>): [string, T][];
37
37
 
38
38
  /**
39
39
  * Returns an array of key/values of the enumerable properties of an object
@@ -34,7 +34,7 @@ interface SharedArrayBuffer {
34
34
  }
35
35
 
36
36
  interface SharedArrayBufferConstructor {
37
- prototype: SharedArrayBuffer;
37
+ readonly prototype: SharedArrayBuffer;
38
38
  new (byteLength: number): SharedArrayBuffer;
39
39
  }
40
40
  declare var SharedArrayBuffer: SharedArrayBufferConstructor;
@@ -48,7 +48,7 @@ interface AsyncGeneratorFunction {
48
48
  /**
49
49
  * A reference to the prototype.
50
50
  */
51
- prototype: AsyncGenerator;
51
+ readonly prototype: AsyncGenerator;
52
52
  }
53
53
 
54
54
  interface AsyncGeneratorFunctionConstructor {
@@ -73,5 +73,5 @@ interface AsyncGeneratorFunctionConstructor {
73
73
  /**
74
74
  * A reference to the prototype.
75
75
  */
76
- prototype: AsyncGeneratorFunction;
76
+ readonly prototype: AsyncGeneratorFunction;
77
77
  }
@@ -50,7 +50,7 @@ declare namespace Intl {
50
50
  interface PluralRulesConstructor {
51
51
  new (locales?: string | readonly string[], options?: PluralRulesOptions): PluralRules;
52
52
  (locales?: string | readonly string[], options?: PluralRulesOptions): PluralRules;
53
- supportedLocalesOf(locales: string | readonly string[], options?: { readonly localeMatcher?: "lookup" | "best fit"; }): string[];
53
+ supportedLocalesOf(locales: string | readonly string[], options?: { localeMatcher?: "lookup" | "best fit"; }): string[];
54
54
  }
55
55
 
56
56
  const PluralRules: PluralRulesConstructor;
@@ -122,7 +122,7 @@ interface BigInt {
122
122
 
123
123
  interface BigIntConstructor {
124
124
  (value: bigint | boolean | number | string): bigint;
125
- prototype: BigInt;
125
+ readonly prototype: BigInt;
126
126
 
127
127
  /**
128
128
  * Interprets the low bits of a BigInt as a 2's-complement signed integer.
@@ -388,7 +388,7 @@ interface BigInt64Array {
388
388
  }
389
389
 
390
390
  interface BigInt64ArrayConstructor {
391
- prototype: BigInt64Array;
391
+ readonly prototype: BigInt64Array;
392
392
  new (length?: number): BigInt64Array;
393
393
  new (array: Iterable<bigint>): BigInt64Array;
394
394
  new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigInt64Array;
@@ -660,7 +660,7 @@ interface BigUint64Array {
660
660
  }
661
661
 
662
662
  interface BigUint64ArrayConstructor {
663
- prototype: BigUint64Array;
663
+ readonly prototype: BigUint64Array;
664
664
  new (length?: number): BigUint64Array;
665
665
  new (array: Iterable<bigint>): BigUint64Array;
666
666
  new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigUint64Array;
@@ -444,7 +444,7 @@ declare namespace Intl {
444
444
  *
445
445
  * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/supportedLocalesOf).
446
446
  */
447
- supportedLocalesOf(locales?: LocalesArgument, options?: { readonly localeMatcher?: RelativeTimeFormatLocaleMatcher; }): UnicodeBCP47LocaleIdentifier[];
447
+ supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher; }): UnicodeBCP47LocaleIdentifier[];
448
448
  };
449
449
 
450
450
  interface CollatorConstructor {
@@ -23,7 +23,7 @@ interface AggregateError extends Error {
23
23
  interface AggregateErrorConstructor {
24
24
  new (errors: Iterable<any>, message?: string): AggregateError;
25
25
  (errors: Iterable<any>, message?: string): AggregateError;
26
- prototype: AggregateError;
26
+ readonly prototype: AggregateError;
27
27
  }
28
28
 
29
29
  declare var AggregateError: AggregateErrorConstructor;
@@ -28,7 +28,7 @@ interface WeakRef<T extends WeakKey> {
28
28
  }
29
29
 
30
30
  interface WeakRefConstructor {
31
- prototype: WeakRef<any>;
31
+ readonly prototype: WeakRef<any>;
32
32
 
33
33
  /**
34
34
  * Creates a WeakRef instance for the given target value.
@@ -64,7 +64,7 @@ interface FinalizationRegistry<T> {
64
64
  }
65
65
 
66
66
  interface FinalizationRegistryConstructor {
67
- prototype: FinalizationRegistry<any>;
67
+ readonly prototype: FinalizationRegistry<any>;
68
68
 
69
69
  /**
70
70
  * Creates a finalization registry with an associated cleanup callback
package/lib/lib.es5.d.ts CHANGED
@@ -158,7 +158,7 @@ interface ObjectConstructor {
158
158
  (value: any): any;
159
159
 
160
160
  /** A reference to the prototype for a class of objects. */
161
- prototype: Object;
161
+ readonly prototype: Object;
162
162
 
163
163
  /**
164
164
  * Returns the prototype of an object.
@@ -313,7 +313,7 @@ interface FunctionConstructor {
313
313
  */
314
314
  new (...args: string[]): Function;
315
315
  (...args: string[]): Function;
316
- prototype: Function;
316
+ readonly prototype: Function;
317
317
  }
318
318
 
319
319
  declare var Function: FunctionConstructor;
@@ -534,7 +534,7 @@ interface String {
534
534
  interface StringConstructor {
535
535
  new (value?: any): String;
536
536
  (value?: any): string;
537
- prototype: String;
537
+ readonly prototype: String;
538
538
  fromCharCode(...codes: number[]): string;
539
539
  }
540
540
 
@@ -551,7 +551,7 @@ interface Boolean {
551
551
  interface BooleanConstructor {
552
552
  new (value?: any): Boolean;
553
553
  <T>(value?: T): boolean;
554
- prototype: Boolean;
554
+ readonly prototype: Boolean;
555
555
  }
556
556
 
557
557
  declare var Boolean: BooleanConstructor;
@@ -588,7 +588,7 @@ interface Number {
588
588
  interface NumberConstructor {
589
589
  new (value?: any): Number;
590
590
  (value?: any): number;
591
- prototype: Number;
591
+ readonly prototype: Number;
592
592
 
593
593
  /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */
594
594
  readonly MAX_VALUE: number;
@@ -937,7 +937,7 @@ interface DateConstructor {
937
937
  */
938
938
  new (year: number, monthIndex: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;
939
939
  (): string;
940
- prototype: Date;
940
+ readonly prototype: Date;
941
941
  /**
942
942
  * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.
943
943
  * @param s A date string
@@ -1081,7 +1081,7 @@ interface Error {
1081
1081
  interface ErrorConstructor {
1082
1082
  new (message?: string): Error;
1083
1083
  (message?: string): Error;
1084
- prototype: Error;
1084
+ readonly prototype: Error;
1085
1085
  }
1086
1086
 
1087
1087
  declare var Error: ErrorConstructor;
@@ -1092,7 +1092,7 @@ interface EvalError extends Error {
1092
1092
  interface EvalErrorConstructor extends ErrorConstructor {
1093
1093
  new (message?: string): EvalError;
1094
1094
  (message?: string): EvalError;
1095
- prototype: EvalError;
1095
+ readonly prototype: EvalError;
1096
1096
  }
1097
1097
 
1098
1098
  declare var EvalError: EvalErrorConstructor;
@@ -1103,7 +1103,7 @@ interface RangeError extends Error {
1103
1103
  interface RangeErrorConstructor extends ErrorConstructor {
1104
1104
  new (message?: string): RangeError;
1105
1105
  (message?: string): RangeError;
1106
- prototype: RangeError;
1106
+ readonly prototype: RangeError;
1107
1107
  }
1108
1108
 
1109
1109
  declare var RangeError: RangeErrorConstructor;
@@ -1114,7 +1114,7 @@ interface ReferenceError extends Error {
1114
1114
  interface ReferenceErrorConstructor extends ErrorConstructor {
1115
1115
  new (message?: string): ReferenceError;
1116
1116
  (message?: string): ReferenceError;
1117
- prototype: ReferenceError;
1117
+ readonly prototype: ReferenceError;
1118
1118
  }
1119
1119
 
1120
1120
  declare var ReferenceError: ReferenceErrorConstructor;
@@ -1125,7 +1125,7 @@ interface SyntaxError extends Error {
1125
1125
  interface SyntaxErrorConstructor extends ErrorConstructor {
1126
1126
  new (message?: string): SyntaxError;
1127
1127
  (message?: string): SyntaxError;
1128
- prototype: SyntaxError;
1128
+ readonly prototype: SyntaxError;
1129
1129
  }
1130
1130
 
1131
1131
  declare var SyntaxError: SyntaxErrorConstructor;
@@ -1136,7 +1136,7 @@ interface TypeError extends Error {
1136
1136
  interface TypeErrorConstructor extends ErrorConstructor {
1137
1137
  new (message?: string): TypeError;
1138
1138
  (message?: string): TypeError;
1139
- prototype: TypeError;
1139
+ readonly prototype: TypeError;
1140
1140
  }
1141
1141
 
1142
1142
  declare var TypeError: TypeErrorConstructor;
@@ -1147,7 +1147,7 @@ interface URIError extends Error {
1147
1147
  interface URIErrorConstructor extends ErrorConstructor {
1148
1148
  new (message?: string): URIError;
1149
1149
  (message?: string): URIError;
1150
- prototype: URIError;
1150
+ readonly prototype: URIError;
1151
1151
  }
1152
1152
 
1153
1153
  declare var URIError: URIErrorConstructor;
@@ -1511,7 +1511,7 @@ interface ArrayConstructor {
1511
1511
  <T>(arrayLength: number): T[];
1512
1512
  <T>(...items: T[]): T[];
1513
1513
  isArray(arg: any): arg is any[];
1514
- prototype: any[];
1514
+ readonly prototype: any[];
1515
1515
  }
1516
1516
 
1517
1517
  declare var Array: ArrayConstructor;
@@ -1713,7 +1713,7 @@ interface ArrayBufferTypes {
1713
1713
  type ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes];
1714
1714
 
1715
1715
  interface ArrayBufferConstructor {
1716
- prototype: ArrayBuffer;
1716
+ readonly prototype: ArrayBuffer;
1717
1717
  new (byteLength: number): ArrayBuffer;
1718
1718
  isView(arg: any): arg is ArrayBufferView;
1719
1719
  }
@@ -1723,17 +1723,17 @@ interface ArrayBufferView {
1723
1723
  /**
1724
1724
  * The ArrayBuffer instance referenced by the array.
1725
1725
  */
1726
- readonly buffer: ArrayBufferLike;
1726
+ buffer: ArrayBufferLike;
1727
1727
 
1728
1728
  /**
1729
1729
  * The length in bytes of the array.
1730
1730
  */
1731
- readonly byteLength: number;
1731
+ byteLength: number;
1732
1732
 
1733
1733
  /**
1734
1734
  * The offset in bytes of the array.
1735
1735
  */
1736
- readonly byteOffset: number;
1736
+ byteOffset: number;
1737
1737
  }
1738
1738
 
1739
1739
  interface DataView {
@@ -1865,8 +1865,8 @@ interface DataView {
1865
1865
  }
1866
1866
 
1867
1867
  interface DataViewConstructor {
1868
- prototype: DataView;
1869
- new (buffer: ArrayBufferLike & { readonly BYTES_PER_ELEMENT?: never; }, byteOffset?: number, byteLength?: number): DataView;
1868
+ readonly prototype: DataView;
1869
+ new (buffer: ArrayBufferLike & { BYTES_PER_ELEMENT?: never; }, byteOffset?: number, byteLength?: number): DataView;
1870
1870
  }
1871
1871
  declare var DataView: DataViewConstructor;
1872
1872
 
@@ -2118,7 +2118,7 @@ interface Int8Array {
2118
2118
  [index: number]: number;
2119
2119
  }
2120
2120
  interface Int8ArrayConstructor {
2121
- prototype: Int8Array;
2121
+ readonly prototype: Int8Array;
2122
2122
  new (length: number): Int8Array;
2123
2123
  new (array: ArrayLike<number> | ArrayBufferLike): Int8Array;
2124
2124
  new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int8Array;
@@ -2399,7 +2399,7 @@ interface Uint8Array {
2399
2399
  }
2400
2400
 
2401
2401
  interface Uint8ArrayConstructor {
2402
- prototype: Uint8Array;
2402
+ readonly prototype: Uint8Array;
2403
2403
  new (length: number): Uint8Array;
2404
2404
  new (array: ArrayLike<number> | ArrayBufferLike): Uint8Array;
2405
2405
  new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8Array;
@@ -2680,7 +2680,7 @@ interface Uint8ClampedArray {
2680
2680
  }
2681
2681
 
2682
2682
  interface Uint8ClampedArrayConstructor {
2683
- prototype: Uint8ClampedArray;
2683
+ readonly prototype: Uint8ClampedArray;
2684
2684
  new (length: number): Uint8ClampedArray;
2685
2685
  new (array: ArrayLike<number> | ArrayBufferLike): Uint8ClampedArray;
2686
2686
  new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8ClampedArray;
@@ -2960,7 +2960,7 @@ interface Int16Array {
2960
2960
  }
2961
2961
 
2962
2962
  interface Int16ArrayConstructor {
2963
- prototype: Int16Array;
2963
+ readonly prototype: Int16Array;
2964
2964
  new (length: number): Int16Array;
2965
2965
  new (array: ArrayLike<number> | ArrayBufferLike): Int16Array;
2966
2966
  new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int16Array;
@@ -3241,7 +3241,7 @@ interface Uint16Array {
3241
3241
  }
3242
3242
 
3243
3243
  interface Uint16ArrayConstructor {
3244
- prototype: Uint16Array;
3244
+ readonly prototype: Uint16Array;
3245
3245
  new (length: number): Uint16Array;
3246
3246
  new (array: ArrayLike<number> | ArrayBufferLike): Uint16Array;
3247
3247
  new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint16Array;
@@ -3521,7 +3521,7 @@ interface Int32Array {
3521
3521
  }
3522
3522
 
3523
3523
  interface Int32ArrayConstructor {
3524
- prototype: Int32Array;
3524
+ readonly prototype: Int32Array;
3525
3525
  new (length: number): Int32Array;
3526
3526
  new (array: ArrayLike<number> | ArrayBufferLike): Int32Array;
3527
3527
  new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int32Array;
@@ -3801,7 +3801,7 @@ interface Uint32Array {
3801
3801
  }
3802
3802
 
3803
3803
  interface Uint32ArrayConstructor {
3804
- prototype: Uint32Array;
3804
+ readonly prototype: Uint32Array;
3805
3805
  new (length: number): Uint32Array;
3806
3806
  new (array: ArrayLike<number> | ArrayBufferLike): Uint32Array;
3807
3807
  new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint32Array;
@@ -4082,7 +4082,7 @@ interface Float32Array {
4082
4082
  }
4083
4083
 
4084
4084
  interface Float32ArrayConstructor {
4085
- prototype: Float32Array;
4085
+ readonly prototype: Float32Array;
4086
4086
  new (length: number): Float32Array;
4087
4087
  new (array: ArrayLike<number> | ArrayBufferLike): Float32Array;
4088
4088
  new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float32Array;
@@ -4363,7 +4363,7 @@ interface Float64Array {
4363
4363
  }
4364
4364
 
4365
4365
  interface Float64ArrayConstructor {
4366
- prototype: Float64Array;
4366
+ readonly prototype: Float64Array;
4367
4367
  new (length: number): Float64Array;
4368
4368
  new (array: ArrayLike<number> | ArrayBufferLike): Float64Array;
4369
4369
  new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float64Array;
@@ -4490,7 +4490,7 @@ declare namespace Intl {
4490
4490
  new (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
4491
4491
  (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
4492
4492
  supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[];
4493
- prototype: NumberFormat;
4493
+ readonly prototype: NumberFormat;
4494
4494
  }
4495
4495
 
4496
4496
  var NumberFormat: NumberFormatConstructor;
@@ -4537,7 +4537,7 @@ declare namespace Intl {
4537
4537
  new (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;
4538
4538
  (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;
4539
4539
  supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[];
4540
- prototype: DateTimeFormat;
4540
+ readonly prototype: DateTimeFormat;
4541
4541
  }
4542
4542
 
4543
4543
  var DateTimeFormat: DateTimeFormatConstructor;
@@ -46,7 +46,7 @@ interface SuppressedError extends Error {
46
46
  interface SuppressedErrorConstructor {
47
47
  new (error: any, suppressed: any, message?: string): SuppressedError;
48
48
  (error: any, suppressed: any, message?: string): SuppressedError;
49
- prototype: SuppressedError;
49
+ readonly prototype: SuppressedError;
50
50
  }
51
51
  declare var SuppressedError: SuppressedErrorConstructor;
52
52
 
@@ -113,7 +113,7 @@ interface DisposableStack {
113
113
 
114
114
  interface DisposableStackConstructor {
115
115
  new (): DisposableStack;
116
- prototype: DisposableStack;
116
+ readonly prototype: DisposableStack;
117
117
  }
118
118
  declare var DisposableStack: DisposableStackConstructor;
119
119
 
@@ -180,6 +180,6 @@ interface AsyncDisposableStack {
180
180
 
181
181
  interface AsyncDisposableStackConstructor {
182
182
  new (): AsyncDisposableStack;
183
- prototype: AsyncDisposableStack;
183
+ readonly prototype: AsyncDisposableStack;
184
184
  }
185
185
  declare var AsyncDisposableStack: AsyncDisposableStackConstructor;
@@ -508,8 +508,8 @@ interface PushSubscriptionOptionsInit {
508
508
  }
509
509
 
510
510
  interface QueuingStrategy<T = any> {
511
- readonly highWaterMark?: number;
512
- readonly size?: QueuingStrategySize<T>;
511
+ highWaterMark?: number;
512
+ size?: QueuingStrategySize<T>;
513
513
  }
514
514
 
515
515
  interface QueuingStrategyInit {
@@ -518,7 +518,7 @@ interface QueuingStrategyInit {
518
518
  *
519
519
  * Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw.
520
520
  */
521
- readonly highWaterMark: number;
521
+ highWaterMark: number;
522
522
  }
523
523
 
524
524
  interface RTCEncodedAudioFrameMetadata {
@@ -1910,9 +1910,9 @@ interface DOMException extends Error {
1910
1910
  */
1911
1911
  readonly code: number;
1912
1912
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
1913
- message: string;
1913
+ readonly message: string;
1914
1914
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
1915
- name: string;
1915
+ readonly name: string;
1916
1916
  readonly INDEX_SIZE_ERR: 1;
1917
1917
  readonly DOMSTRING_SIZE_ERR: 2;
1918
1918
  readonly HIERARCHY_REQUEST_ERR: 3;
@@ -4871,7 +4871,7 @@ interface ReadableStream<R = any> {
4871
4871
 
4872
4872
  declare var ReadableStream: {
4873
4873
  prototype: ReadableStream;
4874
- new(underlyingSource: UnderlyingByteSource, strategy?: { readonly highWaterMark?: number }): ReadableStream<Uint8Array>;
4874
+ new(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number }): ReadableStream<Uint8Array>;
4875
4875
  new<R = any>(underlyingSource: UnderlyingDefaultSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
4876
4876
  new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
4877
4877
  };
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.5";
21
- var version = `${versionMajorMinor}.0-insiders.20240423`;
21
+ var version = `${versionMajorMinor}.0-insiders.20240424`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -6886,8 +6886,6 @@ var Diagnostics = {
6886
6886
  Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
6887
6887
  Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1 /* Error */, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
6888
6888
  One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value: diag(4126, 1 /* Error */, "One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126", "One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."),
6889
- Property_0_is_readonly_in_the_source_but_not_in_the_target: diag(4127, 1 /* Error */, "Property_0_is_readonly_in_the_source_but_not_in_the_target_4127", "Property '{0}' is 'readonly' in the source but not in the target."),
6890
- _0_index_signature_is_readonly_in_the_source_but_not_in_the_target: diag(4128, 1 /* Error */, "_0_index_signature_is_readonly_in_the_source_but_not_in_the_target_4128", "'{0}' index signature is 'readonly' in the source but not in the target."),
6891
6889
  The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
6892
6890
  Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
6893
6891
  File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
@@ -7457,7 +7455,6 @@ var Diagnostics = {
7457
7455
  Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, 3 /* Message */, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."),
7458
7456
  Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3 /* Message */, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."),
7459
7457
  Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files: diag(6719, 3 /* Message */, "Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719", "Require sufficient annotation on exports so other tools can trivially generate declaration files."),
7460
- Ensure_that_readonly_properties_remain_read_only_in_type_relationships: diag(6720, 3 /* Message */, "Ensure_that_readonly_properties_remain_read_only_in_type_relationships_6720", "Ensure that 'readonly' properties remain read-only in type relationships."),
7461
7458
  Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
7462
7459
  Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),
7463
7460
  one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"),
@@ -36216,15 +36213,6 @@ var commandOptionsWithoutBuild = [
36216
36213
  description: Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,
36217
36214
  defaultValueDescription: false
36218
36215
  },
36219
- {
36220
- name: "enforceReadonly",
36221
- type: "boolean",
36222
- affectsSemanticDiagnostics: true,
36223
- affectsBuildInfo: true,
36224
- category: Diagnostics.Type_Checking,
36225
- description: Diagnostics.Ensure_that_readonly_properties_remain_read_only_in_type_relationships,
36226
- defaultValueDescription: false
36227
- },
36228
36216
  // Module Resolution
36229
36217
  {
36230
36218
  name: "moduleResolution",
@@ -45293,7 +45281,6 @@ function createTypeChecker(host) {
45293
45281
  var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
45294
45282
  var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
45295
45283
  var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
45296
- var enforceReadonly = compilerOptions.enforceReadonly;
45297
45284
  var checkBinaryExpression = createCheckBinaryExpression();
45298
45285
  var emitResolver = createResolver();
45299
45286
  var nodeBuilder = createNodeBuilder();
@@ -64443,10 +64430,7 @@ function createTypeChecker(host) {
64443
64430
  }
64444
64431
  return 0 /* False */;
64445
64432
  }
64446
- if ((relation === strictSubtypeRelation || enforceReadonly) && isReadonlySymbol(sourceProp) && !isReadonlySymbol(targetProp) && !(targetProp.flags & 8192 /* Method */)) {
64447
- if (reportErrors2) {
64448
- reportError(Diagnostics.Property_0_is_readonly_in_the_source_but_not_in_the_target, symbolToString(targetProp));
64449
- }
64433
+ if (relation === strictSubtypeRelation && isReadonlySymbol(sourceProp) && !isReadonlySymbol(targetProp)) {
64450
64434
  return 0 /* False */;
64451
64435
  }
64452
64436
  const related = isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors2, intersectionState);
@@ -64915,21 +64899,12 @@ function createTypeChecker(host) {
64915
64899
  void 0,
64916
64900
  intersectionState
64917
64901
  );
64918
- if (!related) {
64919
- if (reportErrors2) {
64920
- if (sourceInfo.keyType === targetInfo.keyType) {
64921
- reportError(Diagnostics._0_index_signatures_are_incompatible, typeToString(sourceInfo.keyType));
64922
- } else {
64923
- reportError(Diagnostics._0_and_1_index_signatures_are_incompatible, typeToString(sourceInfo.keyType), typeToString(targetInfo.keyType));
64924
- }
64925
- }
64926
- return 0 /* False */;
64927
- }
64928
- if (enforceReadonly && sourceInfo.isReadonly && !targetInfo.isReadonly) {
64929
- if (reportErrors2) {
64930
- reportError(Diagnostics._0_index_signature_is_readonly_in_the_source_but_not_in_the_target, typeToString(sourceInfo.keyType));
64902
+ if (!related && reportErrors2) {
64903
+ if (sourceInfo.keyType === targetInfo.keyType) {
64904
+ reportError(Diagnostics._0_index_signatures_are_incompatible, typeToString(sourceInfo.keyType));
64905
+ } else {
64906
+ reportError(Diagnostics._0_and_1_index_signatures_are_incompatible, typeToString(sourceInfo.keyType), typeToString(targetInfo.keyType));
64931
64907
  }
64932
- return 0 /* False */;
64933
64908
  }
64934
64909
  return related;
64935
64910
  }
@@ -70442,9 +70417,10 @@ function createTypeChecker(host) {
70442
70417
  (t) => {
70443
70418
  var _a;
70444
70419
  if (isGenericMappedType(t) && !t.declaration.nameType) {
70445
- const constraint = getBaseConstraintOrType(getConstraintTypeFromMappedType(t));
70420
+ const constraint = getConstraintTypeFromMappedType(t);
70421
+ const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
70446
70422
  const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name));
70447
- if (isTypeAssignableTo(propertyNameType, constraint)) {
70423
+ if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
70448
70424
  return substituteIndexedMappedType(t, propertyNameType);
70449
70425
  }
70450
70426
  } else if (t.flags & 3670016 /* StructuredType */) {
@@ -70494,17 +70470,23 @@ function createTypeChecker(host) {
70494
70470
  const symbol = getSymbolOfDeclaration(element);
70495
70471
  return getTypeOfPropertyOfContextualType(type, symbol.escapedName, getSymbolLinks(symbol).nameType);
70496
70472
  }
70497
- const name = getNameOfDeclaration(element);
70498
- if (name && isComputedPropertyName(name)) {
70499
- const exprType = checkExpression(name.expression);
70500
- if (isTypeUsableAsPropertyName(exprType)) {
70501
- return getTypeOfPropertyOfContextualType(type, getPropertyNameFromType(exprType), exprType);
70473
+ if (hasDynamicName(element)) {
70474
+ const name = getNameOfDeclaration(element);
70475
+ if (name && isComputedPropertyName(name)) {
70476
+ const exprType = checkExpression(name.expression);
70477
+ const propType = isTypeUsableAsPropertyName(exprType) && getTypeOfPropertyOfContextualType(type, getPropertyNameFromType(exprType));
70478
+ if (propType) {
70479
+ return propType;
70480
+ }
70502
70481
  }
70482
+ }
70483
+ if (element.name) {
70484
+ const nameType = getLiteralTypeFromPropertyName(element.name);
70503
70485
  return mapType(
70504
70486
  type,
70505
70487
  (t) => {
70506
70488
  var _a;
70507
- return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), exprType)) == null ? void 0 : _a.type;
70489
+ return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType)) == null ? void 0 : _a.type;
70508
70490
  },
70509
70491
  /*noReductions*/
70510
70492
  true
@@ -70513,20 +70495,6 @@ function createTypeChecker(host) {
70513
70495
  }
70514
70496
  return void 0;
70515
70497
  }
70516
- function isContextualPropertyMutable(type, name, nameType) {
70517
- return someType(type, (t) => {
70518
- const propName = nameType ? isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : void 0 : name;
70519
- const prop = propName && getPropertyOfType(t, propName);
70520
- if (prop) {
70521
- return !isReadonlySymbol(prop);
70522
- }
70523
- const indexInfo = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)));
70524
- if (indexInfo) {
70525
- return !indexInfo.isReadonly;
70526
- }
70527
- return false;
70528
- });
70529
- }
70530
70498
  function getSpreadIndices(elements) {
70531
70499
  let first2, last2;
70532
70500
  for (let i = 0; i < elements.length; i++) {
@@ -71318,6 +71286,7 @@ function createTypeChecker(host) {
71318
71286
  );
71319
71287
  const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 206 /* ObjectBindingPattern */ || contextualType.pattern.kind === 210 /* ObjectLiteralExpression */);
71320
71288
  const inConstContext = isConstContext(node);
71289
+ const checkFlags = inConstContext ? 8 /* Readonly */ : 0;
71321
71290
  const isInJavascript = isInJSFile(node) && !isInJsonFile(node);
71322
71291
  const enumTag = isInJavascript ? getJSDocEnumTag(node) : void 0;
71323
71292
  const isJSObjectLiteral = !contextualType && isInJavascript && !enumTag;
@@ -71353,7 +71322,6 @@ function createTypeChecker(host) {
71353
71322
  }
71354
71323
  objectFlags |= getObjectFlags(type) & 458752 /* PropagatingFlags */;
71355
71324
  const nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : void 0;
71356
- const checkFlags = inConstContext && !(enforceReadonly && contextualType && isContextualPropertyMutable(contextualType, member.escapedName, nameType)) ? 8 /* Readonly */ : 0;
71357
71325
  const prop = nameType ? createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) : createSymbol(4 /* Property */ | member.flags, member.escapedName, checkFlags);
71358
71326
  if (nameType) {
71359
71327
  prop.links.nameType = nameType;
@@ -118828,6 +118796,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
118828
118796
  let resolvedModulesProcessing;
118829
118797
  let resolvedTypeReferenceDirectiveNames;
118830
118798
  let resolvedTypeReferenceDirectiveNamesProcessing;
118799
+ let hasFileNamesDifferOnlyInCasingError = false;
118831
118800
  let packageMap;
118832
118801
  const maxNodeModuleJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0;
118833
118802
  let currentNodeModulesDepth = 0;
@@ -119172,7 +119141,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
119172
119141
  getCanonicalFileName,
119173
119142
  getFileIncludeReasons: () => fileReasons,
119174
119143
  structureIsReused,
119175
- writeFile: writeFile2
119144
+ writeFile: writeFile2,
119145
+ hasFileNamesDifferOnlyInCasingError: () => hasFileNamesDifferOnlyInCasingError
119176
119146
  };
119177
119147
  onProgramCreateComplete();
119178
119148
  fileProcessingDiagnostics == null ? void 0 : fileProcessingDiagnostics.forEach((diagnostic) => {
@@ -119522,6 +119492,9 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
119522
119492
  if (!oldProgram) {
119523
119493
  return 0 /* Not */;
119524
119494
  }
119495
+ if (oldProgram.hasFileNamesDifferOnlyInCasingError()) {
119496
+ return 0 /* Not */;
119497
+ }
119525
119498
  const oldOptions = oldProgram.getCompilerOptions();
119526
119499
  if (changesAffectModuleResolution(oldOptions, options)) {
119527
119500
  return 0 /* Not */;
@@ -120491,6 +120464,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
120491
120464
  );
120492
120465
  }
120493
120466
  function reportFileNamesDifferOnlyInCasingError(fileName, existingFile, reason) {
120467
+ hasFileNamesDifferOnlyInCasingError = true;
120494
120468
  const hasExistingReasonToReportErrorOn = !isReferencedFile(reason) && some(fileReasons.get(existingFile.path), isReferencedFile);
120495
120469
  if (hasExistingReasonToReportErrorOn) {
120496
120470
  addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, Diagnostics.Already_included_file_name_0_differs_from_file_name_1_only_in_casing, [existingFile.fileName, fileName]);
@@ -6893,7 +6893,6 @@ declare namespace ts {
6893
6893
  downlevelIteration?: boolean;
6894
6894
  emitBOM?: boolean;
6895
6895
  emitDecoratorMetadata?: boolean;
6896
- enforceReadonly?: boolean;
6897
6896
  exactOptionalPropertyTypes?: boolean;
6898
6897
  experimentalDecorators?: boolean;
6899
6898
  forceConsistentCasingInFileNames?: boolean;
@@ -11191,6 +11190,7 @@ declare namespace ts {
11191
11190
  };
11192
11191
  function preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo;
11193
11192
  function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput;
11193
+ function transpileDeclaration(input: string, transpileOptions: TranspileOptions): TranspileOutput;
11194
11194
  function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string;
11195
11195
  interface TranspileOptions {
11196
11196
  compilerOptions?: CompilerOptions;
package/lib/typescript.js CHANGED
@@ -2272,6 +2272,7 @@ __export(typescript_exports, {
2272
2272
  transformSystemModule: () => transformSystemModule,
2273
2273
  transformTypeScript: () => transformTypeScript,
2274
2274
  transpile: () => transpile,
2275
+ transpileDeclaration: () => transpileDeclaration,
2275
2276
  transpileModule: () => transpileModule,
2276
2277
  transpileOptionValueCompilerOptions: () => transpileOptionValueCompilerOptions,
2277
2278
  tryAddToSet: () => tryAddToSet,
@@ -2360,7 +2361,7 @@ module.exports = __toCommonJS(typescript_exports);
2360
2361
 
2361
2362
  // src/compiler/corePublic.ts
2362
2363
  var versionMajorMinor = "5.5";
2363
- var version = `${versionMajorMinor}.0-insiders.20240423`;
2364
+ var version = `${versionMajorMinor}.0-insiders.20240424`;
2364
2365
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2365
2366
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2366
2367
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -10492,8 +10493,6 @@ var Diagnostics = {
10492
10493
  Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
10493
10494
  Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1 /* Error */, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
10494
10495
  One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value: diag(4126, 1 /* Error */, "One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126", "One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."),
10495
- Property_0_is_readonly_in_the_source_but_not_in_the_target: diag(4127, 1 /* Error */, "Property_0_is_readonly_in_the_source_but_not_in_the_target_4127", "Property '{0}' is 'readonly' in the source but not in the target."),
10496
- _0_index_signature_is_readonly_in_the_source_but_not_in_the_target: diag(4128, 1 /* Error */, "_0_index_signature_is_readonly_in_the_source_but_not_in_the_target_4128", "'{0}' index signature is 'readonly' in the source but not in the target."),
10497
10496
  The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
10498
10497
  Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
10499
10498
  File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
@@ -11063,7 +11062,6 @@ var Diagnostics = {
11063
11062
  Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, 3 /* Message */, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."),
11064
11063
  Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3 /* Message */, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."),
11065
11064
  Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files: diag(6719, 3 /* Message */, "Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719", "Require sufficient annotation on exports so other tools can trivially generate declaration files."),
11066
- Ensure_that_readonly_properties_remain_read_only_in_type_relationships: diag(6720, 3 /* Message */, "Ensure_that_readonly_properties_remain_read_only_in_type_relationships_6720", "Ensure that 'readonly' properties remain read-only in type relationships."),
11067
11065
  Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
11068
11066
  Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),
11069
11067
  one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"),
@@ -40684,15 +40682,6 @@ var commandOptionsWithoutBuild = [
40684
40682
  description: Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,
40685
40683
  defaultValueDescription: false
40686
40684
  },
40687
- {
40688
- name: "enforceReadonly",
40689
- type: "boolean",
40690
- affectsSemanticDiagnostics: true,
40691
- affectsBuildInfo: true,
40692
- category: Diagnostics.Type_Checking,
40693
- description: Diagnostics.Ensure_that_readonly_properties_remain_read_only_in_type_relationships,
40694
- defaultValueDescription: false
40695
- },
40696
40685
  // Module Resolution
40697
40686
  {
40698
40687
  name: "moduleResolution",
@@ -50117,7 +50106,6 @@ function createTypeChecker(host) {
50117
50106
  var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
50118
50107
  var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
50119
50108
  var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
50120
- var enforceReadonly = compilerOptions.enforceReadonly;
50121
50109
  var checkBinaryExpression = createCheckBinaryExpression();
50122
50110
  var emitResolver = createResolver();
50123
50111
  var nodeBuilder = createNodeBuilder();
@@ -69267,10 +69255,7 @@ function createTypeChecker(host) {
69267
69255
  }
69268
69256
  return 0 /* False */;
69269
69257
  }
69270
- if ((relation === strictSubtypeRelation || enforceReadonly) && isReadonlySymbol(sourceProp) && !isReadonlySymbol(targetProp) && !(targetProp.flags & 8192 /* Method */)) {
69271
- if (reportErrors2) {
69272
- reportError(Diagnostics.Property_0_is_readonly_in_the_source_but_not_in_the_target, symbolToString(targetProp));
69273
- }
69258
+ if (relation === strictSubtypeRelation && isReadonlySymbol(sourceProp) && !isReadonlySymbol(targetProp)) {
69274
69259
  return 0 /* False */;
69275
69260
  }
69276
69261
  const related = isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors2, intersectionState);
@@ -69739,21 +69724,12 @@ function createTypeChecker(host) {
69739
69724
  void 0,
69740
69725
  intersectionState
69741
69726
  );
69742
- if (!related) {
69743
- if (reportErrors2) {
69744
- if (sourceInfo.keyType === targetInfo.keyType) {
69745
- reportError(Diagnostics._0_index_signatures_are_incompatible, typeToString(sourceInfo.keyType));
69746
- } else {
69747
- reportError(Diagnostics._0_and_1_index_signatures_are_incompatible, typeToString(sourceInfo.keyType), typeToString(targetInfo.keyType));
69748
- }
69749
- }
69750
- return 0 /* False */;
69751
- }
69752
- if (enforceReadonly && sourceInfo.isReadonly && !targetInfo.isReadonly) {
69753
- if (reportErrors2) {
69754
- reportError(Diagnostics._0_index_signature_is_readonly_in_the_source_but_not_in_the_target, typeToString(sourceInfo.keyType));
69727
+ if (!related && reportErrors2) {
69728
+ if (sourceInfo.keyType === targetInfo.keyType) {
69729
+ reportError(Diagnostics._0_index_signatures_are_incompatible, typeToString(sourceInfo.keyType));
69730
+ } else {
69731
+ reportError(Diagnostics._0_and_1_index_signatures_are_incompatible, typeToString(sourceInfo.keyType), typeToString(targetInfo.keyType));
69755
69732
  }
69756
- return 0 /* False */;
69757
69733
  }
69758
69734
  return related;
69759
69735
  }
@@ -75266,9 +75242,10 @@ function createTypeChecker(host) {
75266
75242
  (t) => {
75267
75243
  var _a;
75268
75244
  if (isGenericMappedType(t) && !t.declaration.nameType) {
75269
- const constraint = getBaseConstraintOrType(getConstraintTypeFromMappedType(t));
75245
+ const constraint = getConstraintTypeFromMappedType(t);
75246
+ const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
75270
75247
  const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name));
75271
- if (isTypeAssignableTo(propertyNameType, constraint)) {
75248
+ if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
75272
75249
  return substituteIndexedMappedType(t, propertyNameType);
75273
75250
  }
75274
75251
  } else if (t.flags & 3670016 /* StructuredType */) {
@@ -75318,17 +75295,23 @@ function createTypeChecker(host) {
75318
75295
  const symbol = getSymbolOfDeclaration(element);
75319
75296
  return getTypeOfPropertyOfContextualType(type, symbol.escapedName, getSymbolLinks(symbol).nameType);
75320
75297
  }
75321
- const name = getNameOfDeclaration(element);
75322
- if (name && isComputedPropertyName(name)) {
75323
- const exprType = checkExpression(name.expression);
75324
- if (isTypeUsableAsPropertyName(exprType)) {
75325
- return getTypeOfPropertyOfContextualType(type, getPropertyNameFromType(exprType), exprType);
75298
+ if (hasDynamicName(element)) {
75299
+ const name = getNameOfDeclaration(element);
75300
+ if (name && isComputedPropertyName(name)) {
75301
+ const exprType = checkExpression(name.expression);
75302
+ const propType = isTypeUsableAsPropertyName(exprType) && getTypeOfPropertyOfContextualType(type, getPropertyNameFromType(exprType));
75303
+ if (propType) {
75304
+ return propType;
75305
+ }
75326
75306
  }
75307
+ }
75308
+ if (element.name) {
75309
+ const nameType = getLiteralTypeFromPropertyName(element.name);
75327
75310
  return mapType(
75328
75311
  type,
75329
75312
  (t) => {
75330
75313
  var _a;
75331
- return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), exprType)) == null ? void 0 : _a.type;
75314
+ return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType)) == null ? void 0 : _a.type;
75332
75315
  },
75333
75316
  /*noReductions*/
75334
75317
  true
@@ -75337,20 +75320,6 @@ function createTypeChecker(host) {
75337
75320
  }
75338
75321
  return void 0;
75339
75322
  }
75340
- function isContextualPropertyMutable(type, name, nameType) {
75341
- return someType(type, (t) => {
75342
- const propName = nameType ? isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : void 0 : name;
75343
- const prop = propName && getPropertyOfType(t, propName);
75344
- if (prop) {
75345
- return !isReadonlySymbol(prop);
75346
- }
75347
- const indexInfo = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)));
75348
- if (indexInfo) {
75349
- return !indexInfo.isReadonly;
75350
- }
75351
- return false;
75352
- });
75353
- }
75354
75323
  function getSpreadIndices(elements) {
75355
75324
  let first2, last2;
75356
75325
  for (let i = 0; i < elements.length; i++) {
@@ -76142,6 +76111,7 @@ function createTypeChecker(host) {
76142
76111
  );
76143
76112
  const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 206 /* ObjectBindingPattern */ || contextualType.pattern.kind === 210 /* ObjectLiteralExpression */);
76144
76113
  const inConstContext = isConstContext(node);
76114
+ const checkFlags = inConstContext ? 8 /* Readonly */ : 0;
76145
76115
  const isInJavascript = isInJSFile(node) && !isInJsonFile(node);
76146
76116
  const enumTag = isInJavascript ? getJSDocEnumTag(node) : void 0;
76147
76117
  const isJSObjectLiteral = !contextualType && isInJavascript && !enumTag;
@@ -76177,7 +76147,6 @@ function createTypeChecker(host) {
76177
76147
  }
76178
76148
  objectFlags |= getObjectFlags(type) & 458752 /* PropagatingFlags */;
76179
76149
  const nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : void 0;
76180
- const checkFlags = inConstContext && !(enforceReadonly && contextualType && isContextualPropertyMutable(contextualType, member.escapedName, nameType)) ? 8 /* Readonly */ : 0;
76181
76150
  const prop = nameType ? createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) : createSymbol(4 /* Property */ | member.flags, member.escapedName, checkFlags);
76182
76151
  if (nameType) {
76183
76152
  prop.links.nameType = nameType;
@@ -123896,6 +123865,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
123896
123865
  let resolvedModulesProcessing;
123897
123866
  let resolvedTypeReferenceDirectiveNames;
123898
123867
  let resolvedTypeReferenceDirectiveNamesProcessing;
123868
+ let hasFileNamesDifferOnlyInCasingError = false;
123899
123869
  let packageMap;
123900
123870
  const maxNodeModuleJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0;
123901
123871
  let currentNodeModulesDepth = 0;
@@ -124240,7 +124210,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
124240
124210
  getCanonicalFileName,
124241
124211
  getFileIncludeReasons: () => fileReasons,
124242
124212
  structureIsReused,
124243
- writeFile: writeFile2
124213
+ writeFile: writeFile2,
124214
+ hasFileNamesDifferOnlyInCasingError: () => hasFileNamesDifferOnlyInCasingError
124244
124215
  };
124245
124216
  onProgramCreateComplete();
124246
124217
  fileProcessingDiagnostics == null ? void 0 : fileProcessingDiagnostics.forEach((diagnostic) => {
@@ -124590,6 +124561,9 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
124590
124561
  if (!oldProgram) {
124591
124562
  return 0 /* Not */;
124592
124563
  }
124564
+ if (oldProgram.hasFileNamesDifferOnlyInCasingError()) {
124565
+ return 0 /* Not */;
124566
+ }
124593
124567
  const oldOptions = oldProgram.getCompilerOptions();
124594
124568
  if (changesAffectModuleResolution(oldOptions, options)) {
124595
124569
  return 0 /* Not */;
@@ -125559,6 +125533,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
125559
125533
  );
125560
125534
  }
125561
125535
  function reportFileNamesDifferOnlyInCasingError(fileName, existingFile, reason) {
125536
+ hasFileNamesDifferOnlyInCasingError = true;
125562
125537
  const hasExistingReasonToReportErrorOn = !isReferencedFile(reason) && some(fileReasons.get(existingFile.path), isReferencedFile);
125563
125538
  if (hasExistingReasonToReportErrorOn) {
125564
125539
  addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, Diagnostics.Already_included_file_name_0_differs_from_file_name_1_only_in_casing, [existingFile.fileName, fileName]);
@@ -141596,6 +141571,44 @@ var optionsRedundantWithVerbatimModuleSyntax = /* @__PURE__ */ new Set([
141596
141571
  "isolatedModules"
141597
141572
  ]);
141598
141573
  function transpileModule(input, transpileOptions) {
141574
+ return transpileWorker(
141575
+ input,
141576
+ transpileOptions,
141577
+ /*declaration*/
141578
+ false
141579
+ );
141580
+ }
141581
+ function transpileDeclaration(input, transpileOptions) {
141582
+ return transpileWorker(
141583
+ input,
141584
+ transpileOptions,
141585
+ /*declaration*/
141586
+ true
141587
+ );
141588
+ }
141589
+ var barebonesLibContent = `/// <reference no-default-lib="true"/>
141590
+ interface Boolean {}
141591
+ interface Function {}
141592
+ interface CallableFunction {}
141593
+ interface NewableFunction {}
141594
+ interface IArguments {}
141595
+ interface Number {}
141596
+ interface Object {}
141597
+ interface RegExp {}
141598
+ interface String {}
141599
+ interface Array<T> { length: number; [n: number]: T; }
141600
+ interface SymbolConstructor {
141601
+ (desc?: string | number): symbol;
141602
+ for(name: string): symbol;
141603
+ readonly toStringTag: symbol;
141604
+ }
141605
+ declare var Symbol: SymbolConstructor;
141606
+ interface Symbol {
141607
+ readonly [Symbol.toStringTag]: string;
141608
+ }`;
141609
+ var barebonesLibName = "lib.d.ts";
141610
+ var barebonesLibSourceFile = createSourceFile(barebonesLibName, barebonesLibContent, { languageVersion: 99 /* Latest */ });
141611
+ function transpileWorker(input, transpileOptions, declaration) {
141599
141612
  const diagnostics = [];
141600
141613
  const options = transpileOptions.compilerOptions ? fixupCompilerOptions(transpileOptions.compilerOptions, diagnostics) : {};
141601
141614
  const defaultOptions = getDefaultCompilerOptions2();
@@ -141612,9 +141625,16 @@ function transpileModule(input, transpileOptions) {
141612
141625
  }
141613
141626
  options.suppressOutputPathCheck = true;
141614
141627
  options.allowNonTsExtensions = true;
141628
+ if (declaration) {
141629
+ options.declaration = true;
141630
+ options.emitDeclarationOnly = true;
141631
+ options.isolatedDeclarations = true;
141632
+ } else {
141633
+ options.declaration = false;
141634
+ }
141615
141635
  const newLine = getNewLineCharacter(options);
141616
141636
  const compilerHost = {
141617
- getSourceFile: (fileName) => fileName === normalizePath(inputFileName) ? sourceFile : void 0,
141637
+ getSourceFile: (fileName) => fileName === normalizePath(inputFileName) ? sourceFile : fileName === normalizePath(barebonesLibName) ? barebonesLibSourceFile : void 0,
141618
141638
  writeFile: (name, text) => {
141619
141639
  if (fileExtensionIs(name, ".map")) {
141620
141640
  Debug.assertEqual(sourceMapText, void 0, "Unexpected multiple source map outputs, file:", name);
@@ -141624,12 +141644,12 @@ function transpileModule(input, transpileOptions) {
141624
141644
  outputText = text;
141625
141645
  }
141626
141646
  },
141627
- getDefaultLibFileName: () => "lib.d.ts",
141647
+ getDefaultLibFileName: () => barebonesLibName,
141628
141648
  useCaseSensitiveFileNames: () => false,
141629
141649
  getCanonicalFileName: (fileName) => fileName,
141630
141650
  getCurrentDirectory: () => "",
141631
141651
  getNewLine: () => newLine,
141632
- fileExists: (fileName) => fileName === inputFileName,
141652
+ fileExists: (fileName) => fileName === inputFileName || !!declaration && fileName === barebonesLibName,
141633
141653
  readFile: () => "",
141634
141654
  directoryExists: () => true,
141635
141655
  getDirectories: () => []
@@ -141659,7 +141679,8 @@ function transpileModule(input, transpileOptions) {
141659
141679
  }
141660
141680
  let outputText;
141661
141681
  let sourceMapText;
141662
- const program = createProgram([inputFileName], options, compilerHost);
141682
+ const inputs = declaration ? [inputFileName, barebonesLibName] : [inputFileName];
141683
+ const program = createProgram(inputs, options, compilerHost);
141663
141684
  if (transpileOptions.reportDiagnostics) {
141664
141685
  addRange(
141665
141686
  /*to*/
@@ -141674,7 +141695,7 @@ function transpileModule(input, transpileOptions) {
141674
141695
  program.getOptionsDiagnostics()
141675
141696
  );
141676
141697
  }
141677
- program.emit(
141698
+ const result = program.emit(
141678
141699
  /*targetSourceFile*/
141679
141700
  void 0,
141680
141701
  /*writeFile*/
@@ -141682,8 +141703,16 @@ function transpileModule(input, transpileOptions) {
141682
141703
  /*cancellationToken*/
141683
141704
  void 0,
141684
141705
  /*emitOnlyDtsFiles*/
141685
- void 0,
141686
- transpileOptions.transformers
141706
+ declaration,
141707
+ transpileOptions.transformers,
141708
+ /*forceDtsEmit*/
141709
+ declaration
141710
+ );
141711
+ addRange(
141712
+ /*to*/
141713
+ diagnostics,
141714
+ /*from*/
141715
+ result.diagnostics
141687
141716
  );
141688
141717
  if (outputText === void 0)
141689
141718
  return Debug.fail("Output generation failed");
@@ -180052,6 +180081,7 @@ __export(ts_exports2, {
180052
180081
  transformSystemModule: () => transformSystemModule,
180053
180082
  transformTypeScript: () => transformTypeScript,
180054
180083
  transpile: () => transpile,
180084
+ transpileDeclaration: () => transpileDeclaration,
180055
180085
  transpileModule: () => transpileModule,
180056
180086
  transpileOptionValueCompilerOptions: () => transpileOptionValueCompilerOptions,
180057
180087
  tryAddToSet: () => tryAddToSet,
@@ -194478,6 +194508,7 @@ if (typeof console !== "undefined") {
194478
194508
  transformSystemModule,
194479
194509
  transformTypeScript,
194480
194510
  transpile,
194511
+ transpileDeclaration,
194481
194512
  transpileModule,
194482
194513
  transpileOptionValueCompilerOptions,
194483
194514
  tryAddToSet,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.5.0-pr-58296-8",
5
+ "version": "5.5.0-pr-58299-2",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [