@stencil/core 3.0.0-alpha.0 → 3.0.0-alpha.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.
Files changed (73) hide show
  1. package/cli/config-flags.d.ts +16 -16
  2. package/cli/index.cjs +6 -4
  3. package/cli/index.js +6 -4
  4. package/cli/package.json +1 -1
  5. package/compiler/lib.dom.d.ts +434 -251
  6. package/compiler/lib.dom.iterable.d.ts +7 -13
  7. package/compiler/lib.es2015.collection.d.ts +62 -1
  8. package/compiler/lib.es2015.promise.d.ts +9 -4
  9. package/compiler/lib.es2015.proxy.d.ts +91 -2
  10. package/compiler/lib.es2015.reflect.d.ts +25 -2
  11. package/compiler/lib.es2015.symbol.wellknown.d.ts +3 -3
  12. package/compiler/lib.es2017.intl.d.ts +16 -1
  13. package/compiler/lib.es2019.d.ts +1 -0
  14. package/compiler/lib.es2019.intl.d.ts +25 -0
  15. package/compiler/lib.es2020.intl.d.ts +31 -6
  16. package/compiler/lib.es2021.intl.d.ts +11 -3
  17. package/compiler/lib.es2022.d.ts +1 -0
  18. package/compiler/lib.es2022.error.d.ts +2 -2
  19. package/compiler/lib.es2022.sharedmemory.d.ts +27 -0
  20. package/compiler/lib.es5.d.ts +39 -14
  21. package/compiler/lib.esnext.intl.d.ts +5 -1
  22. package/compiler/lib.webworker.d.ts +318 -55
  23. package/compiler/lib.webworker.iterable.d.ts +11 -3
  24. package/compiler/package.json +1 -1
  25. package/compiler/stencil.d.ts +1 -23
  26. package/compiler/stencil.js +12597 -11461
  27. package/compiler/stencil.min.js +2 -2
  28. package/compiler/sys/in-memory-fs.d.ts +3 -3
  29. package/compiler/transpile.d.ts +32 -0
  30. package/dependencies.json +3 -1
  31. package/dev-server/client/app-error.d.ts +1 -1
  32. package/dev-server/client/index.js +1 -1
  33. package/dev-server/client/package.json +1 -1
  34. package/dev-server/connector.html +2 -2
  35. package/dev-server/index.js +1 -1
  36. package/dev-server/open-in-editor-api.js +1 -1
  37. package/dev-server/package.json +1 -1
  38. package/dev-server/server-process.js +2 -2
  39. package/internal/app-data/package.json +1 -1
  40. package/internal/client/css-shim.js +2 -2
  41. package/internal/client/dom.js +1 -1
  42. package/internal/client/index.js +1 -1
  43. package/internal/client/package.json +1 -1
  44. package/internal/client/patch-browser.js +1 -1
  45. package/internal/client/patch-esm.js +1 -1
  46. package/internal/client/polyfills/css-shim.js +1 -1
  47. package/internal/client/shadow-css.js +1 -1
  48. package/internal/hydrate/index.js +2 -2
  49. package/internal/hydrate/package.json +1 -1
  50. package/internal/hydrate/runner.js +4 -4
  51. package/internal/package.json +1 -1
  52. package/internal/stencil-private.d.ts +38 -37
  53. package/internal/stencil-public-compiler.d.ts +27 -27
  54. package/internal/stencil-public-runtime.d.ts +3 -3
  55. package/internal/testing/package.json +1 -1
  56. package/mock-doc/index.cjs +1 -1
  57. package/mock-doc/index.d.ts +2 -2
  58. package/mock-doc/index.js +1 -1
  59. package/mock-doc/package.json +1 -1
  60. package/package.json +8 -8
  61. package/screenshot/package.json +1 -1
  62. package/sys/node/autoprefixer.js +1 -1
  63. package/sys/node/glob.js +1 -1
  64. package/sys/node/index.js +31 -44
  65. package/sys/node/package.json +1 -1
  66. package/sys/node/prompts.js +1 -1
  67. package/sys/node/worker.js +1 -1
  68. package/testing/index.js +613 -420
  69. package/testing/jest/jest-preprocessor.d.ts +3 -3
  70. package/testing/package.json +1 -1
  71. package/testing/puppeteer/puppeteer-declarations.d.ts +4 -4
  72. package/testing/puppeteer/puppeteer-element.d.ts +3 -3
  73. package/testing/testing-utils.d.ts +1 -1
@@ -46,6 +46,10 @@ interface Cache {
46
46
  addAll(requests: Iterable<RequestInfo>): Promise<void>;
47
47
  }
48
48
 
49
+ interface CanvasPath {
50
+ roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | Iterable<number | DOMPointInit>): void;
51
+ }
52
+
49
53
  interface CanvasPathDrawingStyles {
50
54
  setLineDash(segments: Iterable<number>): void;
51
55
  }
@@ -121,7 +125,7 @@ interface Headers {
121
125
 
122
126
  interface IDBDatabase {
123
127
  /** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */
124
- transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
128
+ transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
125
129
  }
126
130
 
127
131
  interface IDBObjectStore {
@@ -133,16 +137,6 @@ interface IDBObjectStore {
133
137
  createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;
134
138
  }
135
139
 
136
- interface MIDIInputMap extends ReadonlyMap<string, MIDIInput> {
137
- }
138
-
139
- interface MIDIOutput {
140
- send(data: Iterable<number>, timestamp?: DOMHighResTimeStamp): void;
141
- }
142
-
143
- interface MIDIOutputMap extends ReadonlyMap<string, MIDIOutput> {
144
- }
145
-
146
140
  interface MediaKeyStatusMap {
147
141
  [Symbol.iterator](): IterableIterator<[BufferSource, MediaKeyStatus]>;
148
142
  entries(): IterableIterator<[BufferSource, MediaKeyStatus]>;
@@ -283,8 +277,8 @@ interface WEBGL_draw_buffers {
283
277
  interface WEBGL_multi_draw {
284
278
  multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
285
279
  multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, drawcount: GLsizei): void;
286
- multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLint>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
287
- multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLint>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, drawcount: GLsizei): void;
280
+ multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
281
+ multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, drawcount: GLsizei): void;
288
282
  }
289
283
 
290
284
  interface WebGL2RenderingContextBase {
@@ -19,18 +19,38 @@ and limitations under the License.
19
19
 
20
20
 
21
21
  interface Map<K, V> {
22
+
22
23
  clear(): void;
24
+ /**
25
+ * @returns true if an element in the Map existed and has been removed, or false if the element does not exist.
26
+ */
23
27
  delete(key: K): boolean;
28
+ /**
29
+ * Executes a provided function once per each key/value pair in the Map, in insertion order.
30
+ */
24
31
  forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
32
+ /**
33
+ * Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.
34
+ * @returns Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.
35
+ */
25
36
  get(key: K): V | undefined;
37
+ /**
38
+ * @returns boolean indicating whether an element with the specified key exists or not.
39
+ */
26
40
  has(key: K): boolean;
41
+ /**
42
+ * Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.
43
+ */
27
44
  set(key: K, value: V): this;
45
+ /**
46
+ * @returns the number of elements in the Map.
47
+ */
28
48
  readonly size: number;
29
49
  }
30
50
 
31
51
  interface MapConstructor {
32
52
  new(): Map<any, any>;
33
- new<K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
53
+ new <K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
34
54
  readonly prototype: Map<any, any>;
35
55
  }
36
56
  declare var Map: MapConstructor;
@@ -43,9 +63,23 @@ interface ReadonlyMap<K, V> {
43
63
  }
44
64
 
45
65
  interface WeakMap<K extends object, V> {
66
+ /**
67
+ * Removes the specified element from the WeakMap.
68
+ * @returns true if the element was successfully removed, or false if it was not present.
69
+ */
46
70
  delete(key: K): boolean;
71
+ /**
72
+ * @returns a specified element.
73
+ */
47
74
  get(key: K): V | undefined;
75
+ /**
76
+ * @returns a boolean indicating whether an element with the specified key exists or not.
77
+ */
48
78
  has(key: K): boolean;
79
+ /**
80
+ * Adds a new element with a specified key and value.
81
+ * @param key Must be an object.
82
+ */
49
83
  set(key: K, value: V): this;
50
84
  }
51
85
 
@@ -56,11 +90,28 @@ interface WeakMapConstructor {
56
90
  declare var WeakMap: WeakMapConstructor;
57
91
 
58
92
  interface Set<T> {
93
+ /**
94
+ * Appends a new element with a specified value to the end of the Set.
95
+ */
59
96
  add(value: T): this;
97
+
60
98
  clear(): void;
99
+ /**
100
+ * Removes a specified value from the Set.
101
+ * @returns Returns true if an element in the Set existed and has been removed, or false if the element does not exist.
102
+ */
61
103
  delete(value: T): boolean;
104
+ /**
105
+ * Executes a provided function once per each value in the Set object, in insertion order.
106
+ */
62
107
  forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
108
+ /**
109
+ * @returns a boolean indicating whether an element with the specified value exists in the Set or not.
110
+ */
63
111
  has(value: T): boolean;
112
+ /**
113
+ * @returns the number of (unique) elements in Set.
114
+ */
64
115
  readonly size: number;
65
116
  }
66
117
 
@@ -77,8 +128,18 @@ interface ReadonlySet<T> {
77
128
  }
78
129
 
79
130
  interface WeakSet<T extends object> {
131
+ /**
132
+ * Appends a new object to the end of the WeakSet.
133
+ */
80
134
  add(value: T): this;
135
+ /**
136
+ * Removes the specified element from the WeakSet.
137
+ * @returns Returns true if the element existed and has been removed, or false if the element does not exist.
138
+ */
81
139
  delete(value: T): boolean;
140
+ /**
141
+ * @returns a boolean indicating whether an object exists in the WeakSet or not.
142
+ */
82
143
  has(value: T): boolean;
83
144
  }
84
145
 
@@ -41,7 +41,7 @@ interface PromiseConstructor {
41
41
  all<T extends readonly unknown[] | []>(values: T): Promise<{ -readonly [P in keyof T]: Awaited<T[P]> }>;
42
42
 
43
43
  // see: lib.es2015.iterable.d.ts
44
- // all<T>(values: Iterable<T | PromiseLike<T>>): Promise<T[]>;
44
+ // all<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>;
45
45
 
46
46
  /**
47
47
  * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
@@ -52,7 +52,7 @@ interface PromiseConstructor {
52
52
  race<T extends readonly unknown[] | []>(values: T): Promise<Awaited<T[number]>>;
53
53
 
54
54
  // see: lib.es2015.iterable.d.ts
55
- // race<T>(values: Iterable<T>): Promise<T extends PromiseLike<infer U> ? U : T>;
55
+ // race<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>;
56
56
 
57
57
  /**
58
58
  * Creates a new rejected promise for the provided reason.
@@ -66,13 +66,18 @@ interface PromiseConstructor {
66
66
  * @returns A resolved promise.
67
67
  */
68
68
  resolve(): Promise<void>;
69
-
70
69
  /**
71
70
  * Creates a new resolved promise for the provided value.
72
71
  * @param value A promise.
73
72
  * @returns A promise whose internal state matches the provided promise.
74
73
  */
75
- resolve<T>(value: T | PromiseLike<T>): Promise<T>;
74
+ resolve<T>(value: T): Promise<Awaited<T>>;
75
+ /**
76
+ * Creates a new resolved promise for the provided value.
77
+ * @param value A promise.
78
+ * @returns A promise whose internal state matches the provided promise.
79
+ */
80
+ resolve<T>(value: T | PromiseLike<T>): Promise<Awaited<T>>;
76
81
  }
77
82
 
78
83
  declare var Promise: PromiseConstructor;
@@ -19,23 +19,112 @@ and limitations under the License.
19
19
 
20
20
 
21
21
  interface ProxyHandler<T extends object> {
22
+ /**
23
+ * A trap method for a function call.
24
+ * @param target The original callable object which is being proxied.
25
+ */
22
26
  apply?(target: T, thisArg: any, argArray: any[]): any;
27
+
28
+ /**
29
+ * A trap for the `new` operator.
30
+ * @param target The original object which is being proxied.
31
+ * @param newTarget The constructor that was originally called.
32
+ */
23
33
  construct?(target: T, argArray: any[], newTarget: Function): object;
24
- defineProperty?(target: T, p: string | symbol, attributes: PropertyDescriptor): boolean;
34
+
35
+ /**
36
+ * A trap for `Object.defineProperty()`.
37
+ * @param target The original object which is being proxied.
38
+ * @returns A `Boolean` indicating whether or not the property has been defined.
39
+ */
40
+ defineProperty?(target: T, property: string | symbol, attributes: PropertyDescriptor): boolean;
41
+
42
+ /**
43
+ * A trap for the `delete` operator.
44
+ * @param target The original object which is being proxied.
45
+ * @param p The name or `Symbol` of the property to delete.
46
+ * @returns A `Boolean` indicating whether or not the property was deleted.
47
+ */
25
48
  deleteProperty?(target: T, p: string | symbol): boolean;
49
+
50
+ /**
51
+ * A trap for getting a property value.
52
+ * @param target The original object which is being proxied.
53
+ * @param p The name or `Symbol` of the property to get.
54
+ * @param receiver The proxy or an object that inherits from the proxy.
55
+ */
26
56
  get?(target: T, p: string | symbol, receiver: any): any;
57
+
58
+ /**
59
+ * A trap for `Object.getOwnPropertyDescriptor()`.
60
+ * @param target The original object which is being proxied.
61
+ * @param p The name of the property whose description should be retrieved.
62
+ */
27
63
  getOwnPropertyDescriptor?(target: T, p: string | symbol): PropertyDescriptor | undefined;
64
+
65
+ /**
66
+ * A trap for the `[[GetPrototypeOf]]` internal method.
67
+ * @param target The original object which is being proxied.
68
+ */
28
69
  getPrototypeOf?(target: T): object | null;
70
+
71
+ /**
72
+ * A trap for the `in` operator.
73
+ * @param target The original object which is being proxied.
74
+ * @param p The name or `Symbol` of the property to check for existence.
75
+ */
29
76
  has?(target: T, p: string | symbol): boolean;
77
+
78
+ /**
79
+ * A trap for `Object.isExtensible()`.
80
+ * @param target The original object which is being proxied.
81
+ */
30
82
  isExtensible?(target: T): boolean;
83
+
84
+ /**
85
+ * A trap for `Reflect.ownKeys()`.
86
+ * @param target The original object which is being proxied.
87
+ */
31
88
  ownKeys?(target: T): ArrayLike<string | symbol>;
89
+
90
+ /**
91
+ * A trap for `Object.preventExtensions()`.
92
+ * @param target The original object which is being proxied.
93
+ */
32
94
  preventExtensions?(target: T): boolean;
33
- set?(target: T, p: string | symbol, value: any, receiver: any): boolean;
95
+
96
+ /**
97
+ * A trap for setting a property value.
98
+ * @param target The original object which is being proxied.
99
+ * @param p The name or `Symbol` of the property to set.
100
+ * @param receiver The object to which the assignment was originally directed.
101
+ * @returns A `Boolean` indicating whether or not the property was set.
102
+ */
103
+ set?(target: T, p: string | symbol, newValue: any, receiver: any): boolean;
104
+
105
+ /**
106
+ * A trap for `Object.setPrototypeOf()`.
107
+ * @param target The original object which is being proxied.
108
+ * @param newPrototype The object's new prototype or `null`.
109
+ */
34
110
  setPrototypeOf?(target: T, v: object | null): boolean;
35
111
  }
36
112
 
37
113
  interface ProxyConstructor {
114
+ /**
115
+ * Creates a revocable Proxy object.
116
+ * @param target A target object to wrap with Proxy.
117
+ * @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
118
+ */
38
119
  revocable<T extends object>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; };
120
+
121
+ /**
122
+ * Creates a Proxy object. The Proxy object allows you to create an object that can be used in place of the
123
+ * original object, but which may redefine fundamental Object operations like getting, setting, and defining
124
+ * properties. Proxy objects are commonly used to log property accesses, validate, format, or sanitize inputs.
125
+ * @param target A target object to wrap with Proxy.
126
+ * @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
127
+ */
39
128
  new <T extends object>(target: T, handler: ProxyHandler<T>): T;
40
129
  }
41
130
  declare var Proxy: ProxyConstructor;
@@ -26,6 +26,11 @@ declare namespace Reflect {
26
26
  * @param thisArgument The object to be used as the this object.
27
27
  * @param argumentsList An array of argument values to be passed to the function.
28
28
  */
29
+ function apply<T, A extends readonly any[], R>(
30
+ target: (this: T, ...args: A) => R,
31
+ thisArgument: T,
32
+ argumentsList: Readonly<A>,
33
+ ): R;
29
34
  function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
30
35
 
31
36
  /**
@@ -35,6 +40,11 @@ declare namespace Reflect {
35
40
  * @param argumentsList An array of argument values to be passed to the constructor.
36
41
  * @param newTarget The constructor to be used as the `new.target` object.
37
42
  */
43
+ function construct<A extends readonly any[], R>(
44
+ target: new (...args: A) => R,
45
+ argumentsList: Readonly<A>,
46
+ newTarget?: new (...args: any) => any,
47
+ ): R;
38
48
  function construct(target: Function, argumentsList: ArrayLike<any>, newTarget?: Function): any;
39
49
 
40
50
  /**
@@ -61,7 +71,11 @@ declare namespace Reflect {
61
71
  * @param receiver The reference to use as the `this` value in the getter function,
62
72
  * if `target[propertyKey]` is an accessor property.
63
73
  */
64
- function get(target: object, propertyKey: PropertyKey, receiver?: any): any;
74
+ function get<T extends object, P extends PropertyKey>(
75
+ target: T,
76
+ propertyKey: P,
77
+ receiver?: unknown,
78
+ ): P extends keyof T ? T[P] : any;
65
79
 
66
80
  /**
67
81
  * Gets the own property descriptor of the specified object.
@@ -69,7 +83,10 @@ declare namespace Reflect {
69
83
  * @param target Object that contains the property.
70
84
  * @param propertyKey The property name.
71
85
  */
72
- function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor | undefined;
86
+ function getOwnPropertyDescriptor<T extends object, P extends PropertyKey>(
87
+ target: T,
88
+ propertyKey: P,
89
+ ): TypedPropertyDescriptor<P extends keyof T ? T[P] : any> | undefined;
73
90
 
74
91
  /**
75
92
  * Returns the prototype of an object.
@@ -111,6 +128,12 @@ declare namespace Reflect {
111
128
  * @param receiver The reference to use as the `this` value in the setter function,
112
129
  * if `target[propertyKey]` is an accessor property.
113
130
  */
131
+ function set<T extends object, P extends PropertyKey>(
132
+ target: T,
133
+ propertyKey: P,
134
+ value: P extends keyof T ? T[P] : any,
135
+ receiver?: any,
136
+ ): boolean;
114
137
  function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
115
138
 
116
139
  /**
@@ -239,9 +239,9 @@ interface String {
239
239
  match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null;
240
240
 
241
241
  /**
242
- * Replaces first match with string or all matches with RegExp.
243
- * @param searchValue A string or RegExp search value.
244
- * @param replaceValue A string containing the text to replace for match.
242
+ * Passes a string and {@linkcode replaceValue} to the `[Symbol.replace]` method on {@linkcode searchValue}. This method is expected to implement its own replacement algorithm.
243
+ * @param searchValue An object that supports searching for and replacing matches within a string.
244
+ * @param replaceValue The replacement text.
245
245
  */
246
246
  replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string;
247
247
 
@@ -19,7 +19,22 @@ and limitations under the License.
19
19
 
20
20
 
21
21
  declare namespace Intl {
22
- type DateTimeFormatPartTypes = "day" | "dayPeriod" | "era" | "hour" | "literal" | "minute" | "month" | "second" | "timeZoneName" | "weekday" | "year";
22
+
23
+ interface DateTimeFormatPartTypesRegistry {
24
+ day: any
25
+ dayPeriod: any
26
+ era: any
27
+ hour: any
28
+ literal: any
29
+ minute: any
30
+ month: any
31
+ second: any
32
+ timeZoneName: any
33
+ weekday: any
34
+ year: any
35
+ }
36
+
37
+ type DateTimeFormatPartTypes = keyof DateTimeFormatPartTypesRegistry;
23
38
 
24
39
  interface DateTimeFormatPart {
25
40
  type: DateTimeFormatPartTypes;
@@ -23,3 +23,4 @@ and limitations under the License.
23
23
  /// <reference lib="es2019.object" />
24
24
  /// <reference lib="es2019.string" />
25
25
  /// <reference lib="es2019.symbol" />
26
+ /// <reference lib="es2019.intl" />
@@ -0,0 +1,25 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */
15
+
16
+
17
+
18
+ /// <reference no-default-lib="true"/>
19
+
20
+
21
+ declare namespace Intl {
22
+ interface DateTimeFormatPartTypesRegistry {
23
+ unknown: any
24
+ }
25
+ }
@@ -18,6 +18,7 @@ and limitations under the License.
18
18
  /// <reference no-default-lib="true"/>
19
19
 
20
20
 
21
+ /// <reference lib="es2018.intl" />
21
22
  declare namespace Intl {
22
23
 
23
24
  /**
@@ -50,6 +51,25 @@ declare namespace Intl {
50
51
  | "second"
51
52
  | "seconds";
52
53
 
54
+ /**
55
+ * Value of the `unit` property in objects returned by
56
+ * `Intl.RelativeTimeFormat.prototype.formatToParts()`. `formatToParts` and
57
+ * `format` methods accept either singular or plural unit names as input,
58
+ * but `formatToParts` only outputs singular (e.g. "day") not plural (e.g.
59
+ * "days").
60
+ *
61
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts#Using_formatToParts).
62
+ */
63
+ type RelativeTimeFormatUnitSingular =
64
+ | "year"
65
+ | "quarter"
66
+ | "month"
67
+ | "week"
68
+ | "day"
69
+ | "hour"
70
+ | "minute"
71
+ | "second";
72
+
53
73
  /**
54
74
  * The locale matching algorithm to use.
55
75
  *
@@ -83,7 +103,7 @@ declare namespace Intl {
83
103
  *
84
104
  * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
85
105
  */
86
- type LocalesArgument = UnicodeBCP47LocaleIdentifier | Locale | (UnicodeBCP47LocaleIdentifier | Locale)[] | undefined;
106
+ type LocalesArgument = UnicodeBCP47LocaleIdentifier | Locale | readonly (UnicodeBCP47LocaleIdentifier | Locale)[] | undefined;
87
107
 
88
108
  /**
89
109
  * An object with some or all of properties of `options` parameter
@@ -120,11 +140,16 @@ declare namespace Intl {
120
140
  *
121
141
  * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts#Using_formatToParts).
122
142
  */
123
- interface RelativeTimeFormatPart {
124
- type: string;
125
- value: string;
126
- unit?: RelativeTimeFormatUnit;
127
- }
143
+ type RelativeTimeFormatPart =
144
+ | {
145
+ type: "literal";
146
+ value: string;
147
+ }
148
+ | {
149
+ type: Exclude<NumberFormatPartTypes, "literal">;
150
+ value: string;
151
+ unit: RelativeTimeFormatUnitSingular;
152
+ };
128
153
 
129
154
  interface RelativeTimeFormat {
130
155
  /**
@@ -20,17 +20,25 @@ and limitations under the License.
20
20
 
21
21
  declare namespace Intl {
22
22
 
23
+ interface DateTimeFormatPartTypesRegistry {
24
+ fractionalSecond: any
25
+ }
26
+
23
27
  interface DateTimeFormatOptions {
24
28
  formatMatcher?: "basic" | "best fit" | "best fit" | undefined;
25
29
  dateStyle?: "full" | "long" | "medium" | "short" | undefined;
26
30
  timeStyle?: "full" | "long" | "medium" | "short" | undefined;
27
31
  dayPeriod?: "narrow" | "short" | "long" | undefined;
28
- fractionalSecondDigits?: 0 | 1 | 2 | 3 | undefined;
32
+ fractionalSecondDigits?: 1 | 2 | 3 | undefined;
33
+ }
34
+
35
+ interface DateTimeRangeFormatPart extends DateTimeFormatPart {
36
+ source: "startRange" | "endRange" | "shared"
29
37
  }
30
38
 
31
39
  interface DateTimeFormat {
32
40
  formatRange(startDate: Date | number | bigint, endDate: Date | number | bigint): string;
33
- formatRangeToParts(startDate: Date | number | bigint, endDate: Date | number | bigint): DateTimeFormatPart[];
41
+ formatRangeToParts(startDate: Date | number | bigint, endDate: Date | number | bigint): DateTimeRangeFormatPart[];
34
42
  }
35
43
 
36
44
  interface ResolvedDateTimeFormatOptions {
@@ -39,7 +47,7 @@ declare namespace Intl {
39
47
  timeStyle?: "full" | "long" | "medium" | "short";
40
48
  hourCycle?: "h11" | "h12" | "h23" | "h24";
41
49
  dayPeriod?: "narrow" | "short" | "long";
42
- fractionalSecondDigits?: 0 | 1 | 2 | 3;
50
+ fractionalSecondDigits?: 1 | 2 | 3;
43
51
  }
44
52
 
45
53
  /**
@@ -23,4 +23,5 @@ and limitations under the License.
23
23
  /// <reference lib="es2022.error" />
24
24
  /// <reference lib="es2022.intl" />
25
25
  /// <reference lib="es2022.object" />
26
+ /// <reference lib="es2022.sharedmemory" />
26
27
  /// <reference lib="es2022.string" />
@@ -19,11 +19,11 @@ and limitations under the License.
19
19
 
20
20
 
21
21
  interface ErrorOptions {
22
- cause?: Error;
22
+ cause?: unknown;
23
23
  }
24
24
 
25
25
  interface Error {
26
- cause?: Error;
26
+ cause?: unknown;
27
27
  }
28
28
 
29
29
  interface ErrorConstructor {
@@ -0,0 +1,27 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */
15
+
16
+
17
+
18
+ /// <reference no-default-lib="true"/>
19
+
20
+
21
+ interface Atomics {
22
+ /**
23
+ * A non-blocking, asynchronous version of wait which is usable on the main thread.
24
+ * Waits asynchronously on a shared memory location and returns a Promise
25
+ */
26
+ waitAsync(typedArray: BigInt64Array | Int32Array, index: number, value: bigint, timeout?: number): { async: false, value: "ok" | "not-equal" | "timed-out" } | { async: true, value: Promise<"ok" | "not-equal" | "timed-out"> };
27
+ }