Skip to content

Commit 8c5b444

Browse files
committed
Web types & tests
1 parent a07eb20 commit 8c5b444

31 files changed

+197
-11
lines changed

packages/core-js-types/src/52/common/efficient-script-yielding.d.ts renamed to packages/core-js-types/src/52/web/efficient-script-yielding.d.ts

File renamed without changes.
File renamed without changes.

packages/core-js-types/src/56/common/efficient-script-yielding.d.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Decodes a string of data which has been encoded using Base64 encoding.
3+
* @param data A base64-encoded string, using the alphabet produced by btoa().
4+
* @returns A binary string containing raw bytes decoded from encodedData.
5+
*/
6+
declare function atob(data: string): string;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* Creates a Base64-encoded ASCII string from a binary string
3+
* (i.e., a string in which each character in the string is treated as a byte of binary data)
4+
* @param data The binary string to encode
5+
* @returns An ASCII string containing the Base64 representation of data
6+
*/
7+
declare function btoa(data: string): string;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
type Immediate = number | object;
2+
3+
/**
4+
* Schedules the execution of a function as soon as possible after the current script yields.
5+
* @param handler The function to execute.
6+
* @param args Arguments to pass to the handler function.
7+
* @returns An identifier that can be used to cancel the scheduled function.
8+
*/
9+
declare function setImmediate(handler: (...args: any[]) => void, ...args: any[]): Immediate;
10+
11+
/**
12+
* Cancels a function scheduled with setImmediate.
13+
* @param immediate The identifier of the scheduled function to cancel.
14+
*/
15+
declare function clearImmediate(immediate: Immediate): void;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
interface VoidFunction {
2+
(): void;
3+
}
4+
5+
/**
6+
* Queues a microtask to be executed at a later time.
7+
* @param callback A function to be executed in the microtask.
8+
*/
9+
declare function queueMicrotask(callback: VoidFunction): void;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
interface CoreJSStructuredSerializeOptions {
2+
readonly __brand?: unique symbol;
3+
4+
transfer?: any[];
5+
}
6+
7+
/**
8+
* Creates a deep clone of a given value using the structured clone algorithm.
9+
* @param value The value to be cloned.
10+
* @param options An optional object that may contain a transfer property,
11+
* which is an array of transferable objects to be transferred rather than cloned.
12+
* @returns A deep clone of the provided value.
13+
*/
14+
declare function structuredClone<T = any>(value: T, options?: CoreJSStructuredSerializeOptions): T;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
interface URL {
2+
toJSON(): string;
3+
}

packages/core-js/modules/web.atob.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// types: web/atob
12
'use strict';
23
var $ = require('../internals/export');
34
var globalThis = require('../internals/global-this');

0 commit comments

Comments
 (0)