Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
983f0bc
🤖 Merge PR #73655 [react-big-calendar] Add missing props type definit…
sirasagi62 Sep 12, 2025
a8dfc5a
🤖 dprint fmt
typescript-bot Sep 12, 2025
67740b1
[react] Move `<Activit>` to Canary release channel (#73609)
eps1lon Sep 12, 2025
b041531
🤖 Merge PR #73536 [chrome] update i18n namespace by @erwanjugand
erwanjugand Sep 12, 2025
2dbe179
🤖 Merge PR #73512 [chrome] update alarms namespace by @erwanjugand
erwanjugand Sep 12, 2025
2cbf2d0
🤖 Merge PR #73523 [chrome] update extension namespace by @erwanjugand
erwanjugand Sep 12, 2025
a12a5d4
🤖 Merge PR #73526 [chrome] update declarativeContent namespace by @er…
erwanjugand Sep 12, 2025
79ec5fb
🤖 Merge PR #73528 [chrome] update fileBrowserHandler namespace by @er…
erwanjugand Sep 12, 2025
4e3e1ee
🤖 Merge PR #73522 [@types/govuk-frontend] Update for GOV.UK Frontend …
colinrotherham Sep 12, 2025
0ce90e6
🤖 Merge PR #73531 [chrome] update fontSettings namespace by @erwanjugand
erwanjugand Sep 12, 2025
8f60370
🤖 Merge PR #73578 fix(node/http): properly re-export WebSocket, Messa…
auvred Sep 12, 2025
29420d4
🤖 Merge PR #73641 Add @types/gimloader package by @TheLazySquid
TheLazySquid Sep 12, 2025
2095d59
🤖 Merge PR #73517 Fix type definition of cross() for d3-array v2 and …
szenadam Sep 12, 2025
5ee273a
🤖 Merge PR #73538 fix(libmime): fix export style, export the class Li…
hkleungai Sep 12, 2025
b43b29d
🤖 Merge PR #73533 feat(plotly.js): update Font Interface by @hkleungai
hkleungai Sep 12, 2025
492a7ba
🤖 Merge PR #73534 feat(plotly.js): add MapboxBounds, supplement jsdoc…
hkleungai Sep 12, 2025
2840242
🤖 Merge PR #73616 feat(emscripten) : Update `writeFile` API by @R3gar…
R3gardless Sep 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
810 changes: 463 additions & 347 deletions types/chrome/index.d.ts

Large diffs are not rendered by default.

588 changes: 493 additions & 95 deletions types/chrome/test/index.ts

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions types/d3-array/d3-array-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2530,9 +2530,9 @@ const chars = ["x", "y"];
const nums = [1, 2];

crossed = d3Array.cross(chars, nums);
crossed = d3Array.cross<string, number>(chars, nums);
crossed = d3Array.cross<[string, number]>(chars, nums);

let strArray: string[] = d3Array.cross<number, number, string>([2, 3], [5, 6], (a, b) => (a + b) + "px");
let strArray: string[] = d3Array.cross<[number, number], string>([2, 3], [5, 6], (a, b) => (a + b) + "px");
strArray = d3Array.cross([2, 3], [5, 6], (a, b) => {
const aa: number = a;
const bb: number = b;
Expand All @@ -2543,9 +2543,9 @@ const readonlyChars = chars as readonly string[];
const readonlyNums = new Uint8Array(nums);

crossed = d3Array.cross(readonlyChars, readonlyNums);
crossed = d3Array.cross<string, number>(readonlyChars, readonlyNums);
crossed = d3Array.cross<[string, number]>(readonlyChars, readonlyNums);

strArray = d3Array.cross<number, number, string>(
strArray = d3Array.cross<[number, number], string>(
[2, 3] as readonly number[],
new Uint8ClampedArray([5, 6]),
(a, b) => (a + b) + "px",
Expand Down
61 changes: 46 additions & 15 deletions types/d3-array/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -648,25 +648,56 @@ export function count<TObject>(
): number;

/**
* Returns the Cartesian product of the two arrays a and b.
* For each element i in the specified array a and each element j in the specified array b, in order,
* it creates a two-element array for each pair.
* Computes the Cartesian product of any number of iterables.
*
* @param a First input array.
* @param b Second input array.
*/
export function cross<S, T>(a: Iterable<S>, b: Iterable<T>): Array<[S, T]>;
* When called **without** a reducer, the result is an array of tuples,
* where each tuple contains one element from each input iterable.
*
* @typeParam T - A tuple type describing the element type of each iterable argument.
* For example, passing `[number[], string[]]` infers `T` as `[number, string]`.
*
* @param iterables - Two or more iterables to combine into a Cartesian product.
* @returns An array of tuples containing one value from each iterable.
*
* @example
* ```ts
* const nums = [1, 2];
* const chars = ['a', 'b'];
* const out = cross(nums, chars);
* // ^? type: [number, string][]
* // Example value: [[1,'a'], [1,'b'], [2,'a'], [2,'b']]
* ```
*/
export function cross<T extends unknown[]>(
...iterables: { [K in keyof T]: Iterable<T[K]> }
): T[];

/**
* Returns the Cartesian product of the two arrays a and b.
* For each element i in the specified array a and each element j in the specified array b, in order,
* invokes the specified reducer function passing the element i and element j.
* Computes the Cartesian product of any number of iterables and then applies
* a reducer to each tuple, returning the reduced values.
*
* @param a First input array.
* @param b Second input array.
* @param reducer A reducer function taking as input an element from "a" and "b" and returning a reduced value.
*/
export function cross<S, T, U>(a: Iterable<S>, b: Iterable<T>, reducer: (a: S, b: T) => U): U[];
* The final argument **must** be the reducer function; all prior arguments are iterables.
*
* @typeParam T - A tuple type describing the element type of each iterable argument.
* @typeParam U - The result type produced by the reducer.
*
* @param args - The iterables to combine, followed by a reducer function.
* @param args.reducer - A function invoked with one element from each iterable
* (spread as individual parameters) that returns a reduced value.
* @returns An array of reduced values returned by the reducer.
*
* @example
* ```ts
* const nums = [1, 2];
* const chars = ['a', 'b'];
* const out = cross(nums, chars, (n, c) => `${n}${c}`);
* // ^? type: string[]
* // Example value: ['1a', '1b', '2a', '2b']
* ```
*/
export function cross<T extends unknown[], U>(
...args: [...iterables: { [K in keyof T]: Iterable<T[K]> }, reducer: (...values: T) => U]
): U[];

/**
* Merges the specified arrays into a single array.
Expand Down
8 changes: 4 additions & 4 deletions types/d3-array/v2/d3-array-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -901,9 +901,9 @@ const chars = ["x", "y"];
const nums = [1, 2];

crossed = d3Array.cross(chars, nums);
crossed = d3Array.cross<string, number>(chars, nums);
crossed = d3Array.cross<[string, number]>(chars, nums);

let strArray: string[] = d3Array.cross<number, number, string>([2, 3], [5, 6], (a, b) => (a + b) + "px");
let strArray: string[] = d3Array.cross<[number, number], string>([2, 3], [5, 6], (a, b) => (a + b) + "px");
strArray = d3Array.cross([2, 3], [5, 6], (a, b) => {
const aa: number = a;
const bb: number = b;
Expand All @@ -914,9 +914,9 @@ const readonlyChars = chars as readonly string[];
const readonlyNums = new Uint8Array(nums);

crossed = d3Array.cross(readonlyChars, readonlyNums);
crossed = d3Array.cross<string, number>(readonlyChars, readonlyNums);
crossed = d3Array.cross<[string, number]>(readonlyChars, readonlyNums);

strArray = d3Array.cross<number, number, string>(
strArray = d3Array.cross<[number, number], string>(
[2, 3] as readonly number[],
new Uint8ClampedArray([5, 6]),
(a, b) => (a + b) + "px",
Expand Down
61 changes: 46 additions & 15 deletions types/d3-array/v2/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -702,25 +702,56 @@ export function count<TObject>(
): number;

/**
* Returns the Cartesian product of the two arrays a and b.
* For each element i in the specified array a and each element j in the specified array b, in order,
* it creates a two-element array for each pair.
* Computes the Cartesian product of any number of iterables.
*
* @param a First input array.
* @param b Second input array.
*/
export function cross<S, T>(a: Iterable<S>, b: Iterable<T>): Array<[S, T]>;
* When called **without** a reducer, the result is an array of tuples,
* where each tuple contains one element from each input iterable.
*
* @typeParam T - A tuple type describing the element type of each iterable argument.
* For example, passing `[number[], string[]]` infers `T` as `[number, string]`.
*
* @param iterables - Two or more iterables to combine into a Cartesian product.
* @returns An array of tuples containing one value from each iterable.
*
* @example
* ```ts
* const nums = [1, 2];
* const chars = ['a', 'b'];
* const out = cross(nums, chars);
* // ^? type: [number, string][]
* // Example value: [[1,'a'], [1,'b'], [2,'a'], [2,'b']]
* ```
*/
export function cross<T extends unknown[]>(
...iterables: { [K in keyof T]: Iterable<T[K]> }
): T[];

/**
* Returns the Cartesian product of the two arrays a and b.
* For each element i in the specified array a and each element j in the specified array b, in order,
* invokes the specified reducer function passing the element i and element j.
* Computes the Cartesian product of any number of iterables and then applies
* a reducer to each tuple, returning the reduced values.
*
* @param a First input array.
* @param b Second input array.
* @param reducer A reducer function taking as input an element from "a" and "b" and returning a reduced value.
*/
export function cross<S, T, U>(a: Iterable<S>, b: Iterable<T>, reducer: (a: S, b: T) => U): U[];
* The final argument **must** be the reducer function; all prior arguments are iterables.
*
* @typeParam T - A tuple type describing the element type of each iterable argument.
* @typeParam U - The result type produced by the reducer.
*
* @param args - The iterables to combine, followed by a reducer function.
* @param args.reducer - A function invoked with one element from each iterable
* (spread as individual parameters) that returns a reduced value.
* @returns An array of reduced values returned by the reducer.
*
* @example
* ```ts
* const nums = [1, 2];
* const chars = ['a', 'b'];
* const out = cross(nums, chars, (n, c) => `${n}${c}`);
* // ^? type: string[]
* // Example value: ['1a', '1b', '2a', '2b']
* ```
*/
export function cross<T extends unknown[], U>(
...args: [...iterables: { [K in keyof T]: Iterable<T[K]> }, reducer: (...values: T) => U]
): U[];

/**
* Merges the specified arrays into a single array.
Expand Down
10 changes: 10 additions & 0 deletions types/emscripten/emscripten-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ function FSTest(): void {
FS.symlink("file", "link");

FS.writeFile("/foobar.txt", "Hello, world");

// Test writeFile with extended options
FS.writeFile("/test-with-mode.txt", "content", { mode: parseInt("0644", 8) });
FS.writeFile("/test-with-flags.txt", "content", { flags: "w+" });
FS.writeFile("/test-with-canown.txt", "content", { canOwn: true });
FS.writeFile("/test-with-all-opts.txt", "content", {
flags: "w",
mode: parseInt("0755", 8),
canOwn: false,
});
FS.unlink("/foobar.txt");

FS.writeFile("file", "foobar");
Expand Down
6 changes: 5 additions & 1 deletion types/emscripten/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,11 @@ declare namespace FS {
function readFile(path: string, opts: { encoding: "binary"; flags?: string | undefined }): Uint8Array;
function readFile(path: string, opts: { encoding: "utf8"; flags?: string | undefined }): string;
function readFile(path: string, opts?: { flags?: string | undefined }): Uint8Array;
function writeFile(path: string, data: string | ArrayBufferView, opts?: { flags?: string | undefined }): void;
function writeFile(
path: string,
data: string | ArrayBufferView,
opts?: { flags?: string | undefined; mode?: number | undefined; canOwn?: boolean | undefined },
): void;

//
// module-level FS code
Expand Down
5 changes: 5 additions & 0 deletions types/gimloader/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!**/*.d.ts
!**/*.d.cts
!**/*.d.mts
!**/*.d.*.ts
33 changes: 33 additions & 0 deletions types/gimloader/gimloader-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
GL; // $ExpectType typeof Api
api; // $ExpectType Api

new GL(); // $ExpectType Api

api.React; // $ExpectType typeof React
api.UI; // $ExpectType Readonly<ScopedUIApi>
api.hotkeys; // $ExpectType Readonly<ScopedHotkeysApi>
api.libs; // $ExpectType Readonly<LibsApi>
api.net; // $ExpectType Readonly<ScopedNetApi>
api.patcher; // $ExpectType Readonly<ScopedPatcherApi>
api.plugins; // $ExpectType Readonly<PluginsApi>
api.rewriter; // $ExpectType Readonly<ScopedRewriterApi>
api.storage; // $ExpectType Readonly<ScopedStorageApi>

GL.React; // $ExpectType typeof React
GL.UI; // $ExpectType Readonly<UIApi>
GL.hotkeys; // $ExpectType Readonly<HotkeysApi>
GL.libs; // $ExpectType Readonly<LibsApi>
GL.net; // $ExpectType Readonly<NetApi>
GL.patcher; // $ExpectType Readonly<PatcherApi>
GL.plugins; // $ExpectType Readonly<PluginsApi>
GL.rewriter; // $ExpectType Readonly<RewriterApi>
GL.storage; // $ExpectType Readonly<StorageApi>

// @ts-expect-error
GL.onStop;
// @ts-expect-error
GL.openSettingsMenu;
// @ts-expect-error
api.onStop();
// @ts-expect-error
api.openSettingsMenu();
Loading