@@ -126,5 +126,148 @@ Index: dom.generated.d.ts
126126 }
127127
128128 declare var RTCStatsReport: {
129+ @@ -34051,13 +34071,20 @@
130+ handler: TimerHandler,
131+ timeout?: number,
132+ ...arguments: any[]
133+ ): number;
134+ +
135+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone) */
136+ - declare function structuredClone<T = any>(
137+ + declare function structuredClone<
138+ + const T extends BetterTypeScriptLibInternals.StructuredClone.NeverOrUnknown<
139+ + BetterTypeScriptLibInternals.StructuredClone.StructuredCloneOutput<
140+ + BetterTypeScriptLibInternals.StructuredClone.AvoidCyclicConstraint<T>
141+ + >
142+ + >,
143+ + >(
144+ value: T,
145+ options?: StructuredSerializeOptions,
146+ - ): T;
147+ + ): BetterTypeScriptLibInternals.StructuredClone.StructuredCloneOutput<T>;
148+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/sessionStorage) */
149+ declare var sessionStorage: Storage;
150+ declare function addEventListener<K extends keyof WindowEventMap>(
151+ type: K,
152+ @@ -34712,4 +34739,119 @@
153+ | "blob"
154+ | "document"
155+ | "json"
156+ | "text";
157+ + // --------------------
158+ +
159+ + declare namespace BetterTypeScriptLibInternals {
160+ + export namespace StructuredClone {
161+ + type Basics = [
162+ + EvalError,
163+ + RangeError,
164+ + ReferenceError,
165+ + TypeError,
166+ + SyntaxError,
167+ + URIError,
168+ + Error,
169+ + Boolean,
170+ + String,
171+ + Date,
172+ + RegExp,
173+ + ];
174+ + type DOMSpecifics = [
175+ + DOMException,
176+ + DOMMatrix,
177+ + DOMMatrixReadOnly,
178+ + DOMPoint,
179+ + DOMPointReadOnly,
180+ + DOMQuad,
181+ + DOMRect,
182+ + DOMRectReadOnly,
183+ + ];
184+ + type FileSystemTypeFamily = [
185+ + FileSystemDirectoryHandle,
186+ + FileSystemFileHandle,
187+ + FileSystemHandle,
188+ + ];
189+ + type WebGPURelatedTypeFamily = [
190+ + // GPUCompilationInfo,
191+ + // GPUCompilationMessage,
192+ + ];
193+ + type TypedArrayFamily = [
194+ + Int8Array,
195+ + Int16Array,
196+ + Int32Array,
197+ + BigInt64Array,
198+ + Uint8Array,
199+ + Uint16Array,
200+ + Uint32Array,
201+ + BigUint64Array,
202+ + Uint8ClampedArray,
203+ + ];
204+ + type Weaken = [
205+ + ...Basics,
206+ + // AudioData,
207+ + Blob,
208+ + // CropTarget,
209+ + // CryptoTarget,
210+ + ...DOMSpecifics,
211+ + ...FileSystemTypeFamily,
212+ + ...WebGPURelatedTypeFamily,
213+ + File,
214+ + FileList,
215+ + ...TypedArrayFamily,
216+ + DataView,
217+ + ImageBitmap,
218+ + ImageData,
219+ + RTCCertificate,
220+ + VideoFrame,
221+ + ];
222+ +
223+ + type MapSubtype<R> = {
224+ + [k in keyof Weaken]: R extends Weaken[k] ? true : false;
225+ + };
226+ + type SelectNumericLiteral<H> = number extends H ? never : H;
227+ + type FilterByNumericLiteralKey<R extends Record<string | number, any>> = {
228+ + [k in keyof R as `${R[k] extends true ? Exclude<SelectNumericLiteral<k>, symbol> : never}`]: [];
229+ + };
230+ + type HitWeakenEntry<E> = keyof FilterByNumericLiteralKey<MapSubtype<E>>;
231+ +
232+ + type NonCloneablePrimitive =
233+ + | Function
234+ + | { new (...args: any[]): any }
235+ + | ((...args: any[]) => any)
236+ + | symbol;
237+ +
238+ + type StructuredCloneOutputObject<T> = {
239+ + -readonly [K in Exclude<keyof T, symbol> as [
240+ + StructuredCloneOutput<T[K]>,
241+ + ] extends [never]
242+ + ? never
243+ + : K]: StructuredCloneOutput<T[K]>;
244+ + };
245+ +
246+ + type StructuredCloneOutput<T> = T extends NonCloneablePrimitive
247+ + ? never
248+ + : T extends ReadonlyArray<any>
249+ + ? number extends T["length"]
250+ + ? Array<StructuredCloneOutput<T[number]>>
251+ + : T extends readonly [infer X, ...infer XS]
252+ + ? [StructuredCloneOutput<X>, ...StructuredCloneOutput<XS>]
253+ + : T extends []
254+ + ? []
255+ + : StructuredCloneOutputObject<T>
256+ + : T extends Map<infer K, infer V>
257+ + ? Map<StructuredCloneOutput<K>, StructuredCloneOutput<V>>
258+ + : T extends Set<infer E>
259+ + ? Set<StructuredCloneOutput<E>>
260+ + : T extends Record<any, any>
261+ + ? HitWeakenEntry<T> extends never
262+ + ? StructuredCloneOutputObject<T>
263+ + : Weaken[HitWeakenEntry<T>]
264+ + : T;
265+ +
266+ + type AvoidCyclicConstraint<T> = [T] extends [infer R] ? R : never;
267+ +
268+ + // 上限が不正にきつくなっているのを無視する
269+ + type NeverOrUnknown<T> = [T] extends [never] ? never : unknown;
270+ + }
271+ + }
129272
130273```
0 commit comments