From e7b275ffdb647d8efec72ce0f240fd763eb49a02 Mon Sep 17 00:00:00 2001 From: Mohit Tejani <60129002+mohitpubnub@users.noreply.github.com> Date: Fri, 1 Dec 2023 13:16:49 +0530 Subject: [PATCH 001/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67568=20pn?= =?UTF-8?q?/update-AppContext-param=20by=20@mohitpubnub?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/pubnub/index.d.ts | 8 ++++++++ types/pubnub/package.json | 2 +- types/pubnub/pubnub-tests.ts | 10 ++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/types/pubnub/index.d.ts b/types/pubnub/index.d.ts index e39378d2770f84..b0cb12a4db5c1d 100644 --- a/types/pubnub/index.d.ts +++ b/types/pubnub/index.d.ts @@ -360,6 +360,7 @@ declare namespace Pubnub { timetoken: string; message: any; publisher: string; + error?: string | undefined; /** * deprecated: @@ -596,6 +597,7 @@ declare namespace Pubnub { timetoken: string | number; messageType?: string | number | undefined; uuid?: string | undefined; + error?: string | undefined; meta?: { [key: string]: any; } | undefined; @@ -1149,6 +1151,9 @@ declare namespace Pubnub { customFields?: boolean | undefined; UUIDFields?: boolean | undefined; customUUIDFields?: boolean | undefined; + statusField?: boolean | undefined; + UUIDStatusField?: boolean | undefined; + UUIDTypeField?: boolean | undefined; } | undefined; filter?: string | undefined; sort?: object | undefined; @@ -1165,6 +1170,9 @@ declare namespace Pubnub { customFields?: boolean | undefined; channelFields?: boolean | undefined; customChannelFields?: boolean | undefined; + statusField?: boolean | undefined; + channelStatusField?: boolean | undefined; + channelTypeField?: boolean | undefined; } | undefined; filter?: string | undefined; sort?: object | undefined; diff --git a/types/pubnub/package.json b/types/pubnub/package.json index 7285f9effe80ed..7e39fa15cc62a2 100644 --- a/types/pubnub/package.json +++ b/types/pubnub/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/pubnub", - "version": "7.3.9999", + "version": "7.4.9999", "projects": [ "https://github.com/pubnub/javascript" ], diff --git a/types/pubnub/pubnub-tests.ts b/types/pubnub/pubnub-tests.ts index 777e99e46ef7bb..7c4fe646fb6bac 100644 --- a/types/pubnub/pubnub-tests.ts +++ b/types/pubnub/pubnub-tests.ts @@ -592,6 +592,11 @@ pubnub.objects.getMemberships({ uuid: "myUuid", include: { channelFields: true, + statusField: true, + customFields: true, + customChannelFields: true, + channelStatusField: true, + channelTypeField: true, }, }); @@ -625,6 +630,11 @@ pubnub.objects.getChannelMembers({ channel: "myChannel", include: { UUIDFields: true, + statusField: true, + customUUIDFields: true, + customFields: true, + UUIDStatusField: true, + UUIDTypeField: true, }, }); From 2fb3dd0c048affa19fa26a28ca708caefa8720cb Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 1 Dec 2023 06:10:34 -0800 Subject: [PATCH 002/519] Update ember for TS 5.4 (#67564) * Update ember for TS 5.4 Ember is broken by https://github.com/microsoft/TypeScript/pull/54753 The discussion on this PR ending at https://github.com/microsoft/TypeScript/pull/54753#issuecomment-1658631909 makes me think that these breaks are acceptable where they aren't strict improvements. * update ExpectType for ember__array/v3 * dprint fmt --- types/ember/test/array.ts | 6 +++--- types/ember/test/ember-tests.ts | 2 +- types/ember/test/extend.ts | 3 --- types/ember/test/reopen.ts | 7 ++++--- types/ember/v2/test/array.ts | 6 +++--- types/ember/v2/test/ember-tests.ts | 2 +- types/ember/v2/test/extend.ts | 3 --- types/ember/v2/test/reopen.ts | 4 ++-- types/ember/v3/test/array.ts | 6 +++--- types/ember/v3/test/ember-tests.ts | 2 +- types/ember/v3/test/extend.ts | 3 --- types/ember/v3/test/reopen.ts | 4 ++-- types/ember__array/test/array.ts | 8 ++++---- types/ember__array/v3/test/array.ts | 8 ++++---- types/ember__object/test/extend.ts | 3 --- types/ember__object/test/reopen.ts | 4 ++-- types/ember__object/v3/test/extend.ts | 3 --- types/ember__object/v3/test/reopen.ts | 4 ++-- 18 files changed, 32 insertions(+), 46 deletions(-) diff --git a/types/ember/test/array.ts b/types/ember/test/array.ts index fdd29ada50861f..f0b20a301dd37c 100755 --- a/types/ember/test/array.ts +++ b/types/ember/test/array.ts @@ -1,7 +1,7 @@ import Ember from "ember"; import { assertType } from "./lib/assert"; -type Person = typeof Person.prototype; +type Person = Ember.Object & { name: string; isHappy: boolean }; const Person = Ember.Object.extend({ name: "", isHappy: false, @@ -13,7 +13,7 @@ const people = Ember.A([ ]); assertType(people.get("length")); -assertType(people.get("lastObject")); +assertType(people.get("lastObject")); assertType(people.isAny("isHappy")); // @ts-expect-error assertType(people.isAny("isHappy", "false")); @@ -22,7 +22,7 @@ assertType>(people.filterBy("isHappy")); assertType>(people.rejectBy("isHappy")); assertType>(people.filter(person => person.get("name") === "Yehuda")); assertType(people.get("[]")); -assertType(people.get("[]").get("firstObject")); +assertType(people.get("[]").get("firstObject")); assertType>(people.mapBy("isHappy")); assertType(people.mapBy("name.length")); diff --git a/types/ember/test/ember-tests.ts b/types/ember/test/ember-tests.ts index beae9e206e7e7f..41bf9fce49e8c1 100755 --- a/types/ember/test/ember-tests.ts +++ b/types/ember/test/ember-tests.ts @@ -139,7 +139,7 @@ const people2 = Ember.A([ Person3.create({ name: "Yehuda", isHappy: true }), Person3.create({ name: "Majd", isHappy: false }), ]); -const isHappy = (person: typeof Person3.prototype): boolean => { +const isHappy = (person: Ember.Object & { name: string; isHappy: boolean }): boolean => { return !!person.get("isHappy"); }; people2.every(isHappy); diff --git a/types/ember/test/extend.ts b/types/ember/test/extend.ts index e5d8a975d2a062..a609bf5c59b796 100755 --- a/types/ember/test/extend.ts +++ b/types/ember/test/extend.ts @@ -13,9 +13,6 @@ const Person = Ember.Object.extend({ }, }); -assertType(Person.prototype.firstName); -assertType<() => string>(Person.prototype.getFullName); - const person = Person.create({ firstName: "Joe", lastName: "Blow", diff --git a/types/ember/test/reopen.ts b/types/ember/test/reopen.ts index 8bb9eb2472b9bf..ad504ffdeaab5d 100755 --- a/types/ember/test/reopen.ts +++ b/types/ember/test/reopen.ts @@ -1,7 +1,7 @@ import Ember from "ember"; import { assertType } from "./lib/assert"; -type Person = typeof Person.prototype; +type Person = { name: string; sayHello(): void } & Ember.Object; const Person = Ember.Object.extend({ name: "", sayHello() { @@ -9,7 +9,9 @@ const Person = Ember.Object.extend({ }, }); -assertType(Person.reopen()); +assertType< + Readonly & { new(properties?: object | undefined): Person } +>(Person.reopen()); assertType(Person.create().name); Person.create().sayHello(); // $ExpectType void @@ -29,7 +31,6 @@ assertType(Person2.species); const tom = Person2.create({ name: "Tom Dale", }); - // @ts-expect-error const badTom = Person2.create({ name: 99 }); diff --git a/types/ember/v2/test/array.ts b/types/ember/v2/test/array.ts index 39cd954c439207..3b9c03c522fa52 100755 --- a/types/ember/v2/test/array.ts +++ b/types/ember/v2/test/array.ts @@ -1,7 +1,7 @@ import Ember from "ember"; import { assertType } from "./lib/assert"; -type Person = typeof Person.prototype; +type Person = Ember.Object & { name: string; isHappy: boolean }; const Person = Ember.Object.extend({ name: "", isHappy: false, @@ -13,14 +13,14 @@ const people = Ember.A([ ]); assertType(people.get("length")); -assertType(people.get("lastObject")); +assertType(people.get("lastObject")); assertType(people.isAny("isHappy")); assertType(people.isAny("isHappy", "false")); assertType>(people.filterBy("isHappy")); assertType>(people.rejectBy("isHappy")); assertType>(people.filter(person => person.get("name") === "Yehuda")); assertType(people.get("[]")); -assertType(people.get("[]").get("firstObject")); +assertType(people.get("[]").get("firstObject")); assertType>(people.mapBy("isHappy")); assertType(people.mapBy("name.length")); diff --git a/types/ember/v2/test/ember-tests.ts b/types/ember/v2/test/ember-tests.ts index 07fb4203476f58..3d9ae307d9115c 100755 --- a/types/ember/v2/test/ember-tests.ts +++ b/types/ember/v2/test/ember-tests.ts @@ -125,7 +125,7 @@ const people2 = Ember.A([ Person3.create({ name: "Yehuda", isHappy: true }), Person3.create({ name: "Majd", isHappy: false }), ]); -const isHappy = (person: typeof Person3.prototype): boolean => { +const isHappy = (person: Ember.Object & { name: string; isHappy: boolean }): boolean => { return !!person.get("isHappy"); }; people2.every(isHappy); diff --git a/types/ember/v2/test/extend.ts b/types/ember/v2/test/extend.ts index 346610d94a23a5..b07f6db68e08d3 100755 --- a/types/ember/v2/test/extend.ts +++ b/types/ember/v2/test/extend.ts @@ -13,9 +13,6 @@ const Person = Ember.Object.extend({ }, }); -assertType(Person.prototype.firstName); -assertType<() => string>(Person.prototype.getFullName); - const person = Person.create({ firstName: "Joe", lastName: "Blow", diff --git a/types/ember/v2/test/reopen.ts b/types/ember/v2/test/reopen.ts index 1f76b5f1f66d52..020842a95c02d2 100755 --- a/types/ember/v2/test/reopen.ts +++ b/types/ember/v2/test/reopen.ts @@ -1,7 +1,7 @@ import Ember from "ember"; import { assertType } from "./lib/assert"; -type Person = typeof Person.prototype; +type Person = Ember.Object & { name: string; sayHello(): void }; const Person = Ember.Object.extend({ name: "", sayHello() { @@ -9,7 +9,7 @@ const Person = Ember.Object.extend({ }, }); -assertType(Person.reopen()); +assertType & { new(properties?: object | undefined): Person }>(Person.reopen()); assertType(Person.create().name); // eslint-disable-next-line @typescript-eslint/no-invalid-void-type diff --git a/types/ember/v3/test/array.ts b/types/ember/v3/test/array.ts index 98c8e2c4720469..945bf7f9b01677 100755 --- a/types/ember/v3/test/array.ts +++ b/types/ember/v3/test/array.ts @@ -1,7 +1,7 @@ import Ember from "ember"; import { assertType } from "./lib/assert"; -type Person = typeof Person.prototype; +type Person = Ember.Object & { name: string; isHappy: boolean }; const Person = Ember.Object.extend({ name: "", isHappy: false, @@ -13,14 +13,14 @@ const people = Ember.A([ ]); assertType(people.get("length")); -assertType(people.get("lastObject")); +assertType(people.get("lastObject")); assertType(people.isAny("isHappy")); assertType(people.isAny("isHappy", "false")); assertType>(people.filterBy("isHappy")); assertType>(people.rejectBy("isHappy")); assertType>(people.filter(person => person.get("name") === "Yehuda")); assertType(people.get("[]")); -assertType(people.get("[]").get("firstObject")); +assertType(people.get("[]").get("firstObject")); assertType>(people.mapBy("isHappy")); assertType(people.mapBy("name.length")); diff --git a/types/ember/v3/test/ember-tests.ts b/types/ember/v3/test/ember-tests.ts index 9fc8a85ee666fd..54fafeff87d07f 100755 --- a/types/ember/v3/test/ember-tests.ts +++ b/types/ember/v3/test/ember-tests.ts @@ -125,7 +125,7 @@ const people2 = Ember.A([ Person3.create({ name: "Yehuda", isHappy: true }), Person3.create({ name: "Majd", isHappy: false }), ]); -const isHappy = (person: typeof Person3.prototype): boolean => { +const isHappy = (person: Ember.Object & { name: string; isHappy: boolean }): boolean => { return !!person.get("isHappy"); }; people2.every(isHappy); diff --git a/types/ember/v3/test/extend.ts b/types/ember/v3/test/extend.ts index 346610d94a23a5..b07f6db68e08d3 100755 --- a/types/ember/v3/test/extend.ts +++ b/types/ember/v3/test/extend.ts @@ -13,9 +13,6 @@ const Person = Ember.Object.extend({ }, }); -assertType(Person.prototype.firstName); -assertType<() => string>(Person.prototype.getFullName); - const person = Person.create({ firstName: "Joe", lastName: "Blow", diff --git a/types/ember/v3/test/reopen.ts b/types/ember/v3/test/reopen.ts index 3cc6d3d848e723..426be63a499ba4 100755 --- a/types/ember/v3/test/reopen.ts +++ b/types/ember/v3/test/reopen.ts @@ -1,7 +1,7 @@ import Ember from "ember"; import { assertType } from "./lib/assert"; -type Person = typeof Person.prototype; +type Person = Ember.Object & { name: string; sayHello(): void }; const Person = Ember.Object.extend({ name: "", sayHello() { @@ -9,7 +9,7 @@ const Person = Ember.Object.extend({ }, }); -assertType(Person.reopen()); +assertType & { new(properties?: object | undefined): Person }>(Person.reopen()); assertType(Person.create().name); Person.create().sayHello(); // $ExpectType void diff --git a/types/ember__array/test/array.ts b/types/ember__array/test/array.ts index 053b0b2bb1fd12..3507df39322137 100755 --- a/types/ember__array/test/array.ts +++ b/types/ember__array/test/array.ts @@ -3,7 +3,7 @@ import MutableArray from "@ember/array/mutable"; import EmberObject from "@ember/object"; import { assertType } from "./lib/assert"; -type Person = typeof Person.prototype; +type Person = EmberObject & { name: string; isHappy: boolean }; const Person = EmberObject.extend({ name: "", isHappy: false, @@ -12,8 +12,8 @@ const Person = EmberObject.extend({ const people = A([Person.create({ name: "Yehuda", isHappy: true }), Person.create({ name: "Majd", isHappy: false })]); assertType(people.get("length")); -assertType(people.get("lastObject")); -assertType(people.get("firstObject")); +assertType(people.get("lastObject")); +assertType(people.get("firstObject")); assertType(people.isAny("isHappy")); assertType(people.isAny("isHappy", false)); // @ts-expect-error @@ -30,7 +30,7 @@ const persons5: Person[] = people.filter(person => person.get("name") === "Yehud const persons6: MutableArray = people.filter(person => person.get("name") === "Yehuda"); assertType(people.get("[]")); -assertType(people.get("[]").get("firstObject")); +assertType(people.get("[]").get("firstObject")); assertType(people.mapBy("isHappy")); assertType(people.mapBy("name.length")); diff --git a/types/ember__array/v3/test/array.ts b/types/ember__array/v3/test/array.ts index c209abbd664639..826415811087d3 100755 --- a/types/ember__array/v3/test/array.ts +++ b/types/ember__array/v3/test/array.ts @@ -3,7 +3,7 @@ import MutableArray from "@ember/array/mutable"; import EmberObject from "@ember/object"; import { assertType } from "./lib/assert"; -type Person = typeof Person.prototype; +type Person = EmberObject & { name: string; isHappy: boolean }; const Person = EmberObject.extend({ name: "", isHappy: false, @@ -12,8 +12,8 @@ const Person = EmberObject.extend({ const people = A([Person.create({ name: "Yehuda", isHappy: true }), Person.create({ name: "Majd", isHappy: false })]); assertType(people.get("length")); -assertType(people.get("lastObject")); -assertType(people.get("firstObject")); +assertType(people.get("lastObject")); +assertType(people.get("firstObject")); assertType(people.isAny("isHappy")); assertType(people.isAny("isHappy", "false")); @@ -25,7 +25,7 @@ const persons5: Person[] = people.filter(person => person.get("name") === "Yehud const persons6: MutableArray = people.filter(person => person.get("name") === "Yehuda"); assertType(people.get("[]")); -assertType(people.get("[]").get("firstObject")); // $ExpectType any +assertType(people.get("[]").get("firstObject")); // $ExpectType Person | undefined assertType(people.mapBy("isHappy")); // $ExpectType boolean[] assertType(people.mapBy("name.length")); diff --git a/types/ember__object/test/extend.ts b/types/ember__object/test/extend.ts index fd9cce57eb90a0..067eea2ed6437f 100644 --- a/types/ember__object/test/extend.ts +++ b/types/ember__object/test/extend.ts @@ -13,9 +13,6 @@ const Person = EmberObject.extend({ }, }); -assertType(Person.prototype.firstName); -assertType<() => string>(Person.prototype.getFullName); - const person = Person.create({ firstName: "Joe", lastName: "Blow", diff --git a/types/ember__object/test/reopen.ts b/types/ember__object/test/reopen.ts index 5e0d231ba86576..614c9ddd1af00e 100644 --- a/types/ember__object/test/reopen.ts +++ b/types/ember__object/test/reopen.ts @@ -2,7 +2,7 @@ import EmberObject from "@ember/object"; import Mixin from "@ember/object/mixin"; import { assertType } from "./lib/assert"; -type Person = typeof Person.prototype; +type Person = EmberObject & { name: string; sayHello(): void }; const Person = EmberObject.extend({ name: "", sayHello() { @@ -10,7 +10,7 @@ const Person = EmberObject.extend({ }, }); -assertType(Person.reopen()); +assertType & { new(properties?: object | undefined): Person }>(Person.reopen()); assertType(Person.create().name); // tslint:disable-next-line no-void-expression diff --git a/types/ember__object/v3/test/extend.ts b/types/ember__object/v3/test/extend.ts index 009e8853523335..77cd9a4592f0ad 100644 --- a/types/ember__object/v3/test/extend.ts +++ b/types/ember__object/v3/test/extend.ts @@ -13,9 +13,6 @@ const Person = EmberObject.extend({ }, }); -assertType(Person.prototype.firstName); -assertType<() => string>(Person.prototype.getFullName); - const person = Person.create({ firstName: "Joe", lastName: "Blow", diff --git a/types/ember__object/v3/test/reopen.ts b/types/ember__object/v3/test/reopen.ts index 5e0d231ba86576..614c9ddd1af00e 100644 --- a/types/ember__object/v3/test/reopen.ts +++ b/types/ember__object/v3/test/reopen.ts @@ -2,7 +2,7 @@ import EmberObject from "@ember/object"; import Mixin from "@ember/object/mixin"; import { assertType } from "./lib/assert"; -type Person = typeof Person.prototype; +type Person = EmberObject & { name: string; sayHello(): void }; const Person = EmberObject.extend({ name: "", sayHello() { @@ -10,7 +10,7 @@ const Person = EmberObject.extend({ }, }); -assertType(Person.reopen()); +assertType & { new(properties?: object | undefined): Person }>(Person.reopen()); assertType(Person.create().name); // tslint:disable-next-line no-void-expression From c7886159a167462165671d83a221bda18e27dcdd Mon Sep 17 00:00:00 2001 From: James Bromwell <943160+thw0rted@users.noreply.github.com> Date: Fri, 1 Dec 2023 20:43:15 +0100 Subject: [PATCH 003/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67341=20[n?= =?UTF-8?q?ode]=20Expose=20global=20ResponseInit;=20remove=20NodeJS.fetch?= =?UTF-8?q?=20namespace=20by=20@thw0rted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [node] Expose global ResponseInit; remove NodeJS.fetch namespace * [node] include global File for v20 only * Update types/node/test/globals.ts Remove trailing whitespace --------- Co-authored-by: Ryan Cavanaugh --- types/node/globals.d.ts | 689 ++++++++++++++------------- types/node/test/globals.ts | 9 +- types/node/ts4.8/globals.d.ts | 688 +++++++++++++------------- types/node/ts4.8/test/globals.ts | 9 +- types/node/v18/globals.d.ts | 680 +++++++++++++------------- types/node/v18/test/globals.ts | 6 +- types/node/v18/ts4.8/globals.d.ts | 680 +++++++++++++------------- types/node/v18/ts4.8/test/globals.ts | 6 +- 8 files changed, 1391 insertions(+), 1376 deletions(-) diff --git a/types/node/globals.d.ts b/types/node/globals.d.ts index 3a449e4c73abc0..418d06408d38e9 100644 --- a/types/node/globals.d.ts +++ b/types/node/globals.d.ts @@ -1,381 +1,386 @@ -// Declare "static" methods in Error -interface ErrorConstructor { - /** Create .stack property on a target object */ - captureStackTrace(targetObject: object, constructorOpt?: Function): void; +export {} // Make this a module + +// #region Fetch and friends +// Conditional type aliases, used at the end of this file. +// Will either be empty if lib-dom is included, or the undici version otherwise. +type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request; +type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response; +type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData; +type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers; +type _RequestInit = typeof globalThis extends { onmessage: any } ? {} + : import("undici-types").RequestInit; +type _ResponseInit = typeof globalThis extends { onmessage: any } ? {} + : import("undici-types").ResponseInit; +type _File = typeof globalThis extends { onmessage: any } ? {} : import("node:buffer").File; +// #endregion Fetch and friends + + +declare global { + // Declare "static" methods in Error + interface ErrorConstructor { + /** Create .stack property on a target object */ + captureStackTrace(targetObject: object, constructorOpt?: Function): void; - /** - * Optional override for formatting stack traces - * - * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces - */ - prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; - - stackTraceLimit: number; -} - -/*-----------------------------------------------* - * * - * GLOBAL * - * * - ------------------------------------------------*/ - -// For backwards compability -interface NodeRequire extends NodeJS.Require {} -interface RequireResolve extends NodeJS.RequireResolve {} -interface NodeModule extends NodeJS.Module {} - -declare var process: NodeJS.Process; -declare var console: Console; - -declare var __filename: string; -declare var __dirname: string; - -declare var require: NodeRequire; -declare var module: NodeModule; - -// Same as module.exports -declare var exports: any; - -/** - * Only available if `--expose-gc` is passed to the process. - */ -declare var gc: undefined | (() => void); + /** + * Optional override for formatting stack traces + * + * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces + */ + prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; -// #region borrowed -// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib -/** A controller object that allows you to abort one or more DOM requests as and when desired. */ -interface AbortController { - /** - * Returns the AbortSignal object associated with this object. - */ + stackTraceLimit: number; + } - readonly signal: AbortSignal; - /** - * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. - */ - abort(reason?: any): void; -} + /*-----------------------------------------------* + * * + * GLOBAL * + * * + ------------------------------------------------*/ -/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ -interface AbortSignal extends EventTarget { - /** - * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. - */ - readonly aborted: boolean; - readonly reason: any; - onabort: null | ((this: AbortSignal, event: Event) => any); - throwIfAborted(): void; -} + // For backwards compability + interface NodeRequire extends NodeJS.Require {} + interface RequireResolve extends NodeJS.RequireResolve {} + interface NodeModule extends NodeJS.Module {} -declare var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T - : { - prototype: AbortController; - new(): AbortController; - }; - -declare var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T - : { - prototype: AbortSignal; - new(): AbortSignal; - abort(reason?: any): AbortSignal; - timeout(milliseconds: number): AbortSignal; - }; -// #endregion borrowed - -// #region Disposable -interface SymbolConstructor { - /** - * A method that is used to release resources held by an object. Called by the semantics of the `using` statement. - */ - readonly dispose: unique symbol; + var process: NodeJS.Process; + var console: Console; - /** - * A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement. - */ - readonly asyncDispose: unique symbol; -} + var __filename: string; + var __dirname: string; -interface Disposable { - [Symbol.dispose](): void; -} + var require: NodeRequire; + var module: NodeModule; -interface AsyncDisposable { - [Symbol.asyncDispose](): PromiseLike; -} -// #endregion Disposable + // Same as module.exports + var exports: any; -// #region ArrayLike.at() -interface RelativeIndexable { /** - * Takes an integer value and returns the item at that index, - * allowing for positive and negative integers. - * Negative integers count back from the last item in the array. + * Only available if `--expose-gc` is passed to the process. */ - at(index: number): T | undefined; -} -interface String extends RelativeIndexable {} -interface Array extends RelativeIndexable {} -interface ReadonlyArray extends RelativeIndexable {} -interface Int8Array extends RelativeIndexable {} -interface Uint8Array extends RelativeIndexable {} -interface Uint8ClampedArray extends RelativeIndexable {} -interface Int16Array extends RelativeIndexable {} -interface Uint16Array extends RelativeIndexable {} -interface Int32Array extends RelativeIndexable {} -interface Uint32Array extends RelativeIndexable {} -interface Float32Array extends RelativeIndexable {} -interface Float64Array extends RelativeIndexable {} -interface BigInt64Array extends RelativeIndexable {} -interface BigUint64Array extends RelativeIndexable {} -// #endregion ArrayLike.at() end - -/** - * @since v17.0.0 - * - * Creates a deep clone of an object. - */ -declare function structuredClone( - value: T, - transfer?: { transfer: ReadonlyArray }, -): T; - -/*----------------------------------------------* -* * -* GLOBAL INTERFACES * -* * -*-----------------------------------------------*/ -declare namespace NodeJS { - interface CallSite { - /** - * Value of "this" - */ - getThis(): unknown; - - /** - * Type of "this" as a string. - * This is the name of the function stored in the constructor field of - * "this", if available. Otherwise the object's [[Class]] internal - * property. - */ - getTypeName(): string | null; - - /** - * Current function - */ - getFunction(): Function | undefined; + var gc: undefined | (() => void); + // #region borrowed + // from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib + /** A controller object that allows you to abort one or more DOM requests as and when desired. */ + interface AbortController { /** - * Name of the current function, typically its name property. - * If a name property is not available an attempt will be made to try - * to infer a name from the function's context. + * Returns the AbortSignal object associated with this object. */ - getFunctionName(): string | null; + readonly signal: AbortSignal; /** - * Name of the property [of "this" or one of its prototypes] that holds - * the current function + * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. */ - getMethodName(): string | null; - - /** - * Name of the script [if this function was defined in a script] - */ - getFileName(): string | undefined; - - /** - * Current line number [if this function was defined in a script] - */ - getLineNumber(): number | null; - - /** - * Current column number [if this function was defined in a script] - */ - getColumnNumber(): number | null; - - /** - * A call site object representing the location where eval was called - * [if this function was created using a call to eval] - */ - getEvalOrigin(): string | undefined; - - /** - * Is this a toplevel invocation, that is, is "this" the global object? - */ - isToplevel(): boolean; + abort(reason?: any): void; + } + /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ + interface AbortSignal extends EventTarget { /** - * Does this call take place in code defined by a call to eval? + * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. */ - isEval(): boolean; + readonly aborted: boolean; + readonly reason: any; + onabort: null | ((this: AbortSignal, event: Event) => any); + throwIfAborted(): void; + } + var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T + : { + prototype: AbortController; + new(): AbortController; + }; + + var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T + : { + prototype: AbortSignal; + new(): AbortSignal; + abort(reason?: any): AbortSignal; + timeout(milliseconds: number): AbortSignal; + }; + // #endregion borrowed + + // #region Disposable + interface SymbolConstructor { /** - * Is this call in native V8 code? + * A method that is used to release resources held by an object. Called by the semantics of the `using` statement. */ - isNative(): boolean; + readonly dispose: unique symbol; /** - * Is this a constructor call? + * A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement. */ - isConstructor(): boolean; + readonly asyncDispose: unique symbol; } - interface ErrnoException extends Error { - errno?: number | undefined; - code?: string | undefined; - path?: string | undefined; - syscall?: string | undefined; + interface Disposable { + [Symbol.dispose](): void; } - interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: BufferEncoding): this; - pause(): this; - resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean | undefined }): T; - unpipe(destination?: WritableStream): this; - unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; - wrap(oldStream: ReadableStream): this; - [Symbol.asyncIterator](): AsyncIterableIterator; + interface AsyncDisposable { + [Symbol.asyncDispose](): PromiseLike; } + // #endregion Disposable - interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; - write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; - end(cb?: () => void): this; - end(data: string | Uint8Array, cb?: () => void): this; - end(str: string, encoding?: BufferEncoding, cb?: () => void): this; - } - - interface ReadWriteStream extends ReadableStream, WritableStream {} - - interface RefCounted { - ref(): this; - unref(): this; - } - - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = TypedArray | DataView; - - interface Require { - (id: string): any; - resolve: RequireResolve; - cache: Dict; + // #region ArrayLike.at() + interface RelativeIndexable { /** - * @deprecated + * Takes an integer value and returns the item at that index, + * allowing for positive and negative integers. + * Negative integers count back from the last item in the array. */ - extensions: RequireExtensions; - main: Module | undefined; + at(index: number): T | undefined; } + interface String extends RelativeIndexable {} + interface Array extends RelativeIndexable {} + interface ReadonlyArray extends RelativeIndexable {} + interface Int8Array extends RelativeIndexable {} + interface Uint8Array extends RelativeIndexable {} + interface Uint8ClampedArray extends RelativeIndexable {} + interface Int16Array extends RelativeIndexable {} + interface Uint16Array extends RelativeIndexable {} + interface Int32Array extends RelativeIndexable {} + interface Uint32Array extends RelativeIndexable {} + interface Float32Array extends RelativeIndexable {} + interface Float64Array extends RelativeIndexable {} + interface BigInt64Array extends RelativeIndexable {} + interface BigUint64Array extends RelativeIndexable {} + // #endregion ArrayLike.at() end - interface RequireResolve { - (id: string, options?: { paths?: string[] | undefined }): string; - paths(request: string): string[] | null; - } - - interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { - ".js": (m: Module, filename: string) => any; - ".json": (m: Module, filename: string) => any; - ".node": (m: Module, filename: string) => any; - } - interface Module { - /** - * `true` if the module is running during the Node.js preload - */ - isPreloading: boolean; - exports: any; - require: Require; - id: string; - filename: string; - loaded: boolean; - /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ - parent: Module | null | undefined; - children: Module[]; - /** - * @since v11.14.0 - * - * The directory name of the module. This is usually the same as the path.dirname() of the module.id. - */ - path: string; - paths: string[]; - } - - interface Dict { - [key: string]: T | undefined; - } - - interface ReadOnlyDict { - readonly [key: string]: T | undefined; + /** + * @since v17.0.0 + * + * Creates a deep clone of an object. + */ + function structuredClone( + value: T, + transfer?: { transfer: ReadonlyArray }, + ): T; + + /*----------------------------------------------* + * * + * GLOBAL INTERFACES * + * * + *-----------------------------------------------*/ + namespace NodeJS { + interface CallSite { + /** + * Value of "this" + */ + getThis(): unknown; + + /** + * Type of "this" as a string. + * This is the name of the function stored in the constructor field of + * "this", if available. Otherwise the object's [[Class]] internal + * property. + */ + getTypeName(): string | null; + + /** + * Current function + */ + getFunction(): Function | undefined; + + /** + * Name of the current function, typically its name property. + * If a name property is not available an attempt will be made to try + * to infer a name from the function's context. + */ + getFunctionName(): string | null; + + /** + * Name of the property [of "this" or one of its prototypes] that holds + * the current function + */ + getMethodName(): string | null; + + /** + * Name of the script [if this function was defined in a script] + */ + getFileName(): string | undefined; + + /** + * Current line number [if this function was defined in a script] + */ + getLineNumber(): number | null; + + /** + * Current column number [if this function was defined in a script] + */ + getColumnNumber(): number | null; + + /** + * A call site object representing the location where eval was called + * [if this function was created using a call to eval] + */ + getEvalOrigin(): string | undefined; + + /** + * Is this a toplevel invocation, that is, is "this" the global object? + */ + isToplevel(): boolean; + + /** + * Does this call take place in code defined by a call to eval? + */ + isEval(): boolean; + + /** + * Is this call in native V8 code? + */ + isNative(): boolean; + + /** + * Is this a constructor call? + */ + isConstructor(): boolean; + } + + interface ErrnoException extends Error { + errno?: number | undefined; + code?: string | undefined; + path?: string | undefined; + syscall?: string | undefined; + } + + interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string | Buffer; + setEncoding(encoding: BufferEncoding): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean | undefined }): T; + unpipe(destination?: WritableStream): this; + unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; + wrap(oldStream: ReadableStream): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; + write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; + end(cb?: () => void): this; + end(data: string | Uint8Array, cb?: () => void): this; + end(str: string, encoding?: BufferEncoding, cb?: () => void): this; + } + + interface ReadWriteStream extends ReadableStream, WritableStream {} + + interface RefCounted { + ref(): this; + unref(): this; + } + + type TypedArray = + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | BigUint64Array + | BigInt64Array + | Float32Array + | Float64Array; + type ArrayBufferView = TypedArray | DataView; + + interface Require { + (id: string): any; + resolve: RequireResolve; + cache: Dict; + /** + * @deprecated + */ + extensions: RequireExtensions; + main: Module | undefined; + } + + interface RequireResolve { + (id: string, options?: { paths?: string[] | undefined }): string; + paths(request: string): string[] | null; + } + + interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { + ".js": (m: Module, filename: string) => any; + ".json": (m: Module, filename: string) => any; + ".node": (m: Module, filename: string) => any; + } + interface Module { + /** + * `true` if the module is running during the Node.js preload + */ + isPreloading: boolean; + exports: any; + require: Require; + id: string; + filename: string; + loaded: boolean; + /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ + parent: Module | null | undefined; + children: Module[]; + /** + * @since v11.14.0 + * + * The directory name of the module. This is usually the same as the path.dirname() of the module.id. + */ + path: string; + paths: string[]; + } + + interface Dict { + [key: string]: T | undefined; + } + + interface ReadOnlyDict { + readonly [key: string]: T | undefined; + } } - namespace fetch { - type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request; - type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response; - type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData; - type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers; - type _RequestInit = typeof globalThis extends { onmessage: any } ? {} - : import("undici-types").RequestInit; - type Request = globalThis.Request; - type Response = globalThis.Response; - type Headers = globalThis.Headers; - type FormData = globalThis.FormData; - type RequestInit = globalThis.RequestInit; - type RequestInfo = import("undici-types").RequestInfo; - type HeadersInit = import("undici-types").HeadersInit; - type BodyInit = import("undici-types").BodyInit; - type RequestRedirect = import("undici-types").RequestRedirect; - type RequestCredentials = import("undici-types").RequestCredentials; - type RequestMode = import("undici-types").RequestMode; - type ReferrerPolicy = import("undici-types").ReferrerPolicy; - type Dispatcher = import("undici-types").Dispatcher; - type RequestDuplex = import("undici-types").RequestDuplex; - } + interface RequestInit extends _RequestInit {} + + function fetch( + input: string | URL | globalThis.Request, + init?: RequestInit, + ): Promise; + + interface Request extends _Request {} + var Request: typeof globalThis extends { + onmessage: any; + Request: infer T; + } ? T + : typeof import("undici-types").Request; + + interface ResponseInit extends _ResponseInit {} + + interface Response extends _Response {} + var Response: typeof globalThis extends { + onmessage: any; + Response: infer T; + } ? T + : typeof import("undici-types").Response; + + interface FormData extends _FormData {} + var FormData: typeof globalThis extends { + onmessage: any; + FormData: infer T; + } ? T + : typeof import("undici-types").FormData; + + interface Headers extends _Headers {} + var Headers: typeof globalThis extends { + onmessage: any; + Headers: infer T; + } ? T + : typeof import("undici-types").Headers; + + interface File extends _File{} + var File: typeof globalThis extends { + onmessage: any; + File: infer T; + } ? T + : typeof import("node:buffer").File; } - -interface RequestInit extends NodeJS.fetch._RequestInit {} - -declare function fetch( - input: NodeJS.fetch.RequestInfo, - init?: RequestInit, -): Promise; - -interface Request extends NodeJS.fetch._Request {} -declare var Request: typeof globalThis extends { - onmessage: any; - Request: infer T; -} ? T - : typeof import("undici-types").Request; - -interface Response extends NodeJS.fetch._Response {} -declare var Response: typeof globalThis extends { - onmessage: any; - Response: infer T; -} ? T - : typeof import("undici-types").Response; - -interface FormData extends NodeJS.fetch._FormData {} -declare var FormData: typeof globalThis extends { - onmessage: any; - FormData: infer T; -} ? T - : typeof import("undici-types").FormData; - -interface Headers extends NodeJS.fetch._Headers {} -declare var Headers: typeof globalThis extends { - onmessage: any; - Headers: infer T; -} ? T - : typeof import("undici-types").Headers; diff --git a/types/node/test/globals.ts b/types/node/test/globals.ts index b8412801346e5c..87e7912f8d1444 100644 --- a/types/node/test/globals.ts +++ b/types/node/test/globals.ts @@ -80,6 +80,11 @@ declare var RANDOM_GLOBAL_VARIABLE: true; dispatcher: undefined, }); - // @ts-expect-error - NodeJS.fetch; + const reqinit: RequestInit = {}; + reqinit.method; // $ExpectType string | undefined + const resinit: ResponseInit = {}; + resinit.status; // $ExpectType number | undefined + + const f: File = {} as any; + f.name; // $ExpectType string } diff --git a/types/node/ts4.8/globals.d.ts b/types/node/ts4.8/globals.d.ts index 3a449e4c73abc0..d7feff13e2ed16 100644 --- a/types/node/ts4.8/globals.d.ts +++ b/types/node/ts4.8/globals.d.ts @@ -1,381 +1,385 @@ -// Declare "static" methods in Error -interface ErrorConstructor { - /** Create .stack property on a target object */ - captureStackTrace(targetObject: object, constructorOpt?: Function): void; +export {} // Make this a module + +// #region Fetch and friends +// Conditional type aliases, used at the end of this file. +// Will either be empty if lib-dom is included, or the undici version otherwise. +type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request; +type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response; +type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData; +type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers; +type _RequestInit = typeof globalThis extends { onmessage: any } ? {} + : import("undici-types").RequestInit; +type _ResponseInit = typeof globalThis extends { onmessage: any } ? {} + : import("undici-types").ResponseInit; +type _File = typeof globalThis extends { onmessage: any } ? {} : import("node:buffer").File; +// #endregion Fetch and friends + +declare global { + // Declare "static" methods in Error + interface ErrorConstructor { + /** Create .stack property on a target object */ + captureStackTrace(targetObject: object, constructorOpt?: Function): void; - /** - * Optional override for formatting stack traces - * - * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces - */ - prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; - - stackTraceLimit: number; -} - -/*-----------------------------------------------* - * * - * GLOBAL * - * * - ------------------------------------------------*/ - -// For backwards compability -interface NodeRequire extends NodeJS.Require {} -interface RequireResolve extends NodeJS.RequireResolve {} -interface NodeModule extends NodeJS.Module {} - -declare var process: NodeJS.Process; -declare var console: Console; - -declare var __filename: string; -declare var __dirname: string; - -declare var require: NodeRequire; -declare var module: NodeModule; - -// Same as module.exports -declare var exports: any; - -/** - * Only available if `--expose-gc` is passed to the process. - */ -declare var gc: undefined | (() => void); + /** + * Optional override for formatting stack traces + * + * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces + */ + prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; -// #region borrowed -// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib -/** A controller object that allows you to abort one or more DOM requests as and when desired. */ -interface AbortController { - /** - * Returns the AbortSignal object associated with this object. - */ + stackTraceLimit: number; + } - readonly signal: AbortSignal; - /** - * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. - */ - abort(reason?: any): void; -} + /*-----------------------------------------------* + * * + * GLOBAL * + * * + ------------------------------------------------*/ -/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ -interface AbortSignal extends EventTarget { - /** - * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. - */ - readonly aborted: boolean; - readonly reason: any; - onabort: null | ((this: AbortSignal, event: Event) => any); - throwIfAborted(): void; -} + // For backwards compability + interface NodeRequire extends NodeJS.Require {} + interface RequireResolve extends NodeJS.RequireResolve {} + interface NodeModule extends NodeJS.Module {} -declare var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T - : { - prototype: AbortController; - new(): AbortController; - }; - -declare var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T - : { - prototype: AbortSignal; - new(): AbortSignal; - abort(reason?: any): AbortSignal; - timeout(milliseconds: number): AbortSignal; - }; -// #endregion borrowed - -// #region Disposable -interface SymbolConstructor { - /** - * A method that is used to release resources held by an object. Called by the semantics of the `using` statement. - */ - readonly dispose: unique symbol; + var process: NodeJS.Process; + var console: Console; - /** - * A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement. - */ - readonly asyncDispose: unique symbol; -} + var __filename: string; + var __dirname: string; -interface Disposable { - [Symbol.dispose](): void; -} + var require: NodeRequire; + var module: NodeModule; -interface AsyncDisposable { - [Symbol.asyncDispose](): PromiseLike; -} -// #endregion Disposable + // Same as module.exports + var exports: any; -// #region ArrayLike.at() -interface RelativeIndexable { /** - * Takes an integer value and returns the item at that index, - * allowing for positive and negative integers. - * Negative integers count back from the last item in the array. + * Only available if `--expose-gc` is passed to the process. */ - at(index: number): T | undefined; -} -interface String extends RelativeIndexable {} -interface Array extends RelativeIndexable {} -interface ReadonlyArray extends RelativeIndexable {} -interface Int8Array extends RelativeIndexable {} -interface Uint8Array extends RelativeIndexable {} -interface Uint8ClampedArray extends RelativeIndexable {} -interface Int16Array extends RelativeIndexable {} -interface Uint16Array extends RelativeIndexable {} -interface Int32Array extends RelativeIndexable {} -interface Uint32Array extends RelativeIndexable {} -interface Float32Array extends RelativeIndexable {} -interface Float64Array extends RelativeIndexable {} -interface BigInt64Array extends RelativeIndexable {} -interface BigUint64Array extends RelativeIndexable {} -// #endregion ArrayLike.at() end - -/** - * @since v17.0.0 - * - * Creates a deep clone of an object. - */ -declare function structuredClone( - value: T, - transfer?: { transfer: ReadonlyArray }, -): T; - -/*----------------------------------------------* -* * -* GLOBAL INTERFACES * -* * -*-----------------------------------------------*/ -declare namespace NodeJS { - interface CallSite { - /** - * Value of "this" - */ - getThis(): unknown; - - /** - * Type of "this" as a string. - * This is the name of the function stored in the constructor field of - * "this", if available. Otherwise the object's [[Class]] internal - * property. - */ - getTypeName(): string | null; - - /** - * Current function - */ - getFunction(): Function | undefined; + var gc: undefined | (() => void); + // #region borrowed + // from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib + /** A controller object that allows you to abort one or more DOM requests as and when desired. */ + interface AbortController { /** - * Name of the current function, typically its name property. - * If a name property is not available an attempt will be made to try - * to infer a name from the function's context. + * Returns the AbortSignal object associated with this object. */ - getFunctionName(): string | null; + readonly signal: AbortSignal; /** - * Name of the property [of "this" or one of its prototypes] that holds - * the current function + * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. */ - getMethodName(): string | null; - - /** - * Name of the script [if this function was defined in a script] - */ - getFileName(): string | undefined; - - /** - * Current line number [if this function was defined in a script] - */ - getLineNumber(): number | null; - - /** - * Current column number [if this function was defined in a script] - */ - getColumnNumber(): number | null; - - /** - * A call site object representing the location where eval was called - * [if this function was created using a call to eval] - */ - getEvalOrigin(): string | undefined; - - /** - * Is this a toplevel invocation, that is, is "this" the global object? - */ - isToplevel(): boolean; + abort(reason?: any): void; + } + /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ + interface AbortSignal extends EventTarget { /** - * Does this call take place in code defined by a call to eval? + * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. */ - isEval(): boolean; + readonly aborted: boolean; + readonly reason: any; + onabort: null | ((this: AbortSignal, event: Event) => any); + throwIfAborted(): void; + } + var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T + : { + prototype: AbortController; + new(): AbortController; + }; + + var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T + : { + prototype: AbortSignal; + new(): AbortSignal; + abort(reason?: any): AbortSignal; + timeout(milliseconds: number): AbortSignal; + }; + // #endregion borrowed + + // #region Disposable + interface SymbolConstructor { /** - * Is this call in native V8 code? + * A method that is used to release resources held by an object. Called by the semantics of the `using` statement. */ - isNative(): boolean; + readonly dispose: unique symbol; /** - * Is this a constructor call? + * A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement. */ - isConstructor(): boolean; + readonly asyncDispose: unique symbol; } - interface ErrnoException extends Error { - errno?: number | undefined; - code?: string | undefined; - path?: string | undefined; - syscall?: string | undefined; + interface Disposable { + [Symbol.dispose](): void; } - interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: BufferEncoding): this; - pause(): this; - resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean | undefined }): T; - unpipe(destination?: WritableStream): this; - unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; - wrap(oldStream: ReadableStream): this; - [Symbol.asyncIterator](): AsyncIterableIterator; + interface AsyncDisposable { + [Symbol.asyncDispose](): PromiseLike; } + // #endregion Disposable - interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; - write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; - end(cb?: () => void): this; - end(data: string | Uint8Array, cb?: () => void): this; - end(str: string, encoding?: BufferEncoding, cb?: () => void): this; - } - - interface ReadWriteStream extends ReadableStream, WritableStream {} - - interface RefCounted { - ref(): this; - unref(): this; - } - - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = TypedArray | DataView; - - interface Require { - (id: string): any; - resolve: RequireResolve; - cache: Dict; + // #region ArrayLike.at() + interface RelativeIndexable { /** - * @deprecated + * Takes an integer value and returns the item at that index, + * allowing for positive and negative integers. + * Negative integers count back from the last item in the array. */ - extensions: RequireExtensions; - main: Module | undefined; + at(index: number): T | undefined; } + interface String extends RelativeIndexable {} + interface Array extends RelativeIndexable {} + interface ReadonlyArray extends RelativeIndexable {} + interface Int8Array extends RelativeIndexable {} + interface Uint8Array extends RelativeIndexable {} + interface Uint8ClampedArray extends RelativeIndexable {} + interface Int16Array extends RelativeIndexable {} + interface Uint16Array extends RelativeIndexable {} + interface Int32Array extends RelativeIndexable {} + interface Uint32Array extends RelativeIndexable {} + interface Float32Array extends RelativeIndexable {} + interface Float64Array extends RelativeIndexable {} + interface BigInt64Array extends RelativeIndexable {} + interface BigUint64Array extends RelativeIndexable {} + // #endregion ArrayLike.at() end - interface RequireResolve { - (id: string, options?: { paths?: string[] | undefined }): string; - paths(request: string): string[] | null; - } - - interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { - ".js": (m: Module, filename: string) => any; - ".json": (m: Module, filename: string) => any; - ".node": (m: Module, filename: string) => any; - } - interface Module { - /** - * `true` if the module is running during the Node.js preload - */ - isPreloading: boolean; - exports: any; - require: Require; - id: string; - filename: string; - loaded: boolean; - /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ - parent: Module | null | undefined; - children: Module[]; - /** - * @since v11.14.0 - * - * The directory name of the module. This is usually the same as the path.dirname() of the module.id. - */ - path: string; - paths: string[]; - } - - interface Dict { - [key: string]: T | undefined; - } - - interface ReadOnlyDict { - readonly [key: string]: T | undefined; + /** + * @since v17.0.0 + * + * Creates a deep clone of an object. + */ + function structuredClone( + value: T, + transfer?: { transfer: ReadonlyArray }, + ): T; + + /*----------------------------------------------* + * * + * GLOBAL INTERFACES * + * * + *-----------------------------------------------*/ + namespace NodeJS { + interface CallSite { + /** + * Value of "this" + */ + getThis(): unknown; + + /** + * Type of "this" as a string. + * This is the name of the function stored in the constructor field of + * "this", if available. Otherwise the object's [[Class]] internal + * property. + */ + getTypeName(): string | null; + + /** + * Current function + */ + getFunction(): Function | undefined; + + /** + * Name of the current function, typically its name property. + * If a name property is not available an attempt will be made to try + * to infer a name from the function's context. + */ + getFunctionName(): string | null; + + /** + * Name of the property [of "this" or one of its prototypes] that holds + * the current function + */ + getMethodName(): string | null; + + /** + * Name of the script [if this function was defined in a script] + */ + getFileName(): string | undefined; + + /** + * Current line number [if this function was defined in a script] + */ + getLineNumber(): number | null; + + /** + * Current column number [if this function was defined in a script] + */ + getColumnNumber(): number | null; + + /** + * A call site object representing the location where eval was called + * [if this function was created using a call to eval] + */ + getEvalOrigin(): string | undefined; + + /** + * Is this a toplevel invocation, that is, is "this" the global object? + */ + isToplevel(): boolean; + + /** + * Does this call take place in code defined by a call to eval? + */ + isEval(): boolean; + + /** + * Is this call in native V8 code? + */ + isNative(): boolean; + + /** + * Is this a constructor call? + */ + isConstructor(): boolean; + } + + interface ErrnoException extends Error { + errno?: number | undefined; + code?: string | undefined; + path?: string | undefined; + syscall?: string | undefined; + } + + interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string | Buffer; + setEncoding(encoding: BufferEncoding): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean | undefined }): T; + unpipe(destination?: WritableStream): this; + unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; + wrap(oldStream: ReadableStream): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; + write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; + end(cb?: () => void): this; + end(data: string | Uint8Array, cb?: () => void): this; + end(str: string, encoding?: BufferEncoding, cb?: () => void): this; + } + + interface ReadWriteStream extends ReadableStream, WritableStream {} + + interface RefCounted { + ref(): this; + unref(): this; + } + + type TypedArray = + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | BigUint64Array + | BigInt64Array + | Float32Array + | Float64Array; + type ArrayBufferView = TypedArray | DataView; + + interface Require { + (id: string): any; + resolve: RequireResolve; + cache: Dict; + /** + * @deprecated + */ + extensions: RequireExtensions; + main: Module | undefined; + } + + interface RequireResolve { + (id: string, options?: { paths?: string[] | undefined }): string; + paths(request: string): string[] | null; + } + + interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { + ".js": (m: Module, filename: string) => any; + ".json": (m: Module, filename: string) => any; + ".node": (m: Module, filename: string) => any; + } + interface Module { + /** + * `true` if the module is running during the Node.js preload + */ + isPreloading: boolean; + exports: any; + require: Require; + id: string; + filename: string; + loaded: boolean; + /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ + parent: Module | null | undefined; + children: Module[]; + /** + * @since v11.14.0 + * + * The directory name of the module. This is usually the same as the path.dirname() of the module.id. + */ + path: string; + paths: string[]; + } + + interface Dict { + [key: string]: T | undefined; + } + + interface ReadOnlyDict { + readonly [key: string]: T | undefined; + } } - namespace fetch { - type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request; - type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response; - type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData; - type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers; - type _RequestInit = typeof globalThis extends { onmessage: any } ? {} - : import("undici-types").RequestInit; - type Request = globalThis.Request; - type Response = globalThis.Response; - type Headers = globalThis.Headers; - type FormData = globalThis.FormData; - type RequestInit = globalThis.RequestInit; - type RequestInfo = import("undici-types").RequestInfo; - type HeadersInit = import("undici-types").HeadersInit; - type BodyInit = import("undici-types").BodyInit; - type RequestRedirect = import("undici-types").RequestRedirect; - type RequestCredentials = import("undici-types").RequestCredentials; - type RequestMode = import("undici-types").RequestMode; - type ReferrerPolicy = import("undici-types").ReferrerPolicy; - type Dispatcher = import("undici-types").Dispatcher; - type RequestDuplex = import("undici-types").RequestDuplex; - } + interface RequestInit extends _RequestInit {} + + function fetch( + input: string | URL | globalThis.Request, + init?: RequestInit, + ): Promise; + + interface Request extends _Request {} + var Request: typeof globalThis extends { + onmessage: any; + Request: infer T; + } ? T + : typeof import("undici-types").Request; + + interface ResponseInit extends _ResponseInit {} + + interface Response extends _Response {} + var Response: typeof globalThis extends { + onmessage: any; + Response: infer T; + } ? T + : typeof import("undici-types").Response; + + interface FormData extends _FormData {} + var FormData: typeof globalThis extends { + onmessage: any; + FormData: infer T; + } ? T + : typeof import("undici-types").FormData; + + interface Headers extends _Headers {} + var Headers: typeof globalThis extends { + onmessage: any; + Headers: infer T; + } ? T + : typeof import("undici-types").Headers; + + interface File extends _File{} + var File: typeof globalThis extends { + onmessage: any; + File: infer T; + } ? T + : typeof import("node:buffer").File; } - -interface RequestInit extends NodeJS.fetch._RequestInit {} - -declare function fetch( - input: NodeJS.fetch.RequestInfo, - init?: RequestInit, -): Promise; - -interface Request extends NodeJS.fetch._Request {} -declare var Request: typeof globalThis extends { - onmessage: any; - Request: infer T; -} ? T - : typeof import("undici-types").Request; - -interface Response extends NodeJS.fetch._Response {} -declare var Response: typeof globalThis extends { - onmessage: any; - Response: infer T; -} ? T - : typeof import("undici-types").Response; - -interface FormData extends NodeJS.fetch._FormData {} -declare var FormData: typeof globalThis extends { - onmessage: any; - FormData: infer T; -} ? T - : typeof import("undici-types").FormData; - -interface Headers extends NodeJS.fetch._Headers {} -declare var Headers: typeof globalThis extends { - onmessage: any; - Headers: infer T; -} ? T - : typeof import("undici-types").Headers; diff --git a/types/node/ts4.8/test/globals.ts b/types/node/ts4.8/test/globals.ts index 5e4e48465b7211..66790b881c3cd5 100644 --- a/types/node/ts4.8/test/globals.ts +++ b/types/node/ts4.8/test/globals.ts @@ -62,6 +62,11 @@ declare var RANDOM_GLOBAL_VARIABLE: true; dispatcher: undefined, }); - // @ts-expect-error - NodeJS.fetch; + const reqinit: RequestInit = {}; + reqinit.method; // $ExpectType string | undefined + const resinit: ResponseInit = {}; + resinit.status; // $ExpectType number | undefined + + const f: File = {} as any; + f.name; // $ExpectType string } diff --git a/types/node/v18/globals.d.ts b/types/node/v18/globals.d.ts index 3a449e4c73abc0..71cf5497036103 100644 --- a/types/node/v18/globals.d.ts +++ b/types/node/v18/globals.d.ts @@ -1,381 +1,377 @@ -// Declare "static" methods in Error -interface ErrorConstructor { - /** Create .stack property on a target object */ - captureStackTrace(targetObject: object, constructorOpt?: Function): void; +export {} // Make this a module + +// #region Fetch and friends +// Conditional type aliases, used at the end of this file. +// Will either be empty if lib-dom is included, or the undici version otherwise. +type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request; +type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response; +type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData; +type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers; +type _RequestInit = typeof globalThis extends { onmessage: any } ? {} + : import("undici-types").RequestInit; +type _ResponseInit = typeof globalThis extends { onmessage: any } ? {} + : import("undici-types").ResponseInit; +// #endregion Fetch and friends + +declare global { + // Declare "static" methods in Error + interface ErrorConstructor { + /** Create .stack property on a target object */ + captureStackTrace(targetObject: object, constructorOpt?: Function): void; - /** - * Optional override for formatting stack traces - * - * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces - */ - prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; - - stackTraceLimit: number; -} - -/*-----------------------------------------------* - * * - * GLOBAL * - * * - ------------------------------------------------*/ - -// For backwards compability -interface NodeRequire extends NodeJS.Require {} -interface RequireResolve extends NodeJS.RequireResolve {} -interface NodeModule extends NodeJS.Module {} - -declare var process: NodeJS.Process; -declare var console: Console; - -declare var __filename: string; -declare var __dirname: string; - -declare var require: NodeRequire; -declare var module: NodeModule; - -// Same as module.exports -declare var exports: any; - -/** - * Only available if `--expose-gc` is passed to the process. - */ -declare var gc: undefined | (() => void); + /** + * Optional override for formatting stack traces + * + * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces + */ + prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; -// #region borrowed -// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib -/** A controller object that allows you to abort one or more DOM requests as and when desired. */ -interface AbortController { - /** - * Returns the AbortSignal object associated with this object. - */ + stackTraceLimit: number; + } - readonly signal: AbortSignal; - /** - * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. - */ - abort(reason?: any): void; -} + /*-----------------------------------------------* + * * + * GLOBAL * + * * + ------------------------------------------------*/ -/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ -interface AbortSignal extends EventTarget { - /** - * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. - */ - readonly aborted: boolean; - readonly reason: any; - onabort: null | ((this: AbortSignal, event: Event) => any); - throwIfAborted(): void; -} + // For backwards compability + interface NodeRequire extends NodeJS.Require {} + interface RequireResolve extends NodeJS.RequireResolve {} + interface NodeModule extends NodeJS.Module {} -declare var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T - : { - prototype: AbortController; - new(): AbortController; - }; - -declare var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T - : { - prototype: AbortSignal; - new(): AbortSignal; - abort(reason?: any): AbortSignal; - timeout(milliseconds: number): AbortSignal; - }; -// #endregion borrowed - -// #region Disposable -interface SymbolConstructor { - /** - * A method that is used to release resources held by an object. Called by the semantics of the `using` statement. - */ - readonly dispose: unique symbol; + var process: NodeJS.Process; + var console: Console; - /** - * A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement. - */ - readonly asyncDispose: unique symbol; -} + var __filename: string; + var __dirname: string; -interface Disposable { - [Symbol.dispose](): void; -} + var require: NodeRequire; + var module: NodeModule; -interface AsyncDisposable { - [Symbol.asyncDispose](): PromiseLike; -} -// #endregion Disposable + // Same as module.exports + var exports: any; -// #region ArrayLike.at() -interface RelativeIndexable { /** - * Takes an integer value and returns the item at that index, - * allowing for positive and negative integers. - * Negative integers count back from the last item in the array. + * Only available if `--expose-gc` is passed to the process. */ - at(index: number): T | undefined; -} -interface String extends RelativeIndexable {} -interface Array extends RelativeIndexable {} -interface ReadonlyArray extends RelativeIndexable {} -interface Int8Array extends RelativeIndexable {} -interface Uint8Array extends RelativeIndexable {} -interface Uint8ClampedArray extends RelativeIndexable {} -interface Int16Array extends RelativeIndexable {} -interface Uint16Array extends RelativeIndexable {} -interface Int32Array extends RelativeIndexable {} -interface Uint32Array extends RelativeIndexable {} -interface Float32Array extends RelativeIndexable {} -interface Float64Array extends RelativeIndexable {} -interface BigInt64Array extends RelativeIndexable {} -interface BigUint64Array extends RelativeIndexable {} -// #endregion ArrayLike.at() end - -/** - * @since v17.0.0 - * - * Creates a deep clone of an object. - */ -declare function structuredClone( - value: T, - transfer?: { transfer: ReadonlyArray }, -): T; - -/*----------------------------------------------* -* * -* GLOBAL INTERFACES * -* * -*-----------------------------------------------*/ -declare namespace NodeJS { - interface CallSite { - /** - * Value of "this" - */ - getThis(): unknown; - - /** - * Type of "this" as a string. - * This is the name of the function stored in the constructor field of - * "this", if available. Otherwise the object's [[Class]] internal - * property. - */ - getTypeName(): string | null; - - /** - * Current function - */ - getFunction(): Function | undefined; + var gc: undefined | (() => void); + // #region borrowed + // from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib + /** A controller object that allows you to abort one or more DOM requests as and when desired. */ + interface AbortController { /** - * Name of the current function, typically its name property. - * If a name property is not available an attempt will be made to try - * to infer a name from the function's context. + * Returns the AbortSignal object associated with this object. */ - getFunctionName(): string | null; + readonly signal: AbortSignal; /** - * Name of the property [of "this" or one of its prototypes] that holds - * the current function + * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. */ - getMethodName(): string | null; - - /** - * Name of the script [if this function was defined in a script] - */ - getFileName(): string | undefined; - - /** - * Current line number [if this function was defined in a script] - */ - getLineNumber(): number | null; - - /** - * Current column number [if this function was defined in a script] - */ - getColumnNumber(): number | null; - - /** - * A call site object representing the location where eval was called - * [if this function was created using a call to eval] - */ - getEvalOrigin(): string | undefined; - - /** - * Is this a toplevel invocation, that is, is "this" the global object? - */ - isToplevel(): boolean; + abort(reason?: any): void; + } + /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ + interface AbortSignal extends EventTarget { /** - * Does this call take place in code defined by a call to eval? + * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. */ - isEval(): boolean; + readonly aborted: boolean; + readonly reason: any; + onabort: null | ((this: AbortSignal, event: Event) => any); + throwIfAborted(): void; + } + var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T + : { + prototype: AbortController; + new(): AbortController; + }; + + var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T + : { + prototype: AbortSignal; + new(): AbortSignal; + abort(reason?: any): AbortSignal; + timeout(milliseconds: number): AbortSignal; + }; + // #endregion borrowed + + // #region Disposable + interface SymbolConstructor { /** - * Is this call in native V8 code? + * A method that is used to release resources held by an object. Called by the semantics of the `using` statement. */ - isNative(): boolean; + readonly dispose: unique symbol; /** - * Is this a constructor call? + * A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement. */ - isConstructor(): boolean; + readonly asyncDispose: unique symbol; } - interface ErrnoException extends Error { - errno?: number | undefined; - code?: string | undefined; - path?: string | undefined; - syscall?: string | undefined; + interface Disposable { + [Symbol.dispose](): void; } - interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: BufferEncoding): this; - pause(): this; - resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean | undefined }): T; - unpipe(destination?: WritableStream): this; - unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; - wrap(oldStream: ReadableStream): this; - [Symbol.asyncIterator](): AsyncIterableIterator; + interface AsyncDisposable { + [Symbol.asyncDispose](): PromiseLike; } + // #endregion Disposable - interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; - write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; - end(cb?: () => void): this; - end(data: string | Uint8Array, cb?: () => void): this; - end(str: string, encoding?: BufferEncoding, cb?: () => void): this; - } - - interface ReadWriteStream extends ReadableStream, WritableStream {} - - interface RefCounted { - ref(): this; - unref(): this; - } - - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = TypedArray | DataView; - - interface Require { - (id: string): any; - resolve: RequireResolve; - cache: Dict; + // #region ArrayLike.at() + interface RelativeIndexable { /** - * @deprecated + * Takes an integer value and returns the item at that index, + * allowing for positive and negative integers. + * Negative integers count back from the last item in the array. */ - extensions: RequireExtensions; - main: Module | undefined; + at(index: number): T | undefined; } + interface String extends RelativeIndexable {} + interface Array extends RelativeIndexable {} + interface ReadonlyArray extends RelativeIndexable {} + interface Int8Array extends RelativeIndexable {} + interface Uint8Array extends RelativeIndexable {} + interface Uint8ClampedArray extends RelativeIndexable {} + interface Int16Array extends RelativeIndexable {} + interface Uint16Array extends RelativeIndexable {} + interface Int32Array extends RelativeIndexable {} + interface Uint32Array extends RelativeIndexable {} + interface Float32Array extends RelativeIndexable {} + interface Float64Array extends RelativeIndexable {} + interface BigInt64Array extends RelativeIndexable {} + interface BigUint64Array extends RelativeIndexable {} + // #endregion ArrayLike.at() end - interface RequireResolve { - (id: string, options?: { paths?: string[] | undefined }): string; - paths(request: string): string[] | null; - } - - interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { - ".js": (m: Module, filename: string) => any; - ".json": (m: Module, filename: string) => any; - ".node": (m: Module, filename: string) => any; - } - interface Module { - /** - * `true` if the module is running during the Node.js preload - */ - isPreloading: boolean; - exports: any; - require: Require; - id: string; - filename: string; - loaded: boolean; - /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ - parent: Module | null | undefined; - children: Module[]; - /** - * @since v11.14.0 - * - * The directory name of the module. This is usually the same as the path.dirname() of the module.id. - */ - path: string; - paths: string[]; - } - - interface Dict { - [key: string]: T | undefined; - } - - interface ReadOnlyDict { - readonly [key: string]: T | undefined; + /** + * @since v17.0.0 + * + * Creates a deep clone of an object. + */ + function structuredClone( + value: T, + transfer?: { transfer: ReadonlyArray }, + ): T; + + /*----------------------------------------------* + * * + * GLOBAL INTERFACES * + * * + *-----------------------------------------------*/ + namespace NodeJS { + interface CallSite { + /** + * Value of "this" + */ + getThis(): unknown; + + /** + * Type of "this" as a string. + * This is the name of the function stored in the constructor field of + * "this", if available. Otherwise the object's [[Class]] internal + * property. + */ + getTypeName(): string | null; + + /** + * Current function + */ + getFunction(): Function | undefined; + + /** + * Name of the current function, typically its name property. + * If a name property is not available an attempt will be made to try + * to infer a name from the function's context. + */ + getFunctionName(): string | null; + + /** + * Name of the property [of "this" or one of its prototypes] that holds + * the current function + */ + getMethodName(): string | null; + + /** + * Name of the script [if this function was defined in a script] + */ + getFileName(): string | undefined; + + /** + * Current line number [if this function was defined in a script] + */ + getLineNumber(): number | null; + + /** + * Current column number [if this function was defined in a script] + */ + getColumnNumber(): number | null; + + /** + * A call site object representing the location where eval was called + * [if this function was created using a call to eval] + */ + getEvalOrigin(): string | undefined; + + /** + * Is this a toplevel invocation, that is, is "this" the global object? + */ + isToplevel(): boolean; + + /** + * Does this call take place in code defined by a call to eval? + */ + isEval(): boolean; + + /** + * Is this call in native V8 code? + */ + isNative(): boolean; + + /** + * Is this a constructor call? + */ + isConstructor(): boolean; + } + + interface ErrnoException extends Error { + errno?: number | undefined; + code?: string | undefined; + path?: string | undefined; + syscall?: string | undefined; + } + + interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string | Buffer; + setEncoding(encoding: BufferEncoding): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean | undefined }): T; + unpipe(destination?: WritableStream): this; + unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; + wrap(oldStream: ReadableStream): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; + write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; + end(cb?: () => void): this; + end(data: string | Uint8Array, cb?: () => void): this; + end(str: string, encoding?: BufferEncoding, cb?: () => void): this; + } + + interface ReadWriteStream extends ReadableStream, WritableStream {} + + interface RefCounted { + ref(): this; + unref(): this; + } + + type TypedArray = + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | BigUint64Array + | BigInt64Array + | Float32Array + | Float64Array; + type ArrayBufferView = TypedArray | DataView; + + interface Require { + (id: string): any; + resolve: RequireResolve; + cache: Dict; + /** + * @deprecated + */ + extensions: RequireExtensions; + main: Module | undefined; + } + + interface RequireResolve { + (id: string, options?: { paths?: string[] | undefined }): string; + paths(request: string): string[] | null; + } + + interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { + ".js": (m: Module, filename: string) => any; + ".json": (m: Module, filename: string) => any; + ".node": (m: Module, filename: string) => any; + } + interface Module { + /** + * `true` if the module is running during the Node.js preload + */ + isPreloading: boolean; + exports: any; + require: Require; + id: string; + filename: string; + loaded: boolean; + /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ + parent: Module | null | undefined; + children: Module[]; + /** + * @since v11.14.0 + * + * The directory name of the module. This is usually the same as the path.dirname() of the module.id. + */ + path: string; + paths: string[]; + } + + interface Dict { + [key: string]: T | undefined; + } + + interface ReadOnlyDict { + readonly [key: string]: T | undefined; + } } - namespace fetch { - type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request; - type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response; - type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData; - type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers; - type _RequestInit = typeof globalThis extends { onmessage: any } ? {} - : import("undici-types").RequestInit; - type Request = globalThis.Request; - type Response = globalThis.Response; - type Headers = globalThis.Headers; - type FormData = globalThis.FormData; - type RequestInit = globalThis.RequestInit; - type RequestInfo = import("undici-types").RequestInfo; - type HeadersInit = import("undici-types").HeadersInit; - type BodyInit = import("undici-types").BodyInit; - type RequestRedirect = import("undici-types").RequestRedirect; - type RequestCredentials = import("undici-types").RequestCredentials; - type RequestMode = import("undici-types").RequestMode; - type ReferrerPolicy = import("undici-types").ReferrerPolicy; - type Dispatcher = import("undici-types").Dispatcher; - type RequestDuplex = import("undici-types").RequestDuplex; - } + interface RequestInit extends _RequestInit {} + + function fetch( + input: string | URL | Request, + init?: RequestInit, + ): Promise; + + interface Request extends _Request {} + var Request: typeof globalThis extends { + onmessage: any; + Request: infer T; + } ? T + : typeof import("undici-types").Request; + + interface ResponseInit extends _ResponseInit {} + + interface Response extends _Response {} + var Response: typeof globalThis extends { + onmessage: any; + Response: infer T; + } ? T + : typeof import("undici-types").Response; + + interface FormData extends _FormData {} + var FormData: typeof globalThis extends { + onmessage: any; + FormData: infer T; + } ? T + : typeof import("undici-types").FormData; + + interface Headers extends _Headers {} + var Headers: typeof globalThis extends { + onmessage: any; + Headers: infer T; + } ? T + : typeof import("undici-types").Headers; } - -interface RequestInit extends NodeJS.fetch._RequestInit {} - -declare function fetch( - input: NodeJS.fetch.RequestInfo, - init?: RequestInit, -): Promise; - -interface Request extends NodeJS.fetch._Request {} -declare var Request: typeof globalThis extends { - onmessage: any; - Request: infer T; -} ? T - : typeof import("undici-types").Request; - -interface Response extends NodeJS.fetch._Response {} -declare var Response: typeof globalThis extends { - onmessage: any; - Response: infer T; -} ? T - : typeof import("undici-types").Response; - -interface FormData extends NodeJS.fetch._FormData {} -declare var FormData: typeof globalThis extends { - onmessage: any; - FormData: infer T; -} ? T - : typeof import("undici-types").FormData; - -interface Headers extends NodeJS.fetch._Headers {} -declare var Headers: typeof globalThis extends { - onmessage: any; - Headers: infer T; -} ? T - : typeof import("undici-types").Headers; diff --git a/types/node/v18/test/globals.ts b/types/node/v18/test/globals.ts index b8412801346e5c..ae5898ea2ebf5c 100644 --- a/types/node/v18/test/globals.ts +++ b/types/node/v18/test/globals.ts @@ -80,6 +80,8 @@ declare var RANDOM_GLOBAL_VARIABLE: true; dispatcher: undefined, }); - // @ts-expect-error - NodeJS.fetch; + const reqinit: RequestInit = {}; + reqinit.method; // $ExpectType string | undefined + const resinit: ResponseInit = {}; + resinit.status; // $ExpectType number | undefined } diff --git a/types/node/v18/ts4.8/globals.d.ts b/types/node/v18/ts4.8/globals.d.ts index 3a449e4c73abc0..71cf5497036103 100644 --- a/types/node/v18/ts4.8/globals.d.ts +++ b/types/node/v18/ts4.8/globals.d.ts @@ -1,381 +1,377 @@ -// Declare "static" methods in Error -interface ErrorConstructor { - /** Create .stack property on a target object */ - captureStackTrace(targetObject: object, constructorOpt?: Function): void; +export {} // Make this a module + +// #region Fetch and friends +// Conditional type aliases, used at the end of this file. +// Will either be empty if lib-dom is included, or the undici version otherwise. +type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request; +type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response; +type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData; +type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers; +type _RequestInit = typeof globalThis extends { onmessage: any } ? {} + : import("undici-types").RequestInit; +type _ResponseInit = typeof globalThis extends { onmessage: any } ? {} + : import("undici-types").ResponseInit; +// #endregion Fetch and friends + +declare global { + // Declare "static" methods in Error + interface ErrorConstructor { + /** Create .stack property on a target object */ + captureStackTrace(targetObject: object, constructorOpt?: Function): void; - /** - * Optional override for formatting stack traces - * - * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces - */ - prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; - - stackTraceLimit: number; -} - -/*-----------------------------------------------* - * * - * GLOBAL * - * * - ------------------------------------------------*/ - -// For backwards compability -interface NodeRequire extends NodeJS.Require {} -interface RequireResolve extends NodeJS.RequireResolve {} -interface NodeModule extends NodeJS.Module {} - -declare var process: NodeJS.Process; -declare var console: Console; - -declare var __filename: string; -declare var __dirname: string; - -declare var require: NodeRequire; -declare var module: NodeModule; - -// Same as module.exports -declare var exports: any; - -/** - * Only available if `--expose-gc` is passed to the process. - */ -declare var gc: undefined | (() => void); + /** + * Optional override for formatting stack traces + * + * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces + */ + prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; -// #region borrowed -// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib -/** A controller object that allows you to abort one or more DOM requests as and when desired. */ -interface AbortController { - /** - * Returns the AbortSignal object associated with this object. - */ + stackTraceLimit: number; + } - readonly signal: AbortSignal; - /** - * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. - */ - abort(reason?: any): void; -} + /*-----------------------------------------------* + * * + * GLOBAL * + * * + ------------------------------------------------*/ -/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ -interface AbortSignal extends EventTarget { - /** - * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. - */ - readonly aborted: boolean; - readonly reason: any; - onabort: null | ((this: AbortSignal, event: Event) => any); - throwIfAborted(): void; -} + // For backwards compability + interface NodeRequire extends NodeJS.Require {} + interface RequireResolve extends NodeJS.RequireResolve {} + interface NodeModule extends NodeJS.Module {} -declare var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T - : { - prototype: AbortController; - new(): AbortController; - }; - -declare var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T - : { - prototype: AbortSignal; - new(): AbortSignal; - abort(reason?: any): AbortSignal; - timeout(milliseconds: number): AbortSignal; - }; -// #endregion borrowed - -// #region Disposable -interface SymbolConstructor { - /** - * A method that is used to release resources held by an object. Called by the semantics of the `using` statement. - */ - readonly dispose: unique symbol; + var process: NodeJS.Process; + var console: Console; - /** - * A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement. - */ - readonly asyncDispose: unique symbol; -} + var __filename: string; + var __dirname: string; -interface Disposable { - [Symbol.dispose](): void; -} + var require: NodeRequire; + var module: NodeModule; -interface AsyncDisposable { - [Symbol.asyncDispose](): PromiseLike; -} -// #endregion Disposable + // Same as module.exports + var exports: any; -// #region ArrayLike.at() -interface RelativeIndexable { /** - * Takes an integer value and returns the item at that index, - * allowing for positive and negative integers. - * Negative integers count back from the last item in the array. + * Only available if `--expose-gc` is passed to the process. */ - at(index: number): T | undefined; -} -interface String extends RelativeIndexable {} -interface Array extends RelativeIndexable {} -interface ReadonlyArray extends RelativeIndexable {} -interface Int8Array extends RelativeIndexable {} -interface Uint8Array extends RelativeIndexable {} -interface Uint8ClampedArray extends RelativeIndexable {} -interface Int16Array extends RelativeIndexable {} -interface Uint16Array extends RelativeIndexable {} -interface Int32Array extends RelativeIndexable {} -interface Uint32Array extends RelativeIndexable {} -interface Float32Array extends RelativeIndexable {} -interface Float64Array extends RelativeIndexable {} -interface BigInt64Array extends RelativeIndexable {} -interface BigUint64Array extends RelativeIndexable {} -// #endregion ArrayLike.at() end - -/** - * @since v17.0.0 - * - * Creates a deep clone of an object. - */ -declare function structuredClone( - value: T, - transfer?: { transfer: ReadonlyArray }, -): T; - -/*----------------------------------------------* -* * -* GLOBAL INTERFACES * -* * -*-----------------------------------------------*/ -declare namespace NodeJS { - interface CallSite { - /** - * Value of "this" - */ - getThis(): unknown; - - /** - * Type of "this" as a string. - * This is the name of the function stored in the constructor field of - * "this", if available. Otherwise the object's [[Class]] internal - * property. - */ - getTypeName(): string | null; - - /** - * Current function - */ - getFunction(): Function | undefined; + var gc: undefined | (() => void); + // #region borrowed + // from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib + /** A controller object that allows you to abort one or more DOM requests as and when desired. */ + interface AbortController { /** - * Name of the current function, typically its name property. - * If a name property is not available an attempt will be made to try - * to infer a name from the function's context. + * Returns the AbortSignal object associated with this object. */ - getFunctionName(): string | null; + readonly signal: AbortSignal; /** - * Name of the property [of "this" or one of its prototypes] that holds - * the current function + * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. */ - getMethodName(): string | null; - - /** - * Name of the script [if this function was defined in a script] - */ - getFileName(): string | undefined; - - /** - * Current line number [if this function was defined in a script] - */ - getLineNumber(): number | null; - - /** - * Current column number [if this function was defined in a script] - */ - getColumnNumber(): number | null; - - /** - * A call site object representing the location where eval was called - * [if this function was created using a call to eval] - */ - getEvalOrigin(): string | undefined; - - /** - * Is this a toplevel invocation, that is, is "this" the global object? - */ - isToplevel(): boolean; + abort(reason?: any): void; + } + /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ + interface AbortSignal extends EventTarget { /** - * Does this call take place in code defined by a call to eval? + * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. */ - isEval(): boolean; + readonly aborted: boolean; + readonly reason: any; + onabort: null | ((this: AbortSignal, event: Event) => any); + throwIfAborted(): void; + } + var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T + : { + prototype: AbortController; + new(): AbortController; + }; + + var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T + : { + prototype: AbortSignal; + new(): AbortSignal; + abort(reason?: any): AbortSignal; + timeout(milliseconds: number): AbortSignal; + }; + // #endregion borrowed + + // #region Disposable + interface SymbolConstructor { /** - * Is this call in native V8 code? + * A method that is used to release resources held by an object. Called by the semantics of the `using` statement. */ - isNative(): boolean; + readonly dispose: unique symbol; /** - * Is this a constructor call? + * A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement. */ - isConstructor(): boolean; + readonly asyncDispose: unique symbol; } - interface ErrnoException extends Error { - errno?: number | undefined; - code?: string | undefined; - path?: string | undefined; - syscall?: string | undefined; + interface Disposable { + [Symbol.dispose](): void; } - interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: BufferEncoding): this; - pause(): this; - resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean | undefined }): T; - unpipe(destination?: WritableStream): this; - unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; - wrap(oldStream: ReadableStream): this; - [Symbol.asyncIterator](): AsyncIterableIterator; + interface AsyncDisposable { + [Symbol.asyncDispose](): PromiseLike; } + // #endregion Disposable - interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; - write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; - end(cb?: () => void): this; - end(data: string | Uint8Array, cb?: () => void): this; - end(str: string, encoding?: BufferEncoding, cb?: () => void): this; - } - - interface ReadWriteStream extends ReadableStream, WritableStream {} - - interface RefCounted { - ref(): this; - unref(): this; - } - - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = TypedArray | DataView; - - interface Require { - (id: string): any; - resolve: RequireResolve; - cache: Dict; + // #region ArrayLike.at() + interface RelativeIndexable { /** - * @deprecated + * Takes an integer value and returns the item at that index, + * allowing for positive and negative integers. + * Negative integers count back from the last item in the array. */ - extensions: RequireExtensions; - main: Module | undefined; + at(index: number): T | undefined; } + interface String extends RelativeIndexable {} + interface Array extends RelativeIndexable {} + interface ReadonlyArray extends RelativeIndexable {} + interface Int8Array extends RelativeIndexable {} + interface Uint8Array extends RelativeIndexable {} + interface Uint8ClampedArray extends RelativeIndexable {} + interface Int16Array extends RelativeIndexable {} + interface Uint16Array extends RelativeIndexable {} + interface Int32Array extends RelativeIndexable {} + interface Uint32Array extends RelativeIndexable {} + interface Float32Array extends RelativeIndexable {} + interface Float64Array extends RelativeIndexable {} + interface BigInt64Array extends RelativeIndexable {} + interface BigUint64Array extends RelativeIndexable {} + // #endregion ArrayLike.at() end - interface RequireResolve { - (id: string, options?: { paths?: string[] | undefined }): string; - paths(request: string): string[] | null; - } - - interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { - ".js": (m: Module, filename: string) => any; - ".json": (m: Module, filename: string) => any; - ".node": (m: Module, filename: string) => any; - } - interface Module { - /** - * `true` if the module is running during the Node.js preload - */ - isPreloading: boolean; - exports: any; - require: Require; - id: string; - filename: string; - loaded: boolean; - /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ - parent: Module | null | undefined; - children: Module[]; - /** - * @since v11.14.0 - * - * The directory name of the module. This is usually the same as the path.dirname() of the module.id. - */ - path: string; - paths: string[]; - } - - interface Dict { - [key: string]: T | undefined; - } - - interface ReadOnlyDict { - readonly [key: string]: T | undefined; + /** + * @since v17.0.0 + * + * Creates a deep clone of an object. + */ + function structuredClone( + value: T, + transfer?: { transfer: ReadonlyArray }, + ): T; + + /*----------------------------------------------* + * * + * GLOBAL INTERFACES * + * * + *-----------------------------------------------*/ + namespace NodeJS { + interface CallSite { + /** + * Value of "this" + */ + getThis(): unknown; + + /** + * Type of "this" as a string. + * This is the name of the function stored in the constructor field of + * "this", if available. Otherwise the object's [[Class]] internal + * property. + */ + getTypeName(): string | null; + + /** + * Current function + */ + getFunction(): Function | undefined; + + /** + * Name of the current function, typically its name property. + * If a name property is not available an attempt will be made to try + * to infer a name from the function's context. + */ + getFunctionName(): string | null; + + /** + * Name of the property [of "this" or one of its prototypes] that holds + * the current function + */ + getMethodName(): string | null; + + /** + * Name of the script [if this function was defined in a script] + */ + getFileName(): string | undefined; + + /** + * Current line number [if this function was defined in a script] + */ + getLineNumber(): number | null; + + /** + * Current column number [if this function was defined in a script] + */ + getColumnNumber(): number | null; + + /** + * A call site object representing the location where eval was called + * [if this function was created using a call to eval] + */ + getEvalOrigin(): string | undefined; + + /** + * Is this a toplevel invocation, that is, is "this" the global object? + */ + isToplevel(): boolean; + + /** + * Does this call take place in code defined by a call to eval? + */ + isEval(): boolean; + + /** + * Is this call in native V8 code? + */ + isNative(): boolean; + + /** + * Is this a constructor call? + */ + isConstructor(): boolean; + } + + interface ErrnoException extends Error { + errno?: number | undefined; + code?: string | undefined; + path?: string | undefined; + syscall?: string | undefined; + } + + interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string | Buffer; + setEncoding(encoding: BufferEncoding): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean | undefined }): T; + unpipe(destination?: WritableStream): this; + unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; + wrap(oldStream: ReadableStream): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; + write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; + end(cb?: () => void): this; + end(data: string | Uint8Array, cb?: () => void): this; + end(str: string, encoding?: BufferEncoding, cb?: () => void): this; + } + + interface ReadWriteStream extends ReadableStream, WritableStream {} + + interface RefCounted { + ref(): this; + unref(): this; + } + + type TypedArray = + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | BigUint64Array + | BigInt64Array + | Float32Array + | Float64Array; + type ArrayBufferView = TypedArray | DataView; + + interface Require { + (id: string): any; + resolve: RequireResolve; + cache: Dict; + /** + * @deprecated + */ + extensions: RequireExtensions; + main: Module | undefined; + } + + interface RequireResolve { + (id: string, options?: { paths?: string[] | undefined }): string; + paths(request: string): string[] | null; + } + + interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { + ".js": (m: Module, filename: string) => any; + ".json": (m: Module, filename: string) => any; + ".node": (m: Module, filename: string) => any; + } + interface Module { + /** + * `true` if the module is running during the Node.js preload + */ + isPreloading: boolean; + exports: any; + require: Require; + id: string; + filename: string; + loaded: boolean; + /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ + parent: Module | null | undefined; + children: Module[]; + /** + * @since v11.14.0 + * + * The directory name of the module. This is usually the same as the path.dirname() of the module.id. + */ + path: string; + paths: string[]; + } + + interface Dict { + [key: string]: T | undefined; + } + + interface ReadOnlyDict { + readonly [key: string]: T | undefined; + } } - namespace fetch { - type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request; - type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response; - type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData; - type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers; - type _RequestInit = typeof globalThis extends { onmessage: any } ? {} - : import("undici-types").RequestInit; - type Request = globalThis.Request; - type Response = globalThis.Response; - type Headers = globalThis.Headers; - type FormData = globalThis.FormData; - type RequestInit = globalThis.RequestInit; - type RequestInfo = import("undici-types").RequestInfo; - type HeadersInit = import("undici-types").HeadersInit; - type BodyInit = import("undici-types").BodyInit; - type RequestRedirect = import("undici-types").RequestRedirect; - type RequestCredentials = import("undici-types").RequestCredentials; - type RequestMode = import("undici-types").RequestMode; - type ReferrerPolicy = import("undici-types").ReferrerPolicy; - type Dispatcher = import("undici-types").Dispatcher; - type RequestDuplex = import("undici-types").RequestDuplex; - } + interface RequestInit extends _RequestInit {} + + function fetch( + input: string | URL | Request, + init?: RequestInit, + ): Promise; + + interface Request extends _Request {} + var Request: typeof globalThis extends { + onmessage: any; + Request: infer T; + } ? T + : typeof import("undici-types").Request; + + interface ResponseInit extends _ResponseInit {} + + interface Response extends _Response {} + var Response: typeof globalThis extends { + onmessage: any; + Response: infer T; + } ? T + : typeof import("undici-types").Response; + + interface FormData extends _FormData {} + var FormData: typeof globalThis extends { + onmessage: any; + FormData: infer T; + } ? T + : typeof import("undici-types").FormData; + + interface Headers extends _Headers {} + var Headers: typeof globalThis extends { + onmessage: any; + Headers: infer T; + } ? T + : typeof import("undici-types").Headers; } - -interface RequestInit extends NodeJS.fetch._RequestInit {} - -declare function fetch( - input: NodeJS.fetch.RequestInfo, - init?: RequestInit, -): Promise; - -interface Request extends NodeJS.fetch._Request {} -declare var Request: typeof globalThis extends { - onmessage: any; - Request: infer T; -} ? T - : typeof import("undici-types").Request; - -interface Response extends NodeJS.fetch._Response {} -declare var Response: typeof globalThis extends { - onmessage: any; - Response: infer T; -} ? T - : typeof import("undici-types").Response; - -interface FormData extends NodeJS.fetch._FormData {} -declare var FormData: typeof globalThis extends { - onmessage: any; - FormData: infer T; -} ? T - : typeof import("undici-types").FormData; - -interface Headers extends NodeJS.fetch._Headers {} -declare var Headers: typeof globalThis extends { - onmessage: any; - Headers: infer T; -} ? T - : typeof import("undici-types").Headers; diff --git a/types/node/v18/ts4.8/test/globals.ts b/types/node/v18/ts4.8/test/globals.ts index 5e4e48465b7211..5a1d98b275b02d 100644 --- a/types/node/v18/ts4.8/test/globals.ts +++ b/types/node/v18/ts4.8/test/globals.ts @@ -62,6 +62,8 @@ declare var RANDOM_GLOBAL_VARIABLE: true; dispatcher: undefined, }); - // @ts-expect-error - NodeJS.fetch; + const reqinit: RequestInit = {}; + reqinit.method; // $ExpectType string | undefined + const resinit: ResponseInit = {}; + resinit.status; // $ExpectType number | undefined } From 9d441f066108663e9ad758c043472fcb06c4a09f Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Fri, 1 Dec 2023 19:44:34 +0000 Subject: [PATCH 004/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/node/globals.d.ts | 5 ++--- types/node/ts4.8/globals.d.ts | 4 ++-- types/node/v18/globals.d.ts | 2 +- types/node/v18/ts4.8/globals.d.ts | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/types/node/globals.d.ts b/types/node/globals.d.ts index 418d06408d38e9..72d1860f6ebf92 100644 --- a/types/node/globals.d.ts +++ b/types/node/globals.d.ts @@ -1,4 +1,4 @@ -export {} // Make this a module +export {}; // Make this a module // #region Fetch and friends // Conditional type aliases, used at the end of this file. @@ -14,7 +14,6 @@ type _ResponseInit = typeof globalThis extends { onmessage: any } ? {} type _File = typeof globalThis extends { onmessage: any } ? {} : import("node:buffer").File; // #endregion Fetch and friends - declare global { // Declare "static" methods in Error interface ErrorConstructor { @@ -377,7 +376,7 @@ declare global { } ? T : typeof import("undici-types").Headers; - interface File extends _File{} + interface File extends _File {} var File: typeof globalThis extends { onmessage: any; File: infer T; diff --git a/types/node/ts4.8/globals.d.ts b/types/node/ts4.8/globals.d.ts index d7feff13e2ed16..72d1860f6ebf92 100644 --- a/types/node/ts4.8/globals.d.ts +++ b/types/node/ts4.8/globals.d.ts @@ -1,4 +1,4 @@ -export {} // Make this a module +export {}; // Make this a module // #region Fetch and friends // Conditional type aliases, used at the end of this file. @@ -376,7 +376,7 @@ declare global { } ? T : typeof import("undici-types").Headers; - interface File extends _File{} + interface File extends _File {} var File: typeof globalThis extends { onmessage: any; File: infer T; diff --git a/types/node/v18/globals.d.ts b/types/node/v18/globals.d.ts index 71cf5497036103..f6c95e9f266c69 100644 --- a/types/node/v18/globals.d.ts +++ b/types/node/v18/globals.d.ts @@ -1,4 +1,4 @@ -export {} // Make this a module +export {}; // Make this a module // #region Fetch and friends // Conditional type aliases, used at the end of this file. diff --git a/types/node/v18/ts4.8/globals.d.ts b/types/node/v18/ts4.8/globals.d.ts index 71cf5497036103..f6c95e9f266c69 100644 --- a/types/node/v18/ts4.8/globals.d.ts +++ b/types/node/v18/ts4.8/globals.d.ts @@ -1,4 +1,4 @@ -export {} // Make this a module +export {}; // Make this a module // #region Fetch and friends // Conditional type aliases, used at the end of this file. From 89d96bd63063b0dee2c35bcf4ce948db9c43cc99 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Fri, 1 Dec 2023 21:45:16 +0100 Subject: [PATCH 005/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67561=20ne?= =?UTF-8?q?w=20types:=20express-as-promise=20by=20@tpluscode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * new types: express-as-promise * style: format * refactor: DOM --- types/express-as-promise/.npmignore | 5 +++ .../express-as-promise-tests.ts | 33 +++++++++++++++++++ types/express-as-promise/index.d.ts | 19 +++++++++++ types/express-as-promise/package.json | 24 ++++++++++++++ types/express-as-promise/tsconfig.json | 21 ++++++++++++ types/express-as-promise/tslint.json | 1 + types/express-as-promise/withServer.d.ts | 5 +++ 7 files changed, 108 insertions(+) create mode 100644 types/express-as-promise/.npmignore create mode 100644 types/express-as-promise/express-as-promise-tests.ts create mode 100644 types/express-as-promise/index.d.ts create mode 100644 types/express-as-promise/package.json create mode 100644 types/express-as-promise/tsconfig.json create mode 100644 types/express-as-promise/tslint.json create mode 100644 types/express-as-promise/withServer.d.ts diff --git a/types/express-as-promise/.npmignore b/types/express-as-promise/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/express-as-promise/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/express-as-promise/express-as-promise-tests.ts b/types/express-as-promise/express-as-promise-tests.ts new file mode 100644 index 00000000000000..7725f2278f3396 --- /dev/null +++ b/types/express-as-promise/express-as-promise-tests.ts @@ -0,0 +1,33 @@ +import ExpressAsPromise = require("express-as-promise"); +import withServer = require("express-as-promise/withServer"); +import { RequestHandler } from "express"; + +async function testStaticFunc() { + await withServer(async server => { + const myMiddleware: RequestHandler = {}; + server.app.use(myMiddleware); + + // $ExpectType string + const url = await server.listen(); + + // $ExpectType Response + const res = await fetch(url); + }); +} + +async function testClass() { + const server = new ExpressAsPromise(); + + server.app.get("/", (req, res) => { + res.send("Hello World!"); + }); + + // starts the listener and writes the base URL to the console + await server.listen(); + + // $ExpectType Response + const response = await server.fetch("/"); + + // ...then stop the server + await server.stop(); +} diff --git a/types/express-as-promise/index.d.ts b/types/express-as-promise/index.d.ts new file mode 100644 index 00000000000000..301554efebbd1e --- /dev/null +++ b/types/express-as-promise/index.d.ts @@ -0,0 +1,19 @@ +import { Express } from "express"; +import { Server } from "http"; + +declare class ExpressAsPromise { + server: Server | null; + app: Express; + + get host(): string; + get port(): string; + get url(): string; + + listen(port?: number, host?: string): Promise; + stop(): Promise; + fetch(pathname: string, options?: RequestInit): Promise; + + static withServer(callback: (server: ExpressAsPromise) => Promise): Promise; +} + +export = ExpressAsPromise; diff --git a/types/express-as-promise/package.json b/types/express-as-promise/package.json new file mode 100644 index 00000000000000..0aeffdf0301d00 --- /dev/null +++ b/types/express-as-promise/package.json @@ -0,0 +1,24 @@ +{ + "private": true, + "name": "@types/express-as-promise", + "version": "1.2.9999", + "projects": [ + "https://github.com/bergos/express-as-promise" + ], + "dependencies": { + "@types/express": "*" + }, + "devDependencies": { + "@types/express-as-promise": "workspace:." + }, + "owners": [ + { + "name": "Tomasz Pluskiewicz", + "githubUsername": "tpluscode" + }, + { + "name": "Ludovic Muller", + "githubUsername": "ludovicm67" + } + ] +} diff --git a/types/express-as-promise/tsconfig.json b/types/express-as-promise/tsconfig.json new file mode 100644 index 00000000000000..3a9d94cea5e776 --- /dev/null +++ b/types/express-as-promise/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "DOM" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "withServer.d.ts", + "express-as-promise-tests.ts" + ] +} diff --git a/types/express-as-promise/tslint.json b/types/express-as-promise/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/express-as-promise/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } diff --git a/types/express-as-promise/withServer.d.ts b/types/express-as-promise/withServer.d.ts new file mode 100644 index 00000000000000..ecc739bfd2a34d --- /dev/null +++ b/types/express-as-promise/withServer.d.ts @@ -0,0 +1,5 @@ +import ExpressAsPromise = require("./index"); + +declare function withServer(callback: (server: ExpressAsPromise) => Promise): Promise; + +export = withServer; From ab208a5c383fa98a341728929d374bf2e5073ef8 Mon Sep 17 00:00:00 2001 From: Harel M Date: Fri, 1 Dec 2023 22:58:06 +0200 Subject: [PATCH 006/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67574=20[g?= =?UTF-8?q?eojson-vt]=20Fix=20`false`=20type=20-=20changed=20to=20`boolean?= =?UTF-8?q?`=20by=20@HarelM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use boolean instead of false * Update geojson-vt-tests.ts * Update geojson-vt-tests.ts Fix tests --- types/geojson-vt/geojson-vt-tests.ts | 3 +++ types/geojson-vt/index.d.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/geojson-vt/geojson-vt-tests.ts b/types/geojson-vt/geojson-vt-tests.ts index 58d1ad8516424d..727bb2d3fc3d2c 100644 --- a/types/geojson-vt/geojson-vt-tests.ts +++ b/types/geojson-vt/geojson-vt-tests.ts @@ -45,6 +45,9 @@ const GeoJsonVTOptions: geojsonvt.Options = { indexMaxPoints: 100000, // max number of points per tile in the index }; +GeoJsonVTOptions.lineMetrics; // $ExpectType boolean | undefined +GeoJsonVTOptions.generateId; // $ExpectType boolean | undefined + const gjv = geojsonvt(GeoJSONData, GeoJsonVTOptions); gjv; // $ExpectType GeoJSONVT gjv.options; // $ExpectType Options diff --git a/types/geojson-vt/index.d.ts b/types/geojson-vt/index.d.ts index f442b9190235e5..92a4fa9b22ca2d 100644 --- a/types/geojson-vt/index.d.ts +++ b/types/geojson-vt/index.d.ts @@ -13,11 +13,11 @@ declare namespace geojsonvt { /** logging level (0 to disable, 1 or 2) */ debug?: 0 | 1 | 2; /** whether to enable line metrics tracking for LineString/MultiLineString features */ - lineMetrics?: false; + lineMetrics?: boolean; /** name of a feature property to promote to feature.id. Cannot be used with `generateId` */ promoteId?: null | string; /** whether to generate feature ids. Cannot be used with `promoteId` */ - generateId?: false; + generateId?: boolean; /** max zoom in the initial tile index */ indexMaxZoom?: number; /** max number of points per tile in the index */ From 6def377cdc37499ebdb2b261cf23e4ef4afce0e7 Mon Sep 17 00:00:00 2001 From: Tristan F Date: Fri, 1 Dec 2023 16:50:11 -0500 Subject: [PATCH 007/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67313=20[s?= =?UTF-8?q?elect]=20add=20types=20by=20@LeoDog896?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: select * fix: use umd declaration, add npmignore --- types/select/.npmignore | 5 +++++ types/select/index.d.ts | 5 +++++ types/select/package.json | 17 +++++++++++++++++ types/select/select-tests.ts | 13 +++++++++++++ types/select/tsconfig.json | 20 ++++++++++++++++++++ types/select/tslint.json | 1 + 6 files changed, 61 insertions(+) create mode 100644 types/select/.npmignore create mode 100644 types/select/index.d.ts create mode 100644 types/select/package.json create mode 100644 types/select/select-tests.ts create mode 100644 types/select/tsconfig.json create mode 100644 types/select/tslint.json diff --git a/types/select/.npmignore b/types/select/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/select/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/select/index.d.ts b/types/select/index.d.ts new file mode 100644 index 00000000000000..d0f410444351a2 --- /dev/null +++ b/types/select/index.d.ts @@ -0,0 +1,5 @@ +declare function select(element: HTMLElement): void; + +export = select; + +export as namespace select; diff --git a/types/select/package.json b/types/select/package.json new file mode 100644 index 00000000000000..f555dbd34ca638 --- /dev/null +++ b/types/select/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/select", + "version": "1.1.9999", + "projects": [ + "https://github.com/zenorocha/select#readme" + ], + "devDependencies": { + "@types/select": "workspace:." + }, + "owners": [ + { + "name": "Tristan F.", + "githubUsername": "LeoDog896" + } + ] +} diff --git a/types/select/select-tests.ts b/types/select/select-tests.ts new file mode 100644 index 00000000000000..89c5d92b244f2e --- /dev/null +++ b/types/select/select-tests.ts @@ -0,0 +1,13 @@ +declare let element: HTMLElement; + +// $ExpectType void +select(element); + +// @ts-expect-error +select(); + +// @ts-expect-error +select(element, element); + +// @ts-expect-error +select(30); diff --git a/types/select/tsconfig.json b/types/select/tsconfig.json new file mode 100644 index 00000000000000..e61485a6647eb3 --- /dev/null +++ b/types/select/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "DOM" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "select-tests.ts" + ] +} diff --git a/types/select/tslint.json b/types/select/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/select/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From 8ba199f3247be8e9259dec649ee6856fe89171d8 Mon Sep 17 00:00:00 2001 From: Tristan F Date: Fri, 1 Dec 2023 16:53:52 -0500 Subject: [PATCH 008/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67314=20[i?= =?UTF-8?q?s-expression]=20add=20types=20by=20@LeoDog896?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: is-expression * fix(is-expression): jsdoc formatting * chore(is-expression): pin version * fix: add npmignore --- types/is-expression/.npmignore | 5 +++++ types/is-expression/index.d.ts | 26 ++++++++++++++++++++++ types/is-expression/is-expression-tests.ts | 25 +++++++++++++++++++++ types/is-expression/package.json | 20 +++++++++++++++++ types/is-expression/tsconfig.json | 19 ++++++++++++++++ types/is-expression/tslint.json | 1 + 6 files changed, 96 insertions(+) create mode 100644 types/is-expression/.npmignore create mode 100644 types/is-expression/index.d.ts create mode 100644 types/is-expression/is-expression-tests.ts create mode 100644 types/is-expression/package.json create mode 100644 types/is-expression/tsconfig.json create mode 100644 types/is-expression/tslint.json diff --git a/types/is-expression/.npmignore b/types/is-expression/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/is-expression/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/is-expression/index.d.ts b/types/is-expression/index.d.ts new file mode 100644 index 00000000000000..b07c98e0e14dc1 --- /dev/null +++ b/types/is-expression/index.d.ts @@ -0,0 +1,26 @@ +import acorn = require("acorn"); + +type Options = acorn.Options & { + /** + * Throw an error if the string is not an expression. + * The error can be an Acorn error, with location information in `err.loc` and `err.pos`. Defaults to `false`. + */ + throw: boolean; + /** + * Use strict mode when trying to parse the string. Defaults to `false`. + * Even if this option is `false`, if you have provided `options.sourceType === 'module'` + * which imples strict mode under ES2015, strict mode will be used. + */ + strict: boolean; + /** + * When `true`, allows line comments in the expression. Defaults to `false` for safety. + */ + lineComment: boolean; +} + +/** + * Validates a string as a JavaScript expression. + */ +declare function isExpression(src: string, options?: Partial): boolean; + +export = isExpression; diff --git a/types/is-expression/is-expression-tests.ts b/types/is-expression/is-expression-tests.ts new file mode 100644 index 00000000000000..bfa54d0d687502 --- /dev/null +++ b/types/is-expression/is-expression-tests.ts @@ -0,0 +1,25 @@ +import isExpression = require('is-expression'); + +// $ExpectType boolean +isExpression('myVar') + +// $ExpectType boolean +isExpression('["an", "array", "\'s"].indexOf("index")') + +// $ExpectType boolean +isExpression('var', { throw: true }) + +// $ExpectType boolean +isExpression('public', { strict: true }) + +// $ExpectType boolean +isExpression('abc // my comment', { lineComment: true }) + +// $ExpectType boolean +isExpression('abc // my comment', { lineComment: true, strict: true, sourceFile: 'myFile.js' }) + +// @ts-expect-error +isExpression(123) + +// @ts-expect-error +isExpression('myVar', { throw: 123 }) diff --git a/types/is-expression/package.json b/types/is-expression/package.json new file mode 100644 index 00000000000000..883bb178d5c3e1 --- /dev/null +++ b/types/is-expression/package.json @@ -0,0 +1,20 @@ +{ + "private": true, + "name": "@types/is-expression", + "version": "4.0.9999", + "projects": [ + "https://github.com/pugjs/is-expression#readme" + ], + "dependencies": { + "acorn": "7.1.1" + }, + "devDependencies": { + "@types/is-expression": "workspace:." + }, + "owners": [ + { + "name": "Tristan F.", + "githubUsername": "LeoDog896" + } + ] +} diff --git a/types/is-expression/tsconfig.json b/types/is-expression/tsconfig.json new file mode 100644 index 00000000000000..dd2860a9588231 --- /dev/null +++ b/types/is-expression/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-expression-tests.ts" + ] +} diff --git a/types/is-expression/tslint.json b/types/is-expression/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/is-expression/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From 0b27e7a35e260502714c1becc11d5fcf76450509 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Fri, 1 Dec 2023 21:55:03 +0000 Subject: [PATCH 009/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/is-expression/index.d.ts | 2 +- types/is-expression/is-expression-tests.ts | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/types/is-expression/index.d.ts b/types/is-expression/index.d.ts index b07c98e0e14dc1..b26cb5b12f3724 100644 --- a/types/is-expression/index.d.ts +++ b/types/is-expression/index.d.ts @@ -16,7 +16,7 @@ type Options = acorn.Options & { * When `true`, allows line comments in the expression. Defaults to `false` for safety. */ lineComment: boolean; -} +}; /** * Validates a string as a JavaScript expression. diff --git a/types/is-expression/is-expression-tests.ts b/types/is-expression/is-expression-tests.ts index bfa54d0d687502..824ea57f748fbd 100644 --- a/types/is-expression/is-expression-tests.ts +++ b/types/is-expression/is-expression-tests.ts @@ -1,25 +1,25 @@ -import isExpression = require('is-expression'); +import isExpression = require("is-expression"); // $ExpectType boolean -isExpression('myVar') +isExpression("myVar"); // $ExpectType boolean -isExpression('["an", "array", "\'s"].indexOf("index")') +isExpression("[\"an\", \"array\", \"'s\"].indexOf(\"index\")"); // $ExpectType boolean -isExpression('var', { throw: true }) +isExpression("var", { throw: true }); // $ExpectType boolean -isExpression('public', { strict: true }) +isExpression("public", { strict: true }); // $ExpectType boolean -isExpression('abc // my comment', { lineComment: true }) +isExpression("abc // my comment", { lineComment: true }); // $ExpectType boolean -isExpression('abc // my comment', { lineComment: true, strict: true, sourceFile: 'myFile.js' }) +isExpression("abc // my comment", { lineComment: true, strict: true, sourceFile: "myFile.js" }); // @ts-expect-error -isExpression(123) +isExpression(123); // @ts-expect-error -isExpression('myVar', { throw: 123 }) +isExpression("myVar", { throw: 123 }); From f72ceece195fc99cc6e816a21746dd6183c098b5 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Fri, 1 Dec 2023 23:01:34 +0100 Subject: [PATCH 010/519] [react] Disallow `undefined` dependencies in `useMemo` (#67454) * [react] Disallow `undefined` dependencies in `useMemo` * backport to 5.0 fork --- types/react/index.d.ts | 2 +- types/react/test/hooks.tsx | 20 +++++++++++++++++--- types/react/ts5.0/index.d.ts | 2 +- types/react/ts5.0/test/hooks.tsx | 20 +++++++++++++++++--- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index bbcd40cb69ebe1..85336eafa9f910 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -1130,7 +1130,7 @@ declare namespace React { * @see https://react.dev/reference/react/useMemo */ // allow undefined, but don't make it optional as that is very likely a mistake - function useMemo(factory: () => T, deps: DependencyList | undefined): T; + function useMemo(factory: () => T, deps: DependencyList): T; /** * `useDebugValue` can be used to display a label for custom hooks in React DevTools. * diff --git a/types/react/test/hooks.tsx b/types/react/test/hooks.tsx index c141d489e82d0b..a0f473a92e9d67 100644 --- a/types/react/test/hooks.tsx +++ b/types/react/test/hooks.tsx @@ -119,6 +119,16 @@ function useEveryHook(ref: React.Ref<{ id: number }> | undefined): () => boolean // inline object, to (manually) check if autocomplete works React.useReducer(reducer, { age: 42, name: "The Answer" }); + // Missing deps are most likely an error and would also trigger react-hooks/exhaustive-deps + // @ts-expect-error + React.useCallback(() => {}); + + React.useCallback( + () => {}, + // @ts-expect-error -- Go beyond what ESLint can do and also "missing deps" at the type-level + undefined, + ); + // Implicit any // @ts-expect-error const anyCallback = React.useCallback(value => { @@ -229,12 +239,16 @@ function useEveryHook(ref: React.Ref<{ id: number }> | undefined): () => boolean React.useDebugValue(id, value => value.toFixed()); React.useDebugValue(id); - // allow passing an explicit undefined - React.useMemo(() => {}, undefined); - // but don't allow it to be missing + // Missing deps are most likely an error and would also trigger react-hooks/exhaustive-deps // @ts-expect-error React.useMemo(() => {}); + React.useMemo( + () => {}, + // @ts-expect-error -- Go beyond what ESLint can do and also "missing deps" at the type-level + undefined, + ); + // useState convenience overload // default to undefined only (not that useful, but type-safe -- no {} or unknown!) // $ExpectType undefined diff --git a/types/react/ts5.0/index.d.ts b/types/react/ts5.0/index.d.ts index 855035d452921b..b03b8d112979b2 100644 --- a/types/react/ts5.0/index.d.ts +++ b/types/react/ts5.0/index.d.ts @@ -1131,7 +1131,7 @@ declare namespace React { * @see https://react.dev/reference/react/useMemo */ // allow undefined, but don't make it optional as that is very likely a mistake - function useMemo(factory: () => T, deps: DependencyList | undefined): T; + function useMemo(factory: () => T, deps: DependencyList): T; /** * `useDebugValue` can be used to display a label for custom hooks in React DevTools. * diff --git a/types/react/ts5.0/test/hooks.tsx b/types/react/ts5.0/test/hooks.tsx index c141d489e82d0b..a0f473a92e9d67 100644 --- a/types/react/ts5.0/test/hooks.tsx +++ b/types/react/ts5.0/test/hooks.tsx @@ -119,6 +119,16 @@ function useEveryHook(ref: React.Ref<{ id: number }> | undefined): () => boolean // inline object, to (manually) check if autocomplete works React.useReducer(reducer, { age: 42, name: "The Answer" }); + // Missing deps are most likely an error and would also trigger react-hooks/exhaustive-deps + // @ts-expect-error + React.useCallback(() => {}); + + React.useCallback( + () => {}, + // @ts-expect-error -- Go beyond what ESLint can do and also "missing deps" at the type-level + undefined, + ); + // Implicit any // @ts-expect-error const anyCallback = React.useCallback(value => { @@ -229,12 +239,16 @@ function useEveryHook(ref: React.Ref<{ id: number }> | undefined): () => boolean React.useDebugValue(id, value => value.toFixed()); React.useDebugValue(id); - // allow passing an explicit undefined - React.useMemo(() => {}, undefined); - // but don't allow it to be missing + // Missing deps are most likely an error and would also trigger react-hooks/exhaustive-deps // @ts-expect-error React.useMemo(() => {}); + React.useMemo( + () => {}, + // @ts-expect-error -- Go beyond what ESLint can do and also "missing deps" at the type-level + undefined, + ); + // useState convenience overload // default to undefined only (not that useful, but type-safe -- no {} or unknown!) // $ExpectType undefined From 0306b91e40b3d153184ab4632b4fe0166054a2a1 Mon Sep 17 00:00:00 2001 From: mroz <41209892+mrozio13pl@users.noreply.github.com> Date: Sat, 2 Dec 2023 08:45:12 +0100 Subject: [PATCH 011/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67546=20ad?= =?UTF-8?q?d=20types=20for=20`resolve-dir`=20by=20@mrozio13pl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/resolve-dir/.npmignore | 5 +++++ types/resolve-dir/index.d.ts | 4 ++++ types/resolve-dir/package.json | 17 +++++++++++++++++ types/resolve-dir/resolve-dir-tests.ts | 3 +++ types/resolve-dir/tsconfig.json | 19 +++++++++++++++++++ types/resolve-dir/tslint.json | 1 + 6 files changed, 49 insertions(+) create mode 100644 types/resolve-dir/.npmignore create mode 100644 types/resolve-dir/index.d.ts create mode 100644 types/resolve-dir/package.json create mode 100644 types/resolve-dir/resolve-dir-tests.ts create mode 100644 types/resolve-dir/tsconfig.json create mode 100644 types/resolve-dir/tslint.json diff --git a/types/resolve-dir/.npmignore b/types/resolve-dir/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/resolve-dir/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/resolve-dir/index.d.ts b/types/resolve-dir/index.d.ts new file mode 100644 index 00000000000000..8c9065548cd396 --- /dev/null +++ b/types/resolve-dir/index.d.ts @@ -0,0 +1,4 @@ +/** Resolve a directory that is either local, global or in the user's home directory. */ +declare function resolveDir(dir: string): string; + +export = resolveDir; diff --git a/types/resolve-dir/package.json b/types/resolve-dir/package.json new file mode 100644 index 00000000000000..5818af1c2ab4f2 --- /dev/null +++ b/types/resolve-dir/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/resolve-dir", + "version": "0.0.9999", + "projects": [ + "https://github.com/jonschlinkert/resolve-dir" + ], + "devDependencies": { + "@types/resolve-dir": "workspace:." + }, + "owners": [ + { + "name": "Jacob Mroz", + "githubUsername": "mrozio13pl" + } + ] +} diff --git a/types/resolve-dir/resolve-dir-tests.ts b/types/resolve-dir/resolve-dir-tests.ts new file mode 100644 index 00000000000000..4dbc4e1e9fbd03 --- /dev/null +++ b/types/resolve-dir/resolve-dir-tests.ts @@ -0,0 +1,3 @@ +import resolveDir = require("resolve-dir"); + +resolveDir('foo'); // $ExpectType string diff --git a/types/resolve-dir/tsconfig.json b/types/resolve-dir/tsconfig.json new file mode 100644 index 00000000000000..f10ebe6fb7ad0f --- /dev/null +++ b/types/resolve-dir/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "resolve-dir-tests.ts" + ] +} diff --git a/types/resolve-dir/tslint.json b/types/resolve-dir/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/resolve-dir/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From a46d1e0effbc49f1a694e26932c89195ca16cc55 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Sat, 2 Dec 2023 07:46:20 +0000 Subject: [PATCH 012/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/resolve-dir/resolve-dir-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/resolve-dir/resolve-dir-tests.ts b/types/resolve-dir/resolve-dir-tests.ts index 4dbc4e1e9fbd03..e5149954dd93dd 100644 --- a/types/resolve-dir/resolve-dir-tests.ts +++ b/types/resolve-dir/resolve-dir-tests.ts @@ -1,3 +1,3 @@ import resolveDir = require("resolve-dir"); -resolveDir('foo'); // $ExpectType string +resolveDir("foo"); // $ExpectType string From 936f86b0733466301c02ddde0268a1a2d6107b79 Mon Sep 17 00:00:00 2001 From: Colin Date: Sun, 3 Dec 2023 00:38:21 +0800 Subject: [PATCH 013/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67265=20[r?= =?UTF-8?q?eact]=20fix=20React.memo=20TS=202590=20Error=20by=20@colinaaa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [react] fix React.memo TS 2590 Error Change-Id: I5de33e0114ce1f726a3032ad4925f4da46e049ed * Use `CustomComponentPropsWithRef` in `LazyExoticComponent` Change-Id: I71757c690df1a2ede5d5d35b0323696aeabb5a18 Signed-off-by: Qingyu Wang * Reorder and document to make relation to "ComponentPropsWithRef" clear * Backport to 5.0 fork --------- Signed-off-by: Qingyu Wang Co-authored-by: Sebastian Silbermann --- types/react/index.d.ts | 16 +++++++++-- types/react/test/tsx.tsx | 51 ++++++++++++++++++++++++++++------ types/react/ts5.0/index.d.ts | 16 +++++++++-- types/react/ts5.0/test/tsx.tsx | 51 ++++++++++++++++++++++++++++------ 4 files changed, 112 insertions(+), 22 deletions(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 85336eafa9f910..375c3a1baea816 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -854,9 +854,21 @@ declare namespace React { JSXElementConstructor ? P : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : {}; + /** + * Get the props of a component that supports the `ref` prop. + * + * WARNING: Use `CustomComponentPropsWithRef` if you know that `T` is not a host component for better type-checking performance. + */ type ComponentPropsWithRef = T extends (new(props: infer P) => Component) ? PropsWithoutRef

& RefAttributes> : PropsWithRef>; + /** + * Like `ComponentPropsWithRef` but without support for host components (i.e. just "custom components") to improve type-checking performance. + */ + type CustomComponentPropsWithRef = T extends (new(props: infer P) => Component) + ? (PropsWithoutRef

& RefAttributes>) + : T extends ((props: infer P, legacyContext?: any) => ReactNode) ? PropsWithRef

+ : never; type ComponentPropsWithoutRef = PropsWithoutRef>; type ComponentRef = T extends NamedExoticComponent< @@ -867,7 +879,7 @@ declare namespace React { // will show `Memo(${Component.displayName || Component.name})` in devtools by default, // but can be given its own specific name - type MemoExoticComponent> = NamedExoticComponent> & { + type MemoExoticComponent> = NamedExoticComponent> & { readonly type: T; }; @@ -880,7 +892,7 @@ declare namespace React { propsAreEqual?: (prevProps: Readonly>, nextProps: Readonly>) => boolean, ): MemoExoticComponent; - type LazyExoticComponent> = ExoticComponent> & { + type LazyExoticComponent> = ExoticComponent> & { readonly _result: T; }; diff --git a/types/react/test/tsx.tsx b/types/react/test/tsx.tsx index e16f7f70789524..2fa8b0fef6e8d7 100644 --- a/types/react/test/tsx.tsx +++ b/types/react/test/tsx.tsx @@ -335,15 +335,48 @@ const Memoized6: React.NamedExoticComponent = React.memo(props => null); // NOTE: this test _requires_ TypeScript 3.1 // It is passing, for what it's worth. -// const Memoized7 = React.memo((() => { -// function HasDefaultProps(props: { test: boolean }) { return null; } -// HasDefaultProps.defaultProps = { -// test: true -// }; -// return HasDefaultProps; -// })()); -// // $ExpectType boolean -// Memoized7.type.defaultProps.test; +const Memoized7 = React.memo((() => { + function HasDefaultProps(props: { test: boolean }) { + return null; + } + HasDefaultProps.defaultProps = { + test: true, + }; + return HasDefaultProps; +})()); +// $ExpectType boolean +Memoized7.type.defaultProps.test; + +// From type-fest +type RequireAllOrNone = + & ( + | Required> + | Partial> + ) + & Omit; + +type MemoizedProps = RequireAllOrNone<{ foo: string; bar: number }, "foo" | "bar">; +declare module "react" { + namespace JSX { + interface IntrinsicElements { + "memoized-element": MemoizedProps; + } + } +} +// $ExpectType Element +; +// $ExpectType Element +; +// @ts-expect-error +; + +const Memoized8 = React.memo((props: MemoizedProps) =>
); +// $ExpectType Element +; +// $ExpectType Element +; +// @ts-expect-error +; const LazyClassComponent = React.lazy(async () => ({ default: ComponentWithPropsAndState })); const LazyMemoized3 = React.lazy(async () => ({ default: Memoized3 })); diff --git a/types/react/ts5.0/index.d.ts b/types/react/ts5.0/index.d.ts index b03b8d112979b2..123638428a4376 100644 --- a/types/react/ts5.0/index.d.ts +++ b/types/react/ts5.0/index.d.ts @@ -855,9 +855,21 @@ declare namespace React { JSXElementConstructor ? P : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : {}; + /** + * Get the props of a component that supports the `ref` prop. + * + * WARNING: Use `CustomComponentPropsWithRef` if you know that `T` is not a host component for better type-checking performance. + */ type ComponentPropsWithRef = T extends (new(props: infer P) => Component) ? PropsWithoutRef

& RefAttributes> : PropsWithRef>; + /** + * Like `ComponentPropsWithRef` but without support for host components (i.e. just "custom components") to improve type-checking performance. + */ + type CustomComponentPropsWithRef = T extends (new(props: infer P) => Component) + ? (PropsWithoutRef

& RefAttributes>) + : T extends ((props: infer P, legacyContext?: any) => ReactNode) ? PropsWithRef

+ : never; type ComponentPropsWithoutRef = PropsWithoutRef>; type ComponentRef = T extends NamedExoticComponent< @@ -868,7 +880,7 @@ declare namespace React { // will show `Memo(${Component.displayName || Component.name})` in devtools by default, // but can be given its own specific name - type MemoExoticComponent> = NamedExoticComponent> & { + type MemoExoticComponent> = NamedExoticComponent> & { readonly type: T; }; @@ -881,7 +893,7 @@ declare namespace React { propsAreEqual?: (prevProps: Readonly>, nextProps: Readonly>) => boolean, ): MemoExoticComponent; - type LazyExoticComponent> = ExoticComponent> & { + type LazyExoticComponent> = ExoticComponent> & { readonly _result: T; }; diff --git a/types/react/ts5.0/test/tsx.tsx b/types/react/ts5.0/test/tsx.tsx index 69cd0aa398b284..9184414b38bade 100644 --- a/types/react/ts5.0/test/tsx.tsx +++ b/types/react/ts5.0/test/tsx.tsx @@ -335,15 +335,48 @@ const Memoized6: React.NamedExoticComponent = React.memo(props => null); // NOTE: this test _requires_ TypeScript 3.1 // It is passing, for what it's worth. -// const Memoized7 = React.memo((() => { -// function HasDefaultProps(props: { test: boolean }) { return null; } -// HasDefaultProps.defaultProps = { -// test: true -// }; -// return HasDefaultProps; -// })()); -// // $ExpectType boolean -// Memoized7.type.defaultProps.test; +const Memoized7 = React.memo((() => { + function HasDefaultProps(props: { test: boolean }) { + return null; + } + HasDefaultProps.defaultProps = { + test: true, + }; + return HasDefaultProps; +})()); +// $ExpectType boolean +Memoized7.type.defaultProps.test; + +// From type-fest +type RequireAllOrNone = + & ( + | Required> + | Partial> + ) + & Omit; + +type MemoizedProps = RequireAllOrNone<{ foo: string; bar: number }, "foo" | "bar">; +declare module "react" { + namespace JSX { + interface IntrinsicElements { + "memoized-element": MemoizedProps; + } + } +} +// $ExpectType Element +; +// $ExpectType Element +; +// @ts-expect-error +; + +const Memoized8 = React.memo((props: MemoizedProps) =>
); +// $ExpectType Element +; +// $ExpectType Element +; +// @ts-expect-error +; const LazyClassComponent = React.lazy(async () => ({ default: ComponentWithPropsAndState })); const LazyMemoized3 = React.lazy(async () => ({ default: Memoized3 })); From b6e360a972cede4d7e44b9563906fb55d9263e71 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sat, 2 Dec 2023 21:43:02 +0100 Subject: [PATCH 014/519] [enzyme] Fix TypeScript 5.4-dev compat (#67582) --- types/enzyme/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/enzyme/index.d.ts b/types/enzyme/index.d.ts index c7836f33f6a14f..aece5f8879b1dd 100644 --- a/types/enzyme/index.d.ts +++ b/types/enzyme/index.d.ts @@ -89,7 +89,7 @@ export interface CommonWrapper

> { invoke< K extends NonNullable< { - [K in keyof P]: P[K] extends ((...arg: any[]) => void) | undefined ? K : never; + [K in keyof P]-?: P[K] extends ((...arg: any[]) => void) | undefined ? K : never; }[keyof P] >, >( From 650c1ce26e70a8a8c3287272340cb8786e891c31 Mon Sep 17 00:00:00 2001 From: Tristan F Date: Sat, 2 Dec 2023 16:12:55 -0500 Subject: [PATCH 015/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67585=20[i?= =?UTF-8?q?s-set]=20add=20types=20by=20@LeoDog896?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: is-set * fix(is-set): loosen type inference - also adds tests to make sure that it doesn't break type inferrence --- types/is-set/.npmignore | 5 +++++ types/is-set/index.d.ts | 3 +++ types/is-set/is-set-tests.ts | 43 ++++++++++++++++++++++++++++++++++++ types/is-set/package.json | 17 ++++++++++++++ types/is-set/tsconfig.json | 19 ++++++++++++++++ types/is-set/tslint.json | 1 + 6 files changed, 88 insertions(+) create mode 100644 types/is-set/.npmignore create mode 100644 types/is-set/index.d.ts create mode 100644 types/is-set/is-set-tests.ts create mode 100644 types/is-set/package.json create mode 100644 types/is-set/tsconfig.json create mode 100644 types/is-set/tslint.json diff --git a/types/is-set/.npmignore b/types/is-set/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/is-set/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/is-set/index.d.ts b/types/is-set/index.d.ts new file mode 100644 index 00000000000000..5a1095467a0861 --- /dev/null +++ b/types/is-set/index.d.ts @@ -0,0 +1,3 @@ +declare function isSet(value: unknown): value is Set; + +export = isSet; diff --git a/types/is-set/is-set-tests.ts b/types/is-set/is-set-tests.ts new file mode 100644 index 00000000000000..b16b4769fea1fe --- /dev/null +++ b/types/is-set/is-set-tests.ts @@ -0,0 +1,43 @@ +import isSet = require("is-set"); + +// $ExpectType boolean +isSet(new Set()); + +// $ExpectType boolean +isSet(new WeakSet()); + +// $ExpectType boolean +isSet(new Map()); + +// $ExpectType boolean +isSet(Symbol()); + +// $ExpectType boolean +isSet(1); + +const x: unknown = new Set(); + +if (isSet(x)) { + // $ExpectType Set + x; + + x.add(1); +} else { + // $ExpectType unknown + x; +} + +const y = new Set(); + +if (isSet(y)) { + // $ExpectType Set + y; + + y.delete(1); +} else { + // $ExpectType never + y; + + // @ts-expect-error + y.delete(1); +} diff --git a/types/is-set/package.json b/types/is-set/package.json new file mode 100644 index 00000000000000..cbf4e31c9c30ae --- /dev/null +++ b/types/is-set/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/is-set", + "version": "2.0.9999", + "projects": [ + "https://github.com/inspect-js/is-set#readme" + ], + "devDependencies": { + "@types/is-set": "workspace:." + }, + "owners": [ + { + "name": "Tristan F.", + "githubUsername": "LeoDog896" + } + ] +} diff --git a/types/is-set/tsconfig.json b/types/is-set/tsconfig.json new file mode 100644 index 00000000000000..a71219cf66cd0a --- /dev/null +++ b/types/is-set/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-set-tests.ts" + ] +} diff --git a/types/is-set/tslint.json b/types/is-set/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/is-set/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From 4f15bc172e0a76f6412ebdff0f0d6a49b0d9821a Mon Sep 17 00:00:00 2001 From: Tristan F Date: Sat, 2 Dec 2023 16:15:22 -0500 Subject: [PATCH 016/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67586=20[g?= =?UTF-8?q?et-symbol-description]=20add=20types=20by=20@LeoDog896?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/get-symbol-description/.npmignore | 5 +++++ .../get-symbol-description-tests.ts | 13 +++++++++++++ types/get-symbol-description/index.d.ts | 3 +++ types/get-symbol-description/package.json | 17 +++++++++++++++++ types/get-symbol-description/tsconfig.json | 19 +++++++++++++++++++ types/get-symbol-description/tslint.json | 1 + 6 files changed, 58 insertions(+) create mode 100644 types/get-symbol-description/.npmignore create mode 100644 types/get-symbol-description/get-symbol-description-tests.ts create mode 100644 types/get-symbol-description/index.d.ts create mode 100644 types/get-symbol-description/package.json create mode 100644 types/get-symbol-description/tsconfig.json create mode 100644 types/get-symbol-description/tslint.json diff --git a/types/get-symbol-description/.npmignore b/types/get-symbol-description/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/get-symbol-description/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/get-symbol-description/get-symbol-description-tests.ts b/types/get-symbol-description/get-symbol-description-tests.ts new file mode 100644 index 00000000000000..1dedfc432be6b5 --- /dev/null +++ b/types/get-symbol-description/get-symbol-description-tests.ts @@ -0,0 +1,13 @@ +import getSymbolDescription = require('get-symbol-description'); + +// $ExpectType string | undefined +getSymbolDescription(Symbol('foo')); + +// $ExpectType string | undefined +getSymbolDescription(Symbol()); + +// $ExpectType string | undefined +getSymbolDescription(Symbol.iterator); + +// @ts-expect-error +getSymbolDescription(1); diff --git a/types/get-symbol-description/index.d.ts b/types/get-symbol-description/index.d.ts new file mode 100644 index 00000000000000..c1982dfc634b87 --- /dev/null +++ b/types/get-symbol-description/index.d.ts @@ -0,0 +1,3 @@ +declare function getSymbolDescription(symbol: symbol): string | undefined; + +export = getSymbolDescription; diff --git a/types/get-symbol-description/package.json b/types/get-symbol-description/package.json new file mode 100644 index 00000000000000..b12c4ca8eff69e --- /dev/null +++ b/types/get-symbol-description/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/get-symbol-description", + "version": "1.0.9999", + "projects": [ + "https://github.com/inspect-js/get-symbol-description#readme" + ], + "devDependencies": { + "@types/get-symbol-description": "workspace:." + }, + "owners": [ + { + "name": "Tristan F.", + "githubUsername": "LeoDog896" + } + ] +} diff --git a/types/get-symbol-description/tsconfig.json b/types/get-symbol-description/tsconfig.json new file mode 100644 index 00000000000000..9457706c026a36 --- /dev/null +++ b/types/get-symbol-description/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "get-symbol-description-tests.ts" + ] +} diff --git a/types/get-symbol-description/tslint.json b/types/get-symbol-description/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/get-symbol-description/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From 944a188a7545488b475c1568113e1c396a985fc1 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Sat, 2 Dec 2023 21:16:30 +0000 Subject: [PATCH 017/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/get-symbol-description/get-symbol-description-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/get-symbol-description/get-symbol-description-tests.ts b/types/get-symbol-description/get-symbol-description-tests.ts index 1dedfc432be6b5..a263473033855f 100644 --- a/types/get-symbol-description/get-symbol-description-tests.ts +++ b/types/get-symbol-description/get-symbol-description-tests.ts @@ -1,7 +1,7 @@ -import getSymbolDescription = require('get-symbol-description'); +import getSymbolDescription = require("get-symbol-description"); // $ExpectType string | undefined -getSymbolDescription(Symbol('foo')); +getSymbolDescription(Symbol("foo")); // $ExpectType string | undefined getSymbolDescription(Symbol()); From a30f4d7dd3069680bc8f553c892d099334ab8710 Mon Sep 17 00:00:00 2001 From: Tristan F Date: Sun, 3 Dec 2023 10:54:28 -0500 Subject: [PATCH 018/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67587=20fi?= =?UTF-8?q?x(is-map):=20make=20function=20type=20guard=20by=20@LeoDog896?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(is-map): make function type guard * fix(is-map): loosen type guard to any --- types/is-map/index.d.ts | 2 +- types/is-map/is-map-tests.ts | 36 ++++++++++++++++++++++++++++++++---- types/is-map/package.json | 4 ++++ 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/types/is-map/index.d.ts b/types/is-map/index.d.ts index 8b4d450486d449..d5378ae1c4f9d3 100644 --- a/types/is-map/index.d.ts +++ b/types/is-map/index.d.ts @@ -1,3 +1,3 @@ -declare function isMap(value: unknown): boolean; +declare function isMap(value: unknown): value is Map; export = isMap; diff --git a/types/is-map/is-map-tests.ts b/types/is-map/is-map-tests.ts index 343864d30985f1..e1c915ec502c66 100644 --- a/types/is-map/is-map-tests.ts +++ b/types/is-map/is-map-tests.ts @@ -1,6 +1,34 @@ import isMap = require("is-map"); -const tests = () => { - !isMap(new Set()); - isMap(Symbol("foo")); -}; +// $ExpectType boolean +isMap(new Map()); + +// $ExpectType boolean +isMap(new WeakMap()); + +// $ExpectType boolean +isMap(new Set()); + +const x: unknown = new Map(); + +if (isMap(x)) { + // $ExpectType Map + x; + + x.set(1, 1); +} + +const y = new Map(); + +if (isMap(y)) { + // $ExpectType Map + y; + + y.delete(1); +} else { + // $ExpectType never + y; + + // @ts-expect-error + y.delete(1); +} diff --git a/types/is-map/package.json b/types/is-map/package.json index c5fc4b9dab5356..db6349c40bb68f 100644 --- a/types/is-map/package.json +++ b/types/is-map/package.json @@ -12,6 +12,10 @@ { "name": "Ankan Bhattacharya", "githubUsername": "Ankan002" + }, + { + "name": "Tristan F.", + "githubUsername": "LeoDog896" } ] } From 87fa48e66a1f1a8f0fd0844988e6de1be86090bf Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sun, 3 Dec 2023 18:05:07 +0100 Subject: [PATCH 019/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67667=20[r?= =?UTF-8?q?eact-loading-indicator]=20Replace=20usage=20of=20React's=20glob?= =?UTF-8?q?al=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-loading-indicator/react-loading-indicator-tests.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-loading-indicator/react-loading-indicator-tests.tsx b/types/react-loading-indicator/react-loading-indicator-tests.tsx index 890d077a35585a..a934e370b882e5 100644 --- a/types/react-loading-indicator/react-loading-indicator-tests.tsx +++ b/types/react-loading-indicator/react-loading-indicator-tests.tsx @@ -2,7 +2,7 @@ import * as React from "react"; import LoadingIndicator, { LoadingIndicatorColor, LoadingIndicatorProps } from "react-loading-indicator"; export class LoadingIndicatorTest extends React.PureComponent { - render(): JSX.Element { + render(): React.JSX.Element { const color: LoadingIndicatorColor = { red: 224, green: 33, From 96f3ec20226ab39e7bdc8ef162d6d52ccfc41340 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sun, 3 Dec 2023 18:07:52 +0100 Subject: [PATCH 020/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67707=20[r?= =?UTF-8?q?eact-splitter-layout]=20Replace=20usage=20of=20React's=20global?= =?UTF-8?q?=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-splitter-layout/react-splitter-layout-tests.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-splitter-layout/react-splitter-layout-tests.tsx b/types/react-splitter-layout/react-splitter-layout-tests.tsx index fa9860a2b70fca..03b0e43fe5db02 100644 --- a/types/react-splitter-layout/react-splitter-layout-tests.tsx +++ b/types/react-splitter-layout/react-splitter-layout-tests.tsx @@ -2,7 +2,7 @@ import * as React from "react"; import SplitterLayout, { SplitterLayoutProps } from "react-splitter-layout"; export class SplitterLayoutTest extends React.PureComponent { - render(): JSX.Element { + render(): React.JSX.Element { const props: SplitterLayoutProps = { percentage: true, secondaryInitialSize: 40, From 6b3ba2a1581c12e9798266b921a50e297eb71043 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sun, 3 Dec 2023 18:21:48 +0100 Subject: [PATCH 021/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67745=20[v?= =?UTF-8?q?ideo-react]=20Replace=20usage=20of=20React's=20global=20JSX=20n?= =?UTF-8?q?amespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/video-react/index.d.ts | 2 +- types/video-react/video-react-tests.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/video-react/index.d.ts b/types/video-react/index.d.ts index 76ac9dc26c7d75..d49a1ee5727099 100644 --- a/types/video-react/index.d.ts +++ b/types/video-react/index.d.ts @@ -1,4 +1,4 @@ -import { LegacyRef } from "react"; +import { LegacyRef, JSX } from "react"; export type PlayerReference = HTMLVideoElement & StaticPlayerInstanceMethods; diff --git a/types/video-react/video-react-tests.tsx b/types/video-react/video-react-tests.tsx index 5668ed551b6b86..aa0516ce3e6b0d 100644 --- a/types/video-react/video-react-tests.tsx +++ b/types/video-react/video-react-tests.tsx @@ -11,7 +11,7 @@ import { const testProps: PlayerProps = { autoPlay: true }; -function TestComponent(props: PlayerProps): JSX.Element { +function TestComponent(props: PlayerProps): React.JSX.Element { return ( From bb14400a40a27d555c1dbc98ffed24d036443173 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Sun, 3 Dec 2023 17:23:03 +0000 Subject: [PATCH 022/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/video-react/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/video-react/index.d.ts b/types/video-react/index.d.ts index d49a1ee5727099..2a129156c5b484 100644 --- a/types/video-react/index.d.ts +++ b/types/video-react/index.d.ts @@ -1,4 +1,4 @@ -import { LegacyRef, JSX } from "react"; +import { JSX, LegacyRef } from "react"; export type PlayerReference = HTMLVideoElement & StaticPlayerInstanceMethods; From ac6324442d84aa1e4465fe13468c927b25c55fcc Mon Sep 17 00:00:00 2001 From: Evgeniy Timokhov Date: Sun, 3 Dec 2023 17:38:24 +0000 Subject: [PATCH 023/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67074=20Re?= =?UTF-8?q?moved=20cyclic=20self-referenced=20`util/types`=20from=20node?= =?UTF-8?q?=20types=20by=20@timocov?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/node/ts4.8/util.d.ts | 3 --- types/node/util.d.ts | 3 --- types/node/v16/ts4.8/util.d.ts | 3 --- types/node/v16/util.d.ts | 3 --- types/node/v18/ts4.8/util.d.ts | 3 --- types/node/v18/util.d.ts | 3 --- 6 files changed, 18 deletions(-) diff --git a/types/node/ts4.8/util.d.ts b/types/node/ts4.8/util.d.ts index 7d55c350ef2f77..ac269ec1b8bada 100644 --- a/types/node/ts4.8/util.d.ts +++ b/types/node/ts4.8/util.d.ts @@ -1654,9 +1654,6 @@ declare module "util" { [Symbol.iterator]: typeof MIMEParams.prototype.entries; } } -declare module "util/types" { - export * from "util/types"; -} declare module "util/types" { import { KeyObject, webcrypto } from "node:crypto"; /** diff --git a/types/node/util.d.ts b/types/node/util.d.ts index 201dcfa59d9764..08712f522c1bb1 100644 --- a/types/node/util.d.ts +++ b/types/node/util.d.ts @@ -1654,9 +1654,6 @@ declare module "util" { [Symbol.iterator]: typeof MIMEParams.prototype.entries; } } -declare module "util/types" { - export * from "util/types"; -} declare module "util/types" { import { KeyObject, webcrypto } from "node:crypto"; /** diff --git a/types/node/v16/ts4.8/util.d.ts b/types/node/v16/ts4.8/util.d.ts index 1d85c02ed82a4f..f7f6df5d047ec4 100644 --- a/types/node/v16/ts4.8/util.d.ts +++ b/types/node/v16/ts4.8/util.d.ts @@ -1188,9 +1188,6 @@ declare module "util" { : typeof _TextEncoder; } } -declare module "util/types" { - export * from "util/types"; -} declare module "util/types" { import { KeyObject, webcrypto } from "node:crypto"; /** diff --git a/types/node/v16/util.d.ts b/types/node/v16/util.d.ts index 1d85c02ed82a4f..f7f6df5d047ec4 100644 --- a/types/node/v16/util.d.ts +++ b/types/node/v16/util.d.ts @@ -1188,9 +1188,6 @@ declare module "util" { : typeof _TextEncoder; } } -declare module "util/types" { - export * from "util/types"; -} declare module "util/types" { import { KeyObject, webcrypto } from "node:crypto"; /** diff --git a/types/node/v18/ts4.8/util.d.ts b/types/node/v18/ts4.8/util.d.ts index ed3fdb284c88bf..3b1d9f99fb5f24 100644 --- a/types/node/v18/ts4.8/util.d.ts +++ b/types/node/v18/ts4.8/util.d.ts @@ -1574,9 +1574,6 @@ declare module "util" { [Symbol.iterator]: typeof MIMEParams.prototype.entries; } } -declare module "util/types" { - export * from "util/types"; -} declare module "util/types" { import { KeyObject, webcrypto } from "node:crypto"; /** diff --git a/types/node/v18/util.d.ts b/types/node/v18/util.d.ts index 845332aebd86c4..6adf5db11bd131 100644 --- a/types/node/v18/util.d.ts +++ b/types/node/v18/util.d.ts @@ -1574,9 +1574,6 @@ declare module "util" { [Symbol.iterator]: typeof MIMEParams.prototype.entries; } } -declare module "util/types" { - export * from "util/types"; -} declare module "util/types" { import { KeyObject, webcrypto } from "node:crypto"; /** From 03a0acff6ccfc3047b136ff353f0898734903042 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sun, 3 Dec 2023 20:38:55 +0100 Subject: [PATCH 024/519] [react-signature-canvas] Replace usage of React's global JSX namespace with scoped JSX (#67699) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- .../react-signature-canvas/react-signature-canvas-tests.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/react-signature-canvas/react-signature-canvas-tests.tsx b/types/react-signature-canvas/react-signature-canvas-tests.tsx index 4ee29bdb326a9b..002d6dfc1b2496 100644 --- a/types/react-signature-canvas/react-signature-canvas-tests.tsx +++ b/types/react-signature-canvas/react-signature-canvas-tests.tsx @@ -2,11 +2,11 @@ import ReactSignatureCanvas from "react-signature-canvas"; import SignaturePad = require("signature_pad"); import * as React from "react"; -const ReactSignatureCanvasNoOptions: JSX.Element = ; +const ReactSignatureCanvasNoOptions: React.JSX.Element = ; -const ReactSignatureCanvasDotSizeFunctionOptions: JSX.Element = 4} />; +const ReactSignatureCanvasDotSizeFunctionOptions: React.JSX.Element = 4} />; -const ReactSignatureCanvasAllOptions: JSX.Element = ( +const ReactSignatureCanvasAllOptions: React.JSX.Element = ( Date: Sun, 3 Dec 2023 20:39:12 +0100 Subject: [PATCH 025/519] [react-stickynode] Replace usage of React's global JSX namespace with scoped JSX (#67710) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-stickynode/react-stickynode-tests.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-stickynode/react-stickynode-tests.tsx b/types/react-stickynode/react-stickynode-tests.tsx index 85d3d3fc9a731c..a4313b093a0e36 100644 --- a/types/react-stickynode/react-stickynode-tests.tsx +++ b/types/react-stickynode/react-stickynode-tests.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import * as Sticky from "react-stickynode"; -const StickyAllOptions: JSX.Element = ( +const StickyAllOptions: React.JSX.Element = ( ); -const StickyOptionalStringOptions: JSX.Element = ( +const StickyOptionalStringOptions: React.JSX.Element = (

); -const StickyNoOptions: JSX.Element = ( +const StickyNoOptions: React.JSX.Element = (
); -const StickyChildrenFunction: JSX.Element = ( +const StickyChildrenFunction: React.JSX.Element = ( {status => { if (status.status === Sticky.STATUS_FIXED) { From 3d87d258ae1b2c19c2987232676d6e8e7a6f9f4d Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sun, 3 Dec 2023 20:39:38 +0100 Subject: [PATCH 026/519] [react-canvas-draw] Replace usage of React's global JSX namespace with scoped JSX (#67642) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-canvas-draw/react-canvas-draw-tests.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-canvas-draw/react-canvas-draw-tests.tsx b/types/react-canvas-draw/react-canvas-draw-tests.tsx index 1ddb375af8b200..cc906d51ffeda0 100644 --- a/types/react-canvas-draw/react-canvas-draw-tests.tsx +++ b/types/react-canvas-draw/react-canvas-draw-tests.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import CanvasDraw from "react-canvas-draw"; -const AllOptions: JSX.Element = ( +const AllOptions: React.JSX.Element = ( canvas.getSaveData()} loadTimeOffset={7} @@ -33,7 +33,7 @@ const AllOptions: JSX.Element = ( /> ); -const NoOptions: JSX.Element = ; +const NoOptions: React.JSX.Element = ; function RefTest() { const ref = React.useRef(null); From 654721b916446b12a8af9da9d6f9cbd9606dedf9 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sun, 3 Dec 2023 20:40:00 +0100 Subject: [PATCH 027/519] [mui-datatables] Replace usage of React's global JSX namespace with scoped JSX (#67625) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/mui-datatables/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mui-datatables/index.d.ts b/types/mui-datatables/index.d.ts index 2d047c41bcdabc..4e11d3cc94186f 100644 --- a/types/mui-datatables/index.d.ts +++ b/types/mui-datatables/index.d.ts @@ -430,7 +430,7 @@ export type MUIDataTableOptions = Partial<{ handleSearch: (text: string) => void, hideSearch: () => void, options: any, - ) => React.Component | JSX.Element; + ) => React.Component | React.JSX.Element; /** * Override default sorting with custom function. * If you just need to override the sorting for a particular column, see the sortCompare method in the Column options. From 0b3c6ad053a5cd379dc0637d854c68dcc42f7e3b Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sun, 3 Dec 2023 20:55:05 +0100 Subject: [PATCH 028/519] [react-native] Replace usage of React's global JSX namespace with scoped JSX (#67672) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- .../Components/DrawerAndroid/DrawerLayoutAndroid.d.ts | 2 +- types/react-native/Libraries/Lists/FlatList.d.ts | 2 +- types/react-native/v0.63/index.d.ts | 6 +++--- types/react-native/v0.64/index.d.ts | 6 +++--- types/react-native/v0.65/index.d.ts | 6 +++--- types/react-native/v0.66/index.d.ts | 6 +++--- types/react-native/v0.67/index.d.ts | 6 +++--- types/react-native/v0.68/index.d.ts | 6 +++--- types/react-native/v0.69/index.d.ts | 6 +++--- types/react-native/v0.70/index.d.ts | 6 +++--- .../Components/DrawerAndroid/DrawerLayoutAndroid.d.ts | 2 +- types/react-native/v0.71/Libraries/Lists/FlatList.d.ts | 2 +- types/react-native/v0.71/test/index.tsx | 2 +- 13 files changed, 29 insertions(+), 29 deletions(-) diff --git a/types/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts b/types/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts index ed6c16aa151e8a..bc14df4acae54c 100644 --- a/types/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +++ b/types/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts @@ -92,7 +92,7 @@ export interface DrawerLayoutAndroidProps extends ViewProps { * The navigation view that will be rendered to the side of the * screen and can be pulled in. */ - renderNavigationView: () => JSX.Element; + renderNavigationView: () => React.JSX.Element; /** * Make the drawer take the entire screen and draw the background of diff --git a/types/react-native/Libraries/Lists/FlatList.d.ts b/types/react-native/Libraries/Lists/FlatList.d.ts index c9cd81d3062ebe..fabfbaf624da61 100644 --- a/types/react-native/Libraries/Lists/FlatList.d.ts +++ b/types/react-native/Libraries/Lists/FlatList.d.ts @@ -208,7 +208,7 @@ export abstract class FlatListComponent< /** * Provides a handle to the underlying scroll responder. */ - getScrollResponder: () => JSX.Element | null | undefined; + getScrollResponder: () => React.JSX.Element | null | undefined; /** * Provides a reference to the underlying host component diff --git a/types/react-native/v0.63/index.d.ts b/types/react-native/v0.63/index.d.ts index 8dc77da9ba3a1d..0160afab36eec1 100644 --- a/types/react-native/v0.63/index.d.ts +++ b/types/react-native/v0.63/index.d.ts @@ -2901,7 +2901,7 @@ export interface DrawerLayoutAndroidProps extends ViewProps { * The navigation view that will be rendered to the side of the * screen and can be pulled in. */ - renderNavigationView: () => JSX.Element; + renderNavigationView: () => React.JSX.Element; /** * Make the drawer take the entire screen and draw the background of @@ -3280,7 +3280,7 @@ export class RecyclerViewBackedScrollView extends RecyclerViewBackedScrollViewBa * implement this method so that they can be composed while providing access * to the underlying scroll responder's methods. */ - getScrollResponder(): JSX.Element; + getScrollResponder(): React.JSX.Element; } export interface SliderPropsAndroid extends ViewProps { @@ -4130,7 +4130,7 @@ export class FlatList extends React.Component> /** * Provides a handle to the underlying scroll responder. */ - getScrollResponder: () => JSX.Element | null | undefined; + getScrollResponder: () => React.JSX.Element | null | undefined; /** * Provides a reference to the underlying host component diff --git a/types/react-native/v0.64/index.d.ts b/types/react-native/v0.64/index.d.ts index 3e605acf5246d4..1fc24317711cbb 100644 --- a/types/react-native/v0.64/index.d.ts +++ b/types/react-native/v0.64/index.d.ts @@ -2931,7 +2931,7 @@ export interface DrawerLayoutAndroidProps extends ViewProps { * The navigation view that will be rendered to the side of the * screen and can be pulled in. */ - renderNavigationView: () => JSX.Element; + renderNavigationView: () => React.JSX.Element; /** * Make the drawer take the entire screen and draw the background of @@ -3314,7 +3314,7 @@ export class RecyclerViewBackedScrollView extends RecyclerViewBackedScrollViewBa * implement this method so that they can be composed while providing access * to the underlying scroll responder's methods. */ - getScrollResponder(): JSX.Element; + getScrollResponder(): React.JSX.Element; } export interface SliderPropsAndroid extends ViewProps { @@ -4169,7 +4169,7 @@ export class FlatList extends React.Component> /** * Provides a handle to the underlying scroll responder. */ - getScrollResponder: () => JSX.Element | null | undefined; + getScrollResponder: () => React.JSX.Element | null | undefined; /** * Provides a reference to the underlying host component diff --git a/types/react-native/v0.65/index.d.ts b/types/react-native/v0.65/index.d.ts index 819a62646c5f04..df43e470e0f420 100644 --- a/types/react-native/v0.65/index.d.ts +++ b/types/react-native/v0.65/index.d.ts @@ -2949,7 +2949,7 @@ export interface DrawerLayoutAndroidProps extends ViewProps { * The navigation view that will be rendered to the side of the * screen and can be pulled in. */ - renderNavigationView: () => JSX.Element; + renderNavigationView: () => React.JSX.Element; /** * Make the drawer take the entire screen and draw the background of @@ -3331,7 +3331,7 @@ export class RecyclerViewBackedScrollView extends RecyclerViewBackedScrollViewBa * implement this method so that they can be composed while providing access * to the underlying scroll responder's methods. */ - getScrollResponder(): JSX.Element; + getScrollResponder(): React.JSX.Element; } export interface SliderPropsAndroid extends ViewProps { @@ -4187,7 +4187,7 @@ export class FlatList extends React.Component> /** * Provides a handle to the underlying scroll responder. */ - getScrollResponder: () => JSX.Element | null | undefined; + getScrollResponder: () => React.JSX.Element | null | undefined; /** * Provides a reference to the underlying host component diff --git a/types/react-native/v0.66/index.d.ts b/types/react-native/v0.66/index.d.ts index 6b7e1a65fae7ac..7b4f78ecbca5b4 100644 --- a/types/react-native/v0.66/index.d.ts +++ b/types/react-native/v0.66/index.d.ts @@ -2998,7 +2998,7 @@ export interface DrawerLayoutAndroidProps extends ViewProps { * The navigation view that will be rendered to the side of the * screen and can be pulled in. */ - renderNavigationView: () => JSX.Element; + renderNavigationView: () => React.JSX.Element; /** * Make the drawer take the entire screen and draw the background of @@ -3250,7 +3250,7 @@ export class RecyclerViewBackedScrollView extends RecyclerViewBackedScrollViewBa * implement this method so that they can be composed while providing access * to the underlying scroll responder's methods. */ - getScrollResponder(): JSX.Element; + getScrollResponder(): React.JSX.Element; } /** @@ -4113,7 +4113,7 @@ export class FlatList extends React.Component> /** * Provides a handle to the underlying scroll responder. */ - getScrollResponder: () => JSX.Element | null | undefined; + getScrollResponder: () => React.JSX.Element | null | undefined; /** * Provides a reference to the underlying host component diff --git a/types/react-native/v0.67/index.d.ts b/types/react-native/v0.67/index.d.ts index 32965123fbcd7d..e2b32fe15a52ab 100644 --- a/types/react-native/v0.67/index.d.ts +++ b/types/react-native/v0.67/index.d.ts @@ -3001,7 +3001,7 @@ export interface DrawerLayoutAndroidProps extends ViewProps { * The navigation view that will be rendered to the side of the * screen and can be pulled in. */ - renderNavigationView: () => JSX.Element; + renderNavigationView: () => React.JSX.Element; /** * Make the drawer take the entire screen and draw the background of @@ -3253,7 +3253,7 @@ export class RecyclerViewBackedScrollView extends RecyclerViewBackedScrollViewBa * implement this method so that they can be composed while providing access * to the underlying scroll responder's methods. */ - getScrollResponder(): JSX.Element; + getScrollResponder(): React.JSX.Element; } /** @@ -4104,7 +4104,7 @@ export class FlatList extends React.Component> /** * Provides a handle to the underlying scroll responder. */ - getScrollResponder: () => JSX.Element | null | undefined; + getScrollResponder: () => React.JSX.Element | null | undefined; /** * Provides a reference to the underlying host component diff --git a/types/react-native/v0.68/index.d.ts b/types/react-native/v0.68/index.d.ts index e6e26a8c9616e7..4ee4ec584c07fa 100644 --- a/types/react-native/v0.68/index.d.ts +++ b/types/react-native/v0.68/index.d.ts @@ -3034,7 +3034,7 @@ export interface DrawerLayoutAndroidProps extends ViewProps { * The navigation view that will be rendered to the side of the * screen and can be pulled in. */ - renderNavigationView: () => JSX.Element; + renderNavigationView: () => React.JSX.Element; /** * Make the drawer take the entire screen and draw the background of @@ -3286,7 +3286,7 @@ export class RecyclerViewBackedScrollView extends RecyclerViewBackedScrollViewBa * implement this method so that they can be composed while providing access * to the underlying scroll responder's methods. */ - getScrollResponder(): JSX.Element; + getScrollResponder(): React.JSX.Element; } /** @@ -4137,7 +4137,7 @@ export class FlatList extends React.Component> /** * Provides a handle to the underlying scroll responder. */ - getScrollResponder: () => JSX.Element | null | undefined; + getScrollResponder: () => React.JSX.Element | null | undefined; /** * Provides a reference to the underlying host component diff --git a/types/react-native/v0.69/index.d.ts b/types/react-native/v0.69/index.d.ts index cfc30e76b36d01..de1631c4608546 100644 --- a/types/react-native/v0.69/index.d.ts +++ b/types/react-native/v0.69/index.d.ts @@ -2968,7 +2968,7 @@ export interface DrawerLayoutAndroidProps extends ViewProps { * The navigation view that will be rendered to the side of the * screen and can be pulled in. */ - renderNavigationView: () => JSX.Element; + renderNavigationView: () => React.JSX.Element; /** * Make the drawer take the entire screen and draw the background of @@ -3220,7 +3220,7 @@ export class RecyclerViewBackedScrollView extends RecyclerViewBackedScrollViewBa * implement this method so that they can be composed while providing access * to the underlying scroll responder's methods. */ - getScrollResponder(): JSX.Element; + getScrollResponder(): React.JSX.Element; } /** @@ -4070,7 +4070,7 @@ export class FlatList extends React.Component> /** * Provides a handle to the underlying scroll responder. */ - getScrollResponder: () => JSX.Element | null | undefined; + getScrollResponder: () => React.JSX.Element | null | undefined; /** * Provides a reference to the underlying host component diff --git a/types/react-native/v0.70/index.d.ts b/types/react-native/v0.70/index.d.ts index 683406b360ec17..12831dd9d1efe5 100644 --- a/types/react-native/v0.70/index.d.ts +++ b/types/react-native/v0.70/index.d.ts @@ -3090,7 +3090,7 @@ export interface DrawerLayoutAndroidProps extends ViewProps { * The navigation view that will be rendered to the side of the * screen and can be pulled in. */ - renderNavigationView: () => JSX.Element; + renderNavigationView: () => React.JSX.Element; /** * Make the drawer take the entire screen and draw the background of @@ -3342,7 +3342,7 @@ export class RecyclerViewBackedScrollView extends RecyclerViewBackedScrollViewBa * implement this method so that they can be composed while providing access * to the underlying scroll responder's methods. */ - getScrollResponder(): JSX.Element; + getScrollResponder(): React.JSX.Element; } /** @@ -4191,7 +4191,7 @@ export class FlatList extends React.Component> /** * Provides a handle to the underlying scroll responder. */ - getScrollResponder: () => JSX.Element | null | undefined; + getScrollResponder: () => React.JSX.Element | null | undefined; /** * Provides a reference to the underlying host component diff --git a/types/react-native/v0.71/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts b/types/react-native/v0.71/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts index ed6c16aa151e8a..bc14df4acae54c 100644 --- a/types/react-native/v0.71/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +++ b/types/react-native/v0.71/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts @@ -92,7 +92,7 @@ export interface DrawerLayoutAndroidProps extends ViewProps { * The navigation view that will be rendered to the side of the * screen and can be pulled in. */ - renderNavigationView: () => JSX.Element; + renderNavigationView: () => React.JSX.Element; /** * Make the drawer take the entire screen and draw the background of diff --git a/types/react-native/v0.71/Libraries/Lists/FlatList.d.ts b/types/react-native/v0.71/Libraries/Lists/FlatList.d.ts index 4d85b5670071ce..07be9cac9d35a3 100644 --- a/types/react-native/v0.71/Libraries/Lists/FlatList.d.ts +++ b/types/react-native/v0.71/Libraries/Lists/FlatList.d.ts @@ -261,7 +261,7 @@ export class FlatList extends React.Component< /** * Provides a handle to the underlying scroll responder. */ - getScrollResponder: () => JSX.Element | null | undefined; + getScrollResponder: () => React.JSX.Element | null | undefined; /** * Provides a reference to the underlying host component diff --git a/types/react-native/v0.71/test/index.tsx b/types/react-native/v0.71/test/index.tsx index a217f624b9c45b..127f9b326e7d2c 100644 --- a/types/react-native/v0.71/test/index.tsx +++ b/types/react-native/v0.71/test/index.tsx @@ -668,7 +668,7 @@ export class FlatListTest extends React.Component, {}> { render() { const { ListEmptyComponent } = this.props; - const listEmptyComponent: JSX.Element | null | undefined = React.isValidElement(ListEmptyComponent) + const listEmptyComponent: React.JSX.Element | null | undefined = React.isValidElement(ListEmptyComponent) ? ListEmptyComponent : ListEmptyComponent && ; From e677ea8f103e81863fd16cd46a382698ba695210 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sun, 3 Dec 2023 20:55:16 +0100 Subject: [PATCH 029/519] [react-native-material-textfield] Replace usage of React's global JSX namespace with scoped JSX (#67677) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-native-material-textfield/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-native-material-textfield/index.d.ts b/types/react-native-material-textfield/index.d.ts index cab0f8f3d3a65f..c5810091637963 100644 --- a/types/react-native-material-textfield/index.d.ts +++ b/types/react-native-material-textfield/index.d.ts @@ -49,8 +49,8 @@ export interface TextFieldProps extends TextInputProps { onPress?(event: Event): void; onChangeText?(text: string): void; - renderLeftAccessory?(): JSX.Element; - renderRightAccessory?(): JSX.Element; + renderLeftAccessory?(): React.JSX.Element; + renderRightAccessory?(): React.JSX.Element; lineType?: "solid" | "dotted" | "dashed" | "none" | undefined; disabledLineType?: "solid" | "dotted" | "dashed" | "none" | undefined; From cf2bdd2adf2c18f6931947059d522fbe7bf6176f Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sun, 3 Dec 2023 20:55:27 +0100 Subject: [PATCH 030/519] [react-native-material-ui] Replace usage of React's global JSX namespace with scoped JSX (#67678) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-native-material-ui/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native-material-ui/index.d.ts b/types/react-native-material-ui/index.d.ts index 12b43a8614f76f..24629267d3a2db 100644 --- a/types/react-native-material-ui/index.d.ts +++ b/types/react-native-material-ui/index.d.ts @@ -1,4 +1,4 @@ -import { Component } from "react"; +import { Component, JSX } from "react"; import { Image, StyleProp, TextStyle as TextStyleRaw, ViewStyle as ViewStyleRaw } from "react-native"; export type ViewStyle = StyleProp; From 47b98fa5530f596fa8eba6db0af92f5bc647e7e5 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sun, 3 Dec 2023 20:55:44 +0100 Subject: [PATCH 031/519] [react-native-tab-navigator] Replace usage of React's global JSX namespace with scoped JSX (#67685) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-native-tab-navigator/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/react-native-tab-navigator/index.d.ts b/types/react-native-tab-navigator/index.d.ts index 65645531815a3f..97ed27c0f5d237 100644 --- a/types/react-native-tab-navigator/index.d.ts +++ b/types/react-native-tab-navigator/index.d.ts @@ -73,17 +73,17 @@ interface TabNavigatorItemProps { /** * Returns Item badge */ - renderBadge?(): JSX.Element; + renderBadge?(): React.JSX.Element; /** * Returns Item icon */ - renderIcon?(): JSX.Element; + renderIcon?(): React.JSX.Element; /** * Returns selected Item icon */ - renderSelectedIcon?(): JSX.Element; + renderSelectedIcon?(): React.JSX.Element; } export class TabNavigator extends React.Component {} From 50939062b3ef0b283a15ecb6cedcfe0efca83094 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sun, 3 Dec 2023 20:55:56 +0100 Subject: [PATCH 032/519] [react-notification-system] Replace usage of React's global JSX namespace with scoped JSX (#67687) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-notification-system/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-notification-system/index.d.ts b/types/react-notification-system/index.d.ts index b745be846ff21d..6633a11e6e2768 100644 --- a/types/react-notification-system/index.d.ts +++ b/types/react-notification-system/index.d.ts @@ -4,8 +4,8 @@ declare namespace NotificationSystem { export type CallBackFunction = (notification: Notification) => void; export interface Notification { - title?: string | JSX.Element | undefined; - message?: string | JSX.Element | undefined; + title?: string | React.JSX.Element | undefined; + message?: string | React.JSX.Element | undefined; level?: "error" | "warning" | "info" | "success" | undefined; position?: "tr" | "tl" | "tc" | "br" | "bl" | "bc" | undefined; autoDismiss?: number | undefined; From 21929b9b8cfe61ecf5dc18719c429d1496ba9c19 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sun, 3 Dec 2023 21:36:31 +0100 Subject: [PATCH 033/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67706=20[r?= =?UTF-8?q?eact-spinner]=20Replace=20usage=20of=20React's=20global=20JSX?= =?UTF-8?q?=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-spinner/react-spinner-tests.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-spinner/react-spinner-tests.tsx b/types/react-spinner/react-spinner-tests.tsx index cc458b2e31825e..3464a472ff7d1e 100644 --- a/types/react-spinner/react-spinner-tests.tsx +++ b/types/react-spinner/react-spinner-tests.tsx @@ -1,4 +1,4 @@ import * as React from "react"; import Spinner from "react-spinner"; -const spinner: JSX.Element = ; +const spinner: React.JSX.Element = ; From 6f83668a7e937c22646018e2d311d784c0d214ee Mon Sep 17 00:00:00 2001 From: shadowplay1 Date: Mon, 4 Dec 2023 07:23:54 +0300 Subject: [PATCH 034/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67440=20fi?= =?UTF-8?q?x(restrictChatMember):=20removing=20chat=20member=20restriction?= =?UTF-8?q?s=20not=20working=20by=20@shadowplay1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(restrictChatMember): removing restrictions not working * fix(tests): corrected the package import * chore(lint): fixed formatting & linting issues * chore(deps): removed dprint from dependencies * feat(restrictChatMember): added overloads to support multiple types for options object --------- Co-authored-by: shadowplay1 --- types/node-telegram-bot-api/index.d.ts | 62 +++++++++++++------ .../node-telegram-bot-api-tests.ts | 19 +++++- types/node-telegram-bot-api/package.json | 2 +- 3 files changed, 62 insertions(+), 21 deletions(-) diff --git a/types/node-telegram-bot-api/index.d.ts b/types/node-telegram-bot-api/index.d.ts index 8aa0d0a23a5c7f..4a7a7271712c12 100644 --- a/types/node-telegram-bot-api/index.d.ts +++ b/types/node-telegram-bot-api/index.d.ts @@ -303,10 +303,11 @@ declare namespace TelegramBot { interface RestrictChatMemberOptions { until_date?: number | undefined; - permissions: ChatPermissions; use_independent_chat_permissions?: boolean | undefined; } + type RestrictChatMemberOptionsWithChatPermissions = RestrictChatMemberOptions & ChatPermissions; + interface PromoteChatMemberOptions { is_anonymous?: boolean | undefined; can_manage_chat?: boolean | undefined; @@ -860,23 +861,23 @@ declare namespace TelegramBot { invite_link?: ChatInviteLink; } - interface ChatPermissions { - can_send_messages?: boolean | undefined; - can_send_audios?: boolean | undefined; - can_send_documents?: boolean | undefined; - can_send_photos?: boolean | undefined; - can_send_videos?: boolean | undefined; - can_send_video_notes?: boolean | undefined; - can_send_voice_notes?: boolean | undefined; - can_send_polls?: boolean | undefined; - can_send_other_messages?: boolean | undefined; - can_add_web_page_previews?: boolean | undefined; - can_change_info?: boolean | undefined; - can_invite_users?: boolean | undefined; - can_pin_messages?: boolean | undefined; - can_manage_topics?: boolean | undefined; - } - + type ChatPermissionsNames = + | "can_send_messages" + | "can_send_audios" + | "can_send_documents" + | "can_send_photos" + | "can_send_videos" + | "can_send_video_notes" + | "can_send_voice_notes" + | "can_send_polls" + | "can_send_other_messages" + | "can_add_web_page_previews" + | "can_change_info" + | "can_invite_users" + | "can_pin_messages" + | "can_manage_topics"; + + type ChatPermissions = Partial>; type StickerType = "regular" | "mask" | "custom_emoji"; interface Sticker extends FileBase { @@ -1718,7 +1719,30 @@ declare class TelegramBot extends TelegramBotEventEmitter; + + restrictChatMember( + chatId: TelegramBot.ChatId, + userId: number, + options?: TelegramBot.RestrictChatMemberOptions & { permissions?: string }, + ): Promise; + + /** + * @deprecated + */ + restrictChatMember( + chatId: TelegramBot.ChatId, + userId: number, + options?: TelegramBot.RestrictChatMemberOptions & { + permissions?: TelegramBot.ChatPermissions; + }, + ): Promise; + + restrictChatMember( + chatId: TelegramBot.ChatId, + userId: number, + options?: TelegramBot.RestrictChatMemberOptions & { permissions?: string | TelegramBot.ChatPermissions }, ): Promise; promoteChatMember( diff --git a/types/node-telegram-bot-api/node-telegram-bot-api-tests.ts b/types/node-telegram-bot-api/node-telegram-bot-api-tests.ts index c0dcbf09fe40ad..7f92eb7b3adbae 100644 --- a/types/node-telegram-bot-api/node-telegram-bot-api-tests.ts +++ b/types/node-telegram-bot-api/node-telegram-bot-api-tests.ts @@ -159,7 +159,24 @@ MyTelegramBot.banChatMember(1234, 5678, { }); MyTelegramBot.unbanChatMember(1234, 5678); MyTelegramBot.restrictChatMember(1234, 5678, { - permissions: { can_add_web_page_previews: true, can_send_polls: false }, + until_date: 12345, + use_independent_chat_permissions: true, + can_invite_users: true, + can_add_web_page_previews: true, + can_send_polls: false, +}); +MyTelegramBot.restrictChatMember(1234, 5678, { + until_date: 12345, + use_independent_chat_permissions: true, + permissions: "asfasdfsdfdasf", +}); +MyTelegramBot.restrictChatMember(1234, 5678, { + until_date: 12345, + use_independent_chat_permissions: true, + + permissions: { + can_add_web_page_previews: true, + }, }); MyTelegramBot.promoteChatMember(1234, 5678, { can_change_info: true }); MyTelegramBot.exportChatInviteLink(1234); diff --git a/types/node-telegram-bot-api/package.json b/types/node-telegram-bot-api/package.json index c0dcf3dd2772b3..08203ff590ee28 100644 --- a/types/node-telegram-bot-api/package.json +++ b/types/node-telegram-bot-api/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/node-telegram-bot-api", - "version": "0.63.9999", + "version": "0.64.9999", "projects": [ "https://github.com/yagop/node-telegram-bot-api" ], From 03f684a608a172217a8b183a6d63506be525fd79 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 4 Dec 2023 08:11:16 +0000 Subject: [PATCH 035/519] =?UTF-8?q?=F0=9F=A4=96=20Update=20CODEOWNERS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/CODEOWNERS | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 00484e35d28bc3..256e28d8611718 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -410,7 +410,7 @@ /types/axios-cancel/ @TheDSCPL /types/axios-concurrency/ @powfix /types/axios-curlirize/ @stevenhankin -/types/axios-token-interceptor/ @innovation-team @mgdodge +/types/axios-token-interceptor/ @team-innovation @mgdodge /types/azdata/ @Charles-Gagnon @alanrenmsft @cheenamalhotra @kburtram @kenvanhyning /types/azure-function-log-intercept/ @peterblazejewicz /types/azure-mobile-services-client/ @dmorosinotto @@ -1148,7 +1148,7 @@ /types/crc32-stream/ @nadhifikbarw /types/create-cert/ @midgleyc /types/create-error/ @tkrotoff -/types/create-hash/ @BendingBender @gallowsmaker @maxbogus @jordansexton +/types/create-hash/ @BendingBender @gallowsmaker @maxbogus /types/create-hmac/ @BendingBender /types/create-html/ @inglec-arista /types/create-keyframe-animation/ @fengyangfifa @@ -1237,6 +1237,7 @@ /types/cytoscape-canvas/ @hellomusa /types/cytoscape-context-menus/ @hellomusa /types/cytoscape-cxtmenu/ @DieserFelix +/types/cytoscape-d3-force/ @mustafamilyas /types/cytoscape-dagre/ @DieserFelix /types/cytoscape-edgehandles/ @o-su @DieserFelix /types/cytoscape-euler/ @RogerDubbs @@ -1936,6 +1937,7 @@ /types/expo__status-bar-height/ @dawnmist /types/express/ @borisyankov @CMUH @puneetar @dfrankland /types/express-actuator/ @etruta @rcruzper +/types/express-as-promise/ @tpluscode @ludovicm67 /types/express-async-wrap/ @remyoudemans /types/express-boom/ @Nox-404 /types/express-brute/ @cyrilschumacher @@ -2017,6 +2019,7 @@ /types/facebook-instant-games/ @menushka @oyvindjam @doterax /types/facebook-js-sdk/ @amritk @mahmoudzohdi @fluidsonic @bengry /types/facebook-locales/ @CvX +/types/facebook-nodejs-business-sdk/ @aisel01 /types/facebook-pixel/ @noctishsu @VictorHom @ninpeng /types/facepaint/ @DogPawHat @antonsamper @timswalling /types/factory-girl/ @stackbuilders @sestrella @elcuy @OlivierKamers @DMcNamara @@ -2784,6 +2787,7 @@ /types/get-sass-vars/ @manuth /types/get-size/ @leondreamed /types/get-ssl-certificate/ @peterblazejewicz +/types/get-symbol-description/ @LeoDog896 /types/get-value/ @DanielRosenwasser /types/getenv/ @impankratov /types/getos/ @BendingBender @@ -3461,6 +3465,7 @@ /types/is-empty/ @termosa /types/is-empty-object/ @Richienb /types/is-even/ @shawnkoon +/types/is-expression/ @LeoDog896 /types/is-file-esm/ @leonzalion /types/is-finite/ @mhegazy /types/is-firefox/ @e9x @@ -3479,7 +3484,7 @@ /types/is-integer/ @djcsdy /types/is-iterable/ @BendingBender /types/is-lambda/ @BendingBender -/types/is-map/ @Ankan002 +/types/is-map/ @Ankan002 @LeoDog896 /types/is-negated-glob/ @ajafff /types/is-number/ @jedster1111 /types/is-number-like/ @ffflorian @@ -3493,6 +3498,7 @@ /types/is-running/ @danwbyrne /types/is-secret/ @wrumsby @peterblazejewicz /types/is-semver/ @BendingBender +/types/is-set/ @LeoDog896 /types/is-ssh/ @ffflorian /types/is-string/ @aaronleopold /types/is-symbol/ @BendingBender @@ -4645,7 +4651,7 @@ /types/lunr/ @seantanly @hokiegeek /types/lunr/v0/ @sebastian-lenz /types/lusca/ @crutchcorn @builtinnya @peterblazejewicz -/types/luxon/ @FourwingsY @jsiebern @mastermatt @pietrovismara @dawnmist @ycmjason @Aitor1995 @peterblazejewicz @carsonf @hugofpsilva @martin-badin +/types/luxon/ @carsonf @peterblazejewicz /types/lwip/ @AyaMorisawa /types/lynx/ @leftshift /types/lyric-parser/ @wkl007 @@ -6851,6 +6857,7 @@ /types/redux-react-session/ @joaomlneto /types/redux-recycle/ @LKay /types/redux-saga-routines/ @alexey-pelykh +/types/redux-saga-test-engine/ @romellem /types/redux-saga-tester/ @BenLorantfy @lawsumisu @BreakBB /types/redux-seamless-immutable/ @SoaresMG /types/redux-sentry-middleware/ @dolezel @@ -6933,6 +6940,7 @@ /types/resize-observer-browser/ @chivesrs @wffurr @AlexanderShushunov /types/resolve/ @marionebl @ajafff @ljharb /types/resolve-bin/ @cameronhunter +/types/resolve-dir/ @mrozio13pl /types/resolve-options/ @delprzemo /types/resolve-path/ @fer22f /types/resolve-protobuf-schema/ @claasahl @@ -7199,6 +7207,7 @@ /types/segment-analytics/ @fongandrew @MiroslavPetrik /types/segment-api/ @padcom /types/segment__isodate/ @BendingBender +/types/select/ @LeoDog896 /types/select2/ @borisyankov @denisname /types/select2/v3/ @borisyankov /types/selectables/ @renjfk @@ -7631,6 +7640,7 @@ /types/stream-throttle/ @danwbyrne /types/stream-to-array/ @Bartvds @BendingBender /types/stream-to-array/v0/ @Bartvds +/types/stream-to-blob/ @NetanelDavid /types/stream-to-promise/ @Alorel /types/stream-write/ @ChocolateLoverRaj /types/streamifier/ @idan-at @@ -8055,6 +8065,7 @@ /types/turbolinks/ @evankim390 /types/turbostatus/ @ffflorian /types/turndown/ @sergey-zhidkov +/types/tusk-mastodon/ @fishcharlie /types/tuya-panel-kit/ @youngjuning @ShinyLeee /types/tv4/ @Bartvds @psnider /types/tween-functions/ @hozblok From aafcadf2e39bb22fd5ab489804cf7d23d41336af Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 11:18:23 +0100 Subject: [PATCH 036/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67612=20[g?= =?UTF-8?q?atsbyjs=5F=5Freach-router]=20Replace=20usage=20of=20React's=20g?= =?UTF-8?q?lobal=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/gatsbyjs__reach-router/gatsbyjs__reach-router-tests.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/gatsbyjs__reach-router/gatsbyjs__reach-router-tests.tsx b/types/gatsbyjs__reach-router/gatsbyjs__reach-router-tests.tsx index d525ea547e3a64..65e6116c98c659 100644 --- a/types/gatsbyjs__reach-router/gatsbyjs__reach-router-tests.tsx +++ b/types/gatsbyjs__reach-router/gatsbyjs__reach-router-tests.tsx @@ -96,4 +96,4 @@ const refObject: React.RefObject = { current: null }; render(, document.getElementById("app-root")); render(, document.getElementById("app-root")); -const elem: JSX.Element = state={5} to="./foo">Click me!; +const elem: React.JSX.Element = state={5} to="./foo">Click me!; From abb6d43d567a50c1b4b60706a04a2f68f6bde029 Mon Sep 17 00:00:00 2001 From: Martin <1544429+MPvHarmelen@users.noreply.github.com> Date: Mon, 4 Dec 2023 11:47:55 +0100 Subject: [PATCH 037/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67550=20Im?= =?UTF-8?q?prove=20sparql.js=20types=20by=20@MPvHarmelen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Improve sparql.js types * Attempt at fixing errors * autoformat files * Add QuadTerm to Expression * Remove Pattern from Expression --- types/sparqljs/index.d.ts | 75 +++++++++++++++++++++----------- types/sparqljs/sparqljs-tests.ts | 16 +++---- 2 files changed, 57 insertions(+), 34 deletions(-) diff --git a/types/sparqljs/index.d.ts b/types/sparqljs/index.d.ts index 3bc436ea554c9f..cab805ea881eed 100644 --- a/types/sparqljs/index.d.ts +++ b/types/sparqljs/index.d.ts @@ -9,6 +9,7 @@ export interface ParserOptions { baseIRI?: string | undefined; factory?: RdfJs.DataFactory | undefined; sparqlStar?: boolean | undefined; + skipUngroupedVariableCheck?: boolean; } export const Generator: { @@ -25,6 +26,7 @@ export interface GeneratorOptions { export interface SparqlParser { parse(query: string): SparqlQuery; + _resetBlanks(): void; } export interface SparqlGenerator { @@ -54,6 +56,12 @@ export interface BaseQuery { type: "query"; base?: string | undefined; prefixes: { [prefix: string]: string }; + from?: + | { + default: IriTerm[]; + named: IriTerm[]; + } + | undefined; where?: Pattern[] | undefined; values?: ValuePatternRow[] | undefined; } @@ -62,10 +70,6 @@ export interface SelectQuery extends BaseQuery { queryType: "SELECT"; variables: Variable[] | [Wildcard]; distinct?: boolean | undefined; - from?: { - default: IriTerm[]; - named: IriTerm[]; - } | undefined; reduced?: boolean | undefined; group?: Grouping[] | undefined; having?: Expression[] | undefined; @@ -76,6 +80,7 @@ export interface SelectQuery extends BaseQuery { export interface Grouping { expression: Expression; + variable?: VariableTerm; } export interface Ordering { @@ -94,7 +99,7 @@ export interface AskQuery extends BaseQuery { export interface DescribeQuery extends BaseQuery { queryType: "DESCRIBE"; - variables: Variable[] | [Wildcard]; + variables: Array | [Wildcard]; } export interface Update { @@ -106,13 +111,33 @@ export interface Update { export type UpdateOperation = InsertDeleteOperation | ManagementOperation; -export interface InsertDeleteOperation { - updateType: "insert" | "delete" | "deletewhere" | "insertdelete"; - graph?: IriTerm | undefined; - insert?: Quads[] | undefined; - delete?: Quads[] | undefined; - where?: Pattern[] | undefined; -} +export type InsertDeleteOperation = + | { + updateType: "insert"; + graph?: GraphOrDefault; + insert: Quads[]; + } + | { + updateType: "delete"; + graph?: GraphOrDefault; + delete: Quads[]; + } + | { + updateType: "insertdelete"; + graph?: GraphOrDefault; + insert?: Quads[]; + delete?: Quads[]; + using?: { + default: IriTerm[]; + named: IriTerm[]; + }; + where?: Pattern[]; + } + | { + updateType: "deletewhere"; + graph?: GraphOrDefault; + delete: Quads[]; + }; export type Quads = BgpPattern | GraphQuads; @@ -139,7 +164,7 @@ export interface LoadOperation { export interface CreateOperation { type: "create"; silent: boolean; - graph: IriTerm; + graph: GraphOrDefault; } export interface ClearDropOperation { @@ -188,7 +213,7 @@ export interface BgpPattern { export interface GraphQuads { type: "graph"; - name: IriTerm; + name: IriTerm | VariableTerm; triples: Triple[]; } @@ -217,7 +242,7 @@ export interface GroupPattern { export interface GraphPattern { type: "graph"; - name: IriTerm; + name: IriTerm | VariableTerm; patterns: Pattern[]; } @@ -228,7 +253,7 @@ export interface MinusPattern { export interface ServicePattern { type: "service"; - name: IriTerm; + name: IriTerm | VariableTerm; silent: boolean; patterns: Pattern[]; } @@ -261,7 +286,7 @@ export interface Triple { export interface PropertyPath { type: "path"; - pathType: "|" | "/" | "^" | "+" | "*" | "!"; + pathType: "|" | "/" | "^" | "+" | "*" | "!" | "?"; items: Array; } @@ -269,11 +294,11 @@ export type Expression = | OperationExpression | FunctionCallExpression | AggregateExpression - | BgpPattern - | GraphPattern - | GroupPattern - | Tuple - | Term; + | Tuple // used in IN operator + | IriTerm + | VariableTerm + | LiteralTerm + | QuadTerm; // allow Expression circularly reference itself export interface Tuple extends Array {} @@ -286,18 +311,18 @@ export interface BaseExpression { export interface OperationExpression extends BaseExpression { type: "operation"; operator: string; - args: Expression[]; + args: Array; } export interface FunctionCallExpression extends BaseExpression { type: "functionCall"; - function: string; + function: string | IriTerm; args: Expression[]; } export interface AggregateExpression extends BaseExpression { type: "aggregate"; - expression: Expression; + expression: Expression | Wildcard; aggregation: string; separator?: string | undefined; } diff --git a/types/sparqljs/sparqljs-tests.ts b/types/sparqljs/sparqljs-tests.ts index 80d9667922cf92..3de33d60d2f74d 100644 --- a/types/sparqljs/sparqljs-tests.ts +++ b/types/sparqljs/sparqljs-tests.ts @@ -119,14 +119,9 @@ function basicQueries() { prefixes, variables: [ var1, - { - variable: var2, - expression: { - type: "operation", - operator: "+", - args: [foo, bar], - }, - }, + var2, + foo, + bar, ], }; } @@ -149,7 +144,10 @@ function updateQueries() { updates: [ { updateType: "insertdelete", - graph: DataFactory.namedNode("http://example.com/foo"), + graph: { + type: "graph", + name: DataFactory.namedNode("http://example.com/foo"), + }, insert: [bgp], delete: [bgp], where: [], From e17412a60de065a4eb01017fb6f614bb4001a57a Mon Sep 17 00:00:00 2001 From: Xu Jianxiang Date: Mon, 4 Dec 2023 19:43:02 +0800 Subject: [PATCH 038/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67556=20fi?= =?UTF-8?q?x:=20add=20drawflow=20missing=20types,=20matches=20drawflow@0.0?= =?UTF-8?q?.59=20by=20@Alfxjx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: add drawflow missing types * fix: add tests & delete unused imports * chore: fix types * doc(drawflow): add type comments --- types/drawflow/drawflow-tests.ts | 4 + types/drawflow/index.d.ts | 127 +++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+) diff --git a/types/drawflow/drawflow-tests.ts b/types/drawflow/drawflow-tests.ts index d931cd7bcedeec..b3939f5e99bd28 100644 --- a/types/drawflow/drawflow-tests.ts +++ b/types/drawflow/drawflow-tests.ts @@ -5,3 +5,7 @@ new Drawflow(element); // $ExpectType string | number new Drawflow(element).addNode("test", 1, 2, 50, 75, "class", null, "html", false); + +new Drawflow(element).nodeId; + +new Drawflow(element).node_selected; diff --git a/types/drawflow/index.d.ts b/types/drawflow/index.d.ts index 80e65338f775cf..48c421d544b25c 100644 --- a/types/drawflow/index.d.ts +++ b/types/drawflow/index.d.ts @@ -3,6 +3,44 @@ export default class Drawflow { constructor(element: HTMLElement, render?: object, parent?: object); + + /** + * @default {} + */ + events: Record void> }>; + + /** + * @required + */ + container: HTMLElement; + + /** + * @default 1 + */ + nodeId: number; + + /** + * @default null + */ + ele_selected: HTMLElement | null; + + /** + * @default null + */ + node_selected: HTMLElement | null; + + /** + * Drag nodes on click inputs + * @default false + */ + drag: boolean; + + /** + * @param eventName + * @param detail + */ + dispatch: (eventName: string, detail: any) => void; + /** * Active reroute * @default false @@ -39,12 +77,42 @@ export default class Drawflow { */ reroute_width: number; + /** + * flag for drawflow drag point + */ + drag_point: boolean; + + /** + * flag for drawflow editor canvas selected + */ + editor_selected: boolean; + + /** + * flag for drawflow connnection line + */ + connection: boolean; + + /** + * connection element + */ + connection_ele: HTMLElement | null; + + /** + * selected connection + */ + connection_selected: HTMLElement | null; + /** * Width of line * @default 5 */ line_path: number; + /** + * first clicked element + */ + first_click: HTMLElement | null; + /** * Force the first input to drop the connection on top of the node * @default false @@ -103,6 +171,45 @@ export default class Drawflow { */ canvas_y: number; + /** + * focused x coordinate + */ + pos_x: number; + + /** + * original x coordinate + */ + pos_x_start: number; + + /** + * focused x coordinate + */ + pos_y: number; + + /** + * original x coordinate + */ + pos_y_start: number; + + /** + * mouse x coordinate + */ + mouse_x: number; + /** + * mouse y coordinate + */ + mouse_y: number; + + /** + * mobile event cache list + */ + evCache: any[]; + + /** + * the diff between previous handlers and current + */ + prevDiff: number; + /** * Graph data object */ @@ -119,6 +226,26 @@ export default class Drawflow { */ precanvas: HTMLElement; + /** + * The drawflow parent element + */ + parent: object; + + /** + * registered nodes for reuse. + */ + noderegister: object; + + /** + * user defined renderer, for example vue + */ + render: object; + + /** + * module name + */ + module: string; + start(): void; load(): any; From 4315b7f96b27ef6a8ba845d8d8808124bae142ce Mon Sep 17 00:00:00 2001 From: Oliver Joseph Ash Date: Mon, 4 Dec 2023 12:47:29 +0000 Subject: [PATCH 039/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67508=20`r?= =?UTF-8?q?eact-tagsinput`:=20correct=20`key`=20type=20in=20`RenderTagProp?= =?UTF-8?q?s`=20by=20@OliverJAsh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update index.d.ts * Update index.d.ts --- types/react-tagsinput/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-tagsinput/index.d.ts b/types/react-tagsinput/index.d.ts index 5097ca340bb962..cdaefc848e26c3 100644 --- a/types/react-tagsinput/index.d.ts +++ b/types/react-tagsinput/index.d.ts @@ -32,7 +32,7 @@ declare namespace TagsInput { readonly getTagDisplayValue: (tag: Tag) => string; readonly onRemove: (tagIndex: number) => void; readonly tag: Tag; - readonly key: string | number; + readonly key: number; } type RenderLayout = (tagElements: React.ReactElement[], inputElement: React.ReactElement) => React.ReactChild; From b98fbc46941ecd163f7b14ae5170d3d9c87ffe6d Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 4 Dec 2023 08:03:23 -0800 Subject: [PATCH 040/519] Update string.prototype.matchall for TS 5.4 (#67760) matchAll actually returns RegExpExecArray not RegExpMatchArray -- index and input are not optional. --- types/string.prototype.matchall/index.d.ts | 2 +- types/string.prototype.matchall/package.json | 1 + .../string.prototype.matchall-tests.ts | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/types/string.prototype.matchall/index.d.ts b/types/string.prototype.matchall/index.d.ts index d996425af12d10..7134d95ce3957d 100644 --- a/types/string.prototype.matchall/index.d.ts +++ b/types/string.prototype.matchall/index.d.ts @@ -4,7 +4,7 @@ * @param str string to match * @param regexp A variable name or string literal containing the regular expression pattern and flags. */ -declare function matchAll(str: string, regexp: string | RegExp): IterableIterator; +declare function matchAll(str: string, regexp: string | RegExp): IterableIterator; declare namespace matchAll { function shim(): void; diff --git a/types/string.prototype.matchall/package.json b/types/string.prototype.matchall/package.json index dccfd00f1a889f..21bacd3e2549f3 100644 --- a/types/string.prototype.matchall/package.json +++ b/types/string.prototype.matchall/package.json @@ -1,6 +1,7 @@ { "private": true, "name": "@types/string.prototype.matchall", + "minimumTypeScriptVersion": "5.4", "version": "4.0.9999", "projects": [ "https://github.com/ljharb/String.prototype.matchAll#readme" diff --git a/types/string.prototype.matchall/string.prototype.matchall-tests.ts b/types/string.prototype.matchall/string.prototype.matchall-tests.ts index 6df288c3294ee4..1e33104016a22f 100644 --- a/types/string.prototype.matchall/string.prototype.matchall-tests.ts +++ b/types/string.prototype.matchall/string.prototype.matchall-tests.ts @@ -4,9 +4,9 @@ const str = "aabc"; const nonRegexStr = "ab"; const globalRegex = /[ac]/g; -matchAll(str, nonRegexStr); // $ExpectType IterableIterator -matchAll(str, new RegExp(nonRegexStr, "g")); // $ExpectType IterableIterator -matchAll(str, globalRegex); // $ExpectType IterableIterator +matchAll(str, nonRegexStr); // $ExpectType IterableIterator +matchAll(str, new RegExp(nonRegexStr, "g")); // $ExpectType IterableIterator +matchAll(str, globalRegex); // $ExpectType IterableIterator matchAll.shim(); // $ExpectType void -str.matchAll(globalRegex); // $ExpectType IterableIterator -str.matchAll(new RegExp(nonRegexStr, "g")); // $ExpectType IterableIterator +str.matchAll(globalRegex); // $ExpectType IterableIterator +str.matchAll(new RegExp(nonRegexStr, "g")); // $ExpectType IterableIterator From bb5de478357e401c2d22b27d1c9902480ca8c4ae Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:11:08 +0100 Subject: [PATCH 041/519] [react-native-snackbar-component] Replace usage of React's global JSX namespace with scoped JSX (#67684) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-native-snackbar-component/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native-snackbar-component/index.d.ts b/types/react-native-snackbar-component/index.d.ts index 8782e6d6be40a4..8f1207e09bdc7d 100644 --- a/types/react-native-snackbar-component/index.d.ts +++ b/types/react-native-snackbar-component/index.d.ts @@ -13,7 +13,7 @@ export interface SnackbarComponentProps { top?: number | Animated.Value | undefined; bottom?: number | Animated.Value | undefined; position?: "bottom" | "top" | undefined; - textMessage?: string | JSX.Element | undefined; + textMessage?: string | React.JSX.Element | undefined; autoHidingTime?: number | undefined; visible?: boolean | undefined; containerStyle?: ViewStyle | undefined; From 895c06841147ef573bfae94bfb5147fc6c90e72b Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:12:03 +0100 Subject: [PATCH 042/519] [react-big-calendar] Replace usage of React's global JSX namespace with scoped JSX (#67635) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-big-calendar/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-big-calendar/index.d.ts b/types/react-big-calendar/index.d.ts index 9ff3fbc22c3b5a..c7d8be7a426873 100644 --- a/types/react-big-calendar/index.d.ts +++ b/types/react-big-calendar/index.d.ts @@ -185,7 +185,7 @@ export interface ResourceHeaderProps { export interface DateCellWrapperProps { range: Date[]; value: Date; - children: JSX.Element; + children: React.JSX.Element; } export interface Components { From 88ab782f09d27e7716e54a5bf89ac264db369347 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:12:22 +0100 Subject: [PATCH 043/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67705=20[r?= =?UTF-8?q?eact-sound]=20Replace=20usage=20of=20React's=20global=20JSX=20n?= =?UTF-8?q?amespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-sound/react-sound-tests.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-sound/react-sound-tests.tsx b/types/react-sound/react-sound-tests.tsx index 5f749ecf486c63..fb400dec980442 100644 --- a/types/react-sound/react-sound-tests.tsx +++ b/types/react-sound/react-sound-tests.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import ReactSound from "react-sound"; -const ReactSoundRequiredOptions: JSX.Element = ( +const ReactSoundRequiredOptions: React.JSX.Element = ( ({}); -const ReactSoundAllOptions: JSX.Element = ( +const ReactSoundAllOptions: React.JSX.Element = ( Date: Mon, 4 Dec 2023 18:12:32 +0100 Subject: [PATCH 044/519] [markdown-navbar] Replace usage of React's global JSX namespace with scoped JSX (#67619) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/markdown-navbar/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/markdown-navbar/index.d.ts b/types/markdown-navbar/index.d.ts index 961814d3e176e2..9222910c0891d9 100644 --- a/types/markdown-navbar/index.d.ts +++ b/types/markdown-navbar/index.d.ts @@ -1,4 +1,4 @@ -import { MouseEvent } from "react"; +import { MouseEvent, JSX } from "react"; declare namespace MarkdownNavbar { interface MarkdownNavbarProps { From d9b20e7cbfc02e78f5155a1e77ad376e9cc83e6e Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:13:01 +0100 Subject: [PATCH 045/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67640=20[r?= =?UTF-8?q?eact-bootstrap-typeahead]=20Replace=20usage=20of=20React's=20gl?= =?UTF-8?q?obal=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-bootstrap-typeahead/index.d.ts | 2 +- .../react-bootstrap-typeahead-tests.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-bootstrap-typeahead/index.d.ts b/types/react-bootstrap-typeahead/index.d.ts index df97613793424e..a7575f57e3ee9b 100644 --- a/types/react-bootstrap-typeahead/index.d.ts +++ b/types/react-bootstrap-typeahead/index.d.ts @@ -207,7 +207,7 @@ export interface TypeaheadProps { multiple?: boolean | undefined; /* Override default new selection text. */ - newSelectionPrefix?: JSX.Element | string; + newSelectionPrefix?: React.JSX.Element | string; /* Invoked when the input is blurred. Receives an event. */ onBlur?: ((e: Event) => void) | undefined; diff --git a/types/react-bootstrap-typeahead/react-bootstrap-typeahead-tests.tsx b/types/react-bootstrap-typeahead/react-bootstrap-typeahead-tests.tsx index f09d34a95f6d93..1757eec74bcda7 100644 --- a/types/react-bootstrap-typeahead/react-bootstrap-typeahead-tests.tsx +++ b/types/react-bootstrap-typeahead/react-bootstrap-typeahead-tests.tsx @@ -65,7 +65,7 @@ class BasicExample extends React.Component { ); }); return [...accum, ...header, ...states]; - }, [] as JSX.Element[]); + }, [] as React.JSX.Element[]); return menuItems; }; From 50cc0f7489c995af939e289a853569ae2f282362 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:13:32 +0100 Subject: [PATCH 046/519] [moxy__next-router-scroll] Replace usage of React's global JSX namespace with scoped JSX (#67624) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/moxy__next-router-scroll/RouterScrollProvider.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/moxy__next-router-scroll/RouterScrollProvider.d.ts b/types/moxy__next-router-scroll/RouterScrollProvider.d.ts index ef0edbf30dac6f..695e4c188f53dc 100644 --- a/types/moxy__next-router-scroll/RouterScrollProvider.d.ts +++ b/types/moxy__next-router-scroll/RouterScrollProvider.d.ts @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import { ReactNode, JSX } from "react"; import { ShouldUpdateScroll } from "scroll-behavior"; import { NextScrollBehaviorContext } from "./scroll-behavior"; export default ScrollBehaviorProvider; From e2a5397c5bfb7d36237341653469875f9adf50ab Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:14:08 +0100 Subject: [PATCH 047/519] [giusto__ink-router] Replace usage of React's global JSX namespace with scoped JSX (#67613) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/giusto__ink-router/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/giusto__ink-router/index.d.ts b/types/giusto__ink-router/index.d.ts index 1c482d12bd35b1..cc5e72f7e10a68 100644 --- a/types/giusto__ink-router/index.d.ts +++ b/types/giusto__ink-router/index.d.ts @@ -1,5 +1,5 @@ import { History, Location } from "history"; -import { Component, ComponentType, ReactNode } from "react"; +import { Component, ComponentType, ReactNode, JSX } from "react"; export interface RouterProps { children: NonNullable; From 47d4b1d9d9d72ab9525bbde6740f9160451255ac Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:14:21 +0100 Subject: [PATCH 048/519] [react-syntax-highlighter] Replace usage of React's global JSX namespace with scoped JSX (#67713) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-syntax-highlighter/index.d.ts | 6 +++--- .../react-syntax-highlighter-tests.tsx | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/types/react-syntax-highlighter/index.d.ts b/types/react-syntax-highlighter/index.d.ts index b75a0bff8b8628..1893c37b1a3604 100644 --- a/types/react-syntax-highlighter/index.d.ts +++ b/types/react-syntax-highlighter/index.d.ts @@ -3,7 +3,7 @@ type lineTagPropsFunction = (lineNumber: number) => React.HTMLProps interface rendererNode { type: "element" | "text"; value?: string | number | undefined; - tagName?: keyof JSX.IntrinsicElements | React.ComponentType | undefined; + tagName?: keyof React.JSX.IntrinsicElements | React.ComponentType | undefined; properties?: { className: any[]; [key: string]: any }; children?: rendererNode[]; } @@ -30,8 +30,8 @@ declare module "react-syntax-highlighter" { wrapLongLines?: boolean | undefined; lineProps?: lineTagPropsFunction | React.HTMLProps | undefined; renderer?: (props: rendererProps) => React.ReactNode; - PreTag?: keyof JSX.IntrinsicElements | React.ComponentType | undefined; - CodeTag?: keyof JSX.IntrinsicElements | React.ComponentType | undefined; + PreTag?: keyof React.JSX.IntrinsicElements | React.ComponentType | undefined; + CodeTag?: keyof React.JSX.IntrinsicElements | React.ComponentType | undefined; [spread: string]: any; } diff --git a/types/react-syntax-highlighter/react-syntax-highlighter-tests.tsx b/types/react-syntax-highlighter/react-syntax-highlighter-tests.tsx index d9ded0f22d226c..6f231b0654be4f 100644 --- a/types/react-syntax-highlighter/react-syntax-highlighter-tests.tsx +++ b/types/react-syntax-highlighter/react-syntax-highlighter-tests.tsx @@ -24,7 +24,7 @@ const codeString = `class CPP { } `; -function hljsHighlighter(): JSX.Element { +function hljsHighlighter(): React.JSX.Element { SyntaxHighlighter.supportedLanguages; // $ExpectType string[] return ( @@ -34,7 +34,7 @@ function hljsHighlighter(): JSX.Element { ); } -function hljsLightHighlighter(): JSX.Element { +function hljsLightHighlighter(): React.JSX.Element { LightHighlighter.registerLanguage("javascript", javascript); return ( @@ -44,7 +44,7 @@ function hljsLightHighlighter(): JSX.Element { ); } -function prismHighlighter(): JSX.Element { +function prismHighlighter(): React.JSX.Element { PrismSyntaxHighlighter.supportedLanguages; // $ExpectType string[] return ( @@ -53,7 +53,7 @@ function prismHighlighter(): JSX.Element { ); } -function primsLightHighlighter(): JSX.Element { +function primsLightHighlighter(): React.JSX.Element { PrismLightHighlighter.registerLanguage("jsx", jsx); return ( From 30f3a8ab4fca4a2faa4127f173e3c09b1686b366 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:14:49 +0100 Subject: [PATCH 049/519] [react-instantsearch-dom] Replace usage of React's global JSX namespace with scoped JSX (#67660) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-instantsearch-dom/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/react-instantsearch-dom/index.d.ts b/types/react-instantsearch-dom/index.d.ts index 773bb9bcc26ae5..c958d4707ba9db 100644 --- a/types/react-instantsearch-dom/index.d.ts +++ b/types/react-instantsearch-dom/index.d.ts @@ -119,9 +119,9 @@ export interface SearchBoxProps extends CommonWidgetProps { searchAsYouType?: boolean | undefined; showLoadingIndicator?: boolean | undefined; - submit?: JSX.Element | undefined; - reset?: JSX.Element | undefined; - loadingIndicator?: JSX.Element | undefined; + submit?: React.JSX.Element | undefined; + reset?: React.JSX.Element | undefined; + loadingIndicator?: React.JSX.Element | undefined; onSubmit?: ((event: React.SyntheticEvent) => any) | undefined; onReset?: ((event: React.SyntheticEvent) => any) | undefined; From e66e4e79773bc394d7e41d89878a6c6791bc930a Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:15:08 +0100 Subject: [PATCH 050/519] [react-simple-oauth2-login] Replace usage of React's global JSX namespace with scoped JSX (#67700) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-simple-oauth2-login/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-simple-oauth2-login/index.d.ts b/types/react-simple-oauth2-login/index.d.ts index 70938f3158806e..f6c876f1da64d9 100644 --- a/types/react-simple-oauth2-login/index.d.ts +++ b/types/react-simple-oauth2-login/index.d.ts @@ -26,4 +26,4 @@ export interface OAuth2LoginProps { extraParams?: Record; } -export default function OAuth2Login(props: OAuth2LoginProps): JSX.Element; +export default function OAuth2Login(props: OAuth2LoginProps): React.JSX.Element; From e4b289a84a157cfecb58fa369c001540dad1fda7 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:15:21 +0100 Subject: [PATCH 051/519] [cxs] Replace usage of React's global JSX namespace with scoped JSX (#67607) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/cxs/component/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/cxs/component/index.d.ts b/types/cxs/component/index.d.ts index 96a46ef54e9f5c..48be4e9036e3fc 100644 --- a/types/cxs/component/index.d.ts +++ b/types/cxs/component/index.d.ts @@ -3,14 +3,14 @@ import { CSSObject } from "../index"; type ApparentComponentProps< // eslint-disable-next-line @typescript-eslint/no-explicit-any - C extends keyof JSX.IntrinsicElements | React.JSXElementConstructor, -> = C extends React.JSXElementConstructor ? JSX.LibraryManagedAttributes + C extends keyof React.JSX.IntrinsicElements | React.JSXElementConstructor, +> = C extends React.JSXElementConstructor ? React.JSX.LibraryManagedAttributes : React.ComponentPropsWithRef; declare const cxsComponent: { < Component extends - | keyof JSX.IntrinsicElements + | keyof React.JSX.IntrinsicElements // eslint-disable-next-line @typescript-eslint/no-explicit-any | React.JSXElementConstructor, PropsType extends object & ApparentComponentProps, From 31306fe7f5d6d0bbb4168b6b01e42e8668f4bce0 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:15:31 +0100 Subject: [PATCH 052/519] [marvelapp__react-ab-test] Replace usage of React's global JSX namespace with scoped JSX (#67620) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/marvelapp__react-ab-test/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/marvelapp__react-ab-test/index.d.ts b/types/marvelapp__react-ab-test/index.d.ts index f145da14483180..ad5070345e4fa5 100644 --- a/types/marvelapp__react-ab-test/index.d.ts +++ b/types/marvelapp__react-ab-test/index.d.ts @@ -1,4 +1,4 @@ -/// +import { JSX } from "react"; export type ListenerCallback = (experimentName: string, variantName: string) => void; export interface Subscription { From 46535dbd726e8364c547a48e509a8732adf24dcd Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:15:41 +0100 Subject: [PATCH 053/519] [react-slider] Replace usage of React's global JSX namespace with scoped JSX (#67702) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-slider/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-slider/index.d.ts b/types/react-slider/index.d.ts index 760f61e05ed13e..e9139d7b3f857b 100644 --- a/types/react-slider/index.d.ts +++ b/types/react-slider/index.d.ts @@ -1,4 +1,4 @@ -import { Component, HTMLProps, RefCallback } from "react"; +import { Component, HTMLProps, RefCallback, JSX } from "react"; interface HTMLPropsWithRefCallback extends HTMLProps { ref: RefCallback; From 34c9b6d251e3c5272cfb8cc3821b600fe9de707d Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:15:51 +0100 Subject: [PATCH 054/519] [react-copy-write] Replace usage of React's global JSX namespace with scoped JSX (#67644) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-copy-write/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-copy-write/index.d.ts b/types/react-copy-write/index.d.ts index d7157ea8014503..c598c9cbe8279b 100644 --- a/types/react-copy-write/index.d.ts +++ b/types/react-copy-write/index.d.ts @@ -1,4 +1,4 @@ -import { Component } from "react"; +import { Component, JSX } from "react"; // It'd be nice if this could somehow be improved! Perhaps we need variadic // kinds plus infer keyword? Alternatively unions may solve our issue if we had From a7caafcffe89f8bf48762e00335adcbb33d6e9aa Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:16:07 +0100 Subject: [PATCH 055/519] [react-sortable-tree] Replace usage of React's global JSX namespace with scoped JSX (#67704) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-sortable-tree/index.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/types/react-sortable-tree/index.d.ts b/types/react-sortable-tree/index.d.ts index 49e5af7f59f89a..57f018fe042863 100644 --- a/types/react-sortable-tree/index.d.ts +++ b/types/react-sortable-tree/index.d.ts @@ -98,12 +98,12 @@ export interface NodeRendererProps { canDrag: boolean; scaffoldBlockPxWidth: number; toggleChildrenVisibility?(data: NodeData): void; - buttons?: JSX.Element[] | undefined; + buttons?: React.JSX.Element[] | undefined; className?: string | undefined; style?: React.CSSProperties | undefined; - title?: ((data: NodeData) => JSX.Element | JSX.Element) | undefined; - subtitle?: ((data: NodeData) => JSX.Element | JSX.Element) | undefined; - icons?: JSX.Element[] | undefined; + title?: ((data: NodeData) => React.JSX.Element | React.JSX.Element) | undefined; + subtitle?: ((data: NodeData) => React.JSX.Element | React.JSX.Element) | undefined; + icons?: React.JSX.Element[] | undefined; lowerSiblingCounts: number[]; swapDepth?: number | undefined; swapFrom?: number | undefined; @@ -147,7 +147,7 @@ export interface TreeRendererProps { rowDirection?: "ltr" | "rtl" | undefined; listIndex: number; - children: JSX.Element[]; + children: React.JSX.Element[]; style?: React.CSSProperties | undefined; // Drop target @@ -203,11 +203,11 @@ export interface ReactSortableTreeProps extends ThemeTreeProps { } // eslint-disable-next-line @definitelytyped/no-unnecessary-generics -declare function SortableTree(props: React.PropsWithChildren>): JSX.Element; +declare function SortableTree(props: React.PropsWithChildren>): React.JSX.Element; // eslint-disable-next-line @definitelytyped/no-unnecessary-generics declare function SortableTreeWithoutDndContext( props: React.PropsWithChildren>, -): JSX.Element; +): React.JSX.Element; export { SortableTree, SortableTreeWithoutDndContext }; export default SortableTree; From 21e30ce05150c695f753d9a0fc457dfef577bc6a Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:16:20 +0100 Subject: [PATCH 056/519] [react-burger-menu] Replace usage of React's global JSX namespace with scoped JSX (#67641) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-burger-menu/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-burger-menu/index.d.ts b/types/react-burger-menu/index.d.ts index 01305756c3363d..e1953e7a6d212a 100644 --- a/types/react-burger-menu/index.d.ts +++ b/types/react-burger-menu/index.d.ts @@ -28,8 +28,8 @@ export interface Props { className?: string | undefined; crossButtonClassName?: string | undefined; crossClassName?: string | undefined; - customBurgerIcon?: JSX.Element | false | undefined; - customCrossIcon?: JSX.Element | false | undefined; + customBurgerIcon?: React.JSX.Element | false | undefined; + customCrossIcon?: React.JSX.Element | false | undefined; customOnKeyDown?(event: React.KeyboardEvent): void; disableAutoFocus?: boolean | undefined; disableCloseOnEsc?: boolean | undefined; From 7a612c37ea3b6791845a3914e7675099bd748bcb Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:16:34 +0100 Subject: [PATCH 057/519] [wordpress__notices] Replace usage of React's global JSX namespace with scoped JSX (#67751) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/wordpress__notices/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/wordpress__notices/index.d.ts b/types/wordpress__notices/index.d.ts index 0957cf0e652131..ff17b0d96a9501 100644 --- a/types/wordpress__notices/index.d.ts +++ b/types/wordpress__notices/index.d.ts @@ -1,5 +1,5 @@ import { StoreDescriptor } from "@wordpress/data"; -import { MouseEventHandler } from "react"; +import { MouseEventHandler, JSX } from "react"; declare module "@wordpress/data" { function dispatch(key: "core/notices"): typeof import("./store/actions"); From 51b90aaa3e2cc5a53cd6f63c75bdf201c2c0cd0d Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:16:47 +0100 Subject: [PATCH 058/519] [wordpress__components] Replace usage of React's global JSX namespace with scoped JSX (#67748) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/wordpress__components/autocomplete/index.d.ts | 2 +- types/wordpress__components/base-control/index.d.ts | 2 +- types/wordpress__components/card/body/index.d.ts | 2 ++ types/wordpress__components/card/divider/index.d.ts | 2 ++ types/wordpress__components/card/footer/index.d.ts | 2 ++ types/wordpress__components/card/header/index.d.ts | 2 ++ types/wordpress__components/card/index.d.ts | 1 + types/wordpress__components/card/media/index.d.ts | 1 + types/wordpress__components/disabled/index.d.ts | 2 +- types/wordpress__components/dropdown-menu/index.d.ts | 2 +- types/wordpress__components/dropdown/index.d.ts | 2 +- types/wordpress__components/form-file-upload/index.d.ts | 2 +- types/wordpress__components/icon-button/index.d.ts | 2 +- types/wordpress__components/icon/index.d.ts | 2 +- types/wordpress__components/placeholder/index.d.ts | 2 +- types/wordpress__components/primitives/svg/index.d.ts | 2 +- types/wordpress__components/radio-control/index.d.ts | 2 +- types/wordpress__components/select-control/index.d.ts | 2 +- types/wordpress__components/slot-fill/slot.d.ts | 2 +- types/wordpress__components/tab-panel/index.d.ts | 2 +- types/wordpress__components/tooltip/index.d.ts | 2 +- types/wordpress__components/ui/context/wordpress-component.d.ts | 2 +- 22 files changed, 26 insertions(+), 16 deletions(-) diff --git a/types/wordpress__components/autocomplete/index.d.ts b/types/wordpress__components/autocomplete/index.d.ts index 72847b54c88d35..1507d828fe3ba0 100644 --- a/types/wordpress__components/autocomplete/index.d.ts +++ b/types/wordpress__components/autocomplete/index.d.ts @@ -1,5 +1,5 @@ import { Value } from "@wordpress/rich-text"; -import { ReactNode } from "react"; +import { ReactNode, JSX } from "react"; declare namespace Autocomplete { /** diff --git a/types/wordpress__components/base-control/index.d.ts b/types/wordpress__components/base-control/index.d.ts index 9713ad6448c09b..1843da4380f94e 100644 --- a/types/wordpress__components/base-control/index.d.ts +++ b/types/wordpress__components/base-control/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType, ReactNode } from "react"; +import { ComponentType, ReactNode, JSX } from "react"; declare namespace BaseControl { interface ControlProps { diff --git a/types/wordpress__components/card/body/index.d.ts b/types/wordpress__components/card/body/index.d.ts index e542edf5c0da93..e991b196d8aa53 100644 --- a/types/wordpress__components/card/body/index.d.ts +++ b/types/wordpress__components/card/body/index.d.ts @@ -1,5 +1,7 @@ import Card from ".."; +import { JSX } from "react"; + declare namespace CardBody { type Props = { /** diff --git a/types/wordpress__components/card/divider/index.d.ts b/types/wordpress__components/card/divider/index.d.ts index 84b72f6f6365bf..f5281dfd228425 100644 --- a/types/wordpress__components/card/divider/index.d.ts +++ b/types/wordpress__components/card/divider/index.d.ts @@ -1,5 +1,7 @@ import { HorizontalRule } from "../../primitives"; +import { JSX } from "react"; + declare namespace CardDivider { type Props = { /** diff --git a/types/wordpress__components/card/footer/index.d.ts b/types/wordpress__components/card/footer/index.d.ts index a9c9726dc38ba0..31b31342469bac 100644 --- a/types/wordpress__components/card/footer/index.d.ts +++ b/types/wordpress__components/card/footer/index.d.ts @@ -1,5 +1,7 @@ import Card from ".."; +import { JSX } from "react"; + declare namespace CardFooter { type Props = { /** diff --git a/types/wordpress__components/card/header/index.d.ts b/types/wordpress__components/card/header/index.d.ts index f60015c29efa4f..2cddf6165cb3a0 100644 --- a/types/wordpress__components/card/header/index.d.ts +++ b/types/wordpress__components/card/header/index.d.ts @@ -1,5 +1,7 @@ import Card from ".."; +import { JSX } from "react"; + declare namespace CardHeader { type Props = { /** diff --git a/types/wordpress__components/card/index.d.ts b/types/wordpress__components/card/index.d.ts index d2d308950948dd..1fbc4a035a44ad 100644 --- a/types/wordpress__components/card/index.d.ts +++ b/types/wordpress__components/card/index.d.ts @@ -1,3 +1,4 @@ +import { JSX } from "react"; declare namespace Card { type CardSize = "large" | "medium" | "small" | "extraSmall"; type Props = { diff --git a/types/wordpress__components/card/media/index.d.ts b/types/wordpress__components/card/media/index.d.ts index 84da151d3a8866..8a8270113a99aa 100644 --- a/types/wordpress__components/card/media/index.d.ts +++ b/types/wordpress__components/card/media/index.d.ts @@ -1,3 +1,4 @@ +import { JSX } from "react"; declare namespace CardMedia { type Props = { /** diff --git a/types/wordpress__components/disabled/index.d.ts b/types/wordpress__components/disabled/index.d.ts index eba31a10e17dab..06cda493ef6835 100644 --- a/types/wordpress__components/disabled/index.d.ts +++ b/types/wordpress__components/disabled/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType, Consumer, ReactNode } from "react"; +import { ComponentType, Consumer, ReactNode, JSX } from "react"; declare namespace Disabled { interface Props { diff --git a/types/wordpress__components/dropdown-menu/index.d.ts b/types/wordpress__components/dropdown-menu/index.d.ts index 858fbfe86284d7..654699d443d8fd 100644 --- a/types/wordpress__components/dropdown-menu/index.d.ts +++ b/types/wordpress__components/dropdown-menu/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType } from "react"; +import { ComponentType, JSX } from "react"; import Button from "../button"; import Dashicon from "../dashicon"; diff --git a/types/wordpress__components/dropdown/index.d.ts b/types/wordpress__components/dropdown/index.d.ts index db12d7f413fa9b..1a84ce266a13b4 100644 --- a/types/wordpress__components/dropdown/index.d.ts +++ b/types/wordpress__components/dropdown/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType, ReactNode } from "react"; +import { ComponentType, ReactNode, JSX } from "react"; import Popover from "../popover"; diff --git a/types/wordpress__components/form-file-upload/index.d.ts b/types/wordpress__components/form-file-upload/index.d.ts index a19c76fb9f4639..b564882ad3ec90 100644 --- a/types/wordpress__components/form-file-upload/index.d.ts +++ b/types/wordpress__components/form-file-upload/index.d.ts @@ -1,4 +1,4 @@ -import { ChangeEventHandler, ComponentType } from "react"; +import { ChangeEventHandler, ComponentType, JSX } from "react"; import IconButton from "../icon-button"; diff --git a/types/wordpress__components/icon-button/index.d.ts b/types/wordpress__components/icon-button/index.d.ts index 92e75d2f0d4ae3..396097bdc532b7 100644 --- a/types/wordpress__components/icon-button/index.d.ts +++ b/types/wordpress__components/icon-button/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType } from "react"; +import { ComponentType, JSX } from "react"; import Button from "../button"; import Dashicon from "../dashicon"; diff --git a/types/wordpress__components/icon/index.d.ts b/types/wordpress__components/icon/index.d.ts index 961dd9ec528e68..9cca877f61cdb0 100644 --- a/types/wordpress__components/icon/index.d.ts +++ b/types/wordpress__components/icon/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType, ReactComponentElement, ReactDOM, SVGProps } from "react"; +import { ComponentType, ReactComponentElement, ReactDOM, SVGProps, JSX } from "react"; import Dashicon from "../dashicon"; diff --git a/types/wordpress__components/placeholder/index.d.ts b/types/wordpress__components/placeholder/index.d.ts index f98ce8ffd175e5..f430f6926f8b54 100644 --- a/types/wordpress__components/placeholder/index.d.ts +++ b/types/wordpress__components/placeholder/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType, HTMLProps } from "react"; +import { ComponentType, HTMLProps, JSX } from "react"; import Icon from "../icon"; diff --git a/types/wordpress__components/primitives/svg/index.d.ts b/types/wordpress__components/primitives/svg/index.d.ts index 8be0a4d23a609b..af0c8dd9b20682 100644 --- a/types/wordpress__components/primitives/svg/index.d.ts +++ b/types/wordpress__components/primitives/svg/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType } from "react"; +import { ComponentType, JSX } from "react"; export const Circle: ComponentType; export const G: ComponentType; diff --git a/types/wordpress__components/radio-control/index.d.ts b/types/wordpress__components/radio-control/index.d.ts index e37efb7db2feaa..160d916e8f5d60 100644 --- a/types/wordpress__components/radio-control/index.d.ts +++ b/types/wordpress__components/radio-control/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType } from "react"; +import { ComponentType, JSX } from "react"; import BaseControl from "../base-control"; diff --git a/types/wordpress__components/select-control/index.d.ts b/types/wordpress__components/select-control/index.d.ts index 5832fd633dc0ce..8fcab726729368 100644 --- a/types/wordpress__components/select-control/index.d.ts +++ b/types/wordpress__components/select-control/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType, HTMLProps } from "react"; +import { ComponentType, HTMLProps, JSX } from "react"; import BaseControl from "../base-control"; diff --git a/types/wordpress__components/slot-fill/slot.d.ts b/types/wordpress__components/slot-fill/slot.d.ts index ce028f18850aa5..fa9a947efa7cdd 100644 --- a/types/wordpress__components/slot-fill/slot.d.ts +++ b/types/wordpress__components/slot-fill/slot.d.ts @@ -1,4 +1,4 @@ -import { ComponentType } from "react"; +import { ComponentType, JSX } from "react"; declare namespace Slot { interface Props { diff --git a/types/wordpress__components/tab-panel/index.d.ts b/types/wordpress__components/tab-panel/index.d.ts index 4da97ae48ef629..1adfdfa6d8eb91 100644 --- a/types/wordpress__components/tab-panel/index.d.ts +++ b/types/wordpress__components/tab-panel/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType } from "react"; +import { ComponentType, JSX } from "react"; declare namespace TabPanel { interface Tab { diff --git a/types/wordpress__components/tooltip/index.d.ts b/types/wordpress__components/tooltip/index.d.ts index a754908664379c..7ff1923866786e 100644 --- a/types/wordpress__components/tooltip/index.d.ts +++ b/types/wordpress__components/tooltip/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType, ReactNode } from "react"; +import { ComponentType, ReactNode, JSX } from "react"; import Popover from "../popover"; import Shortcut from "../shortcut"; diff --git a/types/wordpress__components/ui/context/wordpress-component.d.ts b/types/wordpress__components/ui/context/wordpress-component.d.ts index 064da0b51dd1a7..99ad793aec87d8 100644 --- a/types/wordpress__components/ui/context/wordpress-component.d.ts +++ b/types/wordpress__components/ui/context/wordpress-component.d.ts @@ -1,4 +1,4 @@ -import type { ComponentPropsWithRef, ElementType } from "react"; +import type { ComponentPropsWithRef, ElementType, JSX } from "react"; /** * This file copied from https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/ui/context/wordpress-component.ts From 99e9284c34be337262974d548a176ceff85f9c52 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:16:57 +0100 Subject: [PATCH 059/519] [wordpress__blocks] Replace usage of React's global JSX namespace with scoped JSX (#67747) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/wordpress__blocks/api/categories.d.ts | 2 ++ types/wordpress__blocks/api/node.d.ts | 2 +- types/wordpress__blocks/api/parser.d.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/types/wordpress__blocks/api/categories.d.ts b/types/wordpress__blocks/api/categories.d.ts index dcbc2181011191..b71743e4a59bf8 100644 --- a/types/wordpress__blocks/api/categories.d.ts +++ b/types/wordpress__blocks/api/categories.d.ts @@ -1,5 +1,7 @@ import { Dashicon } from "@wordpress/components"; +import { JSX } from "react"; + export interface Category { slug: string; title: string; diff --git a/types/wordpress__blocks/api/node.d.ts b/types/wordpress__blocks/api/node.d.ts index ea2f8890fe993b..c8372ca7a4330b 100644 --- a/types/wordpress__blocks/api/node.d.ts +++ b/types/wordpress__blocks/api/node.d.ts @@ -1,4 +1,4 @@ -import { ReactChild, ReactElement } from "react"; +import { ReactChild, ReactElement, JSX } from "react"; import children from "./children"; diff --git a/types/wordpress__blocks/api/parser.d.ts b/types/wordpress__blocks/api/parser.d.ts index d235aecf8f1445..3a366b80f78263 100644 --- a/types/wordpress__blocks/api/parser.d.ts +++ b/types/wordpress__blocks/api/parser.d.ts @@ -1,4 +1,4 @@ -import { ReactChild } from "react"; +import { ReactChild, JSX } from "react"; import { Block, BlockInstance } from "../"; From f4620b4c94764d956f7c652a46cd0a0ee6ebcfaf Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:17:05 +0100 Subject: [PATCH 060/519] [wordpress__editor] Replace usage of React's global JSX namespace with scoped JSX (#67750) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/wordpress__editor/components/post-taxonomies/index.d.ts | 2 +- types/wordpress__editor/components/post-visibility/check.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/wordpress__editor/components/post-taxonomies/index.d.ts b/types/wordpress__editor/components/post-taxonomies/index.d.ts index 5c467968cf6558..3c4f537ecf95ff 100644 --- a/types/wordpress__editor/components/post-taxonomies/index.d.ts +++ b/types/wordpress__editor/components/post-taxonomies/index.d.ts @@ -1,5 +1,5 @@ import { Taxonomy } from "@wordpress/core-data"; -import { ComponentType, ReactNode } from "react"; +import { ComponentType, ReactNode, JSX } from "react"; declare namespace PostTaxonomies { interface Props { diff --git a/types/wordpress__editor/components/post-visibility/check.d.ts b/types/wordpress__editor/components/post-visibility/check.d.ts index 7428eccb07d72f..4ec80566e09ee0 100644 --- a/types/wordpress__editor/components/post-visibility/check.d.ts +++ b/types/wordpress__editor/components/post-visibility/check.d.ts @@ -1,4 +1,4 @@ -import { ComponentType } from "react"; +import { ComponentType, JSX } from "react"; declare namespace PostVisibilityCheck { interface RenderProps { From 6645d0b600f677371c0207c953fb213d0f4b047b Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:17:15 +0100 Subject: [PATCH 061/519] [wordpress__edit-post] Replace usage of React's global JSX namespace with scoped JSX (#67749) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- .../block-settings-menu/plugin-block-settings-menu-item.d.ts | 2 +- .../components/header/plugin-more-menu-item.d.ts | 2 +- .../components/header/plugin-sidebar-more-menu-item.d.ts | 2 +- .../components/sidebar/plugin-document-setting-panel.d.ts | 2 +- .../components/sidebar/plugin-post-publish-panel.d.ts | 2 +- .../components/sidebar/plugin-post-status-info.d.ts | 2 +- .../components/sidebar/plugin-pre-publish-panel.d.ts | 2 +- .../wordpress__edit-post/components/sidebar/plugin-sidebar.d.ts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/types/wordpress__edit-post/components/block-settings-menu/plugin-block-settings-menu-item.d.ts b/types/wordpress__edit-post/components/block-settings-menu/plugin-block-settings-menu-item.d.ts index 30b500929f01c9..0dd5a41dc19020 100644 --- a/types/wordpress__edit-post/components/block-settings-menu/plugin-block-settings-menu-item.d.ts +++ b/types/wordpress__edit-post/components/block-settings-menu/plugin-block-settings-menu-item.d.ts @@ -1,5 +1,5 @@ import { Dashicon } from "@wordpress/components"; -import { ComponentType, MouseEventHandler } from "react"; +import { ComponentType, MouseEventHandler, JSX } from "react"; declare namespace PluginBlockSettingsMenuItem { interface Props { diff --git a/types/wordpress__edit-post/components/header/plugin-more-menu-item.d.ts b/types/wordpress__edit-post/components/header/plugin-more-menu-item.d.ts index b81b4bc53e8652..754cf6a79c9f04 100644 --- a/types/wordpress__edit-post/components/header/plugin-more-menu-item.d.ts +++ b/types/wordpress__edit-post/components/header/plugin-more-menu-item.d.ts @@ -1,5 +1,5 @@ import { Dashicon, MenuItem } from "@wordpress/components"; -import { ComponentType, ReactNode } from "react"; +import { ComponentType, ReactNode, JSX } from "react"; declare namespace PluginMoreMenuItem { interface Props extends Omit { diff --git a/types/wordpress__edit-post/components/header/plugin-sidebar-more-menu-item.d.ts b/types/wordpress__edit-post/components/header/plugin-sidebar-more-menu-item.d.ts index 7e1f8d252fc5b5..58314db97e11b7 100644 --- a/types/wordpress__edit-post/components/header/plugin-sidebar-more-menu-item.d.ts +++ b/types/wordpress__edit-post/components/header/plugin-sidebar-more-menu-item.d.ts @@ -1,5 +1,5 @@ import { Dashicon } from "@wordpress/components"; -import { ComponentType, ReactNode } from "react"; +import { ComponentType, ReactNode, JSX } from "react"; declare namespace PluginSidebarMoreMenuItem { interface Props { diff --git a/types/wordpress__edit-post/components/sidebar/plugin-document-setting-panel.d.ts b/types/wordpress__edit-post/components/sidebar/plugin-document-setting-panel.d.ts index a5e471657f5518..20cc0e3eb63b82 100644 --- a/types/wordpress__edit-post/components/sidebar/plugin-document-setting-panel.d.ts +++ b/types/wordpress__edit-post/components/sidebar/plugin-document-setting-panel.d.ts @@ -1,5 +1,5 @@ import { Dashicon, Slot } from "@wordpress/components"; -import { FC, ReactNode } from "react"; +import { FC, ReactNode, JSX } from "react"; declare namespace PluginDocumentSettingPanel { interface Props { diff --git a/types/wordpress__edit-post/components/sidebar/plugin-post-publish-panel.d.ts b/types/wordpress__edit-post/components/sidebar/plugin-post-publish-panel.d.ts index 40ba1fcf061b64..2692f5e09cc44a 100644 --- a/types/wordpress__edit-post/components/sidebar/plugin-post-publish-panel.d.ts +++ b/types/wordpress__edit-post/components/sidebar/plugin-post-publish-panel.d.ts @@ -1,5 +1,5 @@ import { Slot } from "@wordpress/components"; -import { FC, ReactNode } from "react"; +import { FC, ReactNode, JSX } from "react"; declare namespace PluginPostPublishPanel { interface Props { diff --git a/types/wordpress__edit-post/components/sidebar/plugin-post-status-info.d.ts b/types/wordpress__edit-post/components/sidebar/plugin-post-status-info.d.ts index b242a0c4273b38..53ae0f3afca2ce 100644 --- a/types/wordpress__edit-post/components/sidebar/plugin-post-status-info.d.ts +++ b/types/wordpress__edit-post/components/sidebar/plugin-post-status-info.d.ts @@ -1,5 +1,5 @@ import { Slot } from "@wordpress/components"; -import { FC, ReactNode } from "react"; +import { FC, ReactNode, JSX } from "react"; declare namespace PluginPostStatusInfo { interface Props { diff --git a/types/wordpress__edit-post/components/sidebar/plugin-pre-publish-panel.d.ts b/types/wordpress__edit-post/components/sidebar/plugin-pre-publish-panel.d.ts index 424482d48a8bf4..9f443cdf5d6e04 100644 --- a/types/wordpress__edit-post/components/sidebar/plugin-pre-publish-panel.d.ts +++ b/types/wordpress__edit-post/components/sidebar/plugin-pre-publish-panel.d.ts @@ -1,5 +1,5 @@ import { Slot } from "@wordpress/components"; -import { FC, ReactNode } from "react"; +import { FC, ReactNode, JSX } from "react"; declare namespace PluginPrePublishPanel { interface Props { diff --git a/types/wordpress__edit-post/components/sidebar/plugin-sidebar.d.ts b/types/wordpress__edit-post/components/sidebar/plugin-sidebar.d.ts index 414edc60daf127..a53b581843df5b 100644 --- a/types/wordpress__edit-post/components/sidebar/plugin-sidebar.d.ts +++ b/types/wordpress__edit-post/components/sidebar/plugin-sidebar.d.ts @@ -1,5 +1,5 @@ import { Dashicon } from "@wordpress/components"; -import { ComponentType, ReactNode } from "react"; +import { ComponentType, ReactNode, JSX } from "react"; declare namespace PluginSidebar { interface Props { From 21397b87e8aa3c08316ffd776ee73ca62669a9a6 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:17:32 +0100 Subject: [PATCH 062/519] [react-blessed] Replace usage of React's global JSX namespace with scoped JSX (#67636) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-blessed/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-blessed/index.d.ts b/types/react-blessed/index.d.ts index b30a43b2a78f3d..dea61b91d6b2b0 100644 --- a/types/react-blessed/index.d.ts +++ b/types/react-blessed/index.d.ts @@ -7,8 +7,8 @@ export {}; // eslint-disable-next-line @typescript-eslint/no-invalid-void-type export type Callback = () => void | null | undefined; -export type renderer = (c: JSX.Element, s: Blessed.Widgets.Screen, callback?: Callback) => React.Component | null; -export function render(c: JSX.Element, s: Blessed.Widgets.Screen, callback?: Callback): React.Component | null; +export type renderer = (c: React.JSX.Element, s: Blessed.Widgets.Screen, callback?: Callback) => React.Component | null; +export function render(c: React.JSX.Element, s: Blessed.Widgets.Screen, callback?: Callback): React.Component | null; export function createBlessedRenderer(bls: any): renderer; From 9c1d538c6bf5cb18ad1223e7b1657af6457ddf8a Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:19:00 +0100 Subject: [PATCH 063/519] [reactabular-table] Replace usage of React's global JSX namespace with scoped JSX (#67732) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/reactabular-table/index.d.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/types/reactabular-table/index.d.ts b/types/reactabular-table/index.d.ts index 889d2d144243ee..259a971cd899d1 100644 --- a/types/reactabular-table/index.d.ts +++ b/types/reactabular-table/index.d.ts @@ -3,7 +3,7 @@ import * as React from "react"; export interface Column { property?: string | undefined; header?: { - label: string | JSX.Element; + label: string | React.JSX.Element; transforms?: ColumnTransform[] | undefined; formatters?: ColumnFormatter[] | undefined; draggable?: boolean | undefined; @@ -18,24 +18,24 @@ export interface Column { } export interface Renderers { - table?: string | (() => JSX.Element) | undefined; + table?: string | (() => React.JSX.Element) | undefined; header?: { - wrapper?: string | ((props: any) => JSX.Element) | ((props: any) => React.ReactInstance) | undefined; - row?: string | ((props: any) => JSX.Element) | ((props: any) => React.ReactInstance) | undefined; + wrapper?: string | ((props: any) => React.JSX.Element) | ((props: any) => React.ReactInstance) | undefined; + row?: string | ((props: any) => React.JSX.Element) | ((props: any) => React.ReactInstance) | undefined; cell?: | string - | ((props: any, column: Column) => JSX.Element) + | ((props: any, column: Column) => React.JSX.Element) | ((props: any) => React.ReactInstance) | undefined; } | undefined; body?: { - wrapper?: string | ((props: any) => JSX.Element) | ((props: any) => React.ReactInstance) | undefined; - row?: string | ((props: any, rowData: any) => JSX.Element) | ((props: any) => React.ReactInstance) | undefined; - cell?: string | ((props: any) => JSX.Element) | ((props: any) => React.ReactInstance) | undefined; + wrapper?: string | ((props: any) => React.JSX.Element) | ((props: any) => React.ReactInstance) | undefined; + row?: string | ((props: any, rowData: any) => React.JSX.Element) | ((props: any) => React.ReactInstance) | undefined; + cell?: string | ((props: any) => React.JSX.Element) | ((props: any) => React.ReactInstance) | undefined; } | undefined; } -export type ColumnTransform = (label: string | JSX.Element | React.ReactInstance, props: { +export type ColumnTransform = (label: string | React.JSX.Element | React.ReactInstance, props: { column: Column; columnIndex: number; property: string; @@ -49,18 +49,18 @@ export type CellTransform = (value: any, props: { property: string; }) => any; -export type ColumnFormatter = (label: string | JSX.Element, props: { +export type ColumnFormatter = (label: string | React.JSX.Element, props: { rowData: any; column: Column; columnIndex: number; -}) => string | JSX.Element; +}) => string | React.JSX.Element; export type CellFormatter = (value: any, props: { column: Column; columnIndex: number; rowData: any; rowIndex: number; -}) => string | JSX.Element; +}) => string | React.JSX.Element; export interface ProviderProps { children?: React.ReactNode; From 460dcf7625493914f1b9455412545f51db562013 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:19:27 +0100 Subject: [PATCH 064/519] [fslightbox-react] Replace usage of React's global JSX namespace with scoped JSX (#67610) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/fslightbox-react/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/fslightbox-react/index.d.ts b/types/fslightbox-react/index.d.ts index 0f45935808210f..e5f6970e287ecf 100644 --- a/types/fslightbox-react/index.d.ts +++ b/types/fslightbox-react/index.d.ts @@ -21,10 +21,10 @@ export interface CustomToolbarButtonProps extends Required { export interface FsLightboxProps { toggler: boolean; - sources?: Array | undefined; + sources?: Array | undefined; // captions - captions?: Array | undefined; // pro feature + captions?: Array | undefined; // pro feature // custom attributes customAttributes?: Array<{ [key: string]: string } | null> | undefined; @@ -51,7 +51,7 @@ export interface FsLightboxProps { // thumbs thumbs?: Array | undefined; // pro feature - thumbsIcons?: Array | undefined; // pro feature + thumbsIcons?: Array | undefined; // pro feature // animations initialAnimation?: string | undefined; // pro feature From cd101770f0bae29c5ef5b07c68a6aab0510a51aa Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 4 Dec 2023 17:20:56 +0000 Subject: [PATCH 065/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/giusto__ink-router/index.d.ts | 2 +- types/markdown-navbar/index.d.ts | 2 +- types/moxy__next-router-scroll/RouterScrollProvider.d.ts | 2 +- types/react-slider/index.d.ts | 2 +- types/reactabular-table/index.d.ts | 6 +++++- types/wordpress__blocks/api/node.d.ts | 2 +- types/wordpress__blocks/api/parser.d.ts | 2 +- types/wordpress__components/autocomplete/index.d.ts | 2 +- types/wordpress__components/base-control/index.d.ts | 2 +- types/wordpress__components/disabled/index.d.ts | 2 +- types/wordpress__components/dropdown/index.d.ts | 2 +- types/wordpress__components/icon/index.d.ts | 2 +- types/wordpress__components/tooltip/index.d.ts | 2 +- .../plugin-block-settings-menu-item.d.ts | 2 +- .../components/header/plugin-more-menu-item.d.ts | 2 +- .../components/header/plugin-sidebar-more-menu-item.d.ts | 2 +- .../components/sidebar/plugin-document-setting-panel.d.ts | 2 +- .../components/sidebar/plugin-post-publish-panel.d.ts | 2 +- .../components/sidebar/plugin-post-status-info.d.ts | 2 +- .../components/sidebar/plugin-pre-publish-panel.d.ts | 2 +- .../components/sidebar/plugin-sidebar.d.ts | 2 +- .../wordpress__editor/components/post-taxonomies/index.d.ts | 2 +- types/wordpress__notices/index.d.ts | 2 +- 23 files changed, 27 insertions(+), 23 deletions(-) diff --git a/types/giusto__ink-router/index.d.ts b/types/giusto__ink-router/index.d.ts index cc5e72f7e10a68..12cfe77c746503 100644 --- a/types/giusto__ink-router/index.d.ts +++ b/types/giusto__ink-router/index.d.ts @@ -1,5 +1,5 @@ import { History, Location } from "history"; -import { Component, ComponentType, ReactNode, JSX } from "react"; +import { Component, ComponentType, JSX, ReactNode } from "react"; export interface RouterProps { children: NonNullable; diff --git a/types/markdown-navbar/index.d.ts b/types/markdown-navbar/index.d.ts index 9222910c0891d9..f29c17523cbccd 100644 --- a/types/markdown-navbar/index.d.ts +++ b/types/markdown-navbar/index.d.ts @@ -1,4 +1,4 @@ -import { MouseEvent, JSX } from "react"; +import { JSX, MouseEvent } from "react"; declare namespace MarkdownNavbar { interface MarkdownNavbarProps { diff --git a/types/moxy__next-router-scroll/RouterScrollProvider.d.ts b/types/moxy__next-router-scroll/RouterScrollProvider.d.ts index 695e4c188f53dc..f986513a760663 100644 --- a/types/moxy__next-router-scroll/RouterScrollProvider.d.ts +++ b/types/moxy__next-router-scroll/RouterScrollProvider.d.ts @@ -1,4 +1,4 @@ -import { ReactNode, JSX } from "react"; +import { JSX, ReactNode } from "react"; import { ShouldUpdateScroll } from "scroll-behavior"; import { NextScrollBehaviorContext } from "./scroll-behavior"; export default ScrollBehaviorProvider; diff --git a/types/react-slider/index.d.ts b/types/react-slider/index.d.ts index e9139d7b3f857b..116f8545be7f17 100644 --- a/types/react-slider/index.d.ts +++ b/types/react-slider/index.d.ts @@ -1,4 +1,4 @@ -import { Component, HTMLProps, RefCallback, JSX } from "react"; +import { Component, HTMLProps, JSX, RefCallback } from "react"; interface HTMLPropsWithRefCallback extends HTMLProps { ref: RefCallback; diff --git a/types/reactabular-table/index.d.ts b/types/reactabular-table/index.d.ts index 259a971cd899d1..8278bb4c4d78fa 100644 --- a/types/reactabular-table/index.d.ts +++ b/types/reactabular-table/index.d.ts @@ -30,7 +30,11 @@ export interface Renderers { } | undefined; body?: { wrapper?: string | ((props: any) => React.JSX.Element) | ((props: any) => React.ReactInstance) | undefined; - row?: string | ((props: any, rowData: any) => React.JSX.Element) | ((props: any) => React.ReactInstance) | undefined; + row?: + | string + | ((props: any, rowData: any) => React.JSX.Element) + | ((props: any) => React.ReactInstance) + | undefined; cell?: string | ((props: any) => React.JSX.Element) | ((props: any) => React.ReactInstance) | undefined; } | undefined; } diff --git a/types/wordpress__blocks/api/node.d.ts b/types/wordpress__blocks/api/node.d.ts index c8372ca7a4330b..ced610097b86b5 100644 --- a/types/wordpress__blocks/api/node.d.ts +++ b/types/wordpress__blocks/api/node.d.ts @@ -1,4 +1,4 @@ -import { ReactChild, ReactElement, JSX } from "react"; +import { JSX, ReactChild, ReactElement } from "react"; import children from "./children"; diff --git a/types/wordpress__blocks/api/parser.d.ts b/types/wordpress__blocks/api/parser.d.ts index 3a366b80f78263..9770782949118e 100644 --- a/types/wordpress__blocks/api/parser.d.ts +++ b/types/wordpress__blocks/api/parser.d.ts @@ -1,4 +1,4 @@ -import { ReactChild, JSX } from "react"; +import { JSX, ReactChild } from "react"; import { Block, BlockInstance } from "../"; diff --git a/types/wordpress__components/autocomplete/index.d.ts b/types/wordpress__components/autocomplete/index.d.ts index 1507d828fe3ba0..03eb7cc30e37b7 100644 --- a/types/wordpress__components/autocomplete/index.d.ts +++ b/types/wordpress__components/autocomplete/index.d.ts @@ -1,5 +1,5 @@ import { Value } from "@wordpress/rich-text"; -import { ReactNode, JSX } from "react"; +import { JSX, ReactNode } from "react"; declare namespace Autocomplete { /** diff --git a/types/wordpress__components/base-control/index.d.ts b/types/wordpress__components/base-control/index.d.ts index 1843da4380f94e..1144da4c4e6844 100644 --- a/types/wordpress__components/base-control/index.d.ts +++ b/types/wordpress__components/base-control/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType, ReactNode, JSX } from "react"; +import { ComponentType, JSX, ReactNode } from "react"; declare namespace BaseControl { interface ControlProps { diff --git a/types/wordpress__components/disabled/index.d.ts b/types/wordpress__components/disabled/index.d.ts index 06cda493ef6835..d33bd75af80041 100644 --- a/types/wordpress__components/disabled/index.d.ts +++ b/types/wordpress__components/disabled/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType, Consumer, ReactNode, JSX } from "react"; +import { ComponentType, Consumer, JSX, ReactNode } from "react"; declare namespace Disabled { interface Props { diff --git a/types/wordpress__components/dropdown/index.d.ts b/types/wordpress__components/dropdown/index.d.ts index 1a84ce266a13b4..33745c2a0ad775 100644 --- a/types/wordpress__components/dropdown/index.d.ts +++ b/types/wordpress__components/dropdown/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType, ReactNode, JSX } from "react"; +import { ComponentType, JSX, ReactNode } from "react"; import Popover from "../popover"; diff --git a/types/wordpress__components/icon/index.d.ts b/types/wordpress__components/icon/index.d.ts index 9cca877f61cdb0..135a4caaf91dae 100644 --- a/types/wordpress__components/icon/index.d.ts +++ b/types/wordpress__components/icon/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType, ReactComponentElement, ReactDOM, SVGProps, JSX } from "react"; +import { ComponentType, JSX, ReactComponentElement, ReactDOM, SVGProps } from "react"; import Dashicon from "../dashicon"; diff --git a/types/wordpress__components/tooltip/index.d.ts b/types/wordpress__components/tooltip/index.d.ts index 7ff1923866786e..b2f9592cae916f 100644 --- a/types/wordpress__components/tooltip/index.d.ts +++ b/types/wordpress__components/tooltip/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType, ReactNode, JSX } from "react"; +import { ComponentType, JSX, ReactNode } from "react"; import Popover from "../popover"; import Shortcut from "../shortcut"; diff --git a/types/wordpress__edit-post/components/block-settings-menu/plugin-block-settings-menu-item.d.ts b/types/wordpress__edit-post/components/block-settings-menu/plugin-block-settings-menu-item.d.ts index 0dd5a41dc19020..c9a1d54affca9b 100644 --- a/types/wordpress__edit-post/components/block-settings-menu/plugin-block-settings-menu-item.d.ts +++ b/types/wordpress__edit-post/components/block-settings-menu/plugin-block-settings-menu-item.d.ts @@ -1,5 +1,5 @@ import { Dashicon } from "@wordpress/components"; -import { ComponentType, MouseEventHandler, JSX } from "react"; +import { ComponentType, JSX, MouseEventHandler } from "react"; declare namespace PluginBlockSettingsMenuItem { interface Props { diff --git a/types/wordpress__edit-post/components/header/plugin-more-menu-item.d.ts b/types/wordpress__edit-post/components/header/plugin-more-menu-item.d.ts index 754cf6a79c9f04..0c26ba4b7cee2e 100644 --- a/types/wordpress__edit-post/components/header/plugin-more-menu-item.d.ts +++ b/types/wordpress__edit-post/components/header/plugin-more-menu-item.d.ts @@ -1,5 +1,5 @@ import { Dashicon, MenuItem } from "@wordpress/components"; -import { ComponentType, ReactNode, JSX } from "react"; +import { ComponentType, JSX, ReactNode } from "react"; declare namespace PluginMoreMenuItem { interface Props extends Omit { diff --git a/types/wordpress__edit-post/components/header/plugin-sidebar-more-menu-item.d.ts b/types/wordpress__edit-post/components/header/plugin-sidebar-more-menu-item.d.ts index 58314db97e11b7..12aa5167dd6aec 100644 --- a/types/wordpress__edit-post/components/header/plugin-sidebar-more-menu-item.d.ts +++ b/types/wordpress__edit-post/components/header/plugin-sidebar-more-menu-item.d.ts @@ -1,5 +1,5 @@ import { Dashicon } from "@wordpress/components"; -import { ComponentType, ReactNode, JSX } from "react"; +import { ComponentType, JSX, ReactNode } from "react"; declare namespace PluginSidebarMoreMenuItem { interface Props { diff --git a/types/wordpress__edit-post/components/sidebar/plugin-document-setting-panel.d.ts b/types/wordpress__edit-post/components/sidebar/plugin-document-setting-panel.d.ts index 20cc0e3eb63b82..9cbfeb94d87162 100644 --- a/types/wordpress__edit-post/components/sidebar/plugin-document-setting-panel.d.ts +++ b/types/wordpress__edit-post/components/sidebar/plugin-document-setting-panel.d.ts @@ -1,5 +1,5 @@ import { Dashicon, Slot } from "@wordpress/components"; -import { FC, ReactNode, JSX } from "react"; +import { FC, JSX, ReactNode } from "react"; declare namespace PluginDocumentSettingPanel { interface Props { diff --git a/types/wordpress__edit-post/components/sidebar/plugin-post-publish-panel.d.ts b/types/wordpress__edit-post/components/sidebar/plugin-post-publish-panel.d.ts index 2692f5e09cc44a..7eb6e844552252 100644 --- a/types/wordpress__edit-post/components/sidebar/plugin-post-publish-panel.d.ts +++ b/types/wordpress__edit-post/components/sidebar/plugin-post-publish-panel.d.ts @@ -1,5 +1,5 @@ import { Slot } from "@wordpress/components"; -import { FC, ReactNode, JSX } from "react"; +import { FC, JSX, ReactNode } from "react"; declare namespace PluginPostPublishPanel { interface Props { diff --git a/types/wordpress__edit-post/components/sidebar/plugin-post-status-info.d.ts b/types/wordpress__edit-post/components/sidebar/plugin-post-status-info.d.ts index 53ae0f3afca2ce..acdada6dc8616e 100644 --- a/types/wordpress__edit-post/components/sidebar/plugin-post-status-info.d.ts +++ b/types/wordpress__edit-post/components/sidebar/plugin-post-status-info.d.ts @@ -1,5 +1,5 @@ import { Slot } from "@wordpress/components"; -import { FC, ReactNode, JSX } from "react"; +import { FC, JSX, ReactNode } from "react"; declare namespace PluginPostStatusInfo { interface Props { diff --git a/types/wordpress__edit-post/components/sidebar/plugin-pre-publish-panel.d.ts b/types/wordpress__edit-post/components/sidebar/plugin-pre-publish-panel.d.ts index 9f443cdf5d6e04..9b148838456c31 100644 --- a/types/wordpress__edit-post/components/sidebar/plugin-pre-publish-panel.d.ts +++ b/types/wordpress__edit-post/components/sidebar/plugin-pre-publish-panel.d.ts @@ -1,5 +1,5 @@ import { Slot } from "@wordpress/components"; -import { FC, ReactNode, JSX } from "react"; +import { FC, JSX, ReactNode } from "react"; declare namespace PluginPrePublishPanel { interface Props { diff --git a/types/wordpress__edit-post/components/sidebar/plugin-sidebar.d.ts b/types/wordpress__edit-post/components/sidebar/plugin-sidebar.d.ts index a53b581843df5b..d5292ed60d4477 100644 --- a/types/wordpress__edit-post/components/sidebar/plugin-sidebar.d.ts +++ b/types/wordpress__edit-post/components/sidebar/plugin-sidebar.d.ts @@ -1,5 +1,5 @@ import { Dashicon } from "@wordpress/components"; -import { ComponentType, ReactNode, JSX } from "react"; +import { ComponentType, JSX, ReactNode } from "react"; declare namespace PluginSidebar { interface Props { diff --git a/types/wordpress__editor/components/post-taxonomies/index.d.ts b/types/wordpress__editor/components/post-taxonomies/index.d.ts index 3c4f537ecf95ff..604ac734bb7368 100644 --- a/types/wordpress__editor/components/post-taxonomies/index.d.ts +++ b/types/wordpress__editor/components/post-taxonomies/index.d.ts @@ -1,5 +1,5 @@ import { Taxonomy } from "@wordpress/core-data"; -import { ComponentType, ReactNode, JSX } from "react"; +import { ComponentType, JSX, ReactNode } from "react"; declare namespace PostTaxonomies { interface Props { diff --git a/types/wordpress__notices/index.d.ts b/types/wordpress__notices/index.d.ts index ff17b0d96a9501..03909770441c9d 100644 --- a/types/wordpress__notices/index.d.ts +++ b/types/wordpress__notices/index.d.ts @@ -1,5 +1,5 @@ import { StoreDescriptor } from "@wordpress/data"; -import { MouseEventHandler, JSX } from "react"; +import { JSX, MouseEventHandler } from "react"; declare module "@wordpress/data" { function dispatch(key: "core/notices"): typeof import("./store/actions"); From 96ed3b314b09503b15692a288147673b39717c73 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:48:37 +0100 Subject: [PATCH 066/519] [rn-material-ui-textfield] Replace usage of React's global JSX namespace with scoped JSX (#67735) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/rn-material-ui-textfield/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/rn-material-ui-textfield/index.d.ts b/types/rn-material-ui-textfield/index.d.ts index 02ae71571a6296..08e14b538369b4 100644 --- a/types/rn-material-ui-textfield/index.d.ts +++ b/types/rn-material-ui-textfield/index.d.ts @@ -67,8 +67,8 @@ export interface TextFieldProps extends TextInputProps { titleTextStyle?: StyleProp | undefined; affixTextStyle?: StyleProp | undefined; formatText?(text: string): string; - renderLeftAccessory?(): JSX.Element; - renderRightAccessory?(): JSX.Element; + renderLeftAccessory?(): React.JSX.Element; + renderRightAccessory?(): React.JSX.Element; onChangeText?(text: string): void; onFocus?(event: NativeSyntheticEvent): void; onBlur?(event: NativeSyntheticEvent): void; From 26cb5e7de530f1e6be457a5ec182836a55ef2eda Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:48:47 +0100 Subject: [PATCH 067/519] [wordpress__block-editor] Replace usage of React's global JSX namespace with scoped JSX (#67746) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/wordpress__block-editor/components/alignment-toolbar.d.ts | 2 +- types/wordpress__block-editor/components/block-controls.d.ts | 2 +- .../components/block-format-controls.d.ts | 2 +- types/wordpress__block-editor/components/block-list.d.ts | 2 +- types/wordpress__block-editor/components/inner-blocks.d.ts | 2 +- .../components/inspector-advanced-controls.d.ts | 2 +- .../wordpress__block-editor/components/inspector-controls.d.ts | 2 +- types/wordpress__block-editor/components/media-placeholder.d.ts | 2 +- .../wordpress__block-editor/components/media-upload/index.d.ts | 2 +- types/wordpress__block-editor/components/rich-text.d.ts | 2 +- types/wordpress__block-editor/components/url-popover.d.ts | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/types/wordpress__block-editor/components/alignment-toolbar.d.ts b/types/wordpress__block-editor/components/alignment-toolbar.d.ts index fa16b0dc1debc0..e88e83bf7f44ef 100644 --- a/types/wordpress__block-editor/components/alignment-toolbar.d.ts +++ b/types/wordpress__block-editor/components/alignment-toolbar.d.ts @@ -1,5 +1,5 @@ import { Dashicon } from "@wordpress/components"; -import { ComponentType } from "react"; +import { ComponentType, JSX } from "react"; declare namespace AlignmentToolbar { interface Props { diff --git a/types/wordpress__block-editor/components/block-controls.d.ts b/types/wordpress__block-editor/components/block-controls.d.ts index 89c7ddd21204a8..020e49d16f9c1a 100644 --- a/types/wordpress__block-editor/components/block-controls.d.ts +++ b/types/wordpress__block-editor/components/block-controls.d.ts @@ -1,5 +1,5 @@ import { Slot, Toolbar } from "@wordpress/components"; -import { FC, ReactNode } from "react"; +import { FC, ReactNode, JSX } from "react"; declare namespace BlockControls { interface Props extends Pick { diff --git a/types/wordpress__block-editor/components/block-format-controls.d.ts b/types/wordpress__block-editor/components/block-format-controls.d.ts index 7481218d7c0ed9..e15dc0b36e1474 100644 --- a/types/wordpress__block-editor/components/block-format-controls.d.ts +++ b/types/wordpress__block-editor/components/block-format-controls.d.ts @@ -1,5 +1,5 @@ import { Slot } from "@wordpress/components"; -import { FC, ReactNode } from "react"; +import { FC, ReactNode, JSX } from "react"; declare namespace BlockFormatControls { interface Props { diff --git a/types/wordpress__block-editor/components/block-list.d.ts b/types/wordpress__block-editor/components/block-list.d.ts index b448c80d97a2e5..6b9e6d222fc92c 100644 --- a/types/wordpress__block-editor/components/block-list.d.ts +++ b/types/wordpress__block-editor/components/block-list.d.ts @@ -1,4 +1,4 @@ -import { ComponentType } from "react"; +import { ComponentType, JSX } from "react"; declare namespace BlockList { interface Props { diff --git a/types/wordpress__block-editor/components/inner-blocks.d.ts b/types/wordpress__block-editor/components/inner-blocks.d.ts index 824a33cd1ceea9..a8b10a3ca4c8e9 100644 --- a/types/wordpress__block-editor/components/inner-blocks.d.ts +++ b/types/wordpress__block-editor/components/inner-blocks.d.ts @@ -1,5 +1,5 @@ import { TemplateArray } from "@wordpress/blocks"; -import { ComponentType, Ref } from "react"; +import { ComponentType, Ref, JSX } from "react"; import { EditorTemplateLock } from "../"; diff --git a/types/wordpress__block-editor/components/inspector-advanced-controls.d.ts b/types/wordpress__block-editor/components/inspector-advanced-controls.d.ts index 9a85f5c4e2a091..b1b24d830f002a 100644 --- a/types/wordpress__block-editor/components/inspector-advanced-controls.d.ts +++ b/types/wordpress__block-editor/components/inspector-advanced-controls.d.ts @@ -1,5 +1,5 @@ import { Slot } from "@wordpress/components"; -import { FC, ReactNode } from "react"; +import { FC, ReactNode, JSX } from "react"; declare namespace InspectorAdvancedControls { interface Props { diff --git a/types/wordpress__block-editor/components/inspector-controls.d.ts b/types/wordpress__block-editor/components/inspector-controls.d.ts index 7381b342ea59c3..2325998f334ecf 100644 --- a/types/wordpress__block-editor/components/inspector-controls.d.ts +++ b/types/wordpress__block-editor/components/inspector-controls.d.ts @@ -1,5 +1,5 @@ import { Slot } from "@wordpress/components"; -import { FC, ReactNode } from "react"; +import { FC, ReactNode, JSX } from "react"; declare namespace InspectorControls { interface Props { diff --git a/types/wordpress__block-editor/components/media-placeholder.d.ts b/types/wordpress__block-editor/components/media-placeholder.d.ts index c6fcd1aba5e907..67e5ad76cffd6a 100644 --- a/types/wordpress__block-editor/components/media-placeholder.d.ts +++ b/types/wordpress__block-editor/components/media-placeholder.d.ts @@ -1,6 +1,6 @@ /* eslint-disable @definitelytyped/no-unnecessary-generics */ import { Dashicon, DropZone } from "@wordpress/components"; -import { ComponentType, MouseEventHandler } from "react"; +import { ComponentType, MouseEventHandler, JSX } from "react"; declare namespace MediaPlaceholder { type MediaPlaceholderMultipleAction = "add"; diff --git a/types/wordpress__block-editor/components/media-upload/index.d.ts b/types/wordpress__block-editor/components/media-upload/index.d.ts index 744c9da202ae5a..8cae19e38d2bef 100644 --- a/types/wordpress__block-editor/components/media-upload/index.d.ts +++ b/types/wordpress__block-editor/components/media-upload/index.d.ts @@ -1,5 +1,5 @@ /* eslint-disable @definitelytyped/no-unnecessary-generics */ -import { ComponentType } from "react"; +import { ComponentType, JSX } from "react"; import { default as MediaPlaceholder } from "../media-placeholder"; diff --git a/types/wordpress__block-editor/components/rich-text.d.ts b/types/wordpress__block-editor/components/rich-text.d.ts index fee7f868652187..fe574d2961bb44 100644 --- a/types/wordpress__block-editor/components/rich-text.d.ts +++ b/types/wordpress__block-editor/components/rich-text.d.ts @@ -2,7 +2,7 @@ import { BlockInstance } from "@wordpress/blocks"; import { Autocomplete, ToolbarButton } from "@wordpress/components"; import { displayShortcut, rawShortcut } from "@wordpress/keycodes"; -import { ComponentType, HTMLProps, ReactNode } from "react"; +import { ComponentType, HTMLProps, ReactNode, JSX } from "react"; declare namespace RichText { interface Props extends Omit, "onChange"> { diff --git a/types/wordpress__block-editor/components/url-popover.d.ts b/types/wordpress__block-editor/components/url-popover.d.ts index 54614e9ec2e54c..945f52425b8876 100644 --- a/types/wordpress__block-editor/components/url-popover.d.ts +++ b/types/wordpress__block-editor/components/url-popover.d.ts @@ -1,5 +1,5 @@ import { Popover } from "@wordpress/components"; -import { ComponentType, ReactNode } from "react"; +import { ComponentType, ReactNode, JSX } from "react"; declare namespace URLPopover { interface Props extends Popover.Props { From b6dc70d67d4ed8f741330a1acb9263f42da50472 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 18:49:41 +0100 Subject: [PATCH 068/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67717=20[r?= =?UTF-8?q?eact-touch]=20Replace=20usage=20of=20React's=20global=20JSX=20n?= =?UTF-8?q?amespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-touch/index.d.ts | 2 +- types/react-touch/react-touch-tests.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-touch/index.d.ts b/types/react-touch/index.d.ts index 7b0750a63654b0..4521154da579fd 100644 --- a/types/react-touch/index.d.ts +++ b/types/react-touch/index.d.ts @@ -41,7 +41,7 @@ export interface DraggableCallbackArgument extends DraggableStyle { dy: number; } -export type DraggableCallback = (argument: DraggableCallbackArgument) => JSX.Element; +export type DraggableCallback = (argument: DraggableCallbackArgument) => React.JSX.Element; export interface DraggableProps { /** diff --git a/types/react-touch/react-touch-tests.tsx b/types/react-touch/react-touch-tests.tsx index 3dd7d5e1617780..af91d4a233686d 100644 --- a/types/react-touch/react-touch-tests.tsx +++ b/types/react-touch/react-touch-tests.tsx @@ -37,7 +37,7 @@ export class DraggableTest extends React.PureComponent { return ; } - private readonly callback = (argument: DraggableCallbackArgument): JSX.Element => { + private readonly callback = (argument: DraggableCallbackArgument): React.JSX.Element => { return
; }; } From 83d9462edf902eca47532d1c996694b7de509162 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 4 Dec 2023 17:51:45 +0000 Subject: [PATCH 069/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/wordpress__block-editor/components/block-controls.d.ts | 2 +- .../components/block-format-controls.d.ts | 2 +- types/wordpress__block-editor/components/inner-blocks.d.ts | 2 +- .../components/inspector-advanced-controls.d.ts | 2 +- .../wordpress__block-editor/components/inspector-controls.d.ts | 2 +- types/wordpress__block-editor/components/media-placeholder.d.ts | 2 +- types/wordpress__block-editor/components/rich-text.d.ts | 2 +- types/wordpress__block-editor/components/url-popover.d.ts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/types/wordpress__block-editor/components/block-controls.d.ts b/types/wordpress__block-editor/components/block-controls.d.ts index 020e49d16f9c1a..a9a7890cf22fd5 100644 --- a/types/wordpress__block-editor/components/block-controls.d.ts +++ b/types/wordpress__block-editor/components/block-controls.d.ts @@ -1,5 +1,5 @@ import { Slot, Toolbar } from "@wordpress/components"; -import { FC, ReactNode, JSX } from "react"; +import { FC, JSX, ReactNode } from "react"; declare namespace BlockControls { interface Props extends Pick { diff --git a/types/wordpress__block-editor/components/block-format-controls.d.ts b/types/wordpress__block-editor/components/block-format-controls.d.ts index e15dc0b36e1474..806ad6438c70f7 100644 --- a/types/wordpress__block-editor/components/block-format-controls.d.ts +++ b/types/wordpress__block-editor/components/block-format-controls.d.ts @@ -1,5 +1,5 @@ import { Slot } from "@wordpress/components"; -import { FC, ReactNode, JSX } from "react"; +import { FC, JSX, ReactNode } from "react"; declare namespace BlockFormatControls { interface Props { diff --git a/types/wordpress__block-editor/components/inner-blocks.d.ts b/types/wordpress__block-editor/components/inner-blocks.d.ts index a8b10a3ca4c8e9..eff7f48dffe1c9 100644 --- a/types/wordpress__block-editor/components/inner-blocks.d.ts +++ b/types/wordpress__block-editor/components/inner-blocks.d.ts @@ -1,5 +1,5 @@ import { TemplateArray } from "@wordpress/blocks"; -import { ComponentType, Ref, JSX } from "react"; +import { ComponentType, JSX, Ref } from "react"; import { EditorTemplateLock } from "../"; diff --git a/types/wordpress__block-editor/components/inspector-advanced-controls.d.ts b/types/wordpress__block-editor/components/inspector-advanced-controls.d.ts index b1b24d830f002a..54f263cf57bcf6 100644 --- a/types/wordpress__block-editor/components/inspector-advanced-controls.d.ts +++ b/types/wordpress__block-editor/components/inspector-advanced-controls.d.ts @@ -1,5 +1,5 @@ import { Slot } from "@wordpress/components"; -import { FC, ReactNode, JSX } from "react"; +import { FC, JSX, ReactNode } from "react"; declare namespace InspectorAdvancedControls { interface Props { diff --git a/types/wordpress__block-editor/components/inspector-controls.d.ts b/types/wordpress__block-editor/components/inspector-controls.d.ts index 2325998f334ecf..1952db72bfad8b 100644 --- a/types/wordpress__block-editor/components/inspector-controls.d.ts +++ b/types/wordpress__block-editor/components/inspector-controls.d.ts @@ -1,5 +1,5 @@ import { Slot } from "@wordpress/components"; -import { FC, ReactNode, JSX } from "react"; +import { FC, JSX, ReactNode } from "react"; declare namespace InspectorControls { interface Props { diff --git a/types/wordpress__block-editor/components/media-placeholder.d.ts b/types/wordpress__block-editor/components/media-placeholder.d.ts index 67e5ad76cffd6a..3a52095b36d68d 100644 --- a/types/wordpress__block-editor/components/media-placeholder.d.ts +++ b/types/wordpress__block-editor/components/media-placeholder.d.ts @@ -1,6 +1,6 @@ /* eslint-disable @definitelytyped/no-unnecessary-generics */ import { Dashicon, DropZone } from "@wordpress/components"; -import { ComponentType, MouseEventHandler, JSX } from "react"; +import { ComponentType, JSX, MouseEventHandler } from "react"; declare namespace MediaPlaceholder { type MediaPlaceholderMultipleAction = "add"; diff --git a/types/wordpress__block-editor/components/rich-text.d.ts b/types/wordpress__block-editor/components/rich-text.d.ts index fe574d2961bb44..8d8020c126b89f 100644 --- a/types/wordpress__block-editor/components/rich-text.d.ts +++ b/types/wordpress__block-editor/components/rich-text.d.ts @@ -2,7 +2,7 @@ import { BlockInstance } from "@wordpress/blocks"; import { Autocomplete, ToolbarButton } from "@wordpress/components"; import { displayShortcut, rawShortcut } from "@wordpress/keycodes"; -import { ComponentType, HTMLProps, ReactNode, JSX } from "react"; +import { ComponentType, HTMLProps, JSX, ReactNode } from "react"; declare namespace RichText { interface Props extends Omit, "onChange"> { diff --git a/types/wordpress__block-editor/components/url-popover.d.ts b/types/wordpress__block-editor/components/url-popover.d.ts index 945f52425b8876..729095ae31128b 100644 --- a/types/wordpress__block-editor/components/url-popover.d.ts +++ b/types/wordpress__block-editor/components/url-popover.d.ts @@ -1,5 +1,5 @@ import { Popover } from "@wordpress/components"; -import { ComponentType, ReactNode, JSX } from "react"; +import { ComponentType, JSX, ReactNode } from "react"; declare namespace URLPopover { interface Props extends Popover.Props { From b1f6fa76333b9151c0a819f37d778975acd33552 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 19:41:53 +0100 Subject: [PATCH 070/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67659=20[r?= =?UTF-8?q?eact-instantsearch-core]=20Replace=20usage=20of=20React's=20glo?= =?UTF-8?q?bal=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-instantsearch-core/index.d.ts | 2 +- .../react-instantsearch-core-tests.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-instantsearch-core/index.d.ts b/types/react-instantsearch-core/index.d.ts index 491351f57f4fb5..5503312f708527 100644 --- a/types/react-instantsearch-core/index.d.ts +++ b/types/react-instantsearch-core/index.d.ts @@ -451,7 +451,7 @@ export interface NumericMenuExposed { attribute: string; /** List of options. With a text label, and upper and lower bounds. */ items: Array<{ - label: string | JSX.Element; + label: string | React.JSX.Element; start?: number | undefined; end?: number | undefined; }>; diff --git a/types/react-instantsearch-core/react-instantsearch-core-tests.tsx b/types/react-instantsearch-core/react-instantsearch-core-tests.tsx index ac15f9ee664eb5..037acd2f91a0d6 100644 --- a/types/react-instantsearch-core/react-instantsearch-core-tests.tsx +++ b/types/react-instantsearch-core/react-instantsearch-core-tests.tsx @@ -490,9 +490,9 @@ import { Hits, RefinementList } from "react-instantsearch-dom"; className?: string | undefined; showLoadingIndicator?: boolean | undefined; - submit?: JSX.Element | undefined; - reset?: JSX.Element | undefined; - loadingIndicator?: JSX.Element | undefined; + submit?: React.JSX.Element | undefined; + reset?: React.JSX.Element | undefined; + loadingIndicator?: React.JSX.Element | undefined; onSubmit?: ((event: React.SyntheticEvent) => any) | undefined; onReset?: ((event: React.SyntheticEvent) => any) | undefined; From a30f54189ee26913f5f86062755c159a8a31a12b Mon Sep 17 00:00:00 2001 From: Tristan F Date: Mon, 4 Dec 2023 14:30:34 -0500 Subject: [PATCH 071/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67598=20[a?= =?UTF-8?q?t-least-node]=20add=20types=20by=20@LeoDog896?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/at-least-node/.npmignore | 5 +++++ types/at-least-node/at-least-node-tests.ts | 13 +++++++++++++ types/at-least-node/index.d.ts | 3 +++ types/at-least-node/package.json | 17 +++++++++++++++++ types/at-least-node/tsconfig.json | 19 +++++++++++++++++++ types/at-least-node/tslint.json | 1 + 6 files changed, 58 insertions(+) create mode 100644 types/at-least-node/.npmignore create mode 100644 types/at-least-node/at-least-node-tests.ts create mode 100644 types/at-least-node/index.d.ts create mode 100644 types/at-least-node/package.json create mode 100644 types/at-least-node/tsconfig.json create mode 100644 types/at-least-node/tslint.json diff --git a/types/at-least-node/.npmignore b/types/at-least-node/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/at-least-node/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/at-least-node/at-least-node-tests.ts b/types/at-least-node/at-least-node-tests.ts new file mode 100644 index 00000000000000..8bda997266c69e --- /dev/null +++ b/types/at-least-node/at-least-node-tests.ts @@ -0,0 +1,13 @@ +import atLeastNode = require("at-least-node"); + +// $ExpectType boolean +atLeastNode("0.10.0"); + +// $ExpectType boolean +atLeastNode("0.12.0"); + +// @ts-expect-error +atLeastNode(1); + +// @ts-expect-error +atLeastNode(); diff --git a/types/at-least-node/index.d.ts b/types/at-least-node/index.d.ts new file mode 100644 index 00000000000000..f34b21cd3476a0 --- /dev/null +++ b/types/at-least-node/index.d.ts @@ -0,0 +1,3 @@ +declare function atLeastNode(version: string): boolean; + +export = atLeastNode; diff --git a/types/at-least-node/package.json b/types/at-least-node/package.json new file mode 100644 index 00000000000000..bc2123f6530e90 --- /dev/null +++ b/types/at-least-node/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/at-least-node", + "version": "1.0.9999", + "projects": [ + "https://github.com/RyanZim/at-least-node#readme" + ], + "devDependencies": { + "@types/at-least-node": "workspace:." + }, + "owners": [ + { + "name": "Tristan F.", + "githubUsername": "LeoDog896" + } + ] +} diff --git a/types/at-least-node/tsconfig.json b/types/at-least-node/tsconfig.json new file mode 100644 index 00000000000000..100372f624dc8e --- /dev/null +++ b/types/at-least-node/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "at-least-node-tests.ts" + ] +} diff --git a/types/at-least-node/tslint.json b/types/at-least-node/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/at-least-node/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From 5f0524b4214e943078199e6087faf16ef93bb779 Mon Sep 17 00:00:00 2001 From: Tristan F Date: Mon, 4 Dec 2023 14:30:46 -0500 Subject: [PATCH 072/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67596=20[b?= =?UTF-8?q?undle-name]=20add=20types=20by=20@LeoDog896?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/bundle-name/.npmignore | 5 +++++ types/bundle-name/bundle-name-tests.ts | 10 ++++++++++ types/bundle-name/index.d.ts | 1 + types/bundle-name/package.json | 17 +++++++++++++++++ types/bundle-name/tsconfig.json | 19 +++++++++++++++++++ types/bundle-name/tslint.json | 1 + 6 files changed, 53 insertions(+) create mode 100644 types/bundle-name/.npmignore create mode 100644 types/bundle-name/bundle-name-tests.ts create mode 100644 types/bundle-name/index.d.ts create mode 100644 types/bundle-name/package.json create mode 100644 types/bundle-name/tsconfig.json create mode 100644 types/bundle-name/tslint.json diff --git a/types/bundle-name/.npmignore b/types/bundle-name/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/bundle-name/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/bundle-name/bundle-name-tests.ts b/types/bundle-name/bundle-name-tests.ts new file mode 100644 index 00000000000000..8a0cf05b996689 --- /dev/null +++ b/types/bundle-name/bundle-name-tests.ts @@ -0,0 +1,10 @@ +import bundleName from "bundle-name"; + +// $ExpectType Promise +bundleName("com.apple.Safari"); + +// @ts-expect-error +bundleName(1); + +// @ts-expect-error +bundleName(); diff --git a/types/bundle-name/index.d.ts b/types/bundle-name/index.d.ts new file mode 100644 index 00000000000000..65141026f01c91 --- /dev/null +++ b/types/bundle-name/index.d.ts @@ -0,0 +1 @@ +export default function bundleName(bundleId: string): Promise; diff --git a/types/bundle-name/package.json b/types/bundle-name/package.json new file mode 100644 index 00000000000000..166314bdc2d86c --- /dev/null +++ b/types/bundle-name/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/bundle-name", + "version": "4.0.9999", + "projects": [ + "https://github.com/sindresorhus/bundle-name#readme" + ], + "devDependencies": { + "@types/bundle-name": "workspace:." + }, + "owners": [ + { + "name": "Tristan F.", + "githubUsername": "LeoDog896" + } + ] +} diff --git a/types/bundle-name/tsconfig.json b/types/bundle-name/tsconfig.json new file mode 100644 index 00000000000000..e3761c501389ac --- /dev/null +++ b/types/bundle-name/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bundle-name-tests.ts" + ] +} diff --git a/types/bundle-name/tslint.json b/types/bundle-name/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/bundle-name/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From 59af33ef55e292facfe002b237f614efe1578db1 Mon Sep 17 00:00:00 2001 From: Tristan F Date: Mon, 4 Dec 2023 14:30:55 -0500 Subject: [PATCH 073/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67595=20[d?= =?UTF-8?q?efault-browser-id]=20add=20types=20by=20@LeoDog896?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: default-browser-id * refactor(default-browser-id): don't declare, export directly --- types/default-browser-id/.npmignore | 5 +++++ .../default-browser-id-tests.ts | 11 +++++++++++ types/default-browser-id/index.d.ts | 1 + types/default-browser-id/package.json | 17 +++++++++++++++++ types/default-browser-id/tsconfig.json | 19 +++++++++++++++++++ types/default-browser-id/tslint.json | 1 + 6 files changed, 54 insertions(+) create mode 100644 types/default-browser-id/.npmignore create mode 100644 types/default-browser-id/default-browser-id-tests.ts create mode 100644 types/default-browser-id/index.d.ts create mode 100644 types/default-browser-id/package.json create mode 100644 types/default-browser-id/tsconfig.json create mode 100644 types/default-browser-id/tslint.json diff --git a/types/default-browser-id/.npmignore b/types/default-browser-id/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/default-browser-id/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/default-browser-id/default-browser-id-tests.ts b/types/default-browser-id/default-browser-id-tests.ts new file mode 100644 index 00000000000000..fcf8fe20429e5c --- /dev/null +++ b/types/default-browser-id/default-browser-id-tests.ts @@ -0,0 +1,11 @@ +import defaultBrowserId from "default-browser-id"; + +// $ExpectType Promise +defaultBrowserId(); + +// @ts-expect-error +defaultBrowserId(1); + +// @ts-expect-error +defaultBrowserId("1"); + diff --git a/types/default-browser-id/index.d.ts b/types/default-browser-id/index.d.ts new file mode 100644 index 00000000000000..160c06ffeb7d2a --- /dev/null +++ b/types/default-browser-id/index.d.ts @@ -0,0 +1 @@ +export default function defaultBrowserId(): Promise; diff --git a/types/default-browser-id/package.json b/types/default-browser-id/package.json new file mode 100644 index 00000000000000..58593dc2b5bc3a --- /dev/null +++ b/types/default-browser-id/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/default-browser-id", + "version": "4.0.9999", + "projects": [ + "https://github.com/sindresorhus/default-browser-id#readme" + ], + "devDependencies": { + "@types/default-browser-id": "workspace:." + }, + "owners": [ + { + "name": "Tristan F.", + "githubUsername": "LeoDog896" + } + ] +} diff --git a/types/default-browser-id/tsconfig.json b/types/default-browser-id/tsconfig.json new file mode 100644 index 00000000000000..366666725739ff --- /dev/null +++ b/types/default-browser-id/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "default-browser-id-tests.ts" + ] +} diff --git a/types/default-browser-id/tslint.json b/types/default-browser-id/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/default-browser-id/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From e8d4a5a9cb2f89af72a538527f35ff2d76a8f4f9 Mon Sep 17 00:00:00 2001 From: Tristan F Date: Mon, 4 Dec 2023 14:31:24 -0500 Subject: [PATCH 074/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67593=20[d?= =?UTF-8?q?etect-file]=20add=20types=20by=20@LeoDog896?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/detect-file/.npmignore | 5 +++++ types/detect-file/detect-file-tests.ts | 19 +++++++++++++++++++ types/detect-file/index.d.ts | 7 +++++++ types/detect-file/package.json | 17 +++++++++++++++++ types/detect-file/tsconfig.json | 19 +++++++++++++++++++ types/detect-file/tslint.json | 1 + 6 files changed, 68 insertions(+) create mode 100644 types/detect-file/.npmignore create mode 100644 types/detect-file/detect-file-tests.ts create mode 100644 types/detect-file/index.d.ts create mode 100644 types/detect-file/package.json create mode 100644 types/detect-file/tsconfig.json create mode 100644 types/detect-file/tslint.json diff --git a/types/detect-file/.npmignore b/types/detect-file/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/detect-file/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/detect-file/detect-file-tests.ts b/types/detect-file/detect-file-tests.ts new file mode 100644 index 00000000000000..395a8d92b3b5e8 --- /dev/null +++ b/types/detect-file/detect-file-tests.ts @@ -0,0 +1,19 @@ +import detect = require("detect-file"); + +// $ExpectType string +detect("foo"); + +// $ExpectType string +detect("foo", { nocase: true }); + +// $ExpectType string +detect("foo", { nocase: false }); + +// @ts-expect-error +detect(1); + +// @ts-expect-error +detect("foo", { nocase: 1 }); + +// @ts-expect-error +detect("foo", { nocas: true }); diff --git a/types/detect-file/index.d.ts b/types/detect-file/index.d.ts new file mode 100644 index 00000000000000..ffc35b5d874b83 --- /dev/null +++ b/types/detect-file/index.d.ts @@ -0,0 +1,7 @@ +interface DetectOptions { + nocase?: boolean; +} + +declare function detect(filepath: string, options?: DetectOptions): string; + +export = detect; diff --git a/types/detect-file/package.json b/types/detect-file/package.json new file mode 100644 index 00000000000000..209846cfdeddd8 --- /dev/null +++ b/types/detect-file/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/detect-file", + "version": "1.0.9999", + "projects": [ + "https://github.com/doowb/detect-file" + ], + "devDependencies": { + "@types/detect-file": "workspace:." + }, + "owners": [ + { + "name": "Tristan F.", + "githubUsername": "LeoDog896" + } + ] +} diff --git a/types/detect-file/tsconfig.json b/types/detect-file/tsconfig.json new file mode 100644 index 00000000000000..f367d65d244f38 --- /dev/null +++ b/types/detect-file/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "detect-file-tests.ts" + ] +} diff --git a/types/detect-file/tslint.json b/types/detect-file/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/detect-file/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From 509402fc8aaa4d86795a543a8a6c17624ab24e2a Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 4 Dec 2023 19:33:44 +0000 Subject: [PATCH 075/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/default-browser-id/default-browser-id-tests.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/default-browser-id/default-browser-id-tests.ts b/types/default-browser-id/default-browser-id-tests.ts index fcf8fe20429e5c..66f6ff3b3bfee1 100644 --- a/types/default-browser-id/default-browser-id-tests.ts +++ b/types/default-browser-id/default-browser-id-tests.ts @@ -8,4 +8,3 @@ defaultBrowserId(1); // @ts-expect-error defaultBrowserId("1"); - From 9954981761c078fc397389a1390448e7c9871c21 Mon Sep 17 00:00:00 2001 From: Justin Hall Date: Mon, 4 Dec 2023 13:08:33 -0700 Subject: [PATCH 076/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67755=20Re?= =?UTF-8?q?move=20self=20from=20owners=20of=20react-helmet=20by=20@wKovacs?= =?UTF-8?q?64?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/react-helmet/package.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/types/react-helmet/package.json b/types/react-helmet/package.json index 0d05b94f85d4da..1dba02228d3ca1 100644 --- a/types/react-helmet/package.json +++ b/types/react-helmet/package.json @@ -28,10 +28,6 @@ "name": "Yamagishi Kazutoshi", "githubUsername": "ykzts" }, - { - "name": "Justin Hall", - "githubUsername": "wKovacs64" - }, { "name": "Andriy2", "githubUsername": "Andriy2" From 2059f505842126f0fd1441325121781a67d0a72d Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 21:11:32 +0100 Subject: [PATCH 077/519] [react-gravatar] Replace usage of React's global JSX namespace with scoped JSX (#67655) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-gravatar/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-gravatar/index.d.ts b/types/react-gravatar/index.d.ts index 775ab6343e60bd..ed3eb15dc50cdf 100644 --- a/types/react-gravatar/index.d.ts +++ b/types/react-gravatar/index.d.ts @@ -12,14 +12,14 @@ declare class Gravatar extends React.Component { static readonly defaultProps: Gravatar.Props; - render(): JSX.Element | null; + render(): React.JSX.Element | null; } declare namespace Gravatar { type DefaultImage = "404" | "mm" | "mp" | "identicon" | "monsterid" | "wavatar" | "retro" | "blank"; type Rating = "g" | "pg" | "r" | "x"; - interface Props extends Partial { + interface Props extends Partial { /** * The email address used to look up the Gravatar image. * If you wish to avoid sending an email address to the client, you can compute the md5 hash on the server and From 4a90ee99c74dab6ff60ab02cdad3f04c392e5c24 Mon Sep 17 00:00:00 2001 From: Tristan F Date: Mon, 4 Dec 2023 15:11:55 -0500 Subject: [PATCH 078/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67584=20[i?= =?UTF-8?q?s-extglob]=20add=20types=20by=20@LeoDog896?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/is-extglob/.npmignore | 5 +++++ types/is-extglob/index.d.ts | 3 +++ types/is-extglob/is-extglob-tests.ts | 13 +++++++++++++ types/is-extglob/package.json | 17 +++++++++++++++++ types/is-extglob/tsconfig.json | 19 +++++++++++++++++++ types/is-extglob/tslint.json | 1 + 6 files changed, 58 insertions(+) create mode 100644 types/is-extglob/.npmignore create mode 100644 types/is-extglob/index.d.ts create mode 100644 types/is-extglob/is-extglob-tests.ts create mode 100644 types/is-extglob/package.json create mode 100644 types/is-extglob/tsconfig.json create mode 100644 types/is-extglob/tslint.json diff --git a/types/is-extglob/.npmignore b/types/is-extglob/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/is-extglob/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/is-extglob/index.d.ts b/types/is-extglob/index.d.ts new file mode 100644 index 00000000000000..c981d222eee654 --- /dev/null +++ b/types/is-extglob/index.d.ts @@ -0,0 +1,3 @@ +declare function isExtglob(glob: string): boolean; + +export = isExtglob; diff --git a/types/is-extglob/is-extglob-tests.ts b/types/is-extglob/is-extglob-tests.ts new file mode 100644 index 00000000000000..a88b51cc23099b --- /dev/null +++ b/types/is-extglob/is-extglob-tests.ts @@ -0,0 +1,13 @@ +import isExtglob = require("is-extglob"); + +// $ExpectType boolean +isExtglob('!(foo)'); + +// $ExpectType boolean +isExtglob('?(foo)'); + +// @ts-expect-error +isExtglob(1); + +// @ts-expect-error +isExtglob(null); diff --git a/types/is-extglob/package.json b/types/is-extglob/package.json new file mode 100644 index 00000000000000..7906afc5d7e6f9 --- /dev/null +++ b/types/is-extglob/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/is-extglob", + "version": "2.1.9999", + "projects": [ + "https://github.com/jonschlinkert/is-extglob" + ], + "devDependencies": { + "@types/is-extglob": "workspace:." + }, + "owners": [ + { + "name": "Tristan F.", + "githubUsername": "LeoDog896" + } + ] +} diff --git a/types/is-extglob/tsconfig.json b/types/is-extglob/tsconfig.json new file mode 100644 index 00000000000000..919d4750641c81 --- /dev/null +++ b/types/is-extglob/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-extglob-tests.ts" + ] +} diff --git a/types/is-extglob/tslint.json b/types/is-extglob/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/is-extglob/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From b53fd08527e27af0a324018b933e47ccd2521f6c Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 4 Dec 2023 20:13:31 +0000 Subject: [PATCH 079/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/is-extglob/is-extglob-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/is-extglob/is-extglob-tests.ts b/types/is-extglob/is-extglob-tests.ts index a88b51cc23099b..1e0a79a920345a 100644 --- a/types/is-extglob/is-extglob-tests.ts +++ b/types/is-extglob/is-extglob-tests.ts @@ -1,10 +1,10 @@ import isExtglob = require("is-extglob"); // $ExpectType boolean -isExtglob('!(foo)'); +isExtglob("!(foo)"); // $ExpectType boolean -isExtglob('?(foo)'); +isExtglob("?(foo)"); // @ts-expect-error isExtglob(1); From 945b1064e44d3abe099edd5dc001c61f0417f831 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 21:15:17 +0100 Subject: [PATCH 080/519] [react-relay] Replace usage of React's global JSX namespace with scoped JSX (#67695) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-relay/legacy.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-relay/legacy.d.ts b/types/react-relay/legacy.d.ts index d94cafbfacdfac..59bb3cb4078bfd 100644 --- a/types/react-relay/legacy.d.ts +++ b/types/react-relay/legacy.d.ts @@ -91,8 +91,8 @@ export type RelayRefetchContainer = React. ContainerProps> >; -type PropsWithoutRelay> = - JSX.LibraryManagedAttributes, "relay">>; +type PropsWithoutRelay> = + React.JSX.LibraryManagedAttributes, "relay">>; export function createFragmentContainer< C extends React.ComponentType & { relay?: RelayProp | undefined }>, From 87433a940846668fa1f64cc552bc5721bd1f7cc5 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 21:15:53 +0100 Subject: [PATCH 081/519] [react-katex] Replace usage of React's global JSX namespace with scoped JSX (#67663) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-katex/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-katex/index.d.ts b/types/react-katex/index.d.ts index 0f1f76e4ccc5ea..769060e8b22e1b 100644 --- a/types/react-katex/index.d.ts +++ b/types/react-katex/index.d.ts @@ -16,6 +16,6 @@ export interface MathComponentPropsWithChildren { export type MathComponentProps = MathComponentPropsWithMath | MathComponentPropsWithChildren; -export function BlockMath(props: MathComponentProps): JSX.Element; +export function BlockMath(props: MathComponentProps): React.JSX.Element; -export function InlineMath(props: MathComponentProps): JSX.Element; +export function InlineMath(props: MathComponentProps): React.JSX.Element; From 677290b9f55548c65715050fab3af7eefead8604 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 21:16:15 +0100 Subject: [PATCH 082/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67743=20[t?= =?UTF-8?q?onic-ui=5F=5Freact]=20Replace=20usage=20of=20React's=20global?= =?UTF-8?q?=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/tonic-ui__react/index.d.ts | 236 +++++++++--------- .../tonic-ui__react/tonic-ui__react-tests.tsx | 2 +- 2 files changed, 119 insertions(+), 119 deletions(-) diff --git a/types/tonic-ui__react/index.d.ts b/types/tonic-ui__react/index.d.ts index e8d2c078e703cd..219118b3247e54 100644 --- a/types/tonic-ui__react/index.d.ts +++ b/types/tonic-ui__react/index.d.ts @@ -7,125 +7,125 @@ import * as React from "react"; export {}; export const colorStyle: { dark: ThemeColorStyle; light: ThemeColorStyle }; -export function Accordion(props: AccordionProps): JSX.Element; -export function AccordionBody(props: TonicProps): JSX.Element; -export function AccordionCollapse(props: TonicProps): JSX.Element; -export function AccordionHeader(props: AccordionHeaderProps): JSX.Element; -export function AccordionItem(props: AccordionItemProps): JSX.Element; -export function AccordionToggle(props: AccordionToggleProps): JSX.Element; -export function AccordionToggleIcon(props: AccordionToggleIconProps): JSX.Element; -export function Alert(props: AlertProps): JSX.Element; -export function AlertCloseButton(props: ButtonProps): JSX.Element; +export function Accordion(props: AccordionProps): React.JSX.Element; +export function AccordionBody(props: TonicProps): React.JSX.Element; +export function AccordionCollapse(props: TonicProps): React.JSX.Element; +export function AccordionHeader(props: AccordionHeaderProps): React.JSX.Element; +export function AccordionItem(props: AccordionItemProps): React.JSX.Element; +export function AccordionToggle(props: AccordionToggleProps): React.JSX.Element; +export function AccordionToggleIcon(props: AccordionToggleIconProps): React.JSX.Element; +export function Alert(props: AlertProps): React.JSX.Element; +export function AlertCloseButton(props: ButtonProps): React.JSX.Element; export function AnimatePresence(): any; -export function Badge(props: BadgeProps): JSX.Element; -export function Box(props: TonicProps): JSX.Element; -export function Button(props: ButtonProps): JSX.Element; -export function ButtonBase(props: ButtonProps): JSX.Element; -export function ButtonGroup(props: ButtonGroupProps): JSX.Element; -export function ButtonLink(props: ButtonLinkProps): JSX.Element; -export function Checkbox(props: CheckboxProps): JSX.Element; -export function CheckboxGroup(props: CheckboxGroupProps>): JSX.Element; -export function Collapse(props: TransitionProps): JSX.Element; -export function ControlBox(props: ControlBoxProps): JSX.Element; -export function DarkMode(props: React.PropsWithChildren<{}>): JSX.Element; -export function Divider(props: DividerProps): JSX.Element; -export function Drawer(props: DrawerProps): JSX.Element; -export function DrawerBody(props: TonicProps): JSX.Element; -export function DrawerCloseButton(props: ButtonProps): JSX.Element; -export function DrawerContent(props: DrawerContentProps): JSX.Element; -export function DrawerFooter(props: TonicProps): JSX.Element; -export function DrawerHeader(props: TonicProps): JSX.Element; -export function DrawerOverlay(props: DrawerOverlayProps): JSX.Element; -export function Fade(props: TransitionProps): JSX.Element; -export function Flex(props: FlexProps): JSX.Element; -export function Grid(props: GridProps): JSX.Element; -export function Grow(props: TransitionProps): JSX.Element; -export function Icon(props: IconProps): JSX.Element; -export function Image(props: ImageProps): JSX.Element; -export function Input(props: InputProps): JSX.Element; -export function InputAdornment(props: TonicProps): JSX.Element; -export function InputBase(props: InputProps): JSX.Element; -export function InputControl(props: InputControlProps): JSX.Element; -export function InputGroup(props: InputGroupProps): JSX.Element; -export function InputGroupAddon(props: InputGroupAddonProps): JSX.Element; -export function InputGroupAppend(props: TonicProps): JSX.Element; -export function InputGroupPrepend(props: TonicProps): JSX.Element; -export function LightMode(props: React.PropsWithChildren<{}>): JSX.Element; -export function LinearProgress(props: LinearProgressProps): JSX.Element; -export function Link(props: LinkProps): JSX.Element; -export function LinkButton(props: ButtonProps): JSX.Element; -export function Menu(props: MenuProps): JSX.Element; -export function MenuButton(props: ButtonProps): JSX.Element; -export function MenuContent(props: MenuContentProps): JSX.Element; -export function MenuDivider(props: TonicProps): JSX.Element; -export function MenuGroup(props: MenuGroupProps): JSX.Element; -export function MenuItem(props: MenuItemProps): JSX.Element; -export function MenuList(props: TonicProps): JSX.Element; -export function MenuToggle(props: MenuToggleProps): JSX.Element; -export function MenuToggleIcon(props: MenuToggleIconProps): JSX.Element; -export function Modal(props: ModalProps): JSX.Element; -export function ModalBody(props: TonicProps): JSX.Element; -export function ModalCloseButton(props: ButtonProps): JSX.Element; -export function ModalContent(props: ModalContentProps): JSX.Element; -export function ModalFooter(props: TonicProps): JSX.Element; -export function ModalHeader(props: TonicProps): JSX.Element; -export function ModalOverlay(props: ModalOverlayProps): JSX.Element; -export function Option(props: React.OptionHTMLAttributes): JSX.Element; -export function OptionGroup(props: TonicProps): JSX.Element; -export function Pagination(props: PaginationProps): JSX.Element; -export function PaginationItem(props: PaginationItemProps): JSX.Element; -export function Popover(props: PopoverProps): JSX.Element; -export function PopoverBody(props: TonicProps): JSX.Element; -export function PopoverContent(props: PopoverContentProps): JSX.Element; -export function PopoverFooter(props: TonicProps): JSX.Element; -export function PopoverHeader(props: TonicProps): JSX.Element; -export function PopoverTrigger(props: PopoverTriggerProps): JSX.Element; -export function Portal(props: PortalProps): JSX.Element; -export function PortalManager(props: React.PropsWithChildren<{}>): JSX.Element; -export function Radio(props: InputProps): JSX.Element; -export function RadioGroup(props: RadioGroupProps): JSX.Element; -export function SVGIcon(props: TonicProps): JSX.Element; -export function Scale(props: TransitionScaleProps): JSX.Element; -export function Scrollbar(props: ScrollbarProps): JSX.Element; -export function SearchInput(props: SearchInputProps): JSX.Element; -export function Select(props: SelectProps): JSX.Element; -export function Skeleton(props: SkeletonProps): JSX.Element; -export function Slide(props: TransitionSlideProps): JSX.Element; -export function Space(props: TonicProps): JSX.Element; -export function Spinner(props: SpinnerProps): JSX.Element; -export function Stack(props: StackProps): JSX.Element; -export function Submenu(props: SubmenuProps): JSX.Element; -export function SubmenuList(props: TonicProps): JSX.Element; -export function SubmenuToggle(props: SubmenuToggleProps): JSX.Element; -export function Switch(props: CheckboxProps): JSX.Element; -export function Tab(props: TabProps): JSX.Element; -export function TabList(props: TonicProps): JSX.Element; -export function TabPanel(props: TabPanelProps): JSX.Element; -export function TabPanels(props: TonicProps): JSX.Element; -export function Table(props: TableProps): JSX.Element; -export function TableBody(props: TonicProps): JSX.Element; -export function TableCell(props: TonicProps): JSX.Element; -export function TableHeader(props: TonicProps): JSX.Element; -export function TableHeaderCell(props: TonicProps): JSX.Element; -export function TableHeaderRow(props: TonicProps): JSX.Element; -export function TableRow(props: TonicProps): JSX.Element; -export function Tabs(props: TabsProps): JSX.Element; -export function Tag(props: TagProps): JSX.Element; -export function TagCloseButton(props: ButtonProps): JSX.Element; -export function Text(props: TextProps): JSX.Element; -export function TextLabel(props: TextLabelProps): JSX.Element; -export function Textarea(props: TextareaProps): JSX.Element; +export function Badge(props: BadgeProps): React.JSX.Element; +export function Box(props: TonicProps): React.JSX.Element; +export function Button(props: ButtonProps): React.JSX.Element; +export function ButtonBase(props: ButtonProps): React.JSX.Element; +export function ButtonGroup(props: ButtonGroupProps): React.JSX.Element; +export function ButtonLink(props: ButtonLinkProps): React.JSX.Element; +export function Checkbox(props: CheckboxProps): React.JSX.Element; +export function CheckboxGroup(props: CheckboxGroupProps>): React.JSX.Element; +export function Collapse(props: TransitionProps): React.JSX.Element; +export function ControlBox(props: ControlBoxProps): React.JSX.Element; +export function DarkMode(props: React.PropsWithChildren<{}>): React.JSX.Element; +export function Divider(props: DividerProps): React.JSX.Element; +export function Drawer(props: DrawerProps): React.JSX.Element; +export function DrawerBody(props: TonicProps): React.JSX.Element; +export function DrawerCloseButton(props: ButtonProps): React.JSX.Element; +export function DrawerContent(props: DrawerContentProps): React.JSX.Element; +export function DrawerFooter(props: TonicProps): React.JSX.Element; +export function DrawerHeader(props: TonicProps): React.JSX.Element; +export function DrawerOverlay(props: DrawerOverlayProps): React.JSX.Element; +export function Fade(props: TransitionProps): React.JSX.Element; +export function Flex(props: FlexProps): React.JSX.Element; +export function Grid(props: GridProps): React.JSX.Element; +export function Grow(props: TransitionProps): React.JSX.Element; +export function Icon(props: IconProps): React.JSX.Element; +export function Image(props: ImageProps): React.JSX.Element; +export function Input(props: InputProps): React.JSX.Element; +export function InputAdornment(props: TonicProps): React.JSX.Element; +export function InputBase(props: InputProps): React.JSX.Element; +export function InputControl(props: InputControlProps): React.JSX.Element; +export function InputGroup(props: InputGroupProps): React.JSX.Element; +export function InputGroupAddon(props: InputGroupAddonProps): React.JSX.Element; +export function InputGroupAppend(props: TonicProps): React.JSX.Element; +export function InputGroupPrepend(props: TonicProps): React.JSX.Element; +export function LightMode(props: React.PropsWithChildren<{}>): React.JSX.Element; +export function LinearProgress(props: LinearProgressProps): React.JSX.Element; +export function Link(props: LinkProps): React.JSX.Element; +export function LinkButton(props: ButtonProps): React.JSX.Element; +export function Menu(props: MenuProps): React.JSX.Element; +export function MenuButton(props: ButtonProps): React.JSX.Element; +export function MenuContent(props: MenuContentProps): React.JSX.Element; +export function MenuDivider(props: TonicProps): React.JSX.Element; +export function MenuGroup(props: MenuGroupProps): React.JSX.Element; +export function MenuItem(props: MenuItemProps): React.JSX.Element; +export function MenuList(props: TonicProps): React.JSX.Element; +export function MenuToggle(props: MenuToggleProps): React.JSX.Element; +export function MenuToggleIcon(props: MenuToggleIconProps): React.JSX.Element; +export function Modal(props: ModalProps): React.JSX.Element; +export function ModalBody(props: TonicProps): React.JSX.Element; +export function ModalCloseButton(props: ButtonProps): React.JSX.Element; +export function ModalContent(props: ModalContentProps): React.JSX.Element; +export function ModalFooter(props: TonicProps): React.JSX.Element; +export function ModalHeader(props: TonicProps): React.JSX.Element; +export function ModalOverlay(props: ModalOverlayProps): React.JSX.Element; +export function Option(props: React.OptionHTMLAttributes): React.JSX.Element; +export function OptionGroup(props: TonicProps): React.JSX.Element; +export function Pagination(props: PaginationProps): React.JSX.Element; +export function PaginationItem(props: PaginationItemProps): React.JSX.Element; +export function Popover(props: PopoverProps): React.JSX.Element; +export function PopoverBody(props: TonicProps): React.JSX.Element; +export function PopoverContent(props: PopoverContentProps): React.JSX.Element; +export function PopoverFooter(props: TonicProps): React.JSX.Element; +export function PopoverHeader(props: TonicProps): React.JSX.Element; +export function PopoverTrigger(props: PopoverTriggerProps): React.JSX.Element; +export function Portal(props: PortalProps): React.JSX.Element; +export function PortalManager(props: React.PropsWithChildren<{}>): React.JSX.Element; +export function Radio(props: InputProps): React.JSX.Element; +export function RadioGroup(props: RadioGroupProps): React.JSX.Element; +export function SVGIcon(props: TonicProps): React.JSX.Element; +export function Scale(props: TransitionScaleProps): React.JSX.Element; +export function Scrollbar(props: ScrollbarProps): React.JSX.Element; +export function SearchInput(props: SearchInputProps): React.JSX.Element; +export function Select(props: SelectProps): React.JSX.Element; +export function Skeleton(props: SkeletonProps): React.JSX.Element; +export function Slide(props: TransitionSlideProps): React.JSX.Element; +export function Space(props: TonicProps): React.JSX.Element; +export function Spinner(props: SpinnerProps): React.JSX.Element; +export function Stack(props: StackProps): React.JSX.Element; +export function Submenu(props: SubmenuProps): React.JSX.Element; +export function SubmenuList(props: TonicProps): React.JSX.Element; +export function SubmenuToggle(props: SubmenuToggleProps): React.JSX.Element; +export function Switch(props: CheckboxProps): React.JSX.Element; +export function Tab(props: TabProps): React.JSX.Element; +export function TabList(props: TonicProps): React.JSX.Element; +export function TabPanel(props: TabPanelProps): React.JSX.Element; +export function TabPanels(props: TonicProps): React.JSX.Element; +export function Table(props: TableProps): React.JSX.Element; +export function TableBody(props: TonicProps): React.JSX.Element; +export function TableCell(props: TonicProps): React.JSX.Element; +export function TableHeader(props: TonicProps): React.JSX.Element; +export function TableHeaderCell(props: TonicProps): React.JSX.Element; +export function TableHeaderRow(props: TonicProps): React.JSX.Element; +export function TableRow(props: TonicProps): React.JSX.Element; +export function Tabs(props: TabsProps): React.JSX.Element; +export function Tag(props: TagProps): React.JSX.Element; +export function TagCloseButton(props: ButtonProps): React.JSX.Element; +export function Text(props: TextProps): React.JSX.Element; +export function TextLabel(props: TextLabelProps): React.JSX.Element; +export function Textarea(props: TextareaProps): React.JSX.Element; export const theme: TonicProviderTheme; -export function Toast(props: ToastProps): JSX.Element; -export function ToastCloseButton(props: ButtonProps): JSX.Element; -export function ToastController(props: ToastControllerProps): JSX.Element; -export function ToastProvider(props: ToastProviderProps): JSX.Element; -export function ToastTransition(props: ToastTransitionProps): JSX.Element; -export function TonicProvider(props: React.PropsWithChildren): JSX.Element; -export function Tooltip(props: TooltipProps): JSX.Element; -export function Truncate(prop: TonicProps): JSX.Element; -export function VisuallyHidden(props: TonicProps): JSX.Element; -export function Zoom(props: TransitionProps): JSX.Element; +export function Toast(props: ToastProps): React.JSX.Element; +export function ToastCloseButton(props: ButtonProps): React.JSX.Element; +export function ToastController(props: ToastControllerProps): React.JSX.Element; +export function ToastProvider(props: ToastProviderProps): React.JSX.Element; +export function ToastTransition(props: ToastTransitionProps): React.JSX.Element; +export function TonicProvider(props: React.PropsWithChildren): React.JSX.Element; +export function Tooltip(props: TooltipProps): React.JSX.Element; +export function Truncate(prop: TonicProps): React.JSX.Element; +export function VisuallyHidden(props: TonicProps): React.JSX.Element; +export function Zoom(props: TransitionProps): React.JSX.Element; export const useAccordion: any; export const useAccordionItem: any; export const useAnimatePresence: any; @@ -448,7 +448,7 @@ export interface PaginationProps extends Omit { export interface PaginationItemProps extends TonicProps { type: "start-ellipsis" | "end-ellipsis" | "first-page" | "last-page" | "previous-page" | "next-page"; - slot: { previous: JSX.Element; next: JSX.Element }; + slot: { previous: React.JSX.Element; next: React.JSX.Element }; } export interface PopoverProps extends Omit { diff --git a/types/tonic-ui__react/tonic-ui__react-tests.tsx b/types/tonic-ui__react/tonic-ui__react-tests.tsx index a00c68837bb0ba..1036f9f45acee5 100644 --- a/types/tonic-ui__react/tonic-ui__react-tests.tsx +++ b/types/tonic-ui__react/tonic-ui__react-tests.tsx @@ -17,7 +17,7 @@ import * as React from "react"; const customTheme = { ...theme, box: { color: "grey" } }; -const Container = (): JSX.Element => { +const Container = (): React.JSX.Element => { const [colorMode, setColorMode] = useColorMode(); setColorMode("light"); useColorStyle({ colorMode }); From 7aa743d179c3e25efc78f4e67e10dcd808d00f33 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 21:16:24 +0100 Subject: [PATCH 083/519] [react-redux] Replace usage of React's global JSX namespace with scoped JSX (#67693) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-redux/index.d.ts | 1 + types/react-redux/v5/react-redux-tests.tsx | 2 +- types/react-redux/v6/index.d.ts | 9 ++++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index 17d8b3ec078485..b990b86b85b405 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -6,6 +6,7 @@ import { JSXElementConstructor, NamedExoticComponent, ReactNode, + JSX, } from "react"; import { Action, AnyAction, Dispatch, Store } from "redux"; diff --git a/types/react-redux/v5/react-redux-tests.tsx b/types/react-redux/v5/react-redux-tests.tsx index 77d508c8aa7c7f..10c4e3e32ca44d 100644 --- a/types/react-redux/v5/react-redux-tests.tsx +++ b/types/react-redux/v5/react-redux-tests.tsx @@ -409,7 +409,7 @@ connect { - render(): JSX.Element { + render(): React.JSX.Element { // ... return null; } diff --git a/types/react-redux/v6/index.d.ts b/types/react-redux/v6/index.d.ts index cd0ef65c1ee175..2986b62a1b2738 100644 --- a/types/react-redux/v6/index.d.ts +++ b/types/react-redux/v6/index.d.ts @@ -10,7 +10,14 @@ // to update this type definitions for redux@4.x from redux@3.x. // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/25321 -import { Component, ComponentClass, ComponentType, FunctionComponent, ReactNode } from "react"; +import { + Component, + ComponentClass, + ComponentType, + FunctionComponent, + ReactNode, + JSX, +} from "react"; import { Action, ActionCreator, AnyAction, Dispatch, Store } from "redux"; From 2099180691a2d6c4f8aeae60872656c364b9d416 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 21:16:37 +0100 Subject: [PATCH 084/519] [react-aria-menubutton] Replace usage of React's global JSX namespace with scoped JSX (#67633) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-aria-menubutton/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-aria-menubutton/index.d.ts b/types/react-aria-menubutton/index.d.ts index f76f0b2305bff9..d443006349ad25 100644 --- a/types/react-aria-menubutton/index.d.ts +++ b/types/react-aria-menubutton/index.d.ts @@ -74,7 +74,7 @@ export interface MenuProps extends Omit JSX.Element); + children: React.JSX.Element | (({ isOpen }: { isOpen: boolean }) => React.JSX.Element); } /** From 099df5eca542857c59acbbd36b91f70d944863b9 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 21:16:48 +0100 Subject: [PATCH 085/519] [react-portal-tooltip] Replace usage of React's global JSX namespace with scoped JSX (#67692) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-portal-tooltip/lib/ToolTip.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-portal-tooltip/lib/ToolTip.d.ts b/types/react-portal-tooltip/lib/ToolTip.d.ts index 763a61edcccc1b..17ababb7274f1d 100644 --- a/types/react-portal-tooltip/lib/ToolTip.d.ts +++ b/types/react-portal-tooltip/lib/ToolTip.d.ts @@ -6,7 +6,7 @@ declare class Tooltip extends React.Component {} export default Tooltip; export interface TooltipProps extends Card.CardProps { - parent: string | JSX.Element | React.RefObject; + parent: string | React.JSX.Element | React.RefObject; active?: boolean | undefined; group?: string | undefined; tooltipTimeout?: number | undefined; From afb5340f2a3b8c8629e2c9380b9ef05cbb6292d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Fran=C3=A7ois?= Date: Mon, 4 Dec 2023 21:17:19 +0100 Subject: [PATCH 086/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67756=20Fi?= =?UTF-8?q?x=20luxon=20invalidReason=20and=20invalidExplanation=20types=20?= =?UTF-8?q?by=20@vinassefranche?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/luxon/src/datetime.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/luxon/src/datetime.d.ts b/types/luxon/src/datetime.d.ts index ee0b144e040218..22d6931f7e8b04 100644 --- a/types/luxon/src/datetime.d.ts +++ b/types/luxon/src/datetime.d.ts @@ -801,12 +801,12 @@ export class DateTime { /** * Returns an error code if this DateTime is invalid, or null if the DateTime is valid */ - get invalidReason(): IfValid; + get invalidReason(): IfValid; /** * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid */ - get invalidExplanation(): IfValid; + get invalidExplanation(): IfValid; /** * Get the locale of a DateTime, such as 'en-GB'. The locale is used when formatting the DateTime From 1a51bb1cd566f6603e11da13043a338b98fca0eb Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 21:18:10 +0100 Subject: [PATCH 087/519] [react] Deprecate Mixin types (#67602) --- types/react/index.d.ts | 6 ++++++ types/react/ts5.0/index.d.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 375c3a1baea816..50e0363465c9ff 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -794,6 +794,9 @@ declare namespace React { UNSAFE_componentWillUpdate?(nextProps: Readonly

, nextState: Readonly, nextContext: any): void; } + /** + * @deprecated https://legacy.reactjs.org/blog/2016/07/13/mixins-considered-harmful.html + */ interface Mixin extends ComponentLifecycle { mixins?: Array> | undefined; statics?: { @@ -809,6 +812,9 @@ declare namespace React { getInitialState?(): S; } + /** + * @deprecated https://legacy.reactjs.org/blog/2016/07/13/mixins-considered-harmful.html + */ interface ComponentSpec extends Mixin { render(): ReactNode; diff --git a/types/react/ts5.0/index.d.ts b/types/react/ts5.0/index.d.ts index 123638428a4376..5ad8d14524b7fb 100644 --- a/types/react/ts5.0/index.d.ts +++ b/types/react/ts5.0/index.d.ts @@ -795,6 +795,9 @@ declare namespace React { UNSAFE_componentWillUpdate?(nextProps: Readonly

, nextState: Readonly, nextContext: any): void; } + /** + * @deprecated https://legacy.reactjs.org/blog/2016/07/13/mixins-considered-harmful.html + */ interface Mixin extends ComponentLifecycle { mixins?: Array> | undefined; statics?: { @@ -810,6 +813,9 @@ declare namespace React { getInitialState?(): S; } + /** + * @deprecated https://legacy.reactjs.org/blog/2016/07/13/mixins-considered-harmful.html + */ interface ComponentSpec extends Mixin { render(): ReactNode; From 3f6649a448604b599f3020474df648d9ecce12ef Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 21:18:38 +0100 Subject: [PATCH 088/519] [rasa-webchat] Replace usage of React's global JSX namespace with scoped JSX (#67627) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/rasa-webchat/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/rasa-webchat/index.d.ts b/types/rasa-webchat/index.d.ts index c7ac11aaebb4d5..f5dac12b93d1ee 100644 --- a/types/rasa-webchat/index.d.ts +++ b/types/rasa-webchat/index.d.ts @@ -223,7 +223,7 @@ export interface RasaWebchatProps { * @remarks This can only be used if you call the webchat from a React application * as you can't write a component in pure JavaScript. */ - customComponent?: (messageData: any) => JSX.Element; // Assuming React JSX + customComponent?: (messageData: any) => React.JSX.Element; // Assuming React JSX /** * Call custom code on a specific widget event. From 581f9c8088159ac33e5a1c897e3cd673d016dd36 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 21:18:44 +0100 Subject: [PATCH 089/519] [react-add-to-calendar] Replace usage of React's global JSX namespace with scoped JSX (#67631) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-add-to-calendar/react-add-to-calendar-tests.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-add-to-calendar/react-add-to-calendar-tests.tsx b/types/react-add-to-calendar/react-add-to-calendar-tests.tsx index abf36a12ec170e..bb241877fb6020 100644 --- a/types/react-add-to-calendar/react-add-to-calendar-tests.tsx +++ b/types/react-add-to-calendar/react-add-to-calendar-tests.tsx @@ -9,13 +9,13 @@ const sampleEvent = { endTime: "2016-09-16T21:45:00-04:00", }; -const AddToCalendarRequiredOptions: JSX.Element = ( +const AddToCalendarRequiredOptions: React.JSX.Element = ( ); -const AddToCalendarAllOptions: JSX.Element = ( +const AddToCalendarAllOptions: React.JSX.Element = ( Date: Mon, 4 Dec 2023 21:18:58 +0100 Subject: [PATCH 090/519] [proton-native] Replace usage of React's global JSX namespace with scoped JSX (#67626) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/proton-native/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/proton-native/index.d.ts b/types/proton-native/index.d.ts index d038bf97a1b37d..3092be2c905bba 100644 --- a/types/proton-native/index.d.ts +++ b/types/proton-native/index.d.ts @@ -457,7 +457,7 @@ export interface GroupProps extends GridChildrenProps, Label, Stretchy { /** * Group can only have one child. To have more than one child, use boxes. */ - children?: JSX.Element | undefined; + children?: React.JSX.Element | undefined; /** * Whether the Group is enabled. */ @@ -887,7 +887,7 @@ export interface WindowProps { /** * Window can only have one child. To have more than one child, use boxes. */ - children?: JSX.Element | undefined; + children?: React.JSX.Element | undefined; /** * Whether the window is closed. If set to closed, then the window will be closed. */ @@ -944,7 +944,7 @@ export class Window extends React.Component {} /** * Renders the input component */ -export function render(element: JSX.Element): void; +export function render(element: React.JSX.Element): void; /** * A method to display an alert. From ee8e42eda2547b78d20d34b4a194f83e65c2d1ee Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 4 Dec 2023 21:19:12 +0100 Subject: [PATCH 091/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67650=20[r?= =?UTF-8?q?eact-form]=20Replace=20usage=20of=20React's=20global=20JSX=20na?= =?UTF-8?q?mespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-form/react-form-tests.tsx | 2 +- types/react-form/v1/index.d.ts | 2 +- types/react-form/v2/index.d.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/react-form/react-form-tests.tsx b/types/react-form/react-form-tests.tsx index b89cc2d0e1d7f1..a8a4f9cb972c9f 100644 --- a/types/react-form/react-form-tests.tsx +++ b/types/react-form/react-form-tests.tsx @@ -498,7 +498,7 @@ function FourthMyForm() { // Few tests -export function EmailField(props: any): JSX.Element { +export function EmailField(props: any): React.JSX.Element { const data = useField("email", { defaultValue: props.defaultValue, defaultError: props.defaultError, diff --git a/types/react-form/v1/index.d.ts b/types/react-form/v1/index.d.ts index ea87b3829da5c4..ee060c05344011 100644 --- a/types/react-form/v1/index.d.ts +++ b/types/react-form/v1/index.d.ts @@ -9,7 +9,7 @@ export type FormValues = Nested; export type Touched = Nested; export type FormErrors = { [key: string]: FormError } | [{ [key: string]: FormError }]; export type NestedErrors = Nested; -export type RenderReturn = JSX.Element | false | null; +export type RenderReturn = React.JSX.Element | false | null; export interface FormProps { loadState?(props: FormProps, self: Form): FormState | undefined; diff --git a/types/react-form/v2/index.d.ts b/types/react-form/v2/index.d.ts index ba311fdf8f6a2f..ccb85e14df5e78 100644 --- a/types/react-form/v2/index.d.ts +++ b/types/react-form/v2/index.d.ts @@ -12,7 +12,7 @@ export interface FormErrors { [key: string]: FormError; } export type NestedErrors = Nested; -export type RenderReturn = JSX.Element | false | null | never[]; +export type RenderReturn = React.JSX.Element | false | null | never[]; export interface FormState { values: FormValues; From 1072f39f26ac8ee560fc0009957c1752d1b3821d Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 4 Dec 2023 20:20:42 +0000 Subject: [PATCH 092/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/react-redux/index.d.ts | 2 +- types/react-redux/v6/index.d.ts | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index b990b86b85b405..8ea33cb0c8e579 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -3,10 +3,10 @@ import { Component, ComponentClass, Context, + JSX, JSXElementConstructor, NamedExoticComponent, ReactNode, - JSX, } from "react"; import { Action, AnyAction, Dispatch, Store } from "redux"; diff --git a/types/react-redux/v6/index.d.ts b/types/react-redux/v6/index.d.ts index 2986b62a1b2738..2266d3622d3353 100644 --- a/types/react-redux/v6/index.d.ts +++ b/types/react-redux/v6/index.d.ts @@ -10,14 +10,7 @@ // to update this type definitions for redux@4.x from redux@3.x. // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/25321 -import { - Component, - ComponentClass, - ComponentType, - FunctionComponent, - ReactNode, - JSX, -} from "react"; +import { Component, ComponentClass, ComponentType, FunctionComponent, JSX, ReactNode } from "react"; import { Action, ActionCreator, AnyAction, Dispatch, Store } from "redux"; From 6fd9bcd979800a35d10081a5bde55f5c8d020f40 Mon Sep 17 00:00:00 2001 From: Paul Langton Date: Mon, 4 Dec 2023 15:46:52 -0500 Subject: [PATCH 093/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67398=20no?= =?UTF-8?q?de-schedule:=20add=20isValid=20type=20to=20RecurrenceRule=20by?= =?UTF-8?q?=20@paulangton?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add isValid type to RecurrenceRule * add isValid call to tests --- types/node-schedule/index.d.ts | 1 + types/node-schedule/node-schedule-tests.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/types/node-schedule/index.d.ts b/types/node-schedule/index.d.ts index 2acd939ebd0a6b..f1ffdccc2b44e4 100644 --- a/types/node-schedule/index.d.ts +++ b/types/node-schedule/index.d.ts @@ -119,6 +119,7 @@ export class RecurrenceRule { ); nextInvocationDate(base: Date): Date; + isValid(): boolean; } /** diff --git a/types/node-schedule/node-schedule-tests.ts b/types/node-schedule/node-schedule-tests.ts index b16fba1710d927..db99e01e6b23c7 100644 --- a/types/node-schedule/node-schedule-tests.ts +++ b/types/node-schedule/node-schedule-tests.ts @@ -112,6 +112,8 @@ function testRecurrenceRule() { rule2.hour = 5; rule2.minute = new nodeSchedule.Range(4, 6); rule2.second = new nodeSchedule.Range(8, 12, 2); + + const valid: boolean = rule3.isValid() } /** From 3e80c8117f4a1d9703155941fba443382badffbb Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 4 Dec 2023 20:48:07 +0000 Subject: [PATCH 094/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/node-schedule/node-schedule-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/node-schedule/node-schedule-tests.ts b/types/node-schedule/node-schedule-tests.ts index db99e01e6b23c7..20d92863e6ef61 100644 --- a/types/node-schedule/node-schedule-tests.ts +++ b/types/node-schedule/node-schedule-tests.ts @@ -113,7 +113,7 @@ function testRecurrenceRule() { rule2.minute = new nodeSchedule.Range(4, 6); rule2.second = new nodeSchedule.Range(8, 12, 2); - const valid: boolean = rule3.isValid() + const valid: boolean = rule3.isValid(); } /** From a257b8976c8beec3ed1fe1309bb3519e20779977 Mon Sep 17 00:00:00 2001 From: M Fahad Arif <33180494+fahidarif@users.noreply.github.com> Date: Tue, 5 Dec 2023 03:07:19 +0500 Subject: [PATCH 095/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67577=20Ad?= =?UTF-8?q?d=20types=20for=20the=20async-rerun=20package=20by=20@fahidarif?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add types for the async-rerun package * remove "esModuleInterop" from tsconfig.json * fix JSDocs * fix type naming --- types/async-rerun/.npmignore | 5 +++++ types/async-rerun/async-rerun-tests.ts | 16 ++++++++++++++++ types/async-rerun/index.d.ts | 13 +++++++++++++ types/async-rerun/package.json | 17 +++++++++++++++++ types/async-rerun/tsconfig.json | 19 +++++++++++++++++++ types/async-rerun/tslint.json | 1 + 6 files changed, 71 insertions(+) create mode 100644 types/async-rerun/.npmignore create mode 100644 types/async-rerun/async-rerun-tests.ts create mode 100644 types/async-rerun/index.d.ts create mode 100644 types/async-rerun/package.json create mode 100644 types/async-rerun/tsconfig.json create mode 100644 types/async-rerun/tslint.json diff --git a/types/async-rerun/.npmignore b/types/async-rerun/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/async-rerun/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/async-rerun/async-rerun-tests.ts b/types/async-rerun/async-rerun-tests.ts new file mode 100644 index 00000000000000..d01ff14513ef36 --- /dev/null +++ b/types/async-rerun/async-rerun-tests.ts @@ -0,0 +1,16 @@ +import { runAsync } from "async-rerun"; + + +function test() { + return new Promise((resolve, reject) => { + reject(false); + }) +} + +runAsync(test, 10, 1000, false, true).then((res: any) => { + //logic for the positive case + return true; +}).catch((res: any) => { + //logic for the negative case + return false; +}) \ No newline at end of file diff --git a/types/async-rerun/index.d.ts b/types/async-rerun/index.d.ts new file mode 100644 index 00000000000000..6a783762091616 --- /dev/null +++ b/types/async-rerun/index.d.ts @@ -0,0 +1,13 @@ + +type CallBackFunction = () => Promise; + +/** + * @param fn The function which will be used as parameter should return a PROMISE & SHOULD NOT HAVE ANY PARAMETER it's compulsory, as its a async retry mechanism. Also you can BIND the global scope too with the function in order use the global scoped variables like this => .bind(this). + * @param maxRetries Max Retries in number. + * @param delayInMS Delay time for retries in number as mili-seconds(ms). + * @param alwaysRetry To retry always untill the positive response, If its true then maxRetries will not count. + * @param showLogs To show logs for all retries. + */ +declare function runAsync(fn: CallBackFunction, maxRetries: number, delayInMS: number, alwaysRetry?: boolean, showLogs?: boolean): Promise; + +export { runAsync }; diff --git a/types/async-rerun/package.json b/types/async-rerun/package.json new file mode 100644 index 00000000000000..b556ca7424865e --- /dev/null +++ b/types/async-rerun/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/async-rerun", + "version": "1.1.9999", + "projects": [ + "https://github.com/fahidarif/rerun#readme" + ], + "devDependencies": { + "@types/async-rerun": "workspace:." + }, + "owners": [ + { + "name": "M Fahad A.", + "githubUsername": "fahidarif" + } + ] +} diff --git a/types/async-rerun/tsconfig.json b/types/async-rerun/tsconfig.json new file mode 100644 index 00000000000000..c232e5fbec71c7 --- /dev/null +++ b/types/async-rerun/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "async-rerun-tests.ts" + ] +} diff --git a/types/async-rerun/tslint.json b/types/async-rerun/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/async-rerun/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From c30862f86a3902c8f62b127519a74ea5e861fa99 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 4 Dec 2023 22:08:28 +0000 Subject: [PATCH 096/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/async-rerun/async-rerun-tests.ts | 9 ++++----- types/async-rerun/index.d.ts | 9 +++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/types/async-rerun/async-rerun-tests.ts b/types/async-rerun/async-rerun-tests.ts index d01ff14513ef36..9804ba4c939f77 100644 --- a/types/async-rerun/async-rerun-tests.ts +++ b/types/async-rerun/async-rerun-tests.ts @@ -1,16 +1,15 @@ import { runAsync } from "async-rerun"; - function test() { return new Promise((resolve, reject) => { reject(false); - }) + }); } runAsync(test, 10, 1000, false, true).then((res: any) => { - //logic for the positive case + // logic for the positive case return true; }).catch((res: any) => { - //logic for the negative case + // logic for the negative case return false; -}) \ No newline at end of file +}); diff --git a/types/async-rerun/index.d.ts b/types/async-rerun/index.d.ts index 6a783762091616..c3c7a5b8d7cb42 100644 --- a/types/async-rerun/index.d.ts +++ b/types/async-rerun/index.d.ts @@ -1,4 +1,3 @@ - type CallBackFunction = () => Promise; /** @@ -8,6 +7,12 @@ type CallBackFunction = () => Promise; * @param alwaysRetry To retry always untill the positive response, If its true then maxRetries will not count. * @param showLogs To show logs for all retries. */ -declare function runAsync(fn: CallBackFunction, maxRetries: number, delayInMS: number, alwaysRetry?: boolean, showLogs?: boolean): Promise; +declare function runAsync( + fn: CallBackFunction, + maxRetries: number, + delayInMS: number, + alwaysRetry?: boolean, + showLogs?: boolean, +): Promise; export { runAsync }; From 08cc639df44e4cf57084012e491356288103815f Mon Sep 17 00:00:00 2001 From: Tristan F Date: Mon, 4 Dec 2023 18:28:40 -0500 Subject: [PATCH 097/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67591=20[i?= =?UTF-8?q?s-weakref]=20add=20types=20by=20@LeoDog896?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/is-weakref/.npmignore | 5 ++++ types/is-weakref/index.d.ts | 3 +++ types/is-weakref/is-weakref-tests.ts | 34 ++++++++++++++++++++++++++++ types/is-weakref/package.json | 17 ++++++++++++++ types/is-weakref/tsconfig.json | 19 ++++++++++++++++ types/is-weakref/tslint.json | 1 + 6 files changed, 79 insertions(+) create mode 100644 types/is-weakref/.npmignore create mode 100644 types/is-weakref/index.d.ts create mode 100644 types/is-weakref/is-weakref-tests.ts create mode 100644 types/is-weakref/package.json create mode 100644 types/is-weakref/tsconfig.json create mode 100644 types/is-weakref/tslint.json diff --git a/types/is-weakref/.npmignore b/types/is-weakref/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/is-weakref/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/is-weakref/index.d.ts b/types/is-weakref/index.d.ts new file mode 100644 index 00000000000000..621e7d715f0463 --- /dev/null +++ b/types/is-weakref/index.d.ts @@ -0,0 +1,3 @@ +declare function isWeakRef(value: unknown): value is WeakRef; + +export = isWeakRef; diff --git a/types/is-weakref/is-weakref-tests.ts b/types/is-weakref/is-weakref-tests.ts new file mode 100644 index 00000000000000..d03d085996a1e8 --- /dev/null +++ b/types/is-weakref/is-weakref-tests.ts @@ -0,0 +1,34 @@ +import isWeakRef = require("is-weakref"); + +// $ExpectType boolean +isWeakRef(new WeakRef({})); + +// $ExpectType boolean +isWeakRef({}); + +// $ExpectType boolean +isWeakRef("foo"); + +const weakRef = new WeakRef({}); + +if (isWeakRef(weakRef)) { + // $ExpectType WeakRef<{}> + weakRef; + + weakRef.deref(); +} else { + // $ExpectType never + weakRef; +} + +const x: unknown = new WeakRef({}); + +if (isWeakRef(x)) { + // $ExpectType WeakRef + x; + + x.deref(); +} else { + // $ExpectType unknown + x; +} diff --git a/types/is-weakref/package.json b/types/is-weakref/package.json new file mode 100644 index 00000000000000..9023fa5dc5c5b4 --- /dev/null +++ b/types/is-weakref/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/is-weakref", + "version": "1.0.9999", + "projects": [ + "https://github.com/inspect-js/is-weakref#readme" + ], + "devDependencies": { + "@types/is-weakref": "workspace:." + }, + "owners": [ + { + "name": "Tristan F.", + "githubUsername": "LeoDog896" + } + ] +} diff --git a/types/is-weakref/tsconfig.json b/types/is-weakref/tsconfig.json new file mode 100644 index 00000000000000..598f567a8503cd --- /dev/null +++ b/types/is-weakref/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "ES2021" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-weakref-tests.ts" + ] +} diff --git a/types/is-weakref/tslint.json b/types/is-weakref/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/is-weakref/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From 56075a66e1dd2647a10b9371ca7a79d049a8ce14 Mon Sep 17 00:00:00 2001 From: Tristan F Date: Mon, 4 Dec 2023 18:35:48 -0500 Subject: [PATCH 098/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67597=20[b?= =?UTF-8?q?undle-id]=20add=20types=20by=20@LeoDog896?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/bundle-id/.npmignore | 5 +++++ types/bundle-id/bundle-id-tests.ts | 19 +++++++++++++++++++ types/bundle-id/index.d.ts | 2 ++ types/bundle-id/package.json | 17 +++++++++++++++++ types/bundle-id/tsconfig.json | 19 +++++++++++++++++++ types/bundle-id/tslint.json | 1 + 6 files changed, 63 insertions(+) create mode 100644 types/bundle-id/.npmignore create mode 100644 types/bundle-id/bundle-id-tests.ts create mode 100644 types/bundle-id/index.d.ts create mode 100644 types/bundle-id/package.json create mode 100644 types/bundle-id/tsconfig.json create mode 100644 types/bundle-id/tslint.json diff --git a/types/bundle-id/.npmignore b/types/bundle-id/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/bundle-id/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/bundle-id/bundle-id-tests.ts b/types/bundle-id/bundle-id-tests.ts new file mode 100644 index 00000000000000..384e3881168375 --- /dev/null +++ b/types/bundle-id/bundle-id-tests.ts @@ -0,0 +1,19 @@ +import { bundleId, bundleIdSync } from "bundle-id"; + +// $ExpectType Promise +bundleId("Safari"); + +// $ExpectType string +bundleIdSync("Safari"); + +// @ts-expect-error +bundleId(); + +// @ts-expect-error +bundleId(1); + +// @ts-expect-error +bundleIdSync(); + +// @ts-expect-error +bundleIdSync(1); diff --git a/types/bundle-id/index.d.ts b/types/bundle-id/index.d.ts new file mode 100644 index 00000000000000..c6d46490839f05 --- /dev/null +++ b/types/bundle-id/index.d.ts @@ -0,0 +1,2 @@ +export function bundleId(bundleName: string): Promise; +export function bundleIdSync(bundleName: string): string; diff --git a/types/bundle-id/package.json b/types/bundle-id/package.json new file mode 100644 index 00000000000000..d3b6a00f41a0e0 --- /dev/null +++ b/types/bundle-id/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/bundle-id", + "version": "3.0.9999", + "projects": [ + "https://github.com/sindresorhus/bundle-id#readme" + ], + "devDependencies": { + "@types/bundle-id": "workspace:." + }, + "owners": [ + { + "name": "Tristan F.", + "githubUsername": "LeoDog896" + } + ] +} diff --git a/types/bundle-id/tsconfig.json b/types/bundle-id/tsconfig.json new file mode 100644 index 00000000000000..51c73c2eb4fd18 --- /dev/null +++ b/types/bundle-id/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bundle-id-tests.ts" + ] +} diff --git a/types/bundle-id/tslint.json b/types/bundle-id/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/bundle-id/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From 74e14afe9ae5300dbe10814a9d5bd11420c40d6f Mon Sep 17 00:00:00 2001 From: Tristan F Date: Mon, 4 Dec 2023 18:35:59 -0500 Subject: [PATCH 099/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67592=20[u?= =?UTF-8?q?nique-slug]=20add=20types=20by=20@LeoDog896?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/unique-slug/.npmignore | 5 +++++ types/unique-slug/index.d.ts | 3 +++ types/unique-slug/package.json | 17 +++++++++++++++++ types/unique-slug/tsconfig.json | 19 +++++++++++++++++++ types/unique-slug/tslint.json | 1 + types/unique-slug/unique-slug-tests.ts | 10 ++++++++++ 6 files changed, 55 insertions(+) create mode 100644 types/unique-slug/.npmignore create mode 100644 types/unique-slug/index.d.ts create mode 100644 types/unique-slug/package.json create mode 100644 types/unique-slug/tsconfig.json create mode 100644 types/unique-slug/tslint.json create mode 100644 types/unique-slug/unique-slug-tests.ts diff --git a/types/unique-slug/.npmignore b/types/unique-slug/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/unique-slug/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/unique-slug/index.d.ts b/types/unique-slug/index.d.ts new file mode 100644 index 00000000000000..a66782b0d6519a --- /dev/null +++ b/types/unique-slug/index.d.ts @@ -0,0 +1,3 @@ +declare function uniqueSlug(uniq?: string): string; + +export = uniqueSlug; diff --git a/types/unique-slug/package.json b/types/unique-slug/package.json new file mode 100644 index 00000000000000..293b57ad136b85 --- /dev/null +++ b/types/unique-slug/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/unique-slug", + "version": "4.0.9999", + "projects": [ + "https://github.com/npm/unique-slug#readme" + ], + "devDependencies": { + "@types/unique-slug": "workspace:." + }, + "owners": [ + { + "name": "Tristan F.", + "githubUsername": "LeoDog896" + } + ] +} diff --git a/types/unique-slug/tsconfig.json b/types/unique-slug/tsconfig.json new file mode 100644 index 00000000000000..01a84e6f6bfa7d --- /dev/null +++ b/types/unique-slug/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "unique-slug-tests.ts" + ] +} diff --git a/types/unique-slug/tslint.json b/types/unique-slug/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/unique-slug/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } diff --git a/types/unique-slug/unique-slug-tests.ts b/types/unique-slug/unique-slug-tests.ts new file mode 100644 index 00000000000000..0e589306ad0c35 --- /dev/null +++ b/types/unique-slug/unique-slug-tests.ts @@ -0,0 +1,10 @@ +import uniqueSlug = require("unique-slug"); + +// $ExpectType string +uniqueSlug(); + +// $ExpectType string +uniqueSlug("foo"); + +// @ts-expect-error +uniqueSlug(1); From 65b863cf3eb086a84c5437eeb330565e88c04f0e Mon Sep 17 00:00:00 2001 From: Tristan F Date: Mon, 4 Dec 2023 19:21:49 -0500 Subject: [PATCH 100/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67594=20[t?= =?UTF-8?q?o-object-path]=20add=20types=20by=20@LeoDog896?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/to-object-path/.npmignore | 5 +++++ types/to-object-path/index.d.ts | 5 +++++ types/to-object-path/package.json | 17 +++++++++++++++++ types/to-object-path/to-object-path-tests.ts | 16 ++++++++++++++++ types/to-object-path/tsconfig.json | 19 +++++++++++++++++++ types/to-object-path/tslint.json | 1 + 6 files changed, 63 insertions(+) create mode 100644 types/to-object-path/.npmignore create mode 100644 types/to-object-path/index.d.ts create mode 100644 types/to-object-path/package.json create mode 100644 types/to-object-path/to-object-path-tests.ts create mode 100644 types/to-object-path/tsconfig.json create mode 100644 types/to-object-path/tslint.json diff --git a/types/to-object-path/.npmignore b/types/to-object-path/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/to-object-path/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/to-object-path/index.d.ts b/types/to-object-path/index.d.ts new file mode 100644 index 00000000000000..3977e668aa6b87 --- /dev/null +++ b/types/to-object-path/index.d.ts @@ -0,0 +1,5 @@ +type Path = string | Path[]; + +declare function toPath(...paths: Path[]): string; + +export = toPath; diff --git a/types/to-object-path/package.json b/types/to-object-path/package.json new file mode 100644 index 00000000000000..47ac8bcbdedea8 --- /dev/null +++ b/types/to-object-path/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/to-object-path", + "version": "0.3.9999", + "projects": [ + "https://github.com/jonschlinkert/to-object-path" + ], + "devDependencies": { + "@types/to-object-path": "workspace:." + }, + "owners": [ + { + "name": "Tristan F.", + "githubUsername": "LeoDog896" + } + ] +} diff --git a/types/to-object-path/to-object-path-tests.ts b/types/to-object-path/to-object-path-tests.ts new file mode 100644 index 00000000000000..d49abe29daf0bb --- /dev/null +++ b/types/to-object-path/to-object-path-tests.ts @@ -0,0 +1,16 @@ +import toPath = require("to-object-path"); + +// $ExpectType string +toPath("foo"); + +// $ExpectType string +toPath(["foo", "bar"]); + +// $ExpectType string +toPath("a", ["b", "chrome"], "d", [[["e", "firefox"], "g"], "h"]); + +// @ts-expect-error +toPath(["foo", 1]); + +// @ts-expect-error +toPath(1); diff --git a/types/to-object-path/tsconfig.json b/types/to-object-path/tsconfig.json new file mode 100644 index 00000000000000..5a4bec84720fa2 --- /dev/null +++ b/types/to-object-path/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "to-object-path-tests.ts" + ] +} diff --git a/types/to-object-path/tslint.json b/types/to-object-path/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/to-object-path/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From 608f62f1a14fd6e467d1a635f1826e8715af5864 Mon Sep 17 00:00:00 2001 From: Tristan F Date: Mon, 4 Dec 2023 19:40:31 -0500 Subject: [PATCH 101/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67590=20[i?= =?UTF-8?q?s-negative-zero]=20add=20types=20by=20@LeoDog896?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/is-negative-zero/.npmignore | 5 +++++ types/is-negative-zero/index.d.ts | 3 +++ .../is-negative-zero-tests.ts | 13 +++++++++++++ types/is-negative-zero/package.json | 17 +++++++++++++++++ types/is-negative-zero/tsconfig.json | 19 +++++++++++++++++++ types/is-negative-zero/tslint.json | 1 + 6 files changed, 58 insertions(+) create mode 100644 types/is-negative-zero/.npmignore create mode 100644 types/is-negative-zero/index.d.ts create mode 100644 types/is-negative-zero/is-negative-zero-tests.ts create mode 100644 types/is-negative-zero/package.json create mode 100644 types/is-negative-zero/tsconfig.json create mode 100644 types/is-negative-zero/tslint.json diff --git a/types/is-negative-zero/.npmignore b/types/is-negative-zero/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/is-negative-zero/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/is-negative-zero/index.d.ts b/types/is-negative-zero/index.d.ts new file mode 100644 index 00000000000000..ac12222da666f4 --- /dev/null +++ b/types/is-negative-zero/index.d.ts @@ -0,0 +1,3 @@ +declare function isNegativeZero(value: T): T extends number ? boolean : false; + +export = isNegativeZero; diff --git a/types/is-negative-zero/is-negative-zero-tests.ts b/types/is-negative-zero/is-negative-zero-tests.ts new file mode 100644 index 00000000000000..5ae462d9c9be1a --- /dev/null +++ b/types/is-negative-zero/is-negative-zero-tests.ts @@ -0,0 +1,13 @@ +import isNegativeZero = require('is-negative-zero'); + +// $ExpectType boolean +isNegativeZero(-0); + +// $ExpectType boolean +isNegativeZero(0); + +// $ExpectType false +isNegativeZero(Symbol()); + +// $ExpectType false +isNegativeZero('0'); diff --git a/types/is-negative-zero/package.json b/types/is-negative-zero/package.json new file mode 100644 index 00000000000000..e53e5f25443ddc --- /dev/null +++ b/types/is-negative-zero/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/is-negative-zero", + "version": "2.0.9999", + "projects": [ + "https://github.com/inspect-js/is-negative-zero" + ], + "devDependencies": { + "@types/is-negative-zero": "workspace:." + }, + "owners": [ + { + "name": "Tristan F.", + "githubUsername": "LeoDog896" + } + ] +} diff --git a/types/is-negative-zero/tsconfig.json b/types/is-negative-zero/tsconfig.json new file mode 100644 index 00000000000000..1c4b360f6371da --- /dev/null +++ b/types/is-negative-zero/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-negative-zero-tests.ts" + ] +} diff --git a/types/is-negative-zero/tslint.json b/types/is-negative-zero/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/is-negative-zero/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From c30be5bc139a294f4a538bdd932b2950f1d1b4ea Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 5 Dec 2023 00:41:47 +0000 Subject: [PATCH 102/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/is-negative-zero/is-negative-zero-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/is-negative-zero/is-negative-zero-tests.ts b/types/is-negative-zero/is-negative-zero-tests.ts index 5ae462d9c9be1a..db8f40476a5c7d 100644 --- a/types/is-negative-zero/is-negative-zero-tests.ts +++ b/types/is-negative-zero/is-negative-zero-tests.ts @@ -1,4 +1,4 @@ -import isNegativeZero = require('is-negative-zero'); +import isNegativeZero = require("is-negative-zero"); // $ExpectType boolean isNegativeZero(-0); @@ -10,4 +10,4 @@ isNegativeZero(0); isNegativeZero(Symbol()); // $ExpectType false -isNegativeZero('0'); +isNegativeZero("0"); From 610e763aec9418ae1d1ac3e2e4d4f614a4eb2a57 Mon Sep 17 00:00:00 2001 From: bangbang93 Date: Tue, 5 Dec 2023 09:27:23 +0800 Subject: [PATCH 103/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67569=20ad?= =?UTF-8?q?d=20@types/passport-qq=20by=20@bangbang93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add @types/passport-qq * feat: enchance UserProfileCallback * style: format --- types/passport-qq/.npmignore | 5 +++++ types/passport-qq/index.d.ts | 29 ++++++++++++++++++++++++++ types/passport-qq/package.json | 21 +++++++++++++++++++ types/passport-qq/passport-qq-tests.ts | 9 ++++++++ types/passport-qq/tsconfig.json | 19 +++++++++++++++++ types/passport-qq/tslint.json | 1 + 6 files changed, 84 insertions(+) create mode 100644 types/passport-qq/.npmignore create mode 100644 types/passport-qq/index.d.ts create mode 100644 types/passport-qq/package.json create mode 100644 types/passport-qq/passport-qq-tests.ts create mode 100644 types/passport-qq/tsconfig.json create mode 100644 types/passport-qq/tslint.json diff --git a/types/passport-qq/.npmignore b/types/passport-qq/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/passport-qq/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/passport-qq/index.d.ts b/types/passport-qq/index.d.ts new file mode 100644 index 00000000000000..d9a29cc53f2fe7 --- /dev/null +++ b/types/passport-qq/index.d.ts @@ -0,0 +1,29 @@ +import { Profile } from "passport"; +import { Strategy as OAuth2Strategy, VerifyCallback } from "passport-oauth2"; + +export interface Options { + clientID: string; + clientSecret: string; + callbackURL: string; + authorizationURL?: string; + tokenURL?: string; + scopeSeparator?: string; +} + +export interface User extends Profile { + provider: "qq"; + id: string; + nickanme: string; + _raw: string; + _json: object; +} + +export type UserProfileCallback = (err: Error | null, user: User) => void; + +export type VerifyFunction = (accessToken: string, refreshToken: string, profile: User, done: VerifyCallback) => void; + +export class Strategy extends OAuth2Strategy { + constructor(options: Options, verify: VerifyFunction); + + userProfile(accessToken: string, done: UserProfileCallback): void; +} diff --git a/types/passport-qq/package.json b/types/passport-qq/package.json new file mode 100644 index 00000000000000..7e6f3e56821dcc --- /dev/null +++ b/types/passport-qq/package.json @@ -0,0 +1,21 @@ +{ + "private": true, + "name": "@types/passport-qq", + "version": "0.1.9999", + "projects": [ + "https://github.com/qdsang/passport-qq#readme" + ], + "dependencies": { + "@types/passport": "*", + "@types/passport-oauth2": "*" + }, + "devDependencies": { + "@types/passport-qq": "workspace:." + }, + "owners": [ + { + "name": "bangbang93", + "githubUsername": "bangbang93" + } + ] +} diff --git a/types/passport-qq/passport-qq-tests.ts b/types/passport-qq/passport-qq-tests.ts new file mode 100644 index 00000000000000..e5179928357277 --- /dev/null +++ b/types/passport-qq/passport-qq-tests.ts @@ -0,0 +1,9 @@ +import { Strategy } from "passport-qq"; + +const qqStrategy = new Strategy({ + clientID: "123", + clientSecret: "123", + callbackURL: "http://127.0.0.1:3000/auth/qq/callback", +}, function(accessToken, refreshToken, profile, done) { + done(null, profile); +}); diff --git a/types/passport-qq/tsconfig.json b/types/passport-qq/tsconfig.json new file mode 100644 index 00000000000000..fdab19667d154d --- /dev/null +++ b/types/passport-qq/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "passport-qq-tests.ts" + ] +} diff --git a/types/passport-qq/tslint.json b/types/passport-qq/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/passport-qq/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From 59d2d25823cefa6ca7c15c24b82879af3ae930b0 Mon Sep 17 00:00:00 2001 From: Dmitry Demensky <10235949+demensky@users.noreply.github.com> Date: Tue, 5 Dec 2023 07:06:03 +0200 Subject: [PATCH 104/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67557=20fi?= =?UTF-8?q?x(twitch-ext):=20`BitsTransaction.initiator`=20lowercase=20by?= =?UTF-8?q?=20@demensky?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/twitch-ext/index.d.ts | 5 ++++- types/twitch-ext/twitch-ext-tests.ts | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/twitch-ext/index.d.ts b/types/twitch-ext/index.d.ts index 1fbf37b6e9e9d1..234625b9d4d21c 100644 --- a/types/twitch-ext/index.d.ts +++ b/types/twitch-ext/index.d.ts @@ -322,7 +322,10 @@ declare namespace Twitch.ext { */ displayName: string; - initiator: "CURRENT_USER" | "OTHER"; + // The documentation says that the type of this field is `"CURRENT_USER" | "OTHER"`, + // but in reality it is lowercase. + // https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/67555 + initiator: "current_user" | "other"; /** * Full product object from getProducts call diff --git a/types/twitch-ext/twitch-ext-tests.ts b/types/twitch-ext/twitch-ext-tests.ts index 6758d32b423ff6..a514a68d04779d 100644 --- a/types/twitch-ext/twitch-ext-tests.ts +++ b/types/twitch-ext/twitch-ext-tests.ts @@ -102,6 +102,8 @@ Twitch.ext.bits }); Twitch.ext.bits.onTransactionCancelled(() => console.log("Transaction cancelled")); Twitch.ext.bits.onTransactionComplete(transaction => { + // $ExpectType "current_user" | "other" + transaction.initiator; console.log(`${transaction.initiator} (${transaction.userId}) bought ${transaction.product.displayName}`); console.log(`Transaction id was ${transaction.transactionID}`); }); From df56a4920b3dab07f7bfd270e0d45a12a3e6654f Mon Sep 17 00:00:00 2001 From: arianrhodsandlot Date: Tue, 5 Dec 2023 14:44:36 +0800 Subject: [PATCH 105/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67382=20Ad?= =?UTF-8?q?d=20missing=20option=20properties=20for=20package=20ini=20by=20?= =?UTF-8?q?@arianrhodsandlot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add missing option properties for package ini * Format code --- types/ini/index.d.ts | 5 +++++ types/ini/ini-tests.ts | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/types/ini/index.d.ts b/types/ini/index.d.ts index 8bda3353409096..3faa1467ff1989 100644 --- a/types/ini/index.d.ts +++ b/types/ini/index.d.ts @@ -1,6 +1,11 @@ interface EncodeOptions { + align?: boolean; section?: string; + sort?: boolean; whitespace?: boolean; + newline?: boolean; + platform?: string; + bracketedArray?: boolean; } export function decode(str: string): { diff --git a/types/ini/ini-tests.ts b/types/ini/ini-tests.ts index c9990abed4b6c9..b2784e5ec62e3e 100644 --- a/types/ini/ini-tests.ts +++ b/types/ini/ini-tests.ts @@ -25,6 +25,15 @@ encoded = ini.encode(decoded, "Section"); encoded = ini.encode(decoded, { whitespace: true }); encoded = ini.encode(decoded, { section: "Section" }); encoded = ini.encode(decoded, { whitespace: true, section: "Section" }); +encoded = ini.encode(decoded, { + align: true, + sort: true, + whitespace: true, + section: "Section", + newline: true, + platform: "linux", + bracketedArray: true, +}); // @ts-expect-error let badEncoded = ini.encode(); @@ -36,6 +45,15 @@ encoded = ini.stringify(decoded, "Section"); encoded = ini.stringify(decoded, { whitespace: true }); encoded = ini.stringify(decoded, { section: "Section" }); encoded = ini.stringify(decoded, { whitespace: true, section: "Section" }); +encoded = ini.stringify(decoded, { + align: true, + sort: true, + whitespace: true, + section: "Section", + newline: true, + platform: "linux", + bracketedArray: true, +}); // @ts-expect-error badEncoded = ini.stringify(); From b76495e101b12678d504f6ecb5823983354074e5 Mon Sep 17 00:00:00 2001 From: Daniela Mateescu Date: Tue, 5 Dec 2023 09:33:37 +0200 Subject: [PATCH 106/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67403=20Up?= =?UTF-8?q?grade=20version=20of=20@types/fixed-data-table-2=20after=20addi?= =?UTF-8?q?ng=20Plugins.ResizeCell=20and=20Plugins.ReorderCell=20by=20@dan?= =?UTF-8?q?iela-mateescu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add types Plugins.ResizeCell and Plugins.ReorderCell * Make changes in order for test to pass * Run 'pnpm dprint fmt' for formating acoording to PR reviewer * Update fixed-data-table-2 vresion * Proper version 1.0.9999 --------- Co-authored-by: Daniela Buzatu --- types/fixed-data-table-2/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/fixed-data-table-2/package.json b/types/fixed-data-table-2/package.json index 66a8cc1c965c61..eda6b9a2d34be4 100644 --- a/types/fixed-data-table-2/package.json +++ b/types/fixed-data-table-2/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/fixed-data-table-2", - "version": "0.8.9999", + "version": "1.0.9999", "projects": [ "https://github.com/schrodinger/fixed-data-table-2", "http://schrodinger.github.io/fixed-data-table-2" From 72282372cc216e18ab334a535be37ff8311670ba Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 12:36:06 +0100 Subject: [PATCH 107/519] [reactable] Replace usage of React's global JSX namespace with scoped JSX (#67730) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/reactable/reactable-tests.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types/reactable/reactable-tests.tsx b/types/reactable/reactable-tests.tsx index 2a9405848e5b39..b18045abe2e7fa 100644 --- a/types/reactable/reactable-tests.tsx +++ b/types/reactable/reactable-tests.tsx @@ -33,16 +33,16 @@ const data = [ ]; export class TestComponent extends React.Component { - render(): JSX.Element { + render(): React.JSX.Element { return ; } } export class FullblownReactableTestComponent extends React.Component { - render(): JSX.Element { + render(): React.JSX.Element { const displayedColumns = ["name"]; // custom table Th-elements - const columns: JSX.Element[] = []; + const columns: React.JSX.Element[] = []; for (const colName of displayedColumns) { columns.push( @@ -50,9 +50,9 @@ export class FullblownReactableTestComponent extends React.Component { , ); } - const rows: JSX.Element[] = []; + const rows: React.JSX.Element[] = []; for (const d of data) { - const tds: JSX.Element[] = []; + const tds: React.JSX.Element[] = []; displayedColumns.forEach(col => tds.push( From f70756ed5af047c417850b3ed9d28249aef5c1bd Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 12:36:55 +0100 Subject: [PATCH 108/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67725=20[r?= =?UTF-8?q?eact-vis]=20Replace=20usage=20of=20React's=20global=20JSX=20nam?= =?UTF-8?q?espace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-vis/react-vis-tests.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-vis/react-vis-tests.tsx b/types/react-vis/react-vis-tests.tsx index a21971026acd6b..d322d922734c67 100644 --- a/types/react-vis/react-vis-tests.tsx +++ b/types/react-vis/react-vis-tests.tsx @@ -1,4 +1,4 @@ -import React, { Component, useState } from "react"; +import React, { Component, useState, JSX } from "react"; import { AreaSeries, From 4636385ad169a67a3cc28fbfa5bfbbb31d356372 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 12:37:06 +0100 Subject: [PATCH 109/519] [react-virtualized-select] Replace usage of React's global JSX namespace with scoped JSX (#67724) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-virtualized-select/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-virtualized-select/index.d.ts b/types/react-virtualized-select/index.d.ts index 4384435116ed78..8be61c133a71a1 100644 --- a/types/react-virtualized-select/index.d.ts +++ b/types/react-virtualized-select/index.d.ts @@ -25,7 +25,7 @@ export interface VirtualizedOptionRenderOptions { export interface AdditionalVirtualizedSelectProps { maxHeight?: number | undefined; optionHeight?: number | ((options: { option: TValue }) => number) | undefined; - optionRenderer?(options: VirtualizedOptionRenderOptions): JSX.Element; + optionRenderer?(options: VirtualizedOptionRenderOptions): React.JSX.Element; selectComponent?: React.ComponentClass | React.FunctionComponent | undefined; } From d99cbd673bb53b434a27cf5e402184c03e0f9776 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 12:37:35 +0100 Subject: [PATCH 110/519] [react-date-range] Replace usage of React's global JSX namespace with scoped JSX (#67646) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-date-range/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-date-range/index.d.ts b/types/react-date-range/index.d.ts index 43f1f7da7872b6..9912ffd8c8c39d 100644 --- a/types/react-date-range/index.d.ts +++ b/types/react-date-range/index.d.ts @@ -199,7 +199,7 @@ export interface CalendarProps { mode?: "set" | "setYear" | "setMonth" | "monthOffset", ) => void, props: CalendarProps, - ) => JSX.Element) + ) => React.JSX.Element) | undefined; /** default: none */ onChange?: ((date: Date) => void) | undefined; From f4d01d575810ce68fb21ec0dede935305c3f0f4b Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 12:38:55 +0100 Subject: [PATCH 111/519] [react-leaflet-fullscreen-plugin] Replace usage of React's global JSX namespace with scoped JSX (#67665) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-leaflet-fullscreen-plugin/index.d.ts | 1 + types/react-leaflet-fullscreen-plugin/package.json | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/react-leaflet-fullscreen-plugin/index.d.ts b/types/react-leaflet-fullscreen-plugin/index.d.ts index 2774d37e11dd69..51dc91cdad0b7d 100644 --- a/types/react-leaflet-fullscreen-plugin/index.d.ts +++ b/types/react-leaflet-fullscreen-plugin/index.d.ts @@ -1,3 +1,4 @@ +import { JSX } from "react"; export interface FullscreenProps { position?: "topleft" | "topright" | "bottomleft" | "bottomright" | undefined; title?: string | undefined; diff --git a/types/react-leaflet-fullscreen-plugin/package.json b/types/react-leaflet-fullscreen-plugin/package.json index 2cb2b048127169..a83409bb111ba3 100644 --- a/types/react-leaflet-fullscreen-plugin/package.json +++ b/types/react-leaflet-fullscreen-plugin/package.json @@ -5,8 +5,10 @@ "projects": [ "https://github.com/elangobharathi/react-leaflet-fullscreen-plugin" ], + "dependencies": { + "@types/react": "*" + }, "devDependencies": { - "@types/react": "*", "@types/react-leaflet-fullscreen-plugin": "workspace:." }, "owners": [ From e548c6e83773a806aa6a6018f8ef198111e09f3b Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 12:39:06 +0100 Subject: [PATCH 112/519] [react-list] Replace usage of React's global JSX namespace with scoped JSX (#67666) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-list/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-list/index.d.ts b/types/react-list/index.d.ts index 99314d5066b109..2f652367150def 100644 --- a/types/react-list/index.d.ts +++ b/types/react-list/index.d.ts @@ -1,4 +1,4 @@ -import { Component } from "react"; +import { Component, JSX } from "react"; type ItemRenderer = (index: number, key: number | string) => JSX.Element; type ItemsRenderer = (items: JSX.Element[], ref: string) => JSX.Element; From a8d677927e322f79ffd660e30a644a89cd86395b Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 12:39:19 +0100 Subject: [PATCH 113/519] [re-carousel] Replace usage of React's global JSX namespace with scoped JSX (#67628) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/re-carousel/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/re-carousel/index.d.ts b/types/re-carousel/index.d.ts index cce9da6632a02a..4fd4af12f739cf 100644 --- a/types/re-carousel/index.d.ts +++ b/types/re-carousel/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType, CSSProperties } from "react"; +import { ComponentType, CSSProperties, JSX } from "react"; interface WidgetProps { index: number; From d92681b0bdcc4b673215b88add00480fd996e18d Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 5 Dec 2023 11:40:55 +0000 Subject: [PATCH 114/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/react-vis/react-vis-tests.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-vis/react-vis-tests.tsx b/types/react-vis/react-vis-tests.tsx index d322d922734c67..a51687bce90a90 100644 --- a/types/react-vis/react-vis-tests.tsx +++ b/types/react-vis/react-vis-tests.tsx @@ -1,4 +1,4 @@ -import React, { Component, useState, JSX } from "react"; +import React, { Component, JSX, useState } from "react"; import { AreaSeries, From 9cf39bf3d9ca25a96e406be9f86876bba4e462a9 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 13:48:24 +0100 Subject: [PATCH 115/519] [solid__react] Replace usage of React's global JSX namespace with scoped JSX (#67739) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/solid__react/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/solid__react/index.d.ts b/types/solid__react/index.d.ts index 961cf4daf6f918..c12e32dc2775ee 100644 --- a/types/solid__react/index.d.ts +++ b/types/solid__react/index.d.ts @@ -36,8 +36,8 @@ export interface ListProps { // See https://github.com/Microsoft/dtslint/issues/228 // eslint-disable-next-line @definitelytyped/no-unnecessary-generics filter?: ((item: LDflexValue, index: number, array: LDflexValue[]) => item is T) | undefined; - container?: ((items: JSX.Element) => JSX.Element) | undefined; - children?: ((listItem: LDflexValue, index: number) => JSX.Element) | undefined; + container?: ((items: React.JSX.Element) => React.JSX.Element) | undefined; + children?: ((listItem: LDflexValue, index: number) => React.JSX.Element) | undefined; } export class List extends React.Component {} From 66322a9930d45a8bcf15595ef07432247a36d72e Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 13:49:11 +0100 Subject: [PATCH 116/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67681=20[r?= =?UTF-8?q?eact-native-onboarding-swiper]=20Replace=20usage=20of=20React's?= =?UTF-8?q?=20global=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1l?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-native-onboarding-swiper/index.d.ts | 2 +- .../react-native-onboarding-swiper-tests.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-native-onboarding-swiper/index.d.ts b/types/react-native-onboarding-swiper/index.d.ts index d87973ff228f20..4637232f09c383 100644 --- a/types/react-native-onboarding-swiper/index.d.ts +++ b/types/react-native-onboarding-swiper/index.d.ts @@ -1,4 +1,4 @@ -import { Component, FC } from "react"; +import { Component, FC, JSX } from "react"; import { FlatList, FlatListProps, StyleProp, TextStyle, ViewStyle } from "react-native"; export interface SkipButtonProps { diff --git a/types/react-native-onboarding-swiper/react-native-onboarding-swiper-tests.tsx b/types/react-native-onboarding-swiper/react-native-onboarding-swiper-tests.tsx index 5cf098150bce04..7b09e8d8ec11da 100644 --- a/types/react-native-onboarding-swiper/react-native-onboarding-swiper-tests.tsx +++ b/types/react-native-onboarding-swiper/react-native-onboarding-swiper-tests.tsx @@ -131,7 +131,7 @@ export default App; // mock Button component const Button: React.FC<{ children?: React.ReactNode; - title: string | JSX.Element; + title: string | React.JSX.Element; buttonStyle: StyleProp; containerViewStyle: StyleProp; textStyle: StyleProp; From 68c795db12d031b4d16b13d6827571699571b9d4 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 13:51:14 +0100 Subject: [PATCH 117/519] [react-with-styles] Replace usage of React's global JSX namespace with scoped JSX (#67728) Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-with-styles/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-with-styles/index.d.ts b/types/react-with-styles/index.d.ts index 6375ed52519975..1725679ec3ba8f 100644 --- a/types/react-with-styles/index.d.ts +++ b/types/react-with-styles/index.d.ts @@ -39,7 +39,7 @@ type SFCProps = C extends (props: infer P & { children?: React.ReactNode | un type ElementProps = C extends React.ComponentClass ? ComponentClassProps : C extends React.FC ? SFCProps : any; -type ElementConfig = JSX.LibraryManagedAttributes>; +type ElementConfig = React.JSX.LibraryManagedAttributes>; declare function withStyles( styleFn?: ((theme: T) => Styles) | null, From 3d95aa1e949b60eb11c6defc18433484764d1418 Mon Sep 17 00:00:00 2001 From: Freek Wielstra Date: Tue, 5 Dec 2023 15:44:37 +0100 Subject: [PATCH 118/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67388=20re?= =?UTF-8?q?act-native-charts-wrapper:=20Change=20Axis=20font=20weight=20fr?= =?UTF-8?q?om=20number=20to=20string=20by=20@fwielstra?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See associated PropType at https://github.com/wuxudong/react-native-charts-wrapper/blob/master/lib/AxisIface.js#L15 --- types/react-native-charts-wrapper/index.d.ts | 2 +- .../react-native-charts-wrapper-tests.tsx | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/react-native-charts-wrapper/index.d.ts b/types/react-native-charts-wrapper/index.d.ts index c80e7d5afa3f57..51324a4a741a7e 100644 --- a/types/react-native-charts-wrapper/index.d.ts +++ b/types/react-native-charts-wrapper/index.d.ts @@ -101,7 +101,7 @@ export interface Axis { textSize?: number | undefined; fontFamily?: string | undefined; fontStyle?: string | undefined; - fontWeight?: number | undefined; + fontWeight?: string | undefined; gridColor?: Color | undefined; gridLineWidth?: number | undefined; axisLineColor?: Color | undefined; diff --git a/types/react-native-charts-wrapper/react-native-charts-wrapper-tests.tsx b/types/react-native-charts-wrapper/react-native-charts-wrapper-tests.tsx index 562b8b6a597fac..b052252a3941d7 100644 --- a/types/react-native-charts-wrapper/react-native-charts-wrapper-tests.tsx +++ b/types/react-native-charts-wrapper/react-native-charts-wrapper-tests.tsx @@ -70,6 +70,9 @@ class AxisLineChartScreen extends React.Component { drawAxisLine: true, textColor: processColor("red"), textSize: 16, + fontFamily: "Arial", + fontStyle: "normal", + fontWeight: "700", gridColor: processColor("red"), gridLineWidth: 1, axisLineColor: processColor("darkgray"), From a0f42b4a36685aca3d5f4d9505e0aadcfcfc50dc Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 17:27:25 +0100 Subject: [PATCH 119/519] [react-responsive-embed] Replace usage of React's global JSX namespace with scoped JSX (#67696) --- types/react-responsive-embed/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-responsive-embed/index.d.ts b/types/react-responsive-embed/index.d.ts index f3271a9a28a659..a115b857c431be 100644 --- a/types/react-responsive-embed/index.d.ts +++ b/types/react-responsive-embed/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType } from "react"; +import { ComponentType, JSX } from "react"; type Props = { ratio?: string } & JSX.IntrinsicElements["iframe"]; declare const ResponsiveEmbed: ComponentType; From 73cb30f20a4ac33203ceac82c5821e8a8d89a1b2 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 17:27:35 +0100 Subject: [PATCH 120/519] [react-key-handler] Replace usage of React's global JSX namespace with scoped JSX (#67664) --- types/react-key-handler/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-key-handler/index.d.ts b/types/react-key-handler/index.d.ts index e040b63b845f73..e1e8a34ae18581 100644 --- a/types/react-key-handler/index.d.ts +++ b/types/react-key-handler/index.d.ts @@ -38,19 +38,19 @@ export interface ReactKeyHandlerProps extends ReactKeyHandlerIntrinsicProps { onKeyHandle: (event: React.KeyboardEvent) => void; } -export default function KeyHandler(props: ReactKeyHandlerProps): JSX.Element; +export default function KeyHandler(props: ReactKeyHandlerProps): React.JSX.Element; export function keyHandleDecorator( matcher?: Matcher, -): (props: ReactKeyHandlerProps) => (Component: JSX.Element) => (...args: any[]) => JSX.Element; +): (props: ReactKeyHandlerProps) => (Component: React.JSX.Element) => (...args: any[]) => React.JSX.Element; export function keyToggleHandler( props: ReactKeyHandlerIntrinsicProps, -): (Component: JSX.Element) => (...args: any[]) => JSX.Element; +): (Component: React.JSX.Element) => (...args: any[]) => React.JSX.Element; export function keyHandler( props: ReactKeyHandlerIntrinsicProps, -): (Component: JSX.Element) => (...args: any[]) => JSX.Element; +): (Component: React.JSX.Element) => (...args: any[]) => React.JSX.Element; export const KEYDOWN: _KEYDOWN; From d183cc3a97df71e69bf19f7bed462cbee91247e0 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 17:27:42 +0100 Subject: [PATCH 121/519] [react-wow] Replace usage of React's global JSX namespace with scoped JSX (#67729) --- types/react-wow/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-wow/index.d.ts b/types/react-wow/index.d.ts index 99f27e6fa54872..8a751916ff100f 100644 --- a/types/react-wow/index.d.ts +++ b/types/react-wow/index.d.ts @@ -111,7 +111,7 @@ export interface ReactWOWProps { /** * Content you want to apply the animation to. */ - children: JSX.Element; + children: React.JSX.Element; /** * Animation delay. From 6c4a184f92f060cef7ae9c15d39e4bdb59f6e443 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 17:28:01 +0100 Subject: [PATCH 122/519] [enzyme] Replace usage of React's global JSX namespace with scoped JSX (#67609) --- types/enzyme/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/enzyme/index.d.ts b/types/enzyme/index.d.ts index aece5f8879b1dd..7c300258f20452 100644 --- a/types/enzyme/index.d.ts +++ b/types/enzyme/index.d.ts @@ -2,6 +2,7 @@ import { AllHTMLAttributes as ReactHTMLAttributes, Component, + JSX, ReactElement, SVGAttributes as ReactSVGAttributes, } from "react"; From ccbe07aa6c3df39ca235428fe75c4db3748fb8c6 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 17:28:18 +0100 Subject: [PATCH 123/519] [styletron-react] Replace usage of React's global JSX namespace with scoped JSX (#67742) --- types/styletron-react/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/styletron-react/index.d.ts b/types/styletron-react/index.d.ts index a13cae68ab7d10..dfa6a3219a63fb 100644 --- a/types/styletron-react/index.d.ts +++ b/types/styletron-react/index.d.ts @@ -63,13 +63,13 @@ export type StyletronComponent

= React.FC

, P extends object>( + , P extends object>( component: C, style: (props: P) => StyleObject, ): StyletronComponent< Pick, Exclude, { className: string }>> & P >; - >( + >( component: C, style: StyleObject, ): StyletronComponent, Exclude, { className: string }>>>; @@ -126,7 +126,7 @@ export const Provider: typeof DevProvider | React.Provider; export function DevConsumer(props: { children: (styletronEngine: StandardEngine, debugEngine: DebugEngine, hydrating: boolean) => React.ReactNode; -}): JSX.Element; +}): React.JSX.Element; /** * @param style the StyleObject From 9fe7fdc6e8fdd5e8e87b2f700d0d4dc7dddf9327 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 17:30:05 +0100 Subject: [PATCH 124/519] [react-transition-group] Replace usage of React's global JSX namespace with scoped JSX (#67718) --- types/react-transition-group/TransitionGroup.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-transition-group/TransitionGroup.d.ts b/types/react-transition-group/TransitionGroup.d.ts index 680021b62629c6..9682e68d31c6d3 100644 --- a/types/react-transition-group/TransitionGroup.d.ts +++ b/types/react-transition-group/TransitionGroup.d.ts @@ -1,4 +1,4 @@ -import { Component, ElementType, ReactElement } from "react"; +import { Component, ElementType, ReactElement, JSX } from "react"; import { TransitionActions, TransitionProps } from "./Transition"; export interface IntrinsicTransitionGroupProps From 66c8ceef3552ac218d6dc268db10958f7453809b Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 5 Dec 2023 16:31:18 +0000 Subject: [PATCH 125/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/react-transition-group/TransitionGroup.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-transition-group/TransitionGroup.d.ts b/types/react-transition-group/TransitionGroup.d.ts index 9682e68d31c6d3..a3ab86438e59cb 100644 --- a/types/react-transition-group/TransitionGroup.d.ts +++ b/types/react-transition-group/TransitionGroup.d.ts @@ -1,4 +1,4 @@ -import { Component, ElementType, ReactElement, JSX } from "react"; +import { Component, ElementType, JSX, ReactElement } from "react"; import { TransitionActions, TransitionProps } from "./Transition"; export interface IntrinsicTransitionGroupProps From 9a967de66ebe2aa6ab4b0d7f4a64eb5763f593a3 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 18:28:33 +0100 Subject: [PATCH 126/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67711=20[r?= =?UTF-8?q?eact-stonecutter]=20Replace=20usage=20of=20React's=20global=20J?= =?UTF-8?q?SX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-stonecutter/react-stonecutter-tests.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/react-stonecutter/react-stonecutter-tests.tsx b/types/react-stonecutter/react-stonecutter-tests.tsx index 8e75b1eb937857..e88dbbc507fd26 100644 --- a/types/react-stonecutter/react-stonecutter-tests.tsx +++ b/types/react-stonecutter/react-stonecutter-tests.tsx @@ -20,7 +20,7 @@ const gridConfig: SpringGridProps = { }, }; -const gridElems: JSX.Element[] = [ +const gridElems: React.JSX.Element[] = [

A

,

B

,

C

, @@ -30,13 +30,13 @@ const gridElems: JSX.Element[] = [

G

, ]; -const StonecutterGrid: JSX.Element = ( +const StonecutterGrid: React.JSX.Element = ( {gridElems} ); -const StonecutterGridResponsive: JSX.Element = ( +const StonecutterGridResponsive: React.JSX.Element = ( {gridElems} From 2c68c9ee2fdae8c1e1a2748bcf3dc86d330fba14 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 19:53:32 +0100 Subject: [PATCH 127/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67657=20[r?= =?UTF-8?q?eact-helmet]=20Replace=20usage=20of=20React's=20global=20JSX=20?= =?UTF-8?q?namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-helmet/index.d.ts | 8 ++++---- types/react-helmet/v5/index.d.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/types/react-helmet/index.d.ts b/types/react-helmet/index.d.ts index ed0c5ac03d444f..aed62eefc8e033 100644 --- a/types/react-helmet/index.d.ts +++ b/types/react-helmet/index.d.ts @@ -4,13 +4,13 @@ interface OtherElementAttributes { [key: string]: string | number | boolean | null | undefined; } -type HtmlProps = JSX.IntrinsicElements["html"] & OtherElementAttributes; +type HtmlProps = React.JSX.IntrinsicElements["html"] & OtherElementAttributes; -type BodyProps = JSX.IntrinsicElements["body"] & OtherElementAttributes; +type BodyProps = React.JSX.IntrinsicElements["body"] & OtherElementAttributes; -type LinkProps = JSX.IntrinsicElements["link"]; +type LinkProps = React.JSX.IntrinsicElements["link"]; -type MetaProps = JSX.IntrinsicElements["meta"]; +type MetaProps = React.JSX.IntrinsicElements["meta"]; export interface HelmetTags { baseTag: any[]; diff --git a/types/react-helmet/v5/index.d.ts b/types/react-helmet/v5/index.d.ts index 6debfefaad1128..6c9f61f4426ffd 100644 --- a/types/react-helmet/v5/index.d.ts +++ b/types/react-helmet/v5/index.d.ts @@ -4,13 +4,13 @@ interface OtherElementAttributes { [key: string]: string | number | boolean | null | undefined; } -type HtmlProps = JSX.IntrinsicElements["html"] & OtherElementAttributes; +type HtmlProps = React.JSX.IntrinsicElements["html"] & OtherElementAttributes; -type BodyProps = JSX.IntrinsicElements["body"] & OtherElementAttributes; +type BodyProps = React.JSX.IntrinsicElements["body"] & OtherElementAttributes; -type LinkProps = JSX.IntrinsicElements["link"]; +type LinkProps = React.JSX.IntrinsicElements["link"]; -type MetaProps = JSX.IntrinsicElements["meta"]; +type MetaProps = React.JSX.IntrinsicElements["meta"]; export interface HelmetTags { baseTag: any[]; From 1c660e14acf3db46efdc91afd3cb1cbf0fca076e Mon Sep 17 00:00:00 2001 From: Tyler Hall <0tillathehun0@gmail.com> Date: Tue, 5 Dec 2023 14:40:50 -0500 Subject: [PATCH 128/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67766=20[g?= =?UTF-8?q?it-semver-tags]=20update=20types=20to=20reflect=20new=20Promise?= =?UTF-8?q?-based=20api=20introduced=20in=207.x=20by=20@TillaTheHun0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../git-semver-tags/git-semver-tags-tests.ts | 25 +++++++++---------- types/git-semver-tags/index.d.ts | 5 +--- types/git-semver-tags/package.json | 2 +- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/types/git-semver-tags/git-semver-tags-tests.ts b/types/git-semver-tags/git-semver-tags-tests.ts index d2e6c77ad9de43..128da839cdf403 100644 --- a/types/git-semver-tags/git-semver-tags-tests.ts +++ b/types/git-semver-tags/git-semver-tags-tests.ts @@ -1,25 +1,24 @@ import * as gitSemverTags from "git-semver-tags"; -declare const callback: gitSemverTags.Callback; declare const options: gitSemverTags.Options; -// $ExpectType void -gitSemverTags(callback); +// $ExpectType Promise +gitSemverTags(); -gitSemverTags({ tagPrefix: "skip/", skipUnstable: true }, (err, tags) => { - if (err) { - // - } -}); +// $ExpectType Promise +gitSemverTags(options); -// $ExpectType void -gitSemverTags(options, callback); +// @ts-expect-error +gitSemverTags({ ...options, foo: "bar" }); // @ts-expect-error -gitSemverTags(); +gitSemverTags({ ...options, lernaTags: "not a boolean" }); // @ts-expect-error -gitSemverTags(options); +gitSemverTags({ ...options, package: 123 }); + +// @ts-expect-error +gitSemverTags({ ...options, tagPrefix: 123 }); // @ts-expect-error -gitSemverTags(callback, options); +gitSemverTags({ ...options, skipUnstable: "not a boolean" }); diff --git a/types/git-semver-tags/index.d.ts b/types/git-semver-tags/index.d.ts index 569e4bd9c0bce5..4364a18a9698b7 100644 --- a/types/git-semver-tags/index.d.ts +++ b/types/git-semver-tags/index.d.ts @@ -1,12 +1,9 @@ /** * Get all git semver tags of your repository in reverse chronological order */ -declare function gitSemverTags(options: gitSemverTags.Options, callback: gitSemverTags.Callback): void; -declare function gitSemverTags(callback: gitSemverTags.Callback): void; +declare function gitSemverTags(options?: gitSemverTags.Options): Promise; declare namespace gitSemverTags { - type Callback = (error: any, tags: string[]) => void; - interface Options { /** * Extract lerna style tags (`foo-package@2.0.0`) from the git history, rather diff --git a/types/git-semver-tags/package.json b/types/git-semver-tags/package.json index cd50950c22b98f..7b066c26c159bf 100644 --- a/types/git-semver-tags/package.json +++ b/types/git-semver-tags/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/git-semver-tags", - "version": "4.1.9999", + "version": "7.0.9999", "projects": [ "https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/git-semver-tags#readme" ], From 60eba2809862819123985573580836aead7bbd86 Mon Sep 17 00:00:00 2001 From: Jardel Weyrich Date: Tue, 5 Dec 2023 17:05:26 -0300 Subject: [PATCH 129/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67498=20[s?= =?UTF-8?q?erverless]=20Support=20proper=20throwing=20of=20user=20errors?= =?UTF-8?q?=20in=20plugins=20by=20@jweyrich?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The example below is the recommended way according to Serverless Docs [1]: throw new serverless.classes.Error('Invalid configuration in X'); [1] https://www.serverless.com/framework/docs/guides/plugins/cli-output#errors --- types/serverless/classes/ServerlessError.d.ts | 5 +++++ types/serverless/index.d.ts | 6 ++++++ types/serverless/serverless-tests.ts | 17 +++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 types/serverless/classes/ServerlessError.d.ts diff --git a/types/serverless/classes/ServerlessError.d.ts b/types/serverless/classes/ServerlessError.d.ts new file mode 100644 index 00000000000000..80bb99f1be7ba2 --- /dev/null +++ b/types/serverless/classes/ServerlessError.d.ts @@ -0,0 +1,5 @@ +declare class ServerlessError extends Error { + constructor(message?: string); +} + +export = ServerlessError; diff --git a/types/serverless/index.d.ts b/types/serverless/index.d.ts index 76932dc8b01a4b..4cc0118e8878e1 100644 --- a/types/serverless/index.d.ts +++ b/types/serverless/index.d.ts @@ -3,6 +3,7 @@ import PluginManager = require("./classes/PluginManager"); import Utils = require("./classes/Utils"); import YamlParser = require("./classes/YamlParser"); import AwsProvider = require("./plugins/aws/provider/awsProvider"); +import ServerlessError = require("./classes/ServerlessError"); declare namespace Serverless { interface Options { @@ -58,6 +59,10 @@ declare namespace Serverless { } type Event = AwsProvider.Event | object; + + interface Classes { + Error: typeof ServerlessError; + } } declare class Serverless { @@ -86,6 +91,7 @@ declare class Serverless { yamlParser: YamlParser; pluginManager: PluginManager; + classes: Serverless.Classes; config: Serverless.Config; configurationFilename: string; serverlessDirPath: string; diff --git a/types/serverless/serverless-tests.ts b/types/serverless/serverless-tests.ts index 28733c40adf6e9..dc16bc7920684f 100644 --- a/types/serverless/serverless-tests.ts +++ b/types/serverless/serverless-tests.ts @@ -61,12 +61,29 @@ class BadPlugin implements Plugin { constructor(badArg: number) {} } +// Test a plugin that throws an user error exception +class ThrowUserErrorPlugin implements Plugin { + hooks: Plugin.Hooks; + constructor(serverless: Serverless, options: Serverless.Options, logging: Plugin.Logging) { + this.hooks = { + "command:start": () => {}, + }; + // $ExpectType ServerlessError + const errorWithoutMessage = new serverless.classes.Error(); + // $ExpectType ServerlessError + const errorWithMessage = new serverless.classes.Error("an error message"); + throw new serverless.classes.Error("Invalid configuration in X"); + } +} + const manager = new PluginManager(serverless); manager.addPlugin(CustomPlugin); // Test adding a plugin with an incorrect constructor // prettier-ignore // @ts-expect-error manager.addPlugin(BadPlugin); +// Test adding a plugin that throws an user error exception +manager.addPlugin(ThrowUserErrorPlugin); // Test a plugin with bad arguments for a variable resolver class BadVariablePlugin1 implements Plugin { From e7b75eb6e3abe523c9298ea8eaf260d23f69e60e Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 21:12:09 +0100 Subject: [PATCH 130/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67669=20[r?= =?UTF-8?q?eact-mdl]=20Replace=20usage=20of=20React's=20global=20JSX=20nam?= =?UTF-8?q?espace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-mdl/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/react-mdl/index.d.ts b/types/react-mdl/index.d.ts index 906933cf3b1528..a08c82140a1cf1 100644 --- a/types/react-mdl/index.d.ts +++ b/types/react-mdl/index.d.ts @@ -15,7 +15,7 @@ declare namespace __ReactMDL { ripple?: boolean | undefined; } interface CustomRenderedComponent { - component?: string | JSX.Element | Function | undefined; + component?: string | React.JSX.Element | Function | undefined; } // HTMLAttributes (minus the 'data', 'icon', 'label', 'name', 'rows', 'size', 'title', 'value' attributes) @@ -461,8 +461,8 @@ declare namespace __ReactMDL { info?: string | undefined; } interface ListItemContentProps extends MDLHTMLAttributes, React.DOMAttributes { - avatar?: string | JSX.Element | undefined; - icon?: string | JSX.Element | undefined; + avatar?: string | React.JSX.Element | undefined; + icon?: string | React.JSX.Element | undefined; subtitle?: React.ReactNode | undefined; useBodyClass?: boolean | undefined; } From 94de7160405b054773236c2e84e88f5aaa3f799e Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 21:12:19 +0100 Subject: [PATCH 131/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67654=20[r?= =?UTF-8?q?eact-google-places-suggest]=20Replace=20usage=20of=20React's=20?= =?UTF-8?q?global=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-google-places-suggest/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-google-places-suggest/index.d.ts b/types/react-google-places-suggest/index.d.ts index d71014c9224dbe..2c98c318b01785 100644 --- a/types/react-google-places-suggest/index.d.ts +++ b/types/react-google-places-suggest/index.d.ts @@ -1,5 +1,5 @@ /// -import { Component, ReactNode } from "react"; +import { Component, ReactNode, JSX } from "react"; export default ReactGooglePlacesSuggest; From 1bfa43e91e7a58cac2752ff46644b9d82f4c3579 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 5 Dec 2023 20:14:12 +0000 Subject: [PATCH 132/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/react-google-places-suggest/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-google-places-suggest/index.d.ts b/types/react-google-places-suggest/index.d.ts index 2c98c318b01785..6ad99149ee6777 100644 --- a/types/react-google-places-suggest/index.d.ts +++ b/types/react-google-places-suggest/index.d.ts @@ -1,5 +1,5 @@ /// -import { Component, ReactNode, JSX } from "react"; +import { Component, JSX, ReactNode } from "react"; export default ReactGooglePlacesSuggest; From 7ba889153f7d56024c031e6a3404a272ed3db73b Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 21:47:43 +0100 Subject: [PATCH 133/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67731=20[r?= =?UTF-8?q?eactabular-dnd]=20Replace=20usage=20of=20React's=20global=20JSX?= =?UTF-8?q?=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/reactabular-dnd/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/reactabular-dnd/index.d.ts b/types/reactabular-dnd/index.d.ts index 3a42e5bb78b83d..827dc79a9e19ad 100644 --- a/types/reactabular-dnd/index.d.ts +++ b/types/reactabular-dnd/index.d.ts @@ -1,7 +1,7 @@ -/// - import * as Table from "reactabular-table"; +import { JSX } from "react"; + export interface DndMoveEvent { sourceLabel: string; targetLabel: string; From 3b1864d200c89b0aa68cf547a96ecba66807a235 Mon Sep 17 00:00:00 2001 From: Tristan F Date: Tue, 5 Dec 2023 16:08:33 -0500 Subject: [PATCH 134/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67579=20[c?= =?UTF-8?q?amelize]=20add=20types=20by=20@LeoDog896?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/camelize/.npmignore | 5 +++++ types/camelize/camelize-tests.ts | 34 ++++++++++++++++++++++++++++++++ types/camelize/index.d.ts | 20 +++++++++++++++++++ types/camelize/package.json | 17 ++++++++++++++++ types/camelize/tsconfig.json | 19 ++++++++++++++++++ types/camelize/tslint.json | 1 + 6 files changed, 96 insertions(+) create mode 100644 types/camelize/.npmignore create mode 100644 types/camelize/camelize-tests.ts create mode 100644 types/camelize/index.d.ts create mode 100644 types/camelize/package.json create mode 100644 types/camelize/tsconfig.json create mode 100644 types/camelize/tslint.json diff --git a/types/camelize/.npmignore b/types/camelize/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/camelize/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/camelize/camelize-tests.ts b/types/camelize/camelize-tests.ts new file mode 100644 index 00000000000000..0ce57e426c3da4 --- /dev/null +++ b/types/camelize/camelize-tests.ts @@ -0,0 +1,34 @@ +import camelize = require('camelize'); + +const obj = { + 'foo-bar': 1, + 'bar-baz': { + 'baz-qux': 2, + }, + 'qux.quux': { + 'quux_quuz': { + 'quuz-corge': 3, + }, + }, + 15: 4, +}; + +const camelizedObj = camelize(obj); + +// $ExpectType number +camelizedObj.fooBar; + +// $ExpectType number +camelizedObj.barBaz.bazQux; + +// $ExpectType number +camelizedObj.quxQuux.quuxQuuz.quuzCorge; + +// $ExpectType "fooBar" +camelize('foo-bar' as const); + +// $ExpectType Date +camelize(new Date()); + +// $ExpectType RegExp +camelize(/foo/); diff --git a/types/camelize/index.d.ts b/types/camelize/index.d.ts new file mode 100644 index 00000000000000..eba70e0586e0c2 --- /dev/null +++ b/types/camelize/index.d.ts @@ -0,0 +1,20 @@ +type CamelSeparator = '-' | '_' | '.' + +/** + * Converts a string to camel case. + */ +type CamelCase = + S extends `${infer FirstWord}${CamelSeparator}${infer SecondChar}${infer Remaining}` + ? `${Lowercase}${Uppercase}${CamelCase}` + : Lowercase + +type Camelize = { + [K in keyof T as CamelCase]: T[K] extends {} ? Camelize : T[K] +} + +declare function camelize(obj: T): T extends string ? CamelCase : + T extends RegExp ? T : + T extends Date ? T : + T extends {} ? Camelize : T; + +export = camelize diff --git a/types/camelize/package.json b/types/camelize/package.json new file mode 100644 index 00000000000000..fa1beec509e627 --- /dev/null +++ b/types/camelize/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/camelize", + "version": "1.0.9999", + "projects": [ + "https://github.com/ljharb/camelize" + ], + "devDependencies": { + "@types/camelize": "workspace:." + }, + "owners": [ + { + "name": "Tristan F.", + "githubUsername": "LeoDog896" + } + ] +} diff --git a/types/camelize/tsconfig.json b/types/camelize/tsconfig.json new file mode 100644 index 00000000000000..86695ee94a7550 --- /dev/null +++ b/types/camelize/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "camelize-tests.ts" + ] +} diff --git a/types/camelize/tslint.json b/types/camelize/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/camelize/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From 901622711bfaac97c87cc5cdf88c230d229a0e1d Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 5 Dec 2023 22:09:11 +0100 Subject: [PATCH 135/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67662=20[r?= =?UTF-8?q?eact-jsonschema-form]=20Replace=20usage=20of=20React's=20global?= =?UTF-8?q?=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-jsonschema-form/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-jsonschema-form/index.d.ts b/types/react-jsonschema-form/index.d.ts index c06d352b5653ed..3f63b23364256e 100644 --- a/types/react-jsonschema-form/index.d.ts +++ b/types/react-jsonschema-form/index.d.ts @@ -95,7 +95,7 @@ declare module "react-jsonschema-form" { */ liveOmit?: boolean | undefined; /** Used to change the default `form` tag into a different HTML tag */ - tagName?: keyof JSX.IntrinsicElements | React.ComponentType | undefined; + tagName?: keyof React.JSX.IntrinsicElements | React.ComponentType | undefined; } export default class Form extends React.Component> { From abac13623a5d544b00514d0decfb99a1eddf89c2 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 5 Dec 2023 21:11:11 +0000 Subject: [PATCH 136/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/camelize/camelize-tests.ts | 22 +++++++++++----------- types/camelize/index.d.ts | 24 ++++++++++++------------ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/types/camelize/camelize-tests.ts b/types/camelize/camelize-tests.ts index 0ce57e426c3da4..e74d481309110f 100644 --- a/types/camelize/camelize-tests.ts +++ b/types/camelize/camelize-tests.ts @@ -1,16 +1,16 @@ -import camelize = require('camelize'); +import camelize = require("camelize"); const obj = { - 'foo-bar': 1, - 'bar-baz': { - 'baz-qux': 2, - }, - 'qux.quux': { - 'quux_quuz': { - 'quuz-corge': 3, + "foo-bar": 1, + "bar-baz": { + "baz-qux": 2, }, - }, - 15: 4, + "qux.quux": { + "quux_quuz": { + "quuz-corge": 3, + }, + }, + 15: 4, }; const camelizedObj = camelize(obj); @@ -25,7 +25,7 @@ camelizedObj.barBaz.bazQux; camelizedObj.quxQuux.quuxQuuz.quuzCorge; // $ExpectType "fooBar" -camelize('foo-bar' as const); +camelize("foo-bar" as const); // $ExpectType Date camelize(new Date()); diff --git a/types/camelize/index.d.ts b/types/camelize/index.d.ts index eba70e0586e0c2..81690f28ef780a 100644 --- a/types/camelize/index.d.ts +++ b/types/camelize/index.d.ts @@ -1,20 +1,20 @@ -type CamelSeparator = '-' | '_' | '.' +type CamelSeparator = "-" | "_" | "."; /** * Converts a string to camel case. */ -type CamelCase = - S extends `${infer FirstWord}${CamelSeparator}${infer SecondChar}${infer Remaining}` - ? `${Lowercase}${Uppercase}${CamelCase}` - : Lowercase +type CamelCase = S extends `${infer FirstWord}${CamelSeparator}${infer SecondChar}${infer Remaining}` + ? `${Lowercase}${Uppercase}${CamelCase}` + : Lowercase; type Camelize = { - [K in keyof T as CamelCase]: T[K] extends {} ? Camelize : T[K] -} + [K in keyof T as CamelCase]: T[K] extends {} ? Camelize : T[K]; +}; -declare function camelize(obj: T): T extends string ? CamelCase : - T extends RegExp ? T : - T extends Date ? T : - T extends {} ? Camelize : T; +declare function camelize(obj: T): T extends string ? CamelCase + : T extends RegExp ? T + : T extends Date ? T + : T extends {} ? Camelize + : T; -export = camelize +export = camelize; From 92e9a81583e00a0215dbd40d1b5f85877ddf3f9e Mon Sep 17 00:00:00 2001 From: Ken Egbuna Date: Tue, 5 Dec 2023 13:34:38 -0800 Subject: [PATCH 137/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67589=20sv?= =?UTF-8?q?elte-leafletjs=20-=20Add=20exported=20DivIcon=20class=20definit?= =?UTF-8?q?ion=20by=20@kegbuna?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add DivIcon class definition * Apply formatting --- types/svelte-leafletjs/index.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/types/svelte-leafletjs/index.d.ts b/types/svelte-leafletjs/index.d.ts index 8b1fd96e22decb..ed3bb8ef922e5c 100644 --- a/types/svelte-leafletjs/index.d.ts +++ b/types/svelte-leafletjs/index.d.ts @@ -211,6 +211,17 @@ export class Icon extends SvelteComponentTyped< getIcon(): L.Icon; } +export class DivIcon extends SvelteComponentTyped< + { + options?: L.DivIconOptions; + getDivIcon?(): L.DivIcon; + }, + never, + never +> { + getDivIcon(): L.DivIcon; +} + export class ImageOverlay extends SvelteComponentTyped< { imageUrl: string; From 716dd3bf5c0e9ae634f2dc2a3042e0ff53c3fb00 Mon Sep 17 00:00:00 2001 From: Tomoya Kashifuku Date: Wed, 6 Dec 2023 09:34:18 +0900 Subject: [PATCH 138/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67580=20[j?= =?UTF-8?q?est]=20Change=20arguments=20of=20`todo`=20function=20not=20to?= =?UTF-8?q?=20set=20an=20invalid=20callback=20by=20@tnyo43?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update tests make `todo`s take only a name as an argument * update the type --- types/jest/index.d.ts | 2 +- types/jest/jest-tests.ts | 30 +++++------------------------- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index 48710cfa08d488..d86df60c8caa05 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -563,7 +563,7 @@ declare namespace jest { /** * Sketch out which tests to write in the future. */ - todo: It; + todo: (name: string) => void; /** * Experimental and should be avoided. */ diff --git a/types/jest/jest-tests.ts b/types/jest/jest-tests.ts index 3fdfca765a9578..a4813fd4f5842a 100644 --- a/types/jest/jest-tests.ts +++ b/types/jest/jest-tests.ts @@ -148,11 +148,7 @@ it.skip("name", () => {}, 9001); it.skip("name", async () => {}, 9001); it.skip("name", (callback: jest.DoneCallback) => {}, 9001); -it.todo("name", () => {}); -it.todo("name", async () => {}); -it.todo("name", () => {}, 9001); -it.todo("name", async () => {}, 9001); -it.todo("name", (callback: jest.DoneCallback) => {}, 9001); +it.todo("name"); it.concurrent("name", () => {}); it.concurrent("name", async () => {}); @@ -186,11 +182,7 @@ fit.skip("name", () => {}, 9001); fit.skip("name", async () => {}, 9001); fit.skip("name", (callback: jest.DoneCallback) => {}, 9001); -fit.todo("name", () => {}); -fit.todo("name", async () => {}); -fit.todo("name", () => {}, 9001); -fit.todo("name", async () => {}, 9001); -fit.todo("name", (callback: jest.DoneCallback) => {}, 9001); +fit.todo("name"); fit.concurrent("name", () => {}); fit.concurrent("name", async () => {}); @@ -224,11 +216,7 @@ xit.skip("name", () => {}, 9001); xit.skip("name", async () => {}, 9001); xit.skip("name", (callback: jest.DoneCallback) => {}, 9001); -xit.todo("name", () => {}); -xit.todo("name", async () => {}); -xit.todo("name", () => {}, 9001); -xit.todo("name", async () => {}, 9001); -xit.todo("name", (callback: jest.DoneCallback) => {}, 9001); +xit.todo("name"); xit.concurrent("name", () => {}); xit.concurrent("name", async () => {}); @@ -262,11 +250,7 @@ test.skip("name", () => {}, 9001); test.skip("name", async () => {}, 9001); test.skip("name", (callback: jest.DoneCallback) => {}, 9001); -test.todo("name", () => {}); -test.todo("name", async () => {}); -test.todo("name", () => {}, 9001); -test.todo("name", async () => {}, 9001); -test.todo("name", (callback: jest.DoneCallback) => {}, 9001); +test.todo("name"); test.concurrent("name", () => {}); test.concurrent("name", async () => {}); @@ -300,11 +284,7 @@ xtest.skip("name", () => {}, 9001); xtest.skip("name", async () => {}, 9001); xtest.skip("name", (callback: jest.DoneCallback) => {}, 9001); -xtest.todo("name", () => {}); -xtest.todo("name", async () => {}); -xtest.todo("name", () => {}, 9001); -xtest.todo("name", async () => {}, 9001); -xtest.todo("name", (callback: jest.DoneCallback) => {}, 9001); +xtest.todo("name"); xtest.concurrent("name", () => {}); xtest.concurrent("name", async () => {}); From 6bb236aba6c37904759d3a576ee8d548eb4cd21c Mon Sep 17 00:00:00 2001 From: whincwu Date: Wed, 6 Dec 2023 09:10:28 +0800 Subject: [PATCH 139/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67762=20fe?= =?UTF-8?q?at:=20add=20@types/relationship.js=20by=20@whinc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add @types/relationship.js * style(relationship.js): format files * fix: remove esModuleInterop in tsconfig.json --- package.json | 4 +- types/relationship.js/.npmignore | 5 ++ types/relationship.js/index.d.ts | 84 +++++++++++++++++++ types/relationship.js/package.json | 17 ++++ .../relationship.js/relationship.js-tests.ts | 10 +++ types/relationship.js/tsconfig.json | 19 +++++ types/relationship.js/tslint.json | 1 + 7 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 types/relationship.js/.npmignore create mode 100644 types/relationship.js/index.d.ts create mode 100644 types/relationship.js/package.json create mode 100644 types/relationship.js/relationship.js-tests.ts create mode 100644 types/relationship.js/tsconfig.json create mode 100644 types/relationship.js/tslint.json diff --git a/package.json b/package.json index e933bcd87dfd08..11596dffc39897 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,8 @@ "test-all": "node --enable-source-maps node_modules/@definitelytyped/dtslint-runner/ --path .", "clean": "node scripts/remove-empty.js", "clean-node-modules": "node scripts/clean-node-modules.js", - "test": "node --enable-source-maps node_modules/@definitelytyped/dtslint/ types", - "lint": "node --enable-source-maps node_modules/@definitelytyped/dtslint/ types", + "test": "node --enable-source-maps node_modules/@definitelytyped/dtslint/ types/relationship.js", + "lint": "node --enable-source-maps node_modules/@definitelytyped/dtslint/ types/relationship.js", "prettier": "prettier" }, "devDependencies": { diff --git a/types/relationship.js/.npmignore b/types/relationship.js/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/relationship.js/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/relationship.js/index.d.ts b/types/relationship.js/index.d.ts new file mode 100644 index 00000000000000..f638beb3db2da3 --- /dev/null +++ b/types/relationship.js/index.d.ts @@ -0,0 +1,84 @@ +// Project: relationship.js +// Definitions by: whincwu https://github.com/whinc +/*~ This is the module template file for function modules. + *~ You should rename it to index.d.ts and place it in a folder with the same name as the module. + *~ For example, if you were writing a file for "super-greeter", this + *~ file should be 'super-greeter/index.d.ts' + */ +// Note that ES6 modules cannot directly export class objects. +// This file should be imported using the CommonJS-style: +// import x = require('[~THE MODULE~]'); +// +// Alternatively, if --allowSyntheticDefaultImports or +// --esModuleInterop is turned on, this file can also be +// imported as a default import: +// import x from '[~THE MODULE~]'; +// +// Refer to the TypeScript documentation at +// https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require +// to understand common workarounds for this limitation of ES6 modules. +/*~ If this module is a UMD module that exposes a global variable 'myFuncLib' when + *~ loaded outside a module loader environment, declare that global here. + *~ Otherwise, delete this declaration. + */ +export as namespace relationship; +/*~ This declaration specifies that the function + *~ is the exported object from the file + */ +export = relationship; + +/*~ This example shows how to have multiple overloads for your function */ +interface Relationship { + (name: string | relationship.Options): string[]; + readonly dataCount: number; + readonly data: any; + setMode(sign: string, data: Record): void; +} +// declare function relationship(name: string | relationship.Options): string[]; +declare const relationship: Relationship; +/*~ If you want to expose types from your module as well, you can + *~ place them in this block. Often you will want to describe the + *~ shape of the return type of the function; that type should + *~ be declared in here, as this example shows. + *~ + *~ Note that if you decide to include this namespace, the module can be + *~ incorrectly imported as a namespace object, unless + *~ --esModuleInterop is turned on: + *~ import * as x from '[~THE MODULE~]'; // WRONG! DO NOT DO THIS! + */ +declare namespace relationship { + interface Options { + /** + * 目标对象:目标对象的称谓汉字表达,称谓间用‘的’字分隔 + */ + text?: string; + /** + * 相对对象:相对对象的称谓汉字表达,称谓间用‘的’字分隔,空表示自己 + */ + target?: string; + /** + * 本人性别:0表示女性,1表示男性 + */ + sex?: 0 | 1; + /** + * 转换类型:'default'计算称谓,'chain'计算关系链,'pair'计算关系合称 + * @default 'default' + */ + type?: "default" | "chain" | "pair"; + /** + * 称呼方式:true对方称呼我,false我称呼对方 + * @default false + */ + reverse?: boolean; + /** + * 模式选择:使用setMode方法定制不同地区模式,在此选择自定义模式 + * @default 'default' + */ + mode?: "default" | (string & {}); + /** + * 最短关系:计算两者之间的最短关系 + * @default false + */ + optimal?: boolean; + } +} diff --git a/types/relationship.js/package.json b/types/relationship.js/package.json new file mode 100644 index 00000000000000..b983869463f978 --- /dev/null +++ b/types/relationship.js/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/relationship.js", + "version": "1.2.9999", + "projects": [ + "https://passer-by.com/relationship/" + ], + "devDependencies": { + "@types/relationship.js": "workspace:." + }, + "owners": [ + { + "name": "whincwu", + "githubUsername": "whinc" + } + ] +} diff --git a/types/relationship.js/relationship.js-tests.ts b/types/relationship.js/relationship.js-tests.ts new file mode 100644 index 00000000000000..2b2bc3f5438a2f --- /dev/null +++ b/types/relationship.js/relationship.js-tests.ts @@ -0,0 +1,10 @@ +import relationship = require('relationship.js') + +// $ExpectType string[] +relationship("爸爸的妈妈"); +// $ExpectType string[] +relationship({ text: "爸爸", target: "我" }); +// $ExpectType number +relationship.dataCount; +// $ExpectType void +relationship.setMode("northern", { "m,f": ["姥爷"] }); diff --git a/types/relationship.js/tsconfig.json b/types/relationship.js/tsconfig.json new file mode 100644 index 00000000000000..e49c604dddbdb6 --- /dev/null +++ b/types/relationship.js/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "Node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "relationship.js-tests.ts" + ] +} \ No newline at end of file diff --git a/types/relationship.js/tslint.json b/types/relationship.js/tslint.json new file mode 100644 index 00000000000000..794cb4bf3e0782 --- /dev/null +++ b/types/relationship.js/tslint.json @@ -0,0 +1 @@ +{ "extends": "@definitelytyped/dtslint/dt.json" } From c9dc4a1a060ec1af2fc96b03a0d5301a5e278f2b Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 6 Dec 2023 01:11:45 +0000 Subject: [PATCH 140/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/relationship.js/relationship.js-tests.ts | 2 +- types/relationship.js/tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/relationship.js/relationship.js-tests.ts b/types/relationship.js/relationship.js-tests.ts index 2b2bc3f5438a2f..80d1cb9d1165dd 100644 --- a/types/relationship.js/relationship.js-tests.ts +++ b/types/relationship.js/relationship.js-tests.ts @@ -1,4 +1,4 @@ -import relationship = require('relationship.js') +import relationship = require("relationship.js"); // $ExpectType string[] relationship("爸爸的妈妈"); diff --git a/types/relationship.js/tsconfig.json b/types/relationship.js/tsconfig.json index e49c604dddbdb6..87d03a671371ae 100644 --- a/types/relationship.js/tsconfig.json +++ b/types/relationship.js/tsconfig.json @@ -16,4 +16,4 @@ "index.d.ts", "relationship.js-tests.ts" ] -} \ No newline at end of file +} From f5acedce81042841b2954179d545f47d5cbc59ee Mon Sep 17 00:00:00 2001 From: Ryota Kameoka Date: Wed, 6 Dec 2023 14:34:06 +0900 Subject: [PATCH 141/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67772=20di?= =?UTF-8?q?ff:=20Fix=20typo=20by=20@ryota-ka?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/diff/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/diff/index.d.ts b/types/diff/index.d.ts index d902ccef1aa438..d733328e812838 100644 --- a/types/diff/index.d.ts +++ b/types/diff/index.d.ts @@ -141,7 +141,7 @@ export interface Hunk { export interface BestPath { newPos: number; - componenets: Change[]; + components: Change[]; } export class Diff { From 8a6c4371c447eb948c7f130fbe63783f0f40c297 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:02:47 +0100 Subject: [PATCH 142/519] [react-native-typing-animation] Replace usage of React's global JSX namespace with scoped JSX (#67686) --- types/react-native-typing-animation/index.d.ts | 2 ++ types/react-native-typing-animation/package.json | 1 + 2 files changed, 3 insertions(+) diff --git a/types/react-native-typing-animation/index.d.ts b/types/react-native-typing-animation/index.d.ts index c44cfcc19c7f9f..d66cb4bad07df1 100644 --- a/types/react-native-typing-animation/index.d.ts +++ b/types/react-native-typing-animation/index.d.ts @@ -1,5 +1,7 @@ import { StyleSheetProperties } from "react-native"; +import { JSX } from "react"; + export interface TypingAnimationProps { style?: StyleSheetProperties; dotColor?: string; diff --git a/types/react-native-typing-animation/package.json b/types/react-native-typing-animation/package.json index 29516f5ee8ab0c..5c09de9506565d 100644 --- a/types/react-native-typing-animation/package.json +++ b/types/react-native-typing-animation/package.json @@ -6,6 +6,7 @@ "https://github.com/watadarkstar/react-native-typing-animation#readme" ], "dependencies": { + "@types/react": "*", "@types/react-native": "*" }, "devDependencies": { From 33b72b7252834c294942caf24b1dba74b4c5073c Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:03:40 +0100 Subject: [PATCH 143/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67616=20[j?= =?UTF-8?q?asmine-enzyme]=20Replace=20usage=20of=20React's=20global=20JSX?= =?UTF-8?q?=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/jasmine-enzyme/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/jasmine-enzyme/index.d.ts b/types/jasmine-enzyme/index.d.ts index 48a6b29decd718..d46f84988019b6 100644 --- a/types/jasmine-enzyme/index.d.ts +++ b/types/jasmine-enzyme/index.d.ts @@ -13,7 +13,7 @@ declare global { toContainMatchingElement(selector: string): void; toContainMatchingElements(num: number, selector: string): void; toContainExactlyOneMatchingElement(selector: string): void; - toContainReact(reactInstance: JSX.Element): void; + toContainReact(reactInstance: React.JSX.Element): void; toExist(): void; toHaveClassName(className: string): void; toHaveDisplayName(tagName: string): void; @@ -26,7 +26,7 @@ declare global { toHaveText(text?: string): void; toIncludeText(text: string): void; toHaveValue(value: any): void; - toMatchElement(reactInstance: JSX.Element): void; + toMatchElement(reactInstance: React.JSX.Element): void; toMatchSelector(selector: string): void; } } From 40b1dde76ee2afcf74791c41d84a8c884282794c Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:03:57 +0100 Subject: [PATCH 144/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67603=20[a?= =?UTF-8?q?mericanexpress=5F=5Freact-seo]=20Replace=20usage=20of=20React's?= =?UTF-8?q?=20global=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1l?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/americanexpress__react-seo/index.d.ts | 1 + types/americanexpress__react-seo/package.json | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/americanexpress__react-seo/index.d.ts b/types/americanexpress__react-seo/index.d.ts index ed173cc6dd24fc..d4a37b43b2cef6 100644 --- a/types/americanexpress__react-seo/index.d.ts +++ b/types/americanexpress__react-seo/index.d.ts @@ -1,3 +1,4 @@ +import { JSX } from "react"; export interface Media { src: string; secureUrl?: string; diff --git a/types/americanexpress__react-seo/package.json b/types/americanexpress__react-seo/package.json index 40e8bb68c85c64..557a4cb240fa0e 100644 --- a/types/americanexpress__react-seo/package.json +++ b/types/americanexpress__react-seo/package.json @@ -5,10 +5,12 @@ "projects": [ "https://github.com/americanexpress/react-seo" ], - "devDependencies": { - "@types/americanexpress__react-seo": "workspace:.", + "dependencies": { "@types/react": "*" }, + "devDependencies": { + "@types/americanexpress__react-seo": "workspace:." + }, "owners": [ { "name": "Zenoo", From ce930edaf214aa7418aa86ba188a8788495b7193 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:04:10 +0100 Subject: [PATCH 145/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67736=20[r?= =?UTF-8?q?r-notifications]=20Replace=20usage=20of=20React's=20global=20JS?= =?UTF-8?q?X=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/rr-notifications/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/rr-notifications/index.d.ts b/types/rr-notifications/index.d.ts index b8c1aca5da0844..513fc46bd359bf 100644 --- a/types/rr-notifications/index.d.ts +++ b/types/rr-notifications/index.d.ts @@ -1,4 +1,4 @@ -/// +import { JSX } from "react"; export interface NotificationsContextType { showNotification(payload?: NotificationPayload): void; From 11af476ec541d0c48b0809afda93a658ce5d1a82 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:04:47 +0100 Subject: [PATCH 146/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67740=20[s?= =?UTF-8?q?torybook-readme]=20Replace=20usage=20of=20React's=20global=20JS?= =?UTF-8?q?X=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/storybook-readme/components/Marked.d.ts | 1 + types/storybook-readme/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/types/storybook-readme/components/Marked.d.ts b/types/storybook-readme/components/Marked.d.ts index 1727ae2861a67f..746d92787411c0 100644 --- a/types/storybook-readme/components/Marked.d.ts +++ b/types/storybook-readme/components/Marked.d.ts @@ -1 +1,2 @@ +import { JSX } from "react"; export default function Marked(props: { md: string }): JSX.Element; diff --git a/types/storybook-readme/index.d.ts b/types/storybook-readme/index.d.ts index 929663fefd222b..b1dbdd593f318d 100644 --- a/types/storybook-readme/index.d.ts +++ b/types/storybook-readme/index.d.ts @@ -1,6 +1,6 @@ import { DecoratorFunction, StoryFn } from "@storybook/addons"; import { StoryFnReactReturnType } from "@storybook/react/dist/ts3.9/client/preview/types"; -import { ReactNode } from "react"; +import { ReactNode, JSX } from "react"; // Shared Types export type RenderFunction = StoryFn; From d58ad647431017028626c9510b67ac1c9c7f6f3b Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:05:00 +0100 Subject: [PATCH 147/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67645=20[r?= =?UTF-8?q?eact-currency-format]=20Replace=20usage=20of=20React's=20global?= =?UTF-8?q?=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-currency-format/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-currency-format/index.d.ts b/types/react-currency-format/index.d.ts index 42abe1934e8b04..d7485362fd7795 100644 --- a/types/react-currency-format/index.d.ts +++ b/types/react-currency-format/index.d.ts @@ -1,4 +1,4 @@ -import { Component, ComponentType, HTMLAttributes, InputHTMLAttributes } from "react"; +import { Component, ComponentType, HTMLAttributes, InputHTMLAttributes, JSX } from "react"; declare namespace CurrencyFormat { /** From d52d5f8345341f35abdea26d6c4985d20853a4df Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:05:12 +0100 Subject: [PATCH 148/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67638=20[r?= =?UTF-8?q?eact-bootstrap-table-next]=20Replace=20usage=20of=20React's=20g?= =?UTF-8?q?lobal=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-bootstrap-table-next/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-bootstrap-table-next/index.d.ts b/types/react-bootstrap-table-next/index.d.ts index 55c38f6061fad7..804e0d52268ef2 100644 --- a/types/react-bootstrap-table-next/index.d.ts +++ b/types/react-bootstrap-table-next/index.d.ts @@ -1,6 +1,6 @@ // documentation taken from https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/table-props.html -import { Component, CSSProperties, ReactElement, SyntheticEvent } from "react"; +import { Component, CSSProperties, ReactElement, SyntheticEvent, JSX } from "react"; export const ROW_SELECT_SINGLE = "radio"; export const ROW_SELECT_MULTIPLE = "checkbox"; From 26c4e93ee3855e196caad79f003bb7b127d2e552 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:05:22 +0100 Subject: [PATCH 149/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67703=20[r?= =?UTF-8?q?eact-snapshot]=20Replace=20usage=20of=20React's=20global=20JSX?= =?UTF-8?q?=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-snapshot/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-snapshot/index.d.ts b/types/react-snapshot/index.d.ts index f88f4b25d6e2b6..1ff7a993680968 100644 --- a/types/react-snapshot/index.d.ts +++ b/types/react-snapshot/index.d.ts @@ -1,3 +1,3 @@ import * as React from "react"; -export function render(rootComponent: React.Component | JSX.Element, domElement: HTMLElement | null): void; +export function render(rootComponent: React.Component | React.JSX.Element, domElement: HTMLElement | null): void; From 152bebd4b82ae9b47461d185ab05646f4d3df98a Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:05:36 +0100 Subject: [PATCH 150/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67637=20[r?= =?UTF-8?q?eact-bootstrap-table]=20Replace=20usage=20of=20React's=20global?= =?UTF-8?q?=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-bootstrap-table/v2/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-bootstrap-table/v2/index.d.ts b/types/react-bootstrap-table/v2/index.d.ts index 67184349e4212d..4f1a1320e5e2a2 100644 --- a/types/react-bootstrap-table/v2/index.d.ts +++ b/types/react-bootstrap-table/v2/index.d.ts @@ -3,7 +3,7 @@ // documentation taken from http://allenfang.github.io/react-bootstrap-table/docs.html import { EventEmitter } from "events"; -import { ComponentClass, ReactElement } from "react"; +import { ComponentClass, ReactElement, JSX } from "react"; /** * Interface spec for sepcifying functionality to handle remotely From ae87a41a1786c280b0c2a034b06a3457161fa6a8 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:07:34 +0100 Subject: [PATCH 151/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67741=20[s?= =?UTF-8?q?tyled-components]=20Replace=20usage=20of=20React's=20global=20J?= =?UTF-8?q?SX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/styled-components/index.d.ts | 20 ++++++++++---------- types/styled-components/v3/index.d.ts | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/types/styled-components/index.d.ts b/types/styled-components/index.d.ts index e99162e997702f..e54229411b8d4c 100644 --- a/types/styled-components/index.d.ts +++ b/types/styled-components/index.d.ts @@ -28,7 +28,7 @@ export interface ThemeProps { export type ThemedStyledProps = P & ThemeProps; export type StyledProps

= ThemedStyledProps>; -export type IntrinsicElementsKeys = keyof JSX.IntrinsicElements; +export type IntrinsicElementsKeys = keyof React.JSX.IntrinsicElements; // Any prop that has a default prop becomes optional, but its type is unchanged // Undeclared default props are augmented into the resulting allowable attributes @@ -124,7 +124,7 @@ type ReactDefaultProps = C extends { defaultProps: infer D } ? D : never; export type AnyStyledComponent = StyledComponent | StyledComponent; export type StyledComponent< - C extends keyof JSX.IntrinsicElements | React.ComponentType, + C extends keyof React.JSX.IntrinsicElements | React.ComponentType, T extends object, O extends object = {}, A extends keyof any = never, @@ -158,13 +158,13 @@ export interface StyledComponentBase< O & StyledComponentInnerOtherProps, A | StyledComponentInnerAttrs >; - withComponent>( + withComponent>( component: WithC, ): StyledComponent; } export interface ThemedStyledFunctionBase< - C extends keyof JSX.IntrinsicElements | React.ComponentType, + C extends keyof React.JSX.IntrinsicElements | React.ComponentType, T extends object, O extends object = {}, A extends keyof any = never, @@ -187,7 +187,7 @@ export interface ThemedStyledFunctionBase< } export interface ThemedStyledFunction< - C extends keyof JSX.IntrinsicElements | React.ComponentType, + C extends keyof React.JSX.IntrinsicElements | React.ComponentType, T extends object, O extends object = {}, A extends keyof any = never, @@ -208,13 +208,13 @@ export interface ThemedStyledFunction< ) => ThemedStyledFunction; } -export type StyledFunction> = ThemedStyledFunction< +export type StyledFunction> = ThemedStyledFunction< C, any >; type ThemedStyledComponentFactories = { - [TTag in keyof JSX.IntrinsicElements]: ThemedStyledFunction; + [TTag in keyof React.JSX.IntrinsicElements]: ThemedStyledFunction; }; export type StyledComponentInnerComponent> = C extends StyledComponent< @@ -226,7 +226,7 @@ export type StyledComponentInnerComponent> = : C extends StyledComponent ? I : C; export type StyledComponentPropsWithRef< - C extends keyof JSX.IntrinsicElements | React.ComponentType, + C extends keyof React.JSX.IntrinsicElements | React.ComponentType, > = C extends AnyStyledComponent ? React.ComponentPropsWithRef> : React.ComponentPropsWithRef; export type StyledComponentInnerOtherProps = C extends StyledComponent< @@ -248,7 +248,7 @@ export interface ThemedBaseStyledInterface extends ThemedStyle StyledComponentInnerOtherProps, StyledComponentInnerAttrs >; - >( + >( // unfortunately using a conditional type to validate that it can receive a `theme?: Theme` // causes tests to fail in TS 3.1 component: C, @@ -316,7 +316,7 @@ export type BaseWithThemeFnInterface = extends { theme?: T | undefined } ? C : never, ) => React.ForwardRefExoticComponent< - WithOptionalTheme>, T> + WithOptionalTheme>, T> >; export type WithThemeFnInterface = BaseWithThemeFnInterface>; export const withTheme: WithThemeFnInterface; diff --git a/types/styled-components/v3/index.d.ts b/types/styled-components/v3/index.d.ts index 12ae1ed6794db5..697d56442da60f 100644 --- a/types/styled-components/v3/index.d.ts +++ b/types/styled-components/v3/index.d.ts @@ -37,9 +37,9 @@ type Attrs, T> = { export interface StyledComponentClass extends React.ComponentClass> { extend: ThemedStyledFunction; - withComponent( + withComponent( tag: K, - ): StyledComponentClass; + ): StyledComponentClass; withComponent(element: React.ComponentType): StyledComponentClass; } @@ -60,14 +60,14 @@ export interface ThemedStyledFunction { export type StyledFunction

= ThemedStyledFunction; type ThemedStyledComponentFactories = { - [TTag in keyof JSX.IntrinsicElements]: ThemedStyledFunction; + [TTag in keyof React.JSX.IntrinsicElements]: ThemedStyledFunction; }; export interface ThemedBaseStyledInterface extends ThemedStyledComponentFactories { - (tag: TTag): ThemedStyledFunction< + (tag: TTag): ThemedStyledFunction< P, T, - P & JSX.IntrinsicElements[TTag] + P & React.JSX.IntrinsicElements[TTag] >; (component: StyledComponentClass): ThemedStyledFunction;

(component: React.ComponentType

): ThemedStyledFunction< From 6d841ca97835dedf27d7901c191dac95393ba634 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:07:48 +0100 Subject: [PATCH 152/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67632=20[r?= =?UTF-8?q?eact-app]=20Replace=20usage=20of=20React's=20global=20JSX=20nam?= =?UTF-8?q?espace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-app/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-app/index.d.ts b/types/react-app/index.d.ts index 57a3d8ebe8dc5f..243cca848c28fb 100644 --- a/types/react-app/index.d.ts +++ b/types/react-app/index.d.ts @@ -27,7 +27,7 @@ export interface CreateAppObject { } // exporting the createApp function -export function createApp(createAppObject: CreateAppObject): JSX.Element; +export function createApp(createAppObject: CreateAppObject): React.JSX.Element; export class Link extends React.Component {} export class Layout extends React.Component {} From 2588185c698759aa87f9195ebf4c81472a055070 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:08:03 +0100 Subject: [PATCH 153/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67621=20[m?= =?UTF-8?q?aterial-ui]=20Replace=20usage=20of=20React's=20global=20JSX=20n?= =?UTF-8?q?amespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/material-ui/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/material-ui/index.d.ts b/types/material-ui/index.d.ts index bb327dde6b2d2e..f2abdcef069f73 100644 --- a/types/material-ui/index.d.ts +++ b/types/material-ui/index.d.ts @@ -1678,7 +1678,7 @@ declare namespace __MaterialUI { bodyStyle?: React.CSSProperties | undefined; children?: React.ReactNode; className?: string | undefined; - message: string | JSX.Element; + message: string | React.JSX.Element; onActionClick?: React.MouseEventHandler<{}> | undefined; /** @deprecated Use the open property to control the component instead */ onDismiss?(): void; // DEPRECATED From 41961193cea8d440b48078f66c8808db1d882683 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:08:15 +0100 Subject: [PATCH 154/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67617=20[l?= =?UTF-8?q?oadable=5F=5Fcomponent]=20Replace=20usage=20of=20React's=20glob?= =?UTF-8?q?al=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/loadable__component/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/loadable__component/index.d.ts b/types/loadable__component/index.d.ts index 60a74e4cfb4079..f707b1e9b0b108 100644 --- a/types/loadable__component/index.d.ts +++ b/types/loadable__component/index.d.ts @@ -19,7 +19,7 @@ export type ComponentResolver> = ( export interface OptionsWithoutResolver { cacheKey?(props: Props): any; - fallback?: JSX.Element | undefined; + fallback?: React.JSX.Element | undefined; ssr?: boolean | undefined; } @@ -41,7 +41,7 @@ export interface LoadableComponentMethods { } export interface ExtraComponentProps { - fallback?: JSX.Element | undefined; + fallback?: React.JSX.Element | undefined; } export type LoadableComponent = @@ -60,7 +60,7 @@ export type LoadableClassComponent = export type LoadableLibrary = & React.ComponentType<{ - fallback?: JSX.Element | undefined; + fallback?: React.JSX.Element | undefined; children?: ((module: Module) => React.ReactNode) | undefined; ref?: React.Ref | undefined; }> From 408357078cb044ebf58f279e4459ef068dd8c737 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:08:27 +0100 Subject: [PATCH 155/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67615=20[i?= =?UTF-8?q?put]=20Replace=20usage=20of=20React's=20global=20JSX=20namespac?= =?UTF-8?q?e=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/iput/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/iput/index.d.ts b/types/iput/index.d.ts index 5dee533a2f68f7..aa6ffe79669599 100644 --- a/types/iput/index.d.ts +++ b/types/iput/index.d.ts @@ -14,5 +14,5 @@ export default class IPut extends React.Component { handleChange(e: React.ChangeEvent, i: number): void; handleKeyDown(e: React.KeyboardEvent, i: number): void; handlePaste(e: React.ClipboardEvent, i: number): void; - render(): JSX.Element; + render(): React.JSX.Element; } From 292a621e70f3d6d4603691f739ff8b680f8662f3 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:08:40 +0100 Subject: [PATCH 156/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67608=20[e?= =?UTF-8?q?moji-mart]=20Replace=20usage=20of=20React's=20global=20JSX=20na?= =?UTF-8?q?mespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/emoji-mart/dist-es/utils/shared-props.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/emoji-mart/dist-es/utils/shared-props.d.ts b/types/emoji-mart/dist-es/utils/shared-props.d.ts index 65a086487451e1..2de5e4d9a8fb05 100644 --- a/types/emoji-mart/dist-es/utils/shared-props.d.ts +++ b/types/emoji-mart/dist-es/utils/shared-props.d.ts @@ -2,6 +2,8 @@ import React = require("react"); import { CustomEmoji, EmojiData, EmojiSkin } from "./emoji-index/nimble-emoji-index"; +import { JSX } from "react"; + export type BackgroundImageFn = (set: EmojiSet, sheetSize: EmojiSheetSize) => string; export type EmojiSet = "apple" | "google" | "twitter" | "emojione" | "messenger" | "facebook"; export type EmojiSheetSize = 16 | 20 | 32 | 64; From 210fc329ac73df916082905e3e353aac2b6317fe Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:08:53 +0100 Subject: [PATCH 157/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67605=20[b?= =?UTF-8?q?rainhubeu=5F=5Freact-carousel]=20Replace=20usage=20of=20React's?= =?UTF-8?q?=20global=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1l?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/brainhubeu__react-carousel/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/brainhubeu__react-carousel/index.d.ts b/types/brainhubeu__react-carousel/index.d.ts index 066d15713548ae..57ed8eff297670 100644 --- a/types/brainhubeu__react-carousel/index.d.ts +++ b/types/brainhubeu__react-carousel/index.d.ts @@ -24,8 +24,8 @@ export type CarouselPluginFunc = ({ refs: Record>; }) => { plugin?: (() => void) | undefined; - beforeCarouselItems?: (() => JSX.Element) | undefined; - afterCarouselItems?: (() => JSX.Element) | undefined; + beforeCarouselItems?: (() => React.JSX.Element) | undefined; + afterCarouselItems?: (() => React.JSX.Element) | undefined; carouselCustomProps?: (() => Record any>) | undefined; trackCustomProps?: (() => Record any>) | undefined; slideCustomProps?: (() => Record any>) | undefined; @@ -48,7 +48,7 @@ export interface CarouselProps { itemWidth?: number | undefined; value?: number | undefined; onChange?(value: number): void; - slides?: JSX.Element[] | undefined; + slides?: React.JSX.Element[] | undefined; offset?: number | undefined; draggable?: boolean | undefined; animationSpeed?: number | undefined; From ceeb1d16de7e26779c5340bbf738f3fe6852c53a Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:09:07 +0100 Subject: [PATCH 158/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67604=20[a?= =?UTF-8?q?ssert-equal-jsx]=20Replace=20usage=20of=20React's=20global=20JS?= =?UTF-8?q?X=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/assert-equal-jsx/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/assert-equal-jsx/index.d.ts b/types/assert-equal-jsx/index.d.ts index a73de791b2d9bb..53dc9837e30942 100644 --- a/types/assert-equal-jsx/index.d.ts +++ b/types/assert-equal-jsx/index.d.ts @@ -6,6 +6,6 @@ declare namespace assertEqualJSX { } } -declare function assertEqualJSX(actual: JSX.Element, expected: JSX.Element, opts?: assertEqualJSX.AsssertOptions): void; +declare function assertEqualJSX(actual: React.JSX.Element, expected: React.JSX.Element, opts?: assertEqualJSX.AsssertOptions): void; export = assertEqualJSX; From 59617f26c90db993ca5dc0355afa6ee1047684e8 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 6 Dec 2023 06:11:19 +0000 Subject: [PATCH 159/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/assert-equal-jsx/index.d.ts | 6 +++++- types/react-bootstrap-table-next/index.d.ts | 2 +- types/react-bootstrap-table/v2/index.d.ts | 2 +- types/storybook-readme/index.d.ts | 2 +- types/styled-components/index.d.ts | 9 +++++---- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/types/assert-equal-jsx/index.d.ts b/types/assert-equal-jsx/index.d.ts index 53dc9837e30942..0cb9988ccbfbbb 100644 --- a/types/assert-equal-jsx/index.d.ts +++ b/types/assert-equal-jsx/index.d.ts @@ -6,6 +6,10 @@ declare namespace assertEqualJSX { } } -declare function assertEqualJSX(actual: React.JSX.Element, expected: React.JSX.Element, opts?: assertEqualJSX.AsssertOptions): void; +declare function assertEqualJSX( + actual: React.JSX.Element, + expected: React.JSX.Element, + opts?: assertEqualJSX.AsssertOptions, +): void; export = assertEqualJSX; diff --git a/types/react-bootstrap-table-next/index.d.ts b/types/react-bootstrap-table-next/index.d.ts index 804e0d52268ef2..498869229185ef 100644 --- a/types/react-bootstrap-table-next/index.d.ts +++ b/types/react-bootstrap-table-next/index.d.ts @@ -1,6 +1,6 @@ // documentation taken from https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/table-props.html -import { Component, CSSProperties, ReactElement, SyntheticEvent, JSX } from "react"; +import { Component, CSSProperties, JSX, ReactElement, SyntheticEvent } from "react"; export const ROW_SELECT_SINGLE = "radio"; export const ROW_SELECT_MULTIPLE = "checkbox"; diff --git a/types/react-bootstrap-table/v2/index.d.ts b/types/react-bootstrap-table/v2/index.d.ts index 4f1a1320e5e2a2..1f296d7e60314a 100644 --- a/types/react-bootstrap-table/v2/index.d.ts +++ b/types/react-bootstrap-table/v2/index.d.ts @@ -3,7 +3,7 @@ // documentation taken from http://allenfang.github.io/react-bootstrap-table/docs.html import { EventEmitter } from "events"; -import { ComponentClass, ReactElement, JSX } from "react"; +import { ComponentClass, JSX, ReactElement } from "react"; /** * Interface spec for sepcifying functionality to handle remotely diff --git a/types/storybook-readme/index.d.ts b/types/storybook-readme/index.d.ts index b1dbdd593f318d..5c4da407bb4e3c 100644 --- a/types/storybook-readme/index.d.ts +++ b/types/storybook-readme/index.d.ts @@ -1,6 +1,6 @@ import { DecoratorFunction, StoryFn } from "@storybook/addons"; import { StoryFnReactReturnType } from "@storybook/react/dist/ts3.9/client/preview/types"; -import { ReactNode, JSX } from "react"; +import { JSX, ReactNode } from "react"; // Shared Types export type RenderFunction = StoryFn; diff --git a/types/styled-components/index.d.ts b/types/styled-components/index.d.ts index e54229411b8d4c..c169f69ff082ec 100644 --- a/types/styled-components/index.d.ts +++ b/types/styled-components/index.d.ts @@ -208,10 +208,11 @@ export interface ThemedStyledFunction< ) => ThemedStyledFunction; } -export type StyledFunction> = ThemedStyledFunction< - C, - any ->; +export type StyledFunction> = + ThemedStyledFunction< + C, + any + >; type ThemedStyledComponentFactories = { [TTag in keyof React.JSX.IntrinsicElements]: ThemedStyledFunction; From 50b5f90ce20dda9777b3a504b521692dcf39c100 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:12:03 +0100 Subject: [PATCH 160/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67683=20[r?= =?UTF-8?q?eact-native-share]=20Replace=20usage=20of=20React's=20global=20?= =?UTF-8?q?JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-native-share/Overlay.d.ts | 2 +- types/react-native-share/Sheet.d.ts | 2 +- types/react-native-share/index.d.ts | 2 +- types/react-native-share/v1/Overlay.d.ts | 2 +- types/react-native-share/v1/Sheet.d.ts | 2 +- types/react-native-share/v1/index.d.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/types/react-native-share/Overlay.d.ts b/types/react-native-share/Overlay.d.ts index 2795cb7c3998df..6cbc5b625101ed 100644 --- a/types/react-native-share/Overlay.d.ts +++ b/types/react-native-share/Overlay.d.ts @@ -1,4 +1,4 @@ -import { Component, ReactNode } from "react"; +import { Component, ReactNode, JSX } from "react"; import { Animated, StyleProp, ViewProps } from "react-native"; export interface OverlayState { fadeAnim: Animated.Value; diff --git a/types/react-native-share/Sheet.d.ts b/types/react-native-share/Sheet.d.ts index 63374b7d4dee9c..c2e3f1a0f9ea68 100644 --- a/types/react-native-share/Sheet.d.ts +++ b/types/react-native-share/Sheet.d.ts @@ -1,4 +1,4 @@ -import { Component, ReactNode } from "react"; +import { Component, ReactNode, JSX } from "react"; import { Animated, ViewProps } from "react-native"; export interface SheetProps { diff --git a/types/react-native-share/index.d.ts b/types/react-native-share/index.d.ts index a477d45ab530b3..4cc93769553794 100644 --- a/types/react-native-share/index.d.ts +++ b/types/react-native-share/index.d.ts @@ -1,4 +1,4 @@ -import { Component, ReactNode } from "react"; +import { Component, ReactNode, JSX } from "react"; import { StyleProp, ViewProps } from "react-native"; import Button from "./Button.d"; import Overlay from "./Overlay.d"; diff --git a/types/react-native-share/v1/Overlay.d.ts b/types/react-native-share/v1/Overlay.d.ts index 2795cb7c3998df..6cbc5b625101ed 100644 --- a/types/react-native-share/v1/Overlay.d.ts +++ b/types/react-native-share/v1/Overlay.d.ts @@ -1,4 +1,4 @@ -import { Component, ReactNode } from "react"; +import { Component, ReactNode, JSX } from "react"; import { Animated, StyleProp, ViewProps } from "react-native"; export interface OverlayState { fadeAnim: Animated.Value; diff --git a/types/react-native-share/v1/Sheet.d.ts b/types/react-native-share/v1/Sheet.d.ts index 63374b7d4dee9c..c2e3f1a0f9ea68 100644 --- a/types/react-native-share/v1/Sheet.d.ts +++ b/types/react-native-share/v1/Sheet.d.ts @@ -1,4 +1,4 @@ -import { Component, ReactNode } from "react"; +import { Component, ReactNode, JSX } from "react"; import { Animated, ViewProps } from "react-native"; export interface SheetProps { diff --git a/types/react-native-share/v1/index.d.ts b/types/react-native-share/v1/index.d.ts index 4f7b96be62f68f..e0d2ac5db834b8 100644 --- a/types/react-native-share/v1/index.d.ts +++ b/types/react-native-share/v1/index.d.ts @@ -1,4 +1,4 @@ -import { Component, ReactNode } from "react"; +import { Component, ReactNode, JSX } from "react"; import { StyleProp, ViewProps } from "react-native"; declare namespace Share { function open(options: Options | MultipleOptions): Promise; From 64752b11f7150c380974b18b788b88a32f4ec7b9 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:12:14 +0100 Subject: [PATCH 161/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67690=20[r?= =?UTF-8?q?eact-otp-input]=20Replace=20usage=20of=20React's=20global=20JSX?= =?UTF-8?q?=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-otp-input/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-otp-input/index.d.ts b/types/react-otp-input/index.d.ts index 3d3df63670c100..1662570db52f53 100644 --- a/types/react-otp-input/index.d.ts +++ b/types/react-otp-input/index.d.ts @@ -4,7 +4,7 @@ export interface OTPInputProps { value: number | string; onChange: any; numInputs: number; - separator?: JSX.Element | undefined; + separator?: React.JSX.Element | undefined; isDisabled?: boolean | undefined; shouldAutoFocus?: boolean | undefined; hasErrored?: boolean | undefined; From 499869633388ed24bb6820806a68b2e7ceb1dee6 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:12:25 +0100 Subject: [PATCH 162/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67691=20[r?= =?UTF-8?q?eact-paginate]=20Replace=20usage=20of=20React's=20global=20JSX?= =?UTF-8?q?=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-paginate/v4/index.d.ts | 8 ++++---- types/react-paginate/v5/index.d.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/types/react-paginate/v4/index.d.ts b/types/react-paginate/v4/index.d.ts index 1e78dd9fead492..6f47edbec342f3 100644 --- a/types/react-paginate/v4/index.d.ts +++ b/types/react-paginate/v4/index.d.ts @@ -19,22 +19,22 @@ interface ReactPaginateProps { /** * Label for the `previous` button. */ - previousLabel?: string | JSX.Element | undefined; + previousLabel?: string | React.JSX.Element | undefined; /** * Label for the `next` button. */ - nextLabel?: string | JSX.Element | undefined; + nextLabel?: string | React.JSX.Element | undefined; /** * Label for ellipsis. */ - breakLabel?: string | JSX.Element | undefined; + breakLabel?: string | React.JSX.Element | undefined; /** * The classname on tag `li` of the ellipsis element. */ - breakClassName?: string | JSX.Element | undefined; + breakClassName?: string | React.JSX.Element | undefined; /** * The method to call when a page is clicked. Exposes the current page object as an argument. diff --git a/types/react-paginate/v5/index.d.ts b/types/react-paginate/v5/index.d.ts index 263868abfa21ba..ccf99e09270bd9 100644 --- a/types/react-paginate/v5/index.d.ts +++ b/types/react-paginate/v5/index.d.ts @@ -19,22 +19,22 @@ export interface ReactPaginateProps { /** * Label for the `previous` button. */ - previousLabel?: string | JSX.Element | undefined; + previousLabel?: string | React.JSX.Element | undefined; /** * Label for the `next` button. */ - nextLabel?: string | JSX.Element | undefined; + nextLabel?: string | React.JSX.Element | undefined; /** * Label for ellipsis. */ - breakLabel?: string | JSX.Element | undefined; + breakLabel?: string | React.JSX.Element | undefined; /** * The classname on tag `li` of the ellipsis element. */ - breakClassName?: string | JSX.Element | undefined; + breakClassName?: string | React.JSX.Element | undefined; /** * The method to call when a page is clicked. Exposes the current page object as an argument. From e570a545020dc718d9ca4188663aa8159299dacc Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:12:36 +0100 Subject: [PATCH 163/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67697=20[r?= =?UTF-8?q?eact-router-config]=20Replace=20usage=20of=20React's=20global?= =?UTF-8?q?=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-router-config/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-router-config/index.d.ts b/types/react-router-config/index.d.ts index 4c04647a1e558a..0cd245af5d3850 100644 --- a/types/react-router-config/index.d.ts +++ b/types/react-router-config/index.d.ts @@ -37,4 +37,4 @@ export function renderRoutes( routes: RouteConfig[] | undefined, extraProps?: any, switchProps?: SwitchProps, -): JSX.Element; +): React.JSX.Element; From a71319a92b16ce4a5185c002fc66969f1012ad29 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:12:39 +0100 Subject: [PATCH 164/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67694=20[r?= =?UTF-8?q?eact-redux-toastr]=20Replace=20usage=20of=20React's=20global=20?= =?UTF-8?q?JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-redux-toastr/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-redux-toastr/index.d.ts b/types/react-redux-toastr/index.d.ts index 98c50836ec57d9..3f4adc46f2a591 100644 --- a/types/react-redux-toastr/index.d.ts +++ b/types/react-redux-toastr/index.d.ts @@ -1,4 +1,4 @@ -import { Component } from "react"; +import { Component, JSX } from "react"; import { Action, Reducer } from "redux"; export type iconType = "success" | "info" | "warning" | "error"; From eaf6bceb5e6c5a56f389d92a0ba03ddc250cf87e Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:12:54 +0100 Subject: [PATCH 165/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67720=20[r?= =?UTF-8?q?eact-typing-effect]=20Replace=20usage=20of=20React's=20global?= =?UTF-8?q?=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-typing-effect/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-typing-effect/index.d.ts b/types/react-typing-effect/index.d.ts index 6a82f26ab64fc1..cfbe7840c3896b 100644 --- a/types/react-typing-effect/index.d.ts +++ b/types/react-typing-effect/index.d.ts @@ -1,4 +1,4 @@ -import { Component } from "react"; +import { Component, JSX } from "react"; export interface ReactTypingEffectProps { text: string | string[]; From 10d5806c4ab4c6c0ec578b3dfbc0c9a067b01bdb Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:13:07 +0100 Subject: [PATCH 166/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67715=20[r?= =?UTF-8?q?eact-textfit]=20Replace=20usage=20of=20React's=20global=20JSX?= =?UTF-8?q?=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-textfit/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-textfit/index.d.ts b/types/react-textfit/index.d.ts index 77d6ab665b9dc7..6fc7ca9e59daf5 100644 --- a/types/react-textfit/index.d.ts +++ b/types/react-textfit/index.d.ts @@ -9,4 +9,4 @@ export interface TextfitProps extends React.HTMLAttributes { onReady?: (fontSize: number) => void; } -export function Textfit(props: TextfitProps): JSX.Element; +export function Textfit(props: TextfitProps): React.JSX.Element; From 806e1298e998bd627b74cf02ecb4ceb6b3965160 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:13:23 +0100 Subject: [PATCH 167/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67721=20[r?= =?UTF-8?q?eact-user-tour]=20Replace=20usage=20of=20React's=20global=20JSX?= =?UTF-8?q?=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-user-tour/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-user-tour/index.d.ts b/types/react-user-tour/index.d.ts index 7bba6925387df2..da9dd2cf048dc6 100644 --- a/types/react-user-tour/index.d.ts +++ b/types/react-user-tour/index.d.ts @@ -2,7 +2,7 @@ declare module "react-user-tour" { // Import React - import { ComponentClass, HTMLAttributes } from "react"; + import { ComponentClass, HTMLAttributes, JSX } from "react"; interface TourStep { /** From 57bf52a55a12c985e0c39cafdbda57c58ad5add7 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:13:36 +0100 Subject: [PATCH 168/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67734=20[r?= =?UTF-8?q?eflexbox]=20Replace=20usage=20of=20React's=20global=20JSX=20nam?= =?UTF-8?q?espace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/reflexbox/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/reflexbox/index.d.ts b/types/reflexbox/index.d.ts index ebaef128522d85..83c20a6fc2564f 100644 --- a/types/reflexbox/index.d.ts +++ b/types/reflexbox/index.d.ts @@ -14,8 +14,8 @@ export interface BoxProps } export type BoxType = StyledComponent< - JSX.IntrinsicElements["div"], - Omit> + React.JSX.IntrinsicElements["div"], + Omit> >; export const Box: BoxType; From edc17cfbb630f735e8cd06193087a55b3f8a9441 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:13:39 +0100 Subject: [PATCH 169/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67726=20[r?= =?UTF-8?q?eact-wait]=20Replace=20usage=20of=20React's=20global=20JSX=20na?= =?UTF-8?q?mespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-wait/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-wait/index.d.ts b/types/react-wait/index.d.ts index e72af2240cb0b4..e1d5cd71e8b702 100644 --- a/types/react-wait/index.d.ts +++ b/types/react-wait/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType, FunctionComponent, ReactNode } from "react"; +import { ComponentType, FunctionComponent, ReactNode, JSX } from "react"; export const Waiter: FunctionComponent<{ children?: ReactNode }>; From c9f6fb90d9b25e420498ebd26258d91e0b5eb937 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:14:00 +0100 Subject: [PATCH 170/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67738=20[s?= =?UTF-8?q?imple-react-lightbox]=20Replace=20usage=20of=20React's=20global?= =?UTF-8?q?=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/simple-react-lightbox/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/simple-react-lightbox/index.d.ts b/types/simple-react-lightbox/index.d.ts index 23986b58457b0e..dd8435b06d8b8e 100644 --- a/types/simple-react-lightbox/index.d.ts +++ b/types/simple-react-lightbox/index.d.ts @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import { ReactNode, JSX } from "react"; /** * The object that lightbox uses for the elements array From a50e578a21683b19188944aadc69d9c1c922b0e6 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:17:30 +0100 Subject: [PATCH 171/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67643=20[r?= =?UTF-8?q?eact-cookiebot]=20Replace=20usage=20of=20React's=20global=20JSX?= =?UTF-8?q?=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-cookiebot/index.d.ts | 1 + types/react-cookiebot/package.json | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/react-cookiebot/index.d.ts b/types/react-cookiebot/index.d.ts index e75ee7ab5301a7..389dcc5b2cdf64 100644 --- a/types/react-cookiebot/index.d.ts +++ b/types/react-cookiebot/index.d.ts @@ -1,3 +1,4 @@ +import { JSX } from "react"; /** * A simple react cookie bot component that configure * Cookiebot in your react or react-native-web application. diff --git a/types/react-cookiebot/package.json b/types/react-cookiebot/package.json index 7ddb0573a4b87a..98d1d5459b2174 100644 --- a/types/react-cookiebot/package.json +++ b/types/react-cookiebot/package.json @@ -5,8 +5,10 @@ "projects": [ "https://github.com/yeutech-lab/react-cookiebot/" ], + "dependencies": { + "@types/react": "*" + }, "devDependencies": { - "@types/react": "*", "@types/react-cookiebot": "workspace:." }, "owners": [ From c5df64d20a1e7205635ae06a0ea856b3b92f3338 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:17:48 +0100 Subject: [PATCH 172/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67647=20[r?= =?UTF-8?q?eact-detect-offline]=20Replace=20usage=20of=20React's=20global?= =?UTF-8?q?=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-detect-offline/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-detect-offline/index.d.ts b/types/react-detect-offline/index.d.ts index 3fdb1a80d351ff..433ebf863a2d9a 100644 --- a/types/react-detect-offline/index.d.ts +++ b/types/react-detect-offline/index.d.ts @@ -1,4 +1,4 @@ -/// +import { JSX } from "react"; export interface PollingConfig { url: string; From 52553a13f748969f32c7df722679cc22a087be1b Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:17:59 +0100 Subject: [PATCH 173/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67652=20[r?= =?UTF-8?q?eact-gallery-carousel]=20Replace=20usage=20of=20React's=20globa?= =?UTF-8?q?l=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-gallery-carousel/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-gallery-carousel/index.d.ts b/types/react-gallery-carousel/index.d.ts index 8c463d84ee34cb..0e88645a8e6ce2 100644 --- a/types/react-gallery-carousel/index.d.ts +++ b/types/react-gallery-carousel/index.d.ts @@ -173,5 +173,5 @@ declare namespace Carousel { * The carousel component. * @see {@link https://github.com/yifaneye/react-gallery-carousel#props} */ -declare function Carousel(props: Carousel.CarouselProps): JSX.Element; +declare function Carousel(props: Carousel.CarouselProps): React.JSX.Element; export = Carousel; From 14a274b1a5a14ec719eca11ed9f8cd84d56a2dde Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:18:03 +0100 Subject: [PATCH 174/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67658=20[r?= =?UTF-8?q?eact-helmet-with-visor]=20Replace=20usage=20of=20React's=20glob?= =?UTF-8?q?al=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-helmet-with-visor/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-helmet-with-visor/index.d.ts b/types/react-helmet-with-visor/index.d.ts index 11869edba7f693..57c1582948f108 100644 --- a/types/react-helmet-with-visor/index.d.ts +++ b/types/react-helmet-with-visor/index.d.ts @@ -4,13 +4,13 @@ interface OtherElementAttributes { [key: string]: string | number | boolean | null | undefined; } -type HtmlProps = JSX.IntrinsicElements["html"] & OtherElementAttributes; +type HtmlProps = React.JSX.IntrinsicElements["html"] & OtherElementAttributes; -type BodyProps = JSX.IntrinsicElements["body"] & OtherElementAttributes; +type BodyProps = React.JSX.IntrinsicElements["body"] & OtherElementAttributes; -type LinkProps = JSX.IntrinsicElements["link"]; +type LinkProps = React.JSX.IntrinsicElements["link"]; -type MetaProps = JSX.IntrinsicElements["meta"]; +type MetaProps = React.JSX.IntrinsicElements["meta"]; export interface HelmetTags { baseTag: any[]; From 174162f42227d361cf594b2e90c99e345ea98305 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:18:16 +0100 Subject: [PATCH 175/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67675=20[r?= =?UTF-8?q?eact-native-keep-awake]=20Replace=20usage=20of=20React's=20glob?= =?UTF-8?q?al=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-native-keep-awake/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native-keep-awake/index.d.ts b/types/react-native-keep-awake/index.d.ts index 0a03a6f83fd630..e430c6d7214f30 100644 --- a/types/react-native-keep-awake/index.d.ts +++ b/types/react-native-keep-awake/index.d.ts @@ -1,5 +1,5 @@ import * as React from "react"; -declare class KeepAwake extends React.Component<{ children?: JSX.Element | undefined }> { +declare class KeepAwake extends React.Component<{ children?: React.JSX.Element | undefined }> { static activate(): void; static deactivate(): void; } From 757e7e44f3c55db4b89a65c22a7157d871e524d9 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:18:32 +0100 Subject: [PATCH 176/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67680=20[r?= =?UTF-8?q?eact-native-modern-datepicker]=20Replace=20usage=20of=20React's?= =?UTF-8?q?=20global=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1l?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-native-modern-datepicker/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native-modern-datepicker/index.d.ts b/types/react-native-modern-datepicker/index.d.ts index a28a0fc3f4a981..a0529bbe92df20 100644 --- a/types/react-native-modern-datepicker/index.d.ts +++ b/types/react-native-modern-datepicker/index.d.ts @@ -1,4 +1,4 @@ -import { CSSProperties } from "react"; +import { CSSProperties, JSX } from "react"; export interface ModernDatepickerProps { onSelectedChange?: (dateString: string) => void; From 183af21fc5c340bf35741726ddc5090b6f1fd0c4 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:18:46 +0100 Subject: [PATCH 177/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67682=20[r?= =?UTF-8?q?eact-native-scrollable-tab-view]=20Replace=20usage=20of=20React?= =?UTF-8?q?'s=20global=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps?= =?UTF-8?q?1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-native-scrollable-tab-view/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-native-scrollable-tab-view/index.d.ts b/types/react-native-scrollable-tab-view/index.d.ts index aaafb0b87f5ae3..567bb0ffaceb22 100644 --- a/types/react-native-scrollable-tab-view/index.d.ts +++ b/types/react-native-scrollable-tab-view/index.d.ts @@ -10,7 +10,7 @@ export interface ScrollableTabViewProperties { * and should implement setAnimationValue to be able to animate itself along with the tab content. * You can manually pass the props to the TabBar component. */ - renderTabBar?: ((props: TabBarProps) => JSX.Element) | false | undefined; + renderTabBar?: ((props: TabBarProps) => React.JSX.Element) | false | undefined; /** * Defaults to "top". @@ -99,7 +99,7 @@ export interface ScrollableTabViewProperties { export type TabBarProps = T & { goToPage?: ((pageNumber: number) => void) | undefined; - tabs?: JSX.Element[] | undefined; + tabs?: React.JSX.Element[] | undefined; activeTab?: number | undefined; scrollValue?: Animated.Value | undefined; containerWidth?: number | undefined; @@ -109,7 +109,7 @@ export interface ChangeTabProperties { // currentPage i: number; // currentPage object - ref: JSX.Element; + ref: React.JSX.Element; // previousPage from: number; } @@ -140,7 +140,7 @@ export type RenderTabProperties = ( isTabActive: boolean, onPressHandler: (pageNumber: number) => void, onLayoutHandler?: (event: LayoutChangeEvent) => void, -) => JSX.Element; +) => React.JSX.Element; export class DefaultTabBar extends React.Component> { } From 078bfd1d97f6278712cadde50628cb0fa1cfb369 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:19:08 +0100 Subject: [PATCH 178/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67674=20[r?= =?UTF-8?q?eact-native-flip-card]=20Replace=20usage=20of=20React's=20globa?= =?UTF-8?q?l=20JSX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-native-flip-card/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native-flip-card/index.d.ts b/types/react-native-flip-card/index.d.ts index 787af7365c46e9..2e8ddba6c15e58 100644 --- a/types/react-native-flip-card/index.d.ts +++ b/types/react-native-flip-card/index.d.ts @@ -1,4 +1,4 @@ -import { Component, ComponentClass, ReactNode } from "react"; +import { Component, ComponentClass, ReactNode, JSX } from "react"; import { StyleProp, TextInputProps, TextProps, ViewProps, ViewStyle } from "react-native"; // FlipCard From 5da7c6a14ba49536b4c4ea3a0190df8595c4beab Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 6 Dec 2023 06:20:37 +0000 Subject: [PATCH 179/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/react-native-flip-card/index.d.ts | 2 +- types/react-native-share/Overlay.d.ts | 2 +- types/react-native-share/Sheet.d.ts | 2 +- types/react-native-share/index.d.ts | 2 +- types/react-native-share/v1/Overlay.d.ts | 2 +- types/react-native-share/v1/Sheet.d.ts | 2 +- types/react-native-share/v1/index.d.ts | 2 +- types/react-wait/index.d.ts | 2 +- types/simple-react-lightbox/index.d.ts | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/types/react-native-flip-card/index.d.ts b/types/react-native-flip-card/index.d.ts index 2e8ddba6c15e58..91bca9cbf109d3 100644 --- a/types/react-native-flip-card/index.d.ts +++ b/types/react-native-flip-card/index.d.ts @@ -1,4 +1,4 @@ -import { Component, ComponentClass, ReactNode, JSX } from "react"; +import { Component, ComponentClass, JSX, ReactNode } from "react"; import { StyleProp, TextInputProps, TextProps, ViewProps, ViewStyle } from "react-native"; // FlipCard diff --git a/types/react-native-share/Overlay.d.ts b/types/react-native-share/Overlay.d.ts index 6cbc5b625101ed..b8e5fa008e48ec 100644 --- a/types/react-native-share/Overlay.d.ts +++ b/types/react-native-share/Overlay.d.ts @@ -1,4 +1,4 @@ -import { Component, ReactNode, JSX } from "react"; +import { Component, JSX, ReactNode } from "react"; import { Animated, StyleProp, ViewProps } from "react-native"; export interface OverlayState { fadeAnim: Animated.Value; diff --git a/types/react-native-share/Sheet.d.ts b/types/react-native-share/Sheet.d.ts index c2e3f1a0f9ea68..a31e9e1ee13c77 100644 --- a/types/react-native-share/Sheet.d.ts +++ b/types/react-native-share/Sheet.d.ts @@ -1,4 +1,4 @@ -import { Component, ReactNode, JSX } from "react"; +import { Component, JSX, ReactNode } from "react"; import { Animated, ViewProps } from "react-native"; export interface SheetProps { diff --git a/types/react-native-share/index.d.ts b/types/react-native-share/index.d.ts index 4cc93769553794..2e1da1061890ad 100644 --- a/types/react-native-share/index.d.ts +++ b/types/react-native-share/index.d.ts @@ -1,4 +1,4 @@ -import { Component, ReactNode, JSX } from "react"; +import { Component, JSX, ReactNode } from "react"; import { StyleProp, ViewProps } from "react-native"; import Button from "./Button.d"; import Overlay from "./Overlay.d"; diff --git a/types/react-native-share/v1/Overlay.d.ts b/types/react-native-share/v1/Overlay.d.ts index 6cbc5b625101ed..b8e5fa008e48ec 100644 --- a/types/react-native-share/v1/Overlay.d.ts +++ b/types/react-native-share/v1/Overlay.d.ts @@ -1,4 +1,4 @@ -import { Component, ReactNode, JSX } from "react"; +import { Component, JSX, ReactNode } from "react"; import { Animated, StyleProp, ViewProps } from "react-native"; export interface OverlayState { fadeAnim: Animated.Value; diff --git a/types/react-native-share/v1/Sheet.d.ts b/types/react-native-share/v1/Sheet.d.ts index c2e3f1a0f9ea68..a31e9e1ee13c77 100644 --- a/types/react-native-share/v1/Sheet.d.ts +++ b/types/react-native-share/v1/Sheet.d.ts @@ -1,4 +1,4 @@ -import { Component, ReactNode, JSX } from "react"; +import { Component, JSX, ReactNode } from "react"; import { Animated, ViewProps } from "react-native"; export interface SheetProps { diff --git a/types/react-native-share/v1/index.d.ts b/types/react-native-share/v1/index.d.ts index e0d2ac5db834b8..3e224221964fa4 100644 --- a/types/react-native-share/v1/index.d.ts +++ b/types/react-native-share/v1/index.d.ts @@ -1,4 +1,4 @@ -import { Component, ReactNode, JSX } from "react"; +import { Component, JSX, ReactNode } from "react"; import { StyleProp, ViewProps } from "react-native"; declare namespace Share { function open(options: Options | MultipleOptions): Promise; diff --git a/types/react-wait/index.d.ts b/types/react-wait/index.d.ts index e1d5cd71e8b702..42eb678f219a1f 100644 --- a/types/react-wait/index.d.ts +++ b/types/react-wait/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType, FunctionComponent, ReactNode, JSX } from "react"; +import { ComponentType, FunctionComponent, JSX, ReactNode } from "react"; export const Waiter: FunctionComponent<{ children?: ReactNode }>; diff --git a/types/simple-react-lightbox/index.d.ts b/types/simple-react-lightbox/index.d.ts index dd8435b06d8b8e..befcce51902804 100644 --- a/types/simple-react-lightbox/index.d.ts +++ b/types/simple-react-lightbox/index.d.ts @@ -1,4 +1,4 @@ -import { ReactNode, JSX } from "react"; +import { JSX, ReactNode } from "react"; /** * The object that lightbox uses for the elements array From d4f355fd872447309d2f7141e10a63b1a620ee66 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:34:09 +0100 Subject: [PATCH 180/519] [carbon-components-react] Replace usage of React's global JSX namespace with scoped JSX (#67606) --- .../lib/components/AspectRatio/AspectRatio.d.ts | 4 ++-- .../carbon-components-react/lib/components/Button/Button.d.ts | 4 ++-- .../lib/components/DangerButton/DangerButton.d.ts | 2 +- .../carbon-components-react/lib/components/Dialog/index.d.ts | 2 ++ .../lib/components/FocusScope/index.d.ts | 4 ++-- types/carbon-components-react/lib/components/Grid/Column.d.ts | 4 ++-- types/carbon-components-react/lib/components/Grid/Grid.d.ts | 4 ++-- types/carbon-components-react/lib/components/Grid/Row.d.ts | 4 ++-- .../carbon-components-react/lib/components/Heading/index.d.ts | 4 ++-- .../lib/components/Layout/LayoutDirection.d.ts | 4 ++-- .../carbon-components-react/lib/components/Popover/index.d.ts | 4 ++-- .../lib/components/PrimaryButton/PrimaryButton.d.ts | 2 +- .../lib/components/SecondaryButton/SecondaryButton.d.ts | 2 +- types/carbon-components-react/lib/components/Text/Text.d.ts | 4 ++-- .../lib/components/UIShell/Content.d.ts | 4 ++-- types/carbon-components-react/typings/shared.d.ts | 4 ++-- 16 files changed, 29 insertions(+), 27 deletions(-) diff --git a/types/carbon-components-react/lib/components/AspectRatio/AspectRatio.d.ts b/types/carbon-components-react/lib/components/AspectRatio/AspectRatio.d.ts index a8518c693b169c..1c399716ce53cc 100644 --- a/types/carbon-components-react/lib/components/AspectRatio/AspectRatio.d.ts +++ b/types/carbon-components-react/lib/components/AspectRatio/AspectRatio.d.ts @@ -21,7 +21,7 @@ export type AspectRatioDefaultProps = as?: undefined; }; -export type AspectRatioIntrinsicProps = +export type AspectRatioIntrinsicProps = & AspectRatioBaseProps & SafeProps> & { @@ -39,7 +39,7 @@ export type AspectRatioCustomComponentProps< : never; declare function AspectRatio(props: AspectRatioDefaultProps): FCReturn; -declare function AspectRatio(props: AspectRatioIntrinsicProps): FCReturn; +declare function AspectRatio(props: AspectRatioIntrinsicProps): FCReturn; declare function AspectRatio>( props: AspectRatioCustomComponentProps, ): FCReturn; diff --git a/types/carbon-components-react/lib/components/Button/Button.d.ts b/types/carbon-components-react/lib/components/Button/Button.d.ts index 766549c3564d61..df5fd5a201c94c 100644 --- a/types/carbon-components-react/lib/components/Button/Button.d.ts +++ b/types/carbon-components-react/lib/components/Button/Button.d.ts @@ -70,7 +70,7 @@ export interface ButtonAnchorProps extends ButtonBaseProps, Omit = +export type ButtonIntrinsicProps = & ButtonBaseProps & SafeProps> & { @@ -101,7 +101,7 @@ export type ButtonCustomComponentProps< declare function Button(props: ForwardRefProps): FCReturn; // tslint:disable:unified-signatures breaks certain usages declare function Button(props: ForwardRefProps): FCReturn; -declare function Button( +declare function Button( props: ForwardRefProps & ButtonKindProps>, ): FCReturn; declare function Button, R = unknown>( diff --git a/types/carbon-components-react/lib/components/DangerButton/DangerButton.d.ts b/types/carbon-components-react/lib/components/DangerButton/DangerButton.d.ts index 8d88a10bd4ce98..d67369be51c0a8 100644 --- a/types/carbon-components-react/lib/components/DangerButton/DangerButton.d.ts +++ b/types/carbon-components-react/lib/components/DangerButton/DangerButton.d.ts @@ -5,7 +5,7 @@ import { ButtonAnchorProps, ButtonCustomComponentProps, ButtonDefaultProps, Butt declare function DangerButton(props: FCProps): FCReturn; // tslint:disable:unified-signatures breaks certain usages declare function DangerButton(props: FCProps): FCReturn; -declare function DangerButton(props: FCProps>): FCReturn; +declare function DangerButton(props: FCProps>): FCReturn; declare function DangerButton>( props: FCProps>, ): FCReturn; diff --git a/types/carbon-components-react/lib/components/Dialog/index.d.ts b/types/carbon-components-react/lib/components/Dialog/index.d.ts index 0830e247eb0671..ec784701f77472 100644 --- a/types/carbon-components-react/lib/components/Dialog/index.d.ts +++ b/types/carbon-components-react/lib/components/Dialog/index.d.ts @@ -1,6 +1,8 @@ import { FCReturn, ForwardRefProps, ReactComponentConstructor } from "../../../typings/shared"; import { FocusScopeCustomComponentProps, FocusScopeDefaultProps, FocusScopeIntrinsicProps } from "../FocusScope"; +import { JSX } from "react"; + // Props used by Dialog that are not inherited from FocusScope usage interface DialogBaseProps { "aria-labelledby": string; diff --git a/types/carbon-components-react/lib/components/FocusScope/index.d.ts b/types/carbon-components-react/lib/components/FocusScope/index.d.ts index 7e1fa2b8508d2a..ed6953113f9f56 100644 --- a/types/carbon-components-react/lib/components/FocusScope/index.d.ts +++ b/types/carbon-components-react/lib/components/FocusScope/index.d.ts @@ -27,7 +27,7 @@ export type FocusScopeDefaultProps = as?: undefined; }; -export type FocusScopeIntrinsicProps = +export type FocusScopeIntrinsicProps = & FocusScopeBaseProps & SafeProps> & { @@ -45,7 +45,7 @@ export type FocusScopeCustomComponentProps< : never; declare function FocusScope(props: ForwardRefProps): FCReturn; -declare function FocusScope( +declare function FocusScope( props: ForwardRefProps>, ): FCReturn; declare function FocusScope, R = unknown>( diff --git a/types/carbon-components-react/lib/components/Grid/Column.d.ts b/types/carbon-components-react/lib/components/Grid/Column.d.ts index 99337fa98e4207..2f061ebdd50a5b 100644 --- a/types/carbon-components-react/lib/components/Grid/Column.d.ts +++ b/types/carbon-components-react/lib/components/Grid/Column.d.ts @@ -36,7 +36,7 @@ export type ColumnDefaultProps = as?: undefined; }; -export type ColumnIntrinsicProps = +export type ColumnIntrinsicProps = & ColumnBaseProps & SafeProps> & { @@ -54,7 +54,7 @@ export type ColumnCustomComponentProps< : never; declare function Column(props: ColumnDefaultProps): FCReturn; -declare function Column(props: ColumnIntrinsicProps): FCReturn; +declare function Column(props: ColumnIntrinsicProps): FCReturn; declare function Column>(props: ColumnCustomComponentProps): FCReturn; export default Column; diff --git a/types/carbon-components-react/lib/components/Grid/Grid.d.ts b/types/carbon-components-react/lib/components/Grid/Grid.d.ts index 5ebc8379a0d1f4..01b8c9063205f7 100644 --- a/types/carbon-components-react/lib/components/Grid/Grid.d.ts +++ b/types/carbon-components-react/lib/components/Grid/Grid.d.ts @@ -28,7 +28,7 @@ export type GridDefaultProps = as?: undefined; }; -export type GridIntrinsicProps = +export type GridIntrinsicProps = & GridBaseProps & SafeProps> & { @@ -46,7 +46,7 @@ export type GridCustomComponentProps< : never; declare function Grid(props: GridDefaultProps): FCReturn; -declare function Grid(props: GridIntrinsicProps): FCReturn; +declare function Grid(props: GridIntrinsicProps): FCReturn; declare function Grid>(props: GridCustomComponentProps): FCReturn; export default Grid; diff --git a/types/carbon-components-react/lib/components/Grid/Row.d.ts b/types/carbon-components-react/lib/components/Grid/Row.d.ts index 853962e9ef8322..96738347cfbc6a 100644 --- a/types/carbon-components-react/lib/components/Grid/Row.d.ts +++ b/types/carbon-components-react/lib/components/Grid/Row.d.ts @@ -25,7 +25,7 @@ export type RowDefaultProps = as?: undefined; }; -export type RowIntrinsicProps = +export type RowIntrinsicProps = & RowBaseProps & SafeProps> & { @@ -43,7 +43,7 @@ export type RowCustomComponentProps> : never; declare function Row(props: RowDefaultProps): FCReturn; -declare function Row(props: RowIntrinsicProps): FCReturn; +declare function Row(props: RowIntrinsicProps): FCReturn; declare function Row>(props: RowCustomComponentProps): FCReturn; export default Row; diff --git a/types/carbon-components-react/lib/components/Heading/index.d.ts b/types/carbon-components-react/lib/components/Heading/index.d.ts index ba9bf586c3418e..d35886c0975c67 100644 --- a/types/carbon-components-react/lib/components/Heading/index.d.ts +++ b/types/carbon-components-react/lib/components/Heading/index.d.ts @@ -13,7 +13,7 @@ export type SectionDefaultProps = ReactAttr & { as?: undefined; }; -export type SectionIntrinsicProps = SafeProps> & { +export type SectionIntrinsicProps = SafeProps> & { as: K; }; @@ -25,7 +25,7 @@ export type SectionCustomComponentProps< : never; declare function Section(props: SectionDefaultProps): FCReturn; -declare function Section(props: SectionIntrinsicProps): FCReturn; +declare function Section(props: SectionIntrinsicProps): FCReturn; declare function Section>(props: SectionCustomComponentProps): FCReturn; export interface HeadingProps extends ReactAttr {} diff --git a/types/carbon-components-react/lib/components/Layout/LayoutDirection.d.ts b/types/carbon-components-react/lib/components/Layout/LayoutDirection.d.ts index dbb97c7dcc2fb5..6ec860769b070d 100644 --- a/types/carbon-components-react/lib/components/Layout/LayoutDirection.d.ts +++ b/types/carbon-components-react/lib/components/Layout/LayoutDirection.d.ts @@ -19,7 +19,7 @@ export type LayoutDirectionDefaultProps = as?: undefined; }; -export type LayoutDirectionIntrinsicProps = +export type LayoutDirectionIntrinsicProps = & LayoutDirectionBaseProps & JSXIntrinsicElementProps & { @@ -37,7 +37,7 @@ export type LayoutDirectionCustomComponentProps< : never; declare function LayoutDirection(props: LayoutDirectionDefaultProps): FCReturn; -declare function LayoutDirection( +declare function LayoutDirection( props: LayoutDirectionIntrinsicProps, ): FCReturn; declare function LayoutDirection>( diff --git a/types/carbon-components-react/lib/components/Popover/index.d.ts b/types/carbon-components-react/lib/components/Popover/index.d.ts index e36646fb4efd6c..a141c42ace7187 100644 --- a/types/carbon-components-react/lib/components/Popover/index.d.ts +++ b/types/carbon-components-react/lib/components/Popover/index.d.ts @@ -47,7 +47,7 @@ export type PopoverDefaultProps = as?: undefined; }; -export type PopoverIntrinsicProps = +export type PopoverIntrinsicProps = & PopoverBaseProps & SafePopoverProps> & { @@ -65,7 +65,7 @@ export type PopoverCustomComponentProps< : never; declare function Popover(props: ForwardRefProps): FCReturn; -declare function Popover( +declare function Popover( props: ForwardRefProps>, ): FCReturn; declare function Popover, R = unknown>( diff --git a/types/carbon-components-react/lib/components/PrimaryButton/PrimaryButton.d.ts b/types/carbon-components-react/lib/components/PrimaryButton/PrimaryButton.d.ts index a6e1ff749ae091..7b048d13df7cce 100644 --- a/types/carbon-components-react/lib/components/PrimaryButton/PrimaryButton.d.ts +++ b/types/carbon-components-react/lib/components/PrimaryButton/PrimaryButton.d.ts @@ -5,7 +5,7 @@ import { ButtonAnchorProps, ButtonCustomComponentProps, ButtonDefaultProps, Butt declare function PrimaryButton(props: FCProps): FCReturn; // tslint:disable:unified-signatures breaks certain usages declare function PrimaryButton(props: FCProps): FCReturn; -declare function PrimaryButton( +declare function PrimaryButton( props: FCProps>, ): FCReturn; declare function PrimaryButton>( diff --git a/types/carbon-components-react/lib/components/SecondaryButton/SecondaryButton.d.ts b/types/carbon-components-react/lib/components/SecondaryButton/SecondaryButton.d.ts index 91e6a21def9704..a5029531113670 100644 --- a/types/carbon-components-react/lib/components/SecondaryButton/SecondaryButton.d.ts +++ b/types/carbon-components-react/lib/components/SecondaryButton/SecondaryButton.d.ts @@ -5,7 +5,7 @@ import { ButtonAnchorProps, ButtonCustomComponentProps, ButtonDefaultProps, Butt declare function SecondaryButton(props: FCProps): FCReturn; // tslint:disable:unified-signatures breaks certain usages declare function SecondaryButton(props: FCProps): FCReturn; -declare function SecondaryButton( +declare function SecondaryButton( props: FCProps>, ): FCReturn; declare function SecondaryButton>( diff --git a/types/carbon-components-react/lib/components/Text/Text.d.ts b/types/carbon-components-react/lib/components/Text/Text.d.ts index 30982ed58e7d72..f9186ca0ee00b5 100644 --- a/types/carbon-components-react/lib/components/Text/Text.d.ts +++ b/types/carbon-components-react/lib/components/Text/Text.d.ts @@ -20,7 +20,7 @@ export type TextDefaultProps = as?: undefined; }; -export type TextIntrinsicProps = +export type TextIntrinsicProps = & TextBaseProps & JSXIntrinsicElementProps & { @@ -38,7 +38,7 @@ export type TextCustomComponentProps< : never; declare function Text(props: TextDefaultProps): FCReturn; -declare function Text(props: TextIntrinsicProps): FCReturn; +declare function Text(props: TextIntrinsicProps): FCReturn; declare function Text>(props: TextCustomComponentProps): FCReturn; export { Text }; diff --git a/types/carbon-components-react/lib/components/UIShell/Content.d.ts b/types/carbon-components-react/lib/components/UIShell/Content.d.ts index 873f14925b7f16..fa6223f13bab23 100644 --- a/types/carbon-components-react/lib/components/UIShell/Content.d.ts +++ b/types/carbon-components-react/lib/components/UIShell/Content.d.ts @@ -13,7 +13,7 @@ export type ContentDefaultProps = tagName?: undefined; }; -export type ContentIntrinsicProps = +export type ContentIntrinsicProps = & ContentBaseProps & JSXIntrinsicElementProps & { @@ -21,6 +21,6 @@ export type ContentIntrinsicProps = }; declare function Content(props: ContentDefaultProps): FCReturn; -declare function Content(props: ContentIntrinsicProps): FCReturn; +declare function Content(props: ContentIntrinsicProps): FCReturn; export default Content; diff --git a/types/carbon-components-react/typings/shared.d.ts b/types/carbon-components-react/typings/shared.d.ts index 552962bfac7c0e..3603c385f019ec 100644 --- a/types/carbon-components-react/typings/shared.d.ts +++ b/types/carbon-components-react/typings/shared.d.ts @@ -79,9 +79,9 @@ export type ForwardRefProps = React.PropsWithoutRef = React.ForwardRefExoticComponent>; export type JSXIntrinsicElementProps< - K extends keyof JSX.IntrinsicElements, + K extends keyof React.JSX.IntrinsicElements, REF extends boolean = false, -> = REF extends true ? JSX.IntrinsicElements[K] : Omit; +> = REF extends true ? React.JSX.IntrinsicElements[K] : Omit; // for "as" props export type ReactComponentConstructor

= ((props: P) => FCReturn) | (new(props: P) => React.Component); From b6f512bfef405e223e088d12addebcf146f1db1c Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 6 Dec 2023 06:35:21 +0000 Subject: [PATCH 181/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/components/AspectRatio/AspectRatio.d.ts | 4 +++- .../lib/components/DangerButton/DangerButton.d.ts | 4 +++- .../lib/components/Heading/index.d.ts | 8 +++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/types/carbon-components-react/lib/components/AspectRatio/AspectRatio.d.ts b/types/carbon-components-react/lib/components/AspectRatio/AspectRatio.d.ts index 1c399716ce53cc..98ae359e5714ad 100644 --- a/types/carbon-components-react/lib/components/AspectRatio/AspectRatio.d.ts +++ b/types/carbon-components-react/lib/components/AspectRatio/AspectRatio.d.ts @@ -39,7 +39,9 @@ export type AspectRatioCustomComponentProps< : never; declare function AspectRatio(props: AspectRatioDefaultProps): FCReturn; -declare function AspectRatio(props: AspectRatioIntrinsicProps): FCReturn; +declare function AspectRatio( + props: AspectRatioIntrinsicProps, +): FCReturn; declare function AspectRatio>( props: AspectRatioCustomComponentProps, ): FCReturn; diff --git a/types/carbon-components-react/lib/components/DangerButton/DangerButton.d.ts b/types/carbon-components-react/lib/components/DangerButton/DangerButton.d.ts index d67369be51c0a8..396c03f32786b5 100644 --- a/types/carbon-components-react/lib/components/DangerButton/DangerButton.d.ts +++ b/types/carbon-components-react/lib/components/DangerButton/DangerButton.d.ts @@ -5,7 +5,9 @@ import { ButtonAnchorProps, ButtonCustomComponentProps, ButtonDefaultProps, Butt declare function DangerButton(props: FCProps): FCReturn; // tslint:disable:unified-signatures breaks certain usages declare function DangerButton(props: FCProps): FCReturn; -declare function DangerButton(props: FCProps>): FCReturn; +declare function DangerButton( + props: FCProps>, +): FCReturn; declare function DangerButton>( props: FCProps>, ): FCReturn; diff --git a/types/carbon-components-react/lib/components/Heading/index.d.ts b/types/carbon-components-react/lib/components/Heading/index.d.ts index d35886c0975c67..c8009965973cd3 100644 --- a/types/carbon-components-react/lib/components/Heading/index.d.ts +++ b/types/carbon-components-react/lib/components/Heading/index.d.ts @@ -13,9 +13,11 @@ export type SectionDefaultProps = ReactAttr & { as?: undefined; }; -export type SectionIntrinsicProps = SafeProps> & { - as: K; -}; +export type SectionIntrinsicProps = + & SafeProps> + & { + as: K; + }; export type SectionCustomComponentProps< C extends ReactComponentConstructor, From dfd6d81bb3d35859ab2d8361ecef0a9280b0c2c9 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:35:55 +0100 Subject: [PATCH 182/519] [fundamental-react] Replace usage of React's global JSX namespace with scoped JSX (#67611) --- types/fundamental-react/lib/List/List.d.ts | 4 ++-- types/fundamental-react/lib/Select/Select.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/fundamental-react/lib/List/List.d.ts b/types/fundamental-react/lib/List/List.d.ts index 90e1e4acdfee60..1f7caa2ef62a82 100644 --- a/types/fundamental-react/lib/List/List.d.ts +++ b/types/fundamental-react/lib/List/List.d.ts @@ -12,8 +12,8 @@ export type ListProps = { navigation?: boolean | undefined; partialNavigation?: boolean | undefined; selectable?: boolean | undefined; - footer?: string | JSX.Element | undefined; - header?: string | JSX.Element | undefined; + footer?: string | React.JSX.Element | undefined; + header?: string | React.JSX.Element | undefined; } & React.HTMLAttributes; export interface ListFooterProps { diff --git a/types/fundamental-react/lib/Select/Select.d.ts b/types/fundamental-react/lib/Select/Select.d.ts index b7fd942ebe0f58..21659af0bda011 100644 --- a/types/fundamental-react/lib/Select/Select.d.ts +++ b/types/fundamental-react/lib/Select/Select.d.ts @@ -43,7 +43,7 @@ export interface SelectProps { ref?: React.Ref | undefined; } -declare const Select: ((props: SelectProps & { selectedKey?: T }) => JSX.Element) & { +declare const Select: ((props: SelectProps & { selectedKey?: T }) => React.JSX.Element) & { displayName: "Select"; }; From 827a1985cc7a4a46b90e0ef05f178245ace87d5f Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:36:40 +0100 Subject: [PATCH 183/519] [hig__button] Replace usage of React's global JSX namespace with scoped JSX (#67614) --- types/hig__button/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/hig__button/index.d.ts b/types/hig__button/index.d.ts index 6397ecd40c34ad..157f9a37c8a33e 100644 --- a/types/hig__button/index.d.ts +++ b/types/hig__button/index.d.ts @@ -32,7 +32,7 @@ export interface Props { /** Prevents user interaction with the button */ disabled?: boolean | undefined; /** A @hig/icon element */ - icon?: JSX.Element | undefined; + icon?: React.JSX.Element | undefined; /** Sets the link of a button */ link?: string | undefined; /** Triggers when you click the button */ From 1175864783fbc858aed72c742761c9aaec8bc3c5 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:36:49 +0100 Subject: [PATCH 184/519] [loadable__server] Replace usage of React's global JSX namespace with scoped JSX (#67618) --- types/loadable__server/index.d.ts | 2 +- types/loadable__server/loadable__server-tests.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/loadable__server/index.d.ts b/types/loadable__server/index.d.ts index 90f8dc6e6ef354..d367e1bab28d84 100644 --- a/types/loadable__server/index.d.ts +++ b/types/loadable__server/index.d.ts @@ -1,4 +1,4 @@ -import { Component, ComponentType, ReactElement } from "react"; +import { Component, ComponentType, ReactElement, JSX } from "react"; export type ChunkExtractorOptions = & { diff --git a/types/loadable__server/loadable__server-tests.tsx b/types/loadable__server/loadable__server-tests.tsx index 8011e1d1248a2b..9b520822ab69d9 100644 --- a/types/loadable__server/loadable__server-tests.tsx +++ b/types/loadable__server/loadable__server-tests.tsx @@ -26,7 +26,7 @@ const { collectChunks(

Test
); // Should return jsx - const jsx: JSX.Element = collectChunks(
Test
); + const jsx: React.JSX.Element = collectChunks(
Test
); } // Some example attributes for get functions. From 33617d00bc279f35f662f023de0692ab08ba6397 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:37:14 +0100 Subject: [PATCH 185/519] [material-ui-pagination] Replace usage of React's global JSX namespace with scoped JSX (#67622) --- types/material-ui-pagination/material-ui-pagination-tests.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/material-ui-pagination/material-ui-pagination-tests.tsx b/types/material-ui-pagination/material-ui-pagination-tests.tsx index e8212c36df4610..64a94603d61fc3 100644 --- a/types/material-ui-pagination/material-ui-pagination-tests.tsx +++ b/types/material-ui-pagination/material-ui-pagination-tests.tsx @@ -29,7 +29,7 @@ class Pager extends React.Component<{}, PagerState> { const perPage = 10; const totalPage = Math.floor(length / perPage); - const list: JSX.Element[] = []; + const list: React.JSX.Element[] = []; for (let i = pageIndex * perPage; i < (pageIndex * perPage + perPage); i++) { list.push(

{`No.${i}`}

); } From e5232fda98ef47035b234a864f5de900350b5bc5 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:37:25 +0100 Subject: [PATCH 186/519] [matomo-tracker-react-native] Replace usage of React's global JSX namespace with scoped JSX (#67623) --- types/matomo-tracker-react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/matomo-tracker-react-native/index.d.ts b/types/matomo-tracker-react-native/index.d.ts index de559a15ffefc8..4bf9dadce1342c 100644 --- a/types/matomo-tracker-react-native/index.d.ts +++ b/types/matomo-tracker-react-native/index.d.ts @@ -78,7 +78,7 @@ export interface MatomoProviderProps { children: React.ReactElement; } -export function MatomoProvider(props: MatomoProviderProps): JSX.Element; +export function MatomoProvider(props: MatomoProviderProps): React.JSX.Element; export const MatomoContext: React.Context<{}>; export interface InstanceProps { From 35746d0a359a20d9c1b5219157f4efa4e708af04 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:37:34 +0100 Subject: [PATCH 187/519] [react-adal] Replace usage of React's global JSX namespace with scoped JSX (#67630) --- types/react-adal/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-adal/index.d.ts b/types/react-adal/index.d.ts index 637c35e6836d8c..ac24143333c360 100644 --- a/types/react-adal/index.d.ts +++ b/types/react-adal/index.d.ts @@ -378,6 +378,6 @@ export function withAdalLogin( resource: string, ): ( wrappedComponent: React.ComponentClass | React.FunctionComponent, - renderLoading: () => JSX.Element | null, - renderError: (error: any) => JSX.Element | null, + renderLoading: () => React.JSX.Element | null, + renderError: (error: any) => React.JSX.Element | null, ) => React.ComponentClass; From dbdaead2464c2502e21741133590e9307df3b10a Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:37:42 +0100 Subject: [PATCH 188/519] [react-autosuggest] Replace usage of React's global JSX namespace with scoped JSX (#67634) --- .../react-autosuggest-tests.tsx | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/types/react-autosuggest/react-autosuggest-tests.tsx b/types/react-autosuggest/react-autosuggest-tests.tsx index 03beb411d73b13..a8fda048059e3e 100644 --- a/types/react-autosuggest/react-autosuggest-tests.tsx +++ b/types/react-autosuggest/react-autosuggest-tests.tsx @@ -82,7 +82,7 @@ export class ReactAutosuggestBasicTest extends React.Component { }; // endregion region Rendering methods inputRef = React.createRef(); - render(): JSX.Element { + render(): React.JSX.Element { const { value, suggestions } = this.state; const theme = { @@ -126,7 +126,7 @@ export class ReactAutosuggestBasicTest extends React.Component { alert(`Selected language is ${data.suggestion.name} (${data.suggestion.year}).`); } - protected renderSuggestion(suggestion: Language, params: Autosuggest.RenderSuggestionParams): JSX.Element { + protected renderSuggestion(suggestion: Language, params: Autosuggest.RenderSuggestionParams): React.JSX.Element { const className = params.isHighlighted ? "highlighted" : undefined; return {suggestion.name}; } @@ -228,7 +228,7 @@ export class ReactAutosuggestTypedTest extends React.Component { suggestions: this.getSuggestions(""), }; // endregion region Rendering methods - render(): JSX.Element { + render(): React.JSX.Element { const { value, suggestions } = this.state; const theme = { @@ -263,7 +263,7 @@ export class ReactAutosuggestTypedTest extends React.Component { alert(`Selected language is ${data.suggestion.name} (${data.suggestion.year}).`); } - protected renderSuggestion(suggestion: Language, params: Autosuggest.RenderSuggestionParams): JSX.Element { + protected renderSuggestion(suggestion: Language, params: Autosuggest.RenderSuggestionParams): React.JSX.Element { const className = params.isHighlighted ? "highlighted" : undefined; return {suggestion.name}; } @@ -401,7 +401,7 @@ export class ReactAutosuggestMultipleTest extends React.Component { }; } // endregion region Rendering methods - render(): JSX.Element { + render(): React.JSX.Element { const { value, suggestions } = this.state; return ( @@ -435,16 +435,16 @@ export class ReactAutosuggestMultipleTest extends React.Component { alert(`Selected language is ${language.name} (${language.year}).`); } - protected renderSuggestion(suggestion: Language, params: Autosuggest.RenderSuggestionParams): JSX.Element { + protected renderSuggestion(suggestion: Language, params: Autosuggest.RenderSuggestionParams): React.JSX.Element { const className = params.isHighlighted ? "highlighted" : undefined; return {suggestion.name}; } - protected renderSectionTitle(section: LanguageGroup): JSX.Element { + protected renderSectionTitle(section: LanguageGroup): React.JSX.Element { return {section.title}; } - protected renderInputComponent(inputProps: Autosuggest.RenderInputComponentProps): JSX.Element { + protected renderInputComponent(inputProps: Autosuggest.RenderInputComponentProps): React.JSX.Element { return (
@@ -456,7 +456,7 @@ export class ReactAutosuggestMultipleTest extends React.Component { containerProps, children, query, - }: Autosuggest.RenderSuggestionsContainerParams): JSX.Element { + }: Autosuggest.RenderSuggestionsContainerParams): React.JSX.Element { return (
{children} @@ -549,7 +549,7 @@ export class ReactAutosuggestCustomTest extends React.Component { suggestions: this.getSuggestions(""), }; // endregion region Rendering methods - render(): JSX.Element { + render(): React.JSX.Element { const { value, suggestions } = this.state; return ( @@ -567,7 +567,7 @@ export class ReactAutosuggestCustomTest extends React.Component { ); } - protected renderSuggestion(suggestion: Person, params: Autosuggest.RenderSuggestionParams): JSX.Element { + protected renderSuggestion(suggestion: Person, params: Autosuggest.RenderSuggestionParams): React.JSX.Element { const suggestionText = `${suggestion.first} ${suggestion.last}`; const query = params.query.trim(); const parts = suggestionText.split(" ").map((part: string) => { From f62e54609c4162117c613ae6edfcb2eb22df2949 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:37:53 +0100 Subject: [PATCH 189/519] [react-bootstrap-table2-toolkit] Replace usage of React's global JSX namespace with scoped JSX (#67639) --- types/react-bootstrap-table2-toolkit/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-bootstrap-table2-toolkit/index.d.ts b/types/react-bootstrap-table2-toolkit/index.d.ts index b8adcfb06ad682..677e378c5355f6 100644 --- a/types/react-bootstrap-table2-toolkit/index.d.ts +++ b/types/react-bootstrap-table2-toolkit/index.d.ts @@ -1,6 +1,6 @@ // documentation taken from https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/table-props.html -import { CSSProperties, ReactNode } from "react"; +import { CSSProperties, ReactNode, JSX } from "react"; import { ColumnDescription, SearchProps } from "react-bootstrap-table-next"; /** From a99e829532135b979f55a1edba4a36415552d6da Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:38:03 +0100 Subject: [PATCH 190/519] [react-facebook-login-component] Replace usage of React's global JSX namespace with scoped JSX (#67648) --- .../react-facebook-login-component-tests.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-facebook-login-component/react-facebook-login-component-tests.tsx b/types/react-facebook-login-component/react-facebook-login-component-tests.tsx index 165a235c0ebaba..69baff9e3541fa 100644 --- a/types/react-facebook-login-component/react-facebook-login-component-tests.tsx +++ b/types/react-facebook-login-component/react-facebook-login-component-tests.tsx @@ -5,14 +5,14 @@ const handler = (response: FacebookLoginInfo) => { console.log(response.accessToken); }; -const ReactFacebookLoginComponent: JSX.Element = ( +const ReactFacebookLoginComponent: React.JSX.Element = ( ); -const ReactFacebookLoginComponentAllOptions: JSX.Element = ( +const ReactFacebookLoginComponentAllOptions: React.JSX.Element = ( Date: Wed, 6 Dec 2023 07:38:58 +0100 Subject: [PATCH 191/519] [react-foundation] Replace usage of React's global JSX namespace with scoped JSX (#67651) --- types/react-foundation/components/menu.d.ts | 2 +- types/react-foundation/components/responsive.d.ts | 2 +- types/react-foundation/components/slider.d.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-foundation/components/menu.d.ts b/types/react-foundation/components/menu.d.ts index e3667a31bd0fa0..4ece1e3ca80a5c 100644 --- a/types/react-foundation/components/menu.d.ts +++ b/types/react-foundation/components/menu.d.ts @@ -36,4 +36,4 @@ export interface MenuItemProps extends FlexboxPropTypes, React.HTMLAttributes JSX.Element; +export declare const MenuText: (props: MenuItemProps) => React.JSX.Element; diff --git a/types/react-foundation/components/responsive.d.ts b/types/react-foundation/components/responsive.d.ts index f5e031bfddff42..2bbee185846126 100644 --- a/types/react-foundation/components/responsive.d.ts +++ b/types/react-foundation/components/responsive.d.ts @@ -23,7 +23,7 @@ export declare class ResponsiveNavigation extends Component; alignX: PropTypes.Requireable; diff --git a/types/react-foundation/components/slider.d.ts b/types/react-foundation/components/slider.d.ts index 3b534c05d49662..4be046ae8f69b1 100644 --- a/types/react-foundation/components/slider.d.ts +++ b/types/react-foundation/components/slider.d.ts @@ -8,7 +8,7 @@ import { Component } from "react"; export declare class Slider extends Component { constructor(); componentWillMount(): void; - render(): JSX.Element; + render(): React.JSX.Element; } export interface SliderProps extends React.HTMLAttributes, SliderCommonProps { initialStart?: number | undefined; @@ -25,7 +25,7 @@ export interface SliderState { export declare class TwoHandleSlider extends Component { constructor(); componentWillMount(): void; - render(): JSX.Element; + render(): React.JSX.Element; } export interface TwoHandleSliderProps extends React.HTMLAttributes, SliderCommonProps { initialStart?: number | undefined; From 4324b03b0156ad9d6ff6403f19eeacb71d76d83e Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:39:07 +0100 Subject: [PATCH 192/519] [tuya-panel-kit] Replace usage of React's global JSX namespace with scoped JSX (#67744) --- types/tuya-panel-kit/@react-navigation/core/types.d.ts | 2 +- .../@react-navigation/native/theming/ThemeProvider.d.ts | 2 +- .../stack/navigators/createStackNavigator.d.ts | 2 +- .../stack/views/Header/HeaderBackButton.d.ts | 2 +- .../stack/views/Header/HeaderBackground.d.ts | 2 +- .../@react-navigation/stack/views/Header/HeaderTitle.d.ts | 2 +- .../@react-navigation/stack/views/Stack/StackView.d.ts | 2 +- types/tuya-panel-kit/index.d.ts | 6 +++--- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/types/tuya-panel-kit/@react-navigation/core/types.d.ts b/types/tuya-panel-kit/@react-navigation/core/types.d.ts index 9b728d39847d4a..13805c4538e21a 100644 --- a/types/tuya-panel-kit/@react-navigation/core/types.d.ts +++ b/types/tuya-panel-kit/@react-navigation/core/types.d.ts @@ -339,7 +339,7 @@ export declare type Descriptor< /** * Render the component associated with this route. */ - render(): JSX.Element; + render(): React.JSX.Element; /** * Options for the route. */ diff --git a/types/tuya-panel-kit/@react-navigation/native/theming/ThemeProvider.d.ts b/types/tuya-panel-kit/@react-navigation/native/theming/ThemeProvider.d.ts index 62a5e62f022580..dd13c4c9b29bf5 100644 --- a/types/tuya-panel-kit/@react-navigation/native/theming/ThemeProvider.d.ts +++ b/types/tuya-panel-kit/@react-navigation/native/theming/ThemeProvider.d.ts @@ -6,5 +6,5 @@ declare type Props = { value: Theme; children: React.ReactNode; }; -export default function ThemeProvider({ value, children }: Props): JSX.Element; +export default function ThemeProvider({ value, children }: Props): React.JSX.Element; export {}; diff --git a/types/tuya-panel-kit/@react-navigation/stack/navigators/createStackNavigator.d.ts b/types/tuya-panel-kit/@react-navigation/stack/navigators/createStackNavigator.d.ts index 23c8a4087b721f..9be7c3a8d6b4cb 100644 --- a/types/tuya-panel-kit/@react-navigation/stack/navigators/createStackNavigator.d.ts +++ b/types/tuya-panel-kit/@react-navigation/stack/navigators/createStackNavigator.d.ts @@ -1,6 +1,6 @@ -/// import { DefaultNavigatorOptions, StackNavigationState, StackRouterOptions } from "../../native"; import type { StackNavigationConfig, StackNavigationEventMap, StackNavigationOptions } from "../types"; +import { JSX } from "react"; // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers declare type Props = DefaultNavigatorOptions & StackRouterOptions & StackNavigationConfig; declare function StackNavigator({ initialRouteName, children, screenOptions, ...rest }: Props): JSX.Element; diff --git a/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackButton.d.ts b/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackButton.d.ts index 9d3fc669a02e7a..6953e852c9bc05 100644 --- a/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackButton.d.ts +++ b/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackButton.d.ts @@ -1,5 +1,5 @@ -/// import type { StackHeaderLeftButtonProps } from "../../types"; +import { JSX } from "react"; // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers declare type Props = StackHeaderLeftButtonProps; export default function HeaderBackButton( diff --git a/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackground.d.ts b/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackground.d.ts index be6380cc5e651c..515f216e2e9fce 100644 --- a/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackground.d.ts +++ b/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackground.d.ts @@ -5,5 +5,5 @@ declare type Props = ViewProps & { style?: Animated.WithAnimatedValue> | undefined; children?: React.ReactNode | undefined; }; -export default function HeaderBackground({ style, ...rest }: Props): JSX.Element; +export default function HeaderBackground({ style, ...rest }: Props): React.JSX.Element; export {}; diff --git a/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderTitle.d.ts b/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderTitle.d.ts index f3a6c0e6d198cf..13733a967379aa 100644 --- a/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderTitle.d.ts +++ b/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderTitle.d.ts @@ -1,5 +1,5 @@ -/// import { Animated, StyleProp, TextProps, TextStyle } from "react-native"; +import { JSX } from "react"; // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers declare type Props = Omit & { tintColor?: string | undefined; diff --git a/types/tuya-panel-kit/@react-navigation/stack/views/Stack/StackView.d.ts b/types/tuya-panel-kit/@react-navigation/stack/views/Stack/StackView.d.ts index 6c3f6921f233fe..d1660923e84084 100644 --- a/types/tuya-panel-kit/@react-navigation/stack/views/Stack/StackView.d.ts +++ b/types/tuya-panel-kit/@react-navigation/stack/views/Stack/StackView.d.ts @@ -170,6 +170,6 @@ export default class StackView extends React.Component { private handleGestureStart; private handleGestureEnd; private handleGestureCancel; - render(): JSX.Element; + render(): React.JSX.Element; } export {}; diff --git a/types/tuya-panel-kit/index.d.ts b/types/tuya-panel-kit/index.d.ts index eee4d0c000d393..fca4bf5f8d7f1e 100644 --- a/types/tuya-panel-kit/index.d.ts +++ b/types/tuya-panel-kit/index.d.ts @@ -10931,16 +10931,16 @@ export interface NavigationOptions { /** * 自定义渲染头部栏 */ - renderTopBar?: (() => JSX.Element) | undefined; + renderTopBar?: (() => React.JSX.Element) | undefined; /** * 自定义渲染状态栏 */ - renderStatusBar?: (() => JSX.Element) | undefined; + renderStatusBar?: (() => React.JSX.Element) | undefined; } export class NavigatorLayout

extends React.Component { hookRoute(route: DeprecatedNavigatorRoute): NavigationOptions; - renderScene(route: DeprecatedNavigatorRoute, navigator: DeprecatedNavigator): JSX.Element | undefined; + renderScene(route: DeprecatedNavigatorRoute, navigator: DeprecatedNavigator): React.JSX.Element | undefined; } export interface NavigationRoute { From 90df4eeed02da5d4e8a38b6c2e8590ba8a338150 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:40:05 +0100 Subject: [PATCH 193/519] [react-json-to-csv] Replace usage of React's global JSX namespace with scoped JSX (#67661) --- types/react-json-to-csv/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-json-to-csv/index.d.ts b/types/react-json-to-csv/index.d.ts index 563b3a7903e87c..e326150ee07162 100644 --- a/types/react-json-to-csv/index.d.ts +++ b/types/react-json-to-csv/index.d.ts @@ -7,6 +7,6 @@ export interface CsvDownloadProps extends React.HTMLAttributes Date: Wed, 6 Dec 2023 07:40:46 +0100 Subject: [PATCH 194/519] [react-loading-overlay] Replace usage of React's global JSX namespace with scoped JSX (#67668) --- types/react-loading-overlay/react-loading-overlay-tests.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-loading-overlay/react-loading-overlay-tests.tsx b/types/react-loading-overlay/react-loading-overlay-tests.tsx index bc38adda30f98f..5bd0ca9aef8f44 100644 --- a/types/react-loading-overlay/react-loading-overlay-tests.tsx +++ b/types/react-loading-overlay/react-loading-overlay-tests.tsx @@ -2,7 +2,7 @@ import * as React from "react"; import LoadingOverlay, { LoadingOverlayProps } from "react-loading-overlay"; export class LoadingOverlayTest extends React.PureComponent { - render(): JSX.Element { + render(): React.JSX.Element { const props: LoadingOverlayProps = { active: true, spinner: true, From 6cc7bcc3d101688ba39a74f82fe87b3148477358 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:41:21 +0100 Subject: [PATCH 195/519] [react-native-datepicker] Replace usage of React's global JSX namespace with scoped JSX (#67673) --- types/react-native-datepicker/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native-datepicker/index.d.ts b/types/react-native-datepicker/index.d.ts index e6891c5f38959f..15199b0c20a7cb 100644 --- a/types/react-native-datepicker/index.d.ts +++ b/types/react-native-datepicker/index.d.ts @@ -23,7 +23,7 @@ export interface DatePickerProps { date?: string | Date | moment.Moment | undefined; format?: string | undefined; iconSource?: ImageURISource | undefined; - iconComponent?: JSX.Element | undefined; + iconComponent?: React.JSX.Element | undefined; hideText?: boolean | undefined; minDate?: string | Date | undefined; maxDate?: string | Date | undefined; From 57e2219bcb84e89b8ff8080cb72f7ea739c03f1c Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:41:36 +0100 Subject: [PATCH 196/519] [react-native-modal-filter-picker] Replace usage of React's global JSX namespace with scoped JSX (#67679) --- types/react-native-modal-filter-picker/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/react-native-modal-filter-picker/index.d.ts b/types/react-native-modal-filter-picker/index.d.ts index 0d2cd8cf866da4..52c82d359d529c 100644 --- a/types/react-native-modal-filter-picker/index.d.ts +++ b/types/react-native-modal-filter-picker/index.d.ts @@ -21,9 +21,9 @@ export interface ModalFilterPickerProps { modal?: ModalProps | undefined; selectedOption?: string | undefined; flatListProps?: Partial> | undefined; - renderOption?: ((option: T, isSelected: boolean) => JSX.Element) | undefined; - renderList?: (() => JSX.Element) | undefined; - renderCancelButton?: (() => JSX.Element) | undefined; + renderOption?: ((option: T, isSelected: boolean) => React.JSX.Element) | undefined; + renderList?: (() => React.JSX.Element) | undefined; + renderCancelButton?: (() => React.JSX.Element) | undefined; keyboardShouldPersistTaps?: "never" | "always" | "handle" | undefined; autoFocus?: boolean | undefined; From 62d90e2ddbbe84b9a198a2c5d65ed124d2f2ff3f Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:41:46 +0100 Subject: [PATCH 197/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67689=20[r?= =?UTF-8?q?eact-onsenui]=20Replace=20usage=20of=20React's=20global=20JSX?= =?UTF-8?q?=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-onsenui/index.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/types/react-onsenui/index.d.ts b/types/react-onsenui/index.d.ts index 06a55e1275e8aa..bde0364d5a5598 100644 --- a/types/react-onsenui/index.d.ts +++ b/types/react-onsenui/index.d.ts @@ -125,7 +125,7 @@ export class BackButton extends Component<{ }, any> {} export class Navigator extends Component<{ - renderPage(route: any, navigator?: Navigator): JSX.Element; + renderPage(route: any, navigator?: Navigator): React.JSX.Element; initialRouteStack?: string[] | undefined; initialRoute?: any; onPrePush?(): void; @@ -146,7 +146,7 @@ export class Navigator extends Component<{ // Still incomplete, see https://onsen.io/v2/api/react/RouterNavigator.html export class RouterNavigator extends Component<{ routeConfig: any; - renderPage(route: any, navigator?: Navigator): JSX.Element; + renderPage(route: any, navigator?: Navigator): React.JSX.Element; swipeable?: boolean | "force" | undefined; swipePop?: (() => void) | undefined; swipeTargetWidth?: number | undefined; @@ -436,8 +436,8 @@ export class TabActive extends Component {} export class TabInactive extends Component {} export interface TabbarRenderTab { - content: JSX.Element; - tab: JSX.Element; + content: React.JSX.Element; + tab: React.JSX.Element; } export class Tabbar extends Component<{ @@ -469,9 +469,9 @@ export class LazyList extends Component<{ export class List extends Component<{ modifier?: string | undefined; dataSource?: T[] | undefined; - renderRow?(row: T, index?: number): JSX.Element | undefined; - renderFooter?(): JSX.Element | undefined; - renderHeader?(): JSX.Element | undefined; + renderRow?(row: T, index?: number): React.JSX.Element | undefined; + renderFooter?(): React.JSX.Element | undefined; + renderHeader?(): React.JSX.Element | undefined; }, any> {} export class ListHeader extends Component<{ From 6ef6bb3ce36b2be354547d752796f330d821194c Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:42:00 +0100 Subject: [PATCH 198/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67727=20[r?= =?UTF-8?q?eact-widgets]=20Replace=20usage=20of=20React's=20global=20JSX?= =?UTF-8?q?=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-widgets/lib/DateTimePicker.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-widgets/lib/DateTimePicker.d.ts b/types/react-widgets/lib/DateTimePicker.d.ts index c902cd782b2000..24ca500cc6b12f 100644 --- a/types/react-widgets/lib/DateTimePicker.d.ts +++ b/types/react-widgets/lib/DateTimePicker.d.ts @@ -1,4 +1,4 @@ -import { ComponentClass, ElementType, FocusEvent, KeyboardEvent, ReactElement } from "react"; +import { ComponentClass, ElementType, FocusEvent, KeyboardEvent, ReactElement, JSX } from "react"; import { AutoFocus, ReactWidgetsCommonDropdownProps } from "./CommonProps"; declare namespace DateTimePicker { From 4122b9b251895e05952e48042e8c18b759543c26 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:42:11 +0100 Subject: [PATCH 199/519] [react-onclickoutside] Replace usage of React's global JSX namespace with scoped JSX (#67688) --- types/react-onclickoutside/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-onclickoutside/index.d.ts b/types/react-onclickoutside/index.d.ts index 4b13fde964cf73..e360ba4ec236e8 100644 --- a/types/react-onclickoutside/index.d.ts +++ b/types/react-onclickoutside/index.d.ts @@ -37,7 +37,7 @@ export interface WrapperClass { new(): WrapperInstance; } -export interface WrapperInstance extends React.Component>> { +export interface WrapperInstance extends React.Component>> { getInstance(): C extends typeof React.Component ? InstanceType : never; } From 794c8d0c51094a2e575be5c4c835c8d2dfa56a3e Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:42:24 +0100 Subject: [PATCH 200/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67723=20[r?= =?UTF-8?q?eact-virtualized]=20Replace=20usage=20of=20React's=20global=20J?= =?UTF-8?q?SX=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-virtualized/dist/es/AutoSizer.d.ts | 2 +- types/react-virtualized/dist/es/Collection.d.ts | 2 +- types/react-virtualized/dist/es/List.d.ts | 2 +- types/react-virtualized/dist/es/Table.d.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-virtualized/dist/es/AutoSizer.d.ts b/types/react-virtualized/dist/es/AutoSizer.d.ts index 31935393ea0b01..fa9a9c30b03886 100644 --- a/types/react-virtualized/dist/es/AutoSizer.d.ts +++ b/types/react-virtualized/dist/es/AutoSizer.d.ts @@ -1,5 +1,5 @@ import * as PropTypes from "prop-types"; -import { PureComponent, Requireable, Validator } from "react"; +import { PureComponent, Requireable, Validator, JSX } from "react"; export type Size = { height: number; diff --git a/types/react-virtualized/dist/es/Collection.d.ts b/types/react-virtualized/dist/es/Collection.d.ts index ceb0c1db00b1ad..34c07a03fc9ae0 100644 --- a/types/react-virtualized/dist/es/Collection.d.ts +++ b/types/react-virtualized/dist/es/Collection.d.ts @@ -1,4 +1,4 @@ -import { PureComponent, Requireable, Validator } from "react"; +import { PureComponent, Requireable, Validator, JSX } from "react"; import { Alignment, Index, diff --git a/types/react-virtualized/dist/es/List.d.ts b/types/react-virtualized/dist/es/List.d.ts index 75f2569f0ec9ff..e1ef87ce74b4a6 100644 --- a/types/react-virtualized/dist/es/List.d.ts +++ b/types/react-virtualized/dist/es/List.d.ts @@ -1,4 +1,4 @@ -import { PureComponent } from "react"; +import { PureComponent, JSX } from "react"; import { Alignment, IndexRange, OverscanIndexRange } from "../../index"; import { CellPosition } from "./CellMeasurer"; import { Grid, GridCellProps, GridCoreProps, OverscanIndicesGetter } from "./Grid"; diff --git a/types/react-virtualized/dist/es/Table.d.ts b/types/react-virtualized/dist/es/Table.d.ts index 0f6afbccc95d04..af8423f6d4bbd7 100644 --- a/types/react-virtualized/dist/es/Table.d.ts +++ b/types/react-virtualized/dist/es/Table.d.ts @@ -1,4 +1,4 @@ -import { Component, PureComponent, ReactNode, Requireable, Validator } from "react"; +import { Component, PureComponent, ReactNode, Requireable, Validator, JSX } from "react"; import { Alignment, Index, IndexRange, OverscanIndexRange, ScrollEventData } from "../../index"; import { CellMeasurerCache } from "./CellMeasurer"; import { Grid, GridCoreProps } from "./Grid"; From 04a454ef565590f32f8d6d51f3f17b15f3d0b475 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:42:26 +0100 Subject: [PATCH 201/519] [react-scroll-into-view-if-needed] Replace usage of React's global JSX namespace with scoped JSX (#67698) --- types/react-scroll-into-view-if-needed/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-scroll-into-view-if-needed/index.d.ts b/types/react-scroll-into-view-if-needed/index.d.ts index 7aab08b29548b2..bb7acfe60fc5f2 100644 --- a/types/react-scroll-into-view-if-needed/index.d.ts +++ b/types/react-scroll-into-view-if-needed/index.d.ts @@ -4,7 +4,7 @@ import * as ScrollIntoViewIfNeeded from "scroll-into-view-if-needed"; export interface ReactScrollIntoViewIfNeededProps extends React.HTMLProps { options?: ScrollIntoViewIfNeeded.Options | undefined; active?: boolean | undefined; - elementType?: keyof JSX.IntrinsicElements | undefined; + elementType?: keyof React.JSX.IntrinsicElements | undefined; } export default class ReactScrollIntoViewIfNeeded extends React.Component< From e96e2d509d4630dd944c74e9387719201348104b Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 07:42:39 +0100 Subject: [PATCH 202/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67714=20[r?= =?UTF-8?q?eact-tagcloud]=20Replace=20usage=20of=20React's=20global=20JSX?= =?UTF-8?q?=20namespace=20with=20scoped=20JSX=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64464 --- types/react-tagcloud/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-tagcloud/index.d.ts b/types/react-tagcloud/index.d.ts index 7432d1c497bea6..6d84ec28790ed2 100644 --- a/types/react-tagcloud/index.d.ts +++ b/types/react-tagcloud/index.d.ts @@ -58,7 +58,7 @@ export type RendererFunction = ( tag: Tag, size: number, color: string, -) => JSX.Element; +) => React.JSX.Element; export interface ColorOptions { /** From 1f0840a8cd076a1660cf6455075a1fd0fd0e47d1 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 6 Dec 2023 06:45:04 +0000 Subject: [PATCH 203/519] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/fundamental-react/lib/Select/Select.d.ts | 8 +++++--- types/loadable__server/index.d.ts | 2 +- types/react-bootstrap-table2-toolkit/index.d.ts | 2 +- types/react-onclickoutside/index.d.ts | 4 +++- types/react-virtualized/dist/es/AutoSizer.d.ts | 2 +- types/react-virtualized/dist/es/Collection.d.ts | 2 +- types/react-virtualized/dist/es/List.d.ts | 2 +- types/react-virtualized/dist/es/Table.d.ts | 2 +- types/react-widgets/lib/DateTimePicker.d.ts | 2 +- .../stack/navigators/createStackNavigator.d.ts | 2 +- .../stack/views/Header/HeaderBackButton.d.ts | 2 +- .../@react-navigation/stack/views/Header/HeaderTitle.d.ts | 2 +- 12 files changed, 18 insertions(+), 14 deletions(-) diff --git a/types/fundamental-react/lib/Select/Select.d.ts b/types/fundamental-react/lib/Select/Select.d.ts index 21659af0bda011..cabe6fd0901703 100644 --- a/types/fundamental-react/lib/Select/Select.d.ts +++ b/types/fundamental-react/lib/Select/Select.d.ts @@ -43,8 +43,10 @@ export interface SelectProps { ref?: React.Ref | undefined; } -declare const Select: ((props: SelectProps & { selectedKey?: T }) => React.JSX.Element) & { - displayName: "Select"; -}; +declare const Select: + & ((props: SelectProps & { selectedKey?: T }) => React.JSX.Element) + & { + displayName: "Select"; + }; export default Select; diff --git a/types/loadable__server/index.d.ts b/types/loadable__server/index.d.ts index d367e1bab28d84..9beaeb42f3bc7d 100644 --- a/types/loadable__server/index.d.ts +++ b/types/loadable__server/index.d.ts @@ -1,4 +1,4 @@ -import { Component, ComponentType, ReactElement, JSX } from "react"; +import { Component, ComponentType, JSX, ReactElement } from "react"; export type ChunkExtractorOptions = & { diff --git a/types/react-bootstrap-table2-toolkit/index.d.ts b/types/react-bootstrap-table2-toolkit/index.d.ts index 677e378c5355f6..0f2c0186fb0124 100644 --- a/types/react-bootstrap-table2-toolkit/index.d.ts +++ b/types/react-bootstrap-table2-toolkit/index.d.ts @@ -1,6 +1,6 @@ // documentation taken from https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/table-props.html -import { CSSProperties, ReactNode, JSX } from "react"; +import { CSSProperties, JSX, ReactNode } from "react"; import { ColumnDescription, SearchProps } from "react-bootstrap-table-next"; /** diff --git a/types/react-onclickoutside/index.d.ts b/types/react-onclickoutside/index.d.ts index e360ba4ec236e8..97f85970495b3e 100644 --- a/types/react-onclickoutside/index.d.ts +++ b/types/react-onclickoutside/index.d.ts @@ -37,7 +37,9 @@ export interface WrapperClass { new(): WrapperInstance; } -export interface WrapperInstance extends React.Component>> { +export interface WrapperInstance + extends React.Component>> +{ getInstance(): C extends typeof React.Component ? InstanceType : never; } diff --git a/types/react-virtualized/dist/es/AutoSizer.d.ts b/types/react-virtualized/dist/es/AutoSizer.d.ts index fa9a9c30b03886..fb99514963541b 100644 --- a/types/react-virtualized/dist/es/AutoSizer.d.ts +++ b/types/react-virtualized/dist/es/AutoSizer.d.ts @@ -1,5 +1,5 @@ import * as PropTypes from "prop-types"; -import { PureComponent, Requireable, Validator, JSX } from "react"; +import { JSX, PureComponent, Requireable, Validator } from "react"; export type Size = { height: number; diff --git a/types/react-virtualized/dist/es/Collection.d.ts b/types/react-virtualized/dist/es/Collection.d.ts index 34c07a03fc9ae0..97b3f122dc9865 100644 --- a/types/react-virtualized/dist/es/Collection.d.ts +++ b/types/react-virtualized/dist/es/Collection.d.ts @@ -1,4 +1,4 @@ -import { PureComponent, Requireable, Validator, JSX } from "react"; +import { JSX, PureComponent, Requireable, Validator } from "react"; import { Alignment, Index, diff --git a/types/react-virtualized/dist/es/List.d.ts b/types/react-virtualized/dist/es/List.d.ts index e1ef87ce74b4a6..5ea27edeb9ee0e 100644 --- a/types/react-virtualized/dist/es/List.d.ts +++ b/types/react-virtualized/dist/es/List.d.ts @@ -1,4 +1,4 @@ -import { PureComponent, JSX } from "react"; +import { JSX, PureComponent } from "react"; import { Alignment, IndexRange, OverscanIndexRange } from "../../index"; import { CellPosition } from "./CellMeasurer"; import { Grid, GridCellProps, GridCoreProps, OverscanIndicesGetter } from "./Grid"; diff --git a/types/react-virtualized/dist/es/Table.d.ts b/types/react-virtualized/dist/es/Table.d.ts index af8423f6d4bbd7..3b71c669e7536a 100644 --- a/types/react-virtualized/dist/es/Table.d.ts +++ b/types/react-virtualized/dist/es/Table.d.ts @@ -1,4 +1,4 @@ -import { Component, PureComponent, ReactNode, Requireable, Validator, JSX } from "react"; +import { Component, JSX, PureComponent, ReactNode, Requireable, Validator } from "react"; import { Alignment, Index, IndexRange, OverscanIndexRange, ScrollEventData } from "../../index"; import { CellMeasurerCache } from "./CellMeasurer"; import { Grid, GridCoreProps } from "./Grid"; diff --git a/types/react-widgets/lib/DateTimePicker.d.ts b/types/react-widgets/lib/DateTimePicker.d.ts index 24ca500cc6b12f..d745a918e3b2f3 100644 --- a/types/react-widgets/lib/DateTimePicker.d.ts +++ b/types/react-widgets/lib/DateTimePicker.d.ts @@ -1,4 +1,4 @@ -import { ComponentClass, ElementType, FocusEvent, KeyboardEvent, ReactElement, JSX } from "react"; +import { ComponentClass, ElementType, FocusEvent, JSX, KeyboardEvent, ReactElement } from "react"; import { AutoFocus, ReactWidgetsCommonDropdownProps } from "./CommonProps"; declare namespace DateTimePicker { diff --git a/types/tuya-panel-kit/@react-navigation/stack/navigators/createStackNavigator.d.ts b/types/tuya-panel-kit/@react-navigation/stack/navigators/createStackNavigator.d.ts index 9be7c3a8d6b4cb..3b0e23cfe29ea7 100644 --- a/types/tuya-panel-kit/@react-navigation/stack/navigators/createStackNavigator.d.ts +++ b/types/tuya-panel-kit/@react-navigation/stack/navigators/createStackNavigator.d.ts @@ -1,6 +1,6 @@ +import { JSX } from "react"; import { DefaultNavigatorOptions, StackNavigationState, StackRouterOptions } from "../../native"; import type { StackNavigationConfig, StackNavigationEventMap, StackNavigationOptions } from "../types"; -import { JSX } from "react"; // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers declare type Props = DefaultNavigatorOptions & StackRouterOptions & StackNavigationConfig; declare function StackNavigator({ initialRouteName, children, screenOptions, ...rest }: Props): JSX.Element; diff --git a/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackButton.d.ts b/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackButton.d.ts index 6953e852c9bc05..204e27df53184b 100644 --- a/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackButton.d.ts +++ b/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderBackButton.d.ts @@ -1,5 +1,5 @@ -import type { StackHeaderLeftButtonProps } from "../../types"; import { JSX } from "react"; +import type { StackHeaderLeftButtonProps } from "../../types"; // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers declare type Props = StackHeaderLeftButtonProps; export default function HeaderBackButton( diff --git a/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderTitle.d.ts b/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderTitle.d.ts index 13733a967379aa..ab71884683ec2c 100644 --- a/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderTitle.d.ts +++ b/types/tuya-panel-kit/@react-navigation/stack/views/Header/HeaderTitle.d.ts @@ -1,5 +1,5 @@ -import { Animated, StyleProp, TextProps, TextStyle } from "react-native"; import { JSX } from "react"; +import { Animated, StyleProp, TextProps, TextStyle } from "react-native"; // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers declare type Props = Omit & { tintColor?: string | undefined; From fb9960037fd0155d69319a33503005fe76e4c0e8 Mon Sep 17 00:00:00 2001 From: Todd Tarsi Date: Wed, 6 Dec 2023 01:20:46 -0600 Subject: [PATCH 204/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67753=20[s?= =?UTF-8?q?elenium-webdriver]:=20types=20for=20bidi=20by=20@toddtarsi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [selenium-webdriver]: types for bidi * [selenium-webdriver] type refinement pt 1 * Update types/selenium-webdriver/bidi/evaluateResult.d.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/bidi/evaluateResult.d.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/bidi/protocolType.d.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/bidi/protocolType.d.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/bidi/protocolType.d.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/bidi/scriptManager.d.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/bidi/protocolType.d.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/bidi/protocolValue.d.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/test/bidi/evaluateResult.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/bidi/scriptManager.d.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/bidi/protocolValue.d.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/test/bidi/evaluateResult.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/test/bidi/evaluateResult.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/bidi/protocolValue.d.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/bidi/realmInfo.d.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/bidi/realmInfo.d.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/bidi/scriptManager.d.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/bidi/scriptManager.d.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/bidi/scriptManager.d.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/bidi/scriptManager.d.ts Co-authored-by: Simon Gellis * Update types/selenium-webdriver/bidi/scriptManager.d.ts Co-authored-by: Simon Gellis * Update evaluateResult.d.ts * Update types/selenium-webdriver/bidi/scriptManager.d.ts Co-authored-by: Simon Gellis --------- Co-authored-by: Simon Gellis --- .../bidi/evaluateResult.d.ts | 39 ++++++ .../selenium-webdriver/bidi/protocolType.d.ts | 90 +++++++++++++ .../bidi/protocolValue.d.ts | 87 +++++++++++++ types/selenium-webdriver/bidi/realmInfo.d.ts | 35 ++++++ .../bidi/scriptManager.d.ts | 118 ++++++++++++++++++ .../test/bidi/evaluateResult.ts | 28 +++++ .../test/bidi/protocolType.ts | 22 ++++ .../test/bidi/protocolValue.ts | 50 ++++++++ .../selenium-webdriver/test/bidi/realmInfo.ts | 35 ++++++ .../test/bidi/scriptManager.ts | 117 +++++++++++++++++ 10 files changed, 621 insertions(+) create mode 100644 types/selenium-webdriver/bidi/evaluateResult.d.ts create mode 100644 types/selenium-webdriver/bidi/protocolType.d.ts create mode 100644 types/selenium-webdriver/bidi/protocolValue.d.ts create mode 100644 types/selenium-webdriver/bidi/realmInfo.d.ts create mode 100644 types/selenium-webdriver/bidi/scriptManager.d.ts create mode 100644 types/selenium-webdriver/test/bidi/evaluateResult.ts create mode 100644 types/selenium-webdriver/test/bidi/protocolType.ts create mode 100644 types/selenium-webdriver/test/bidi/protocolValue.ts create mode 100644 types/selenium-webdriver/test/bidi/realmInfo.ts create mode 100644 types/selenium-webdriver/test/bidi/scriptManager.ts diff --git a/types/selenium-webdriver/bidi/evaluateResult.d.ts b/types/selenium-webdriver/bidi/evaluateResult.d.ts new file mode 100644 index 00000000000000..ed8a2bd472bba3 --- /dev/null +++ b/types/selenium-webdriver/bidi/evaluateResult.d.ts @@ -0,0 +1,39 @@ +interface IEvaluateResultType { + SUCCESS: "success"; + EXCEPTION: "exception"; +} + +const EvaluateResultType: IEvaluateResultType; + +declare class EvaluateResultSuccess { + constructor(realmId: string, value: T); + resultType: "success"; + realmId: string; + result: T; +} + +declare type ExceptionShape = { + columnNumber?: number; + exception?: string; + lineNumber?: number; + stackTrace?: string; + text?: string; +}; + +declare class ExceptionDetails { + constructor(exceptionDetails: ExceptionShape); + columnNumber: number | null; + exception: string | null; + lineNumber: number | null; + stackTrace: string | null; + text: string | null; +} + +declare class EvaluateResultException { + constructor(realmId: string, exceptionDetails: ExceptionShape); + resultType: "exception"; + realmId: string; + exceptionDetails: ExceptionDetails; +} + +export { EvaluateResultException, EvaluateResultSuccess, EvaluateResultType, ExceptionDetails }; diff --git a/types/selenium-webdriver/bidi/protocolType.d.ts b/types/selenium-webdriver/bidi/protocolType.d.ts new file mode 100644 index 00000000000000..8e9c29c15837a9 --- /dev/null +++ b/types/selenium-webdriver/bidi/protocolType.d.ts @@ -0,0 +1,90 @@ +interface IPrimitiveType { + UNDEFINED: "undefined"; + NULL: "null"; + STRING: "string"; + NUMBER: "number"; + SPECIAL_NUMBER: "number"; + BOOLEAN: "boolean"; + BIGINT: "bigint"; + + findByName(name: string): + | "undefined" + | "null" + | "string" + | "number" + | "number" + | "boolean" + | "bigint" + | null; +} + +const PrimitiveType: IPrimitiveType; + +interface INonPrimitiveType { + ARRAY: "array"; + DATE: "date"; + MAP: "map"; + OBJECT: "object"; + REGULAR_EXPRESSION: "regexp"; + SET: "set"; + + findByName(name): + | "array" + | "date" + | "map" + | "object" + | "regexp" + | "set" + | null; +} + +const NonPrimitiveType: INonPrimitiveType; + +interface IRemoteType { + SYMBOL: "symbol"; + FUNCTION: "function"; + WEAK_MAP: "weakmap"; + WEAK_SET: "weakset"; + ITERATOR: "iterator"; + GENERATOR: "generator"; + ERROR: "error"; + PROXY: "proxy"; + PROMISE: "promise"; + TYPED_ARRAY: "typedarray"; + ARRAY_BUFFER: "arraybuffer"; + NODE_LIST: "nodelist"; + HTML_COLLECTION: "htmlcollection"; + NODE: "node"; + WINDOW: "window"; + + findByName(name: string): + | "symbol" + | "function" + | "weakmap" + | "weakset" + | "iterator" + | "generator" + | "error" + | "proxy" + | "promise" + | "typedarray" + | "arraybuffer" + | "nodelist" + | "htmlcollection" + | "node" + | "window" + | null; +} + +const RemoteType: IRemoteType; + +interface ISpecialNumberType { + NAN: "NaN"; + MINUS_ZERO: "-0"; + INFINITY: "Infinity"; + MINUS_INFINITY: "-Infinity"; +} + +const SpecialNumberType: ISpecialNumberType; + +export { NonPrimitiveType, PrimitiveType, RemoteType, SpecialNumberType }; diff --git a/types/selenium-webdriver/bidi/protocolValue.d.ts b/types/selenium-webdriver/bidi/protocolValue.d.ts new file mode 100644 index 00000000000000..b7faa95cdf93c4 --- /dev/null +++ b/types/selenium-webdriver/bidi/protocolValue.d.ts @@ -0,0 +1,87 @@ +interface IRemoteReferenceType { + HANDLE: "handle"; + SHARED_ID: "shareId"; +} + +const RemoteReferenceType: IRemoteReferenceType; + +declare type LocalValueJSON = { + type: string; + value?: any; +}; + +declare class LocalValue { + constructor(type: string, value: T); + type: string; + value: T; + + static createStringValue(value: string): LocalValue; + + static createNumberValue(value: number): LocalValue; + + static createSpecialNumberValue(value: number): LocalValue; + + static createUndefinedValue(): LocalValue; + + static createNullValue(): LocalValue; + + static createBooleanValue(value: boolean): LocalValue; + + static createBigIntValue(value: BigInt): LocalValue; + + static createArrayValue(value: any[]): LocalValue; + + static createDateValue(value: Date): LocalValue; + + static createMapValue(map: Map): LocalValue>; + + static createObjectValue(map: Map): LocalValue>; + + static createRegularExpressionValue(value: RegExp): LocalValue; + + static createSetValue(value: Set): LocalValue>; + + toJson(): LocalValueJSON; +} + +declare type RemoteValueJSON = { + type?: string; + handle?: string; + internalId?: string; + value?: T; + sharedId?: string; +}; + +type MappedInternalType = T extends Map ? ReferenceValue + : T extends RegExp ? RegExpValue + : T; + +declare class RemoteValue { + constructor(remoteValue: RemoteValueJSON); + type: string | null; + handle: string | null; + internalId: string | null; + value: MappedInternalType | null; + sharedId: string | null; + deserializeValue(value: MappedInternalType | null, type: string): T; +} + +declare type ReferenceValueJSON = { + handle?: string; + shareId?: string; +}; + +declare class ReferenceValue { + constructor(handle: string, shareId: string); + handle: string | null; + shareId?: string | null; + asMap(): ReferenceValueJSON; +} + +declare class RegExpValue { + constructor(pattern: RegExp, flags: string | null); + pattern: RegExp; + flags: string | null; +} + +export { LocalValue, ReferenceValue, RegExpValue, RemoteReferenceType, RemoteValue }; diff --git a/types/selenium-webdriver/bidi/realmInfo.d.ts b/types/selenium-webdriver/bidi/realmInfo.d.ts new file mode 100644 index 00000000000000..a5cff98311b800 --- /dev/null +++ b/types/selenium-webdriver/bidi/realmInfo.d.ts @@ -0,0 +1,35 @@ +interface IRealmType { + AUDIO_WORKLET: "audio-worklet"; + DEDICATED_WORKER: "dedicated-worker"; + PAINT_WORKLET: "paint-worklet"; + SERVICE_WORKED: "service-worker"; + SHARED_WORKED: "shared-worker"; + WINDOW: "window"; + WORKER: "worker"; + WORKLET: "worklet"; + + findByName(name): + | "audio-worklet" + | "dedicated-worker" + | "paint-worklet" + | "service-worker" + | "shared-worker" + | "window" + | "worker" + | "worklet" + | null; +} + +const RealmType: IRealmType; + +declare class RealmInfo { + constructor(realmId: string, origin: string, realmType: RealmType); + + static fromJson(input: any): RealmInfo; +} + +declare class WindowRealmInfo extends RealmInfo { + constructor(realmId: string, origin: string, realmType: RealmType, browsingContext: any, sandbox: boolean); +} + +export { RealmInfo, RealmType }; diff --git a/types/selenium-webdriver/bidi/scriptManager.d.ts b/types/selenium-webdriver/bidi/scriptManager.d.ts new file mode 100644 index 00000000000000..9944fe819b61a5 --- /dev/null +++ b/types/selenium-webdriver/bidi/scriptManager.d.ts @@ -0,0 +1,118 @@ +import { Session } from "../lib/session"; +import { EvaluateResultException, EvaluateResultSuccess } from "./evaluateResult"; +import { ReferenceValue, RemoteValue } from "./protocolValue"; +import { RealmInfo } from "./realmInfo"; + +type AnyFunction = (...args: any[]) => any; +type ReferenceValueJSON = ReturnType; + +declare class ScriptManager { + constructor(driver: Session); + _driver: Session; + + init(browsingContextId: string): Promise; + + disownRealmScript(realmId: string, handles: string[]): Promise; + + disownBrowsingContextScript( + browsingContextId: string, + handles: string[], + sandbox?: boolean | null, + ): Promise; + + callFunctionInRealm( + realmId: string, + functionDeclaration: FUNC, + awaitPromise: boolean, + argumentValueList?: ReferenceValue[] | null, + thisParameter?: any, + resultOwnership?: any, + ): Promise>>> | EvaluateResultException>; + + callFunctionInBrowsingContext( + browsingContextId: string, + functionDeclaration: FUNC, + awaitPromise: boolean, + argumentValueList?: ReferenceValue[] | null, + thisParameter?: any, + resultOwnership?: any, + sandbox?: boolean | null, + ): Promise>>> | EvaluateResultException>; + + evaluateFunctionInRealm( + realmId: string, + expression: string, + awaitPromise: boolean, + resultOwnership?: any, + ): Promise>>> | EvaluateResultException>; + + evaluateFunctionInBrowsingContext( + browsingContextId: string, + expression: string, + awaitPromise: boolean, + resultOwnership?: any, + sandbox?: boolean | null, + ): Promise>>> | EvaluateResultException>; + + addPreloadScript( + functionDeclaration: (...args: any) => any, + argumentValueList?: ReferenceValue[] | null, + sandbox?: boolean | null, + ): Promise; + + removePreloadScript(script: string): Promise; + + getCallFunctionParams( + targetType: string, + id: string, + sandbox: boolean | null, + functionDeclaration: FUNC, + awaitPromise: boolean, + argumentValueList?: ReferenceValue[] | null, + thisParameter?: any, + resultOwnership?: any, + ): { + target: { context?: string; realm?: string; sandbox?: boolean }; + functionDeclaration: FUNC; + awaitPromise: boolean; + arguments: ReferenceValueJSON[]; + this: any; + resultOwnership: any; + }; + + getEvaluateParams( + targetType: string, + id: string, + sandbox: boolean | null, + expression: string, + awaitPromise: boolean, + resultOwnership?: any, + ): { + target: { + context?: string; + realm?: string; + sandbox?: boolean; + }; + expression: string; + awaitPromise: boolean; + resultOwnership?: any; + }; + + createEvaluateResult( + response: { result: EvaluateResultSuccess | EvaluateResultException }, + ): EvaluateResultSuccess | EvaluateResultException; + + realmInfoMapper(realms: any[]): RealmInfo[]; + + getAllRealms(): Promise; + + getRealmsByType(type: string): RealmInfo[]; + + getRealmsInBrowsingContext(browsingContext: any): Promise; + + getRealmsInBrowsingContextByType(browsingContext: any, type: string): Promise; +} + +declare function getScriptManagerInstance(browsingContextId: string, driver: Session): ScriptManager; + +export = getScriptManagerInstance; diff --git a/types/selenium-webdriver/test/bidi/evaluateResult.ts b/types/selenium-webdriver/test/bidi/evaluateResult.ts new file mode 100644 index 00000000000000..810156ff5cc4f1 --- /dev/null +++ b/types/selenium-webdriver/test/bidi/evaluateResult.ts @@ -0,0 +1,28 @@ +import { error } from "console"; +import { + EvaluateResultException, + EvaluateResultSuccess, + ExceptionDetails, +} from "selenium-webdriver/bidi/evaluateResult"; + +function TestEvaluateResultSuccess() { + const evaluateResultSuccess = new EvaluateResultSuccess("asdf", "string"); + if (evaluateResultSuccess.result !== "string") { + throw new Error("EvaluateResultSuccess failure"); + } +} + +function TestEvaluateResultException() { + const exceptionDetails = new ExceptionDetails({ + columnNumber: 12, + }); + if (exceptionDetails.columnNumber !== 12) { + throw new Error("ExceptionDetails failure"); + } + const evaluateResultException = new EvaluateResultException("asdf", { + columnNumber: 12, + }); + if (evaluateResultException.exceptionDetails.columnNumber !== 12) { + throw new Error("EvaluateResultException failure"); + } +} diff --git a/types/selenium-webdriver/test/bidi/protocolType.ts b/types/selenium-webdriver/test/bidi/protocolType.ts new file mode 100644 index 00000000000000..868f04ecd1c764 --- /dev/null +++ b/types/selenium-webdriver/test/bidi/protocolType.ts @@ -0,0 +1,22 @@ +import { NonPrimitiveType, PrimitiveType, RemoteType } from "selenium-webdriver/bidi/protocolType"; + +function TestPrimitiveType() { + const primitiveTypeMatch = PrimitiveType.findByName("undefined") !== null; + if (!primitiveTypeMatch) { + throw new Error("PrimitiveType.findByName failure"); + } +} + +function TestNonPrimitiveType() { + const nonPrimitiveTypeMatch = NonPrimitiveType.findByName("array") !== null; + if (!nonPrimitiveTypeMatch) { + throw new Error("NonPrimitiveType.findByName failure"); + } +} + +function TestRemoteType() { + const remoteTypeMatch = RemoteType.findByName("symbol") !== null; + if (!remoteTypeMatch) { + throw new Error("RemoteType.findByName failure"); + } +} diff --git a/types/selenium-webdriver/test/bidi/protocolValue.ts b/types/selenium-webdriver/test/bidi/protocolValue.ts new file mode 100644 index 00000000000000..6a29e8bcf02720 --- /dev/null +++ b/types/selenium-webdriver/test/bidi/protocolValue.ts @@ -0,0 +1,50 @@ +import { + LocalValue, + ReferenceValue, + RegExpValue, + RemoteReferenceType, + RemoteValue, +} from "selenium-webdriver/bidi/protocolValue"; + +function TestLocalValue() { + const local = new LocalValue(1); + const localValue = local.toJson(); + const localValueMatch = localValue.value === 1; + if (!localValueMatch) { + throw new Error("LocalValue.toJson failure"); + } +} + +function TestRemoteValue() { + const remote = new RemoteValue({ value: 1 }); + const remoteValue = remote.value; + const remoteValueMatch = remoteValue === 1; + if (!remoteValueMatch) { + throw new Error("RemoteValue.value failure"); + } +} + +function TestReferenceValue() { + const reference = new ReferenceValue("handle", "shareId"); + const referenceValue = reference.asMap(); + const referenceValueMatch = referenceValue.handle === "handle"; + if (!referenceValueMatch) { + throw new Error("ReferenceValue.asMap failure"); + } +} + +function TestRemoteReferenceType() { + const remoteReferenceTypeMatch = RemoteReferenceType.findByName("node") !== null; + if (!remoteReferenceTypeMatch) { + throw new Error("RemoteReferenceType.findByName failure"); + } +} + +function TestRegExpValue() { + const regExp = new RegExpValue(/pattern/, "flags"); + const regExpValue = regExp.pattern; + const regExpValueMatch = regExpValue.source === "pattern"; + if (!regExpValueMatch) { + throw new Error("RegExpValue.pattern failure"); + } +} diff --git a/types/selenium-webdriver/test/bidi/realmInfo.ts b/types/selenium-webdriver/test/bidi/realmInfo.ts new file mode 100644 index 00000000000000..d3fc30a238b87a --- /dev/null +++ b/types/selenium-webdriver/test/bidi/realmInfo.ts @@ -0,0 +1,35 @@ +import { RealmInfo, RealmType } from "selenium-webdriver/bidi/realmInfo"; + +function assert(condition, message) { + if (!condition) { + throw new Error(message || "Test failed"); + } +} + +function TestRealmInfo() { + // Test RealmType + assert(RealmType.AUDIO_WORKLET === "audio-worklet", "RealmType.AUDIO_WORKLET failed"); + assert(RealmType.findByName("audio-worklet") === "audio-worklet", "RealmType.findByName failed"); + + // Test RealmInfo + const realmInfo = new RealmInfo("realmId", "origin", "realmType"); + assert(realmInfo.realmId === "realmId", "RealmInfo.realmId failed"); + assert(realmInfo.origin === "origin", "RealmInfo.origin failed"); + assert(realmInfo.realmType === "realmType", "RealmInfo.realmType failed"); + + // Test RealmInfo.fromJson + const realmInfoFromJson = RealmInfo.fromJson({ type: "audio-worklet", realm: "realmId", origin: "origin" }); + assert(realmInfoFromJson.realmId === "realmId", "RealmInfo.fromJson failed"); + assert(realmInfoFromJson.origin === "origin", "RealmInfo.fromJson failed"); + assert(realmInfoFromJson.realmType === "audio-worklet", "RealmInfo.fromJson failed"); + + // Test WindowRealmInfo + const windowRealmInfo = new WindowRealmInfo("realmId", "origin", "window", "browsingContext", "sandbox"); + assert(windowRealmInfo.realmId === "realmId", "WindowRealmInfo.realmId failed"); + assert(windowRealmInfo.origin === "origin", "WindowRealmInfo.origin failed"); + assert(windowRealmInfo.realmType === "window", "WindowRealmInfo.realmType failed"); + assert(windowRealmInfo.browsingContext === "browsingContext", "WindowRealmInfo.browsingContext failed"); + assert(windowRealmInfo.sandbox === "sandbox", "WindowRealmInfo.sandbox failed"); +} + +TestRealmInfo(); diff --git a/types/selenium-webdriver/test/bidi/scriptManager.ts b/types/selenium-webdriver/test/bidi/scriptManager.ts new file mode 100644 index 00000000000000..1a9afa95aa8c06 --- /dev/null +++ b/types/selenium-webdriver/test/bidi/scriptManager.ts @@ -0,0 +1,117 @@ +const getScriptManagerInstance = require("./scriptManager"); +const { WebDriver } = require("selenium-webdriver"); + +function assert(condition, message) { + if (!condition) { + throw new Error(message || "Test failed"); + } +} + +async function TestScriptManager() { + const driver = new WebDriver(); + const scriptManager = await getScriptManagerInstance("browsingContextId", driver); + + try { + // Test init method + await scriptManager.init("browsingContextId"); + console.log("init method passed"); + + // Test disownRealmScript method + await scriptManager.disownRealmScript("realmId", "handles"); + console.log("disownRealmScript method passed"); + + // Test disownBrowsingContextScript method + await scriptManager.disownBrowsingContextScript("browsingContextId", "handles", "sandbox"); + console.log("disownBrowsingContextScript method passed"); + + // Test callFunctionInRealm method + await scriptManager.callFunctionInRealm( + "realmId", + "functionDeclaration", + "awaitPromise", + "argumentValueList", + "thisParameter", + "resultOwnership", + ); + console.log("callFunctionInRealm method passed"); + + // Test callFunctionInBrowsingContext method + await scriptManager.callFunctionInBrowsingContext( + "browsingContextId", + "functionDeclaration", + "awaitPromise", + "argumentValueList", + "thisParameter", + "resultOwnership", + "sandbox", + ); + console.log("callFunctionInBrowsingContext method passed"); + + // Test evaluateFunctionInRealm method + await scriptManager.evaluateFunctionInRealm("realmId", "expression", "awaitPromise", "resultOwnership"); + console.log("evaluateFunctionInRealm method passed"); + + // Test evaluateFunctionInBrowsingContext method + await scriptManager.evaluateFunctionInBrowsingContext( + "browsingContextId", + "expression", + "awaitPromise", + "resultOwnership", + "sandbox", + ); + console.log("evaluateFunctionInBrowsingContext method passed"); + + // Test addPreloadScript method + await scriptManager.addPreloadScript("functionDeclaration", "argumentValueList", "sandbox"); + console.log("addPreloadScript method passed"); + + // Test removePreloadScript method + await scriptManager.removePreloadScript("script"); + console.log("removePreloadScript method passed"); + + // Test getCallFunctionParams method + scriptManager.getCallFunctionParams( + "targetType", + "id", + "sandbox", + "functionDeclaration", + "awaitPromise", + "argumentValueList", + "thisParameter", + "resultOwnership", + ); + console.log("getCallFunctionParams method passed"); + + // Test getEvaluateParams method + scriptManager.getEvaluateParams("targetType", "id", "sandbox", "expression", "awaitPromise", "resultOwnership"); + console.log("getEvaluateParams method passed"); + + // Test createEvaluateResult method + scriptManager.createEvaluateResult({ result: { type: "SUCCESS", realm: "realmId", result: {} } }); + console.log("createEvaluateResult method passed"); + + // Test realmInfoMapper method + scriptManager.realmInfoMapper([]); + console.log("realmInfoMapper method passed"); + + // Test getAllRealms method + await scriptManager.getAllRealms(); + console.log("getAllRealms method passed"); + + // Test getRealmsByType method + await scriptManager.getRealmsByType("type"); + console.log("getRealmsByType method passed"); + + // Test getRealmsInBrowsingContext method + await scriptManager.getRealmsInBrowsingContext("browsingContext"); + console.log("getRealmsInBrowsingContext method passed"); + + // Test getRealmsInBrowsingContextByType method + await scriptManager.getRealmsInBrowsingContextByType("browsingContext", "type"); + console.log("getRealmsInBrowsingContextByType method passed"); + } catch (err) { + assert(false, err.message); + } +} + +TestScriptManager(); From 8c696d1396cf8613cbc573214adca27556fbfbc5 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Dec 2023 11:28:19 +0100 Subject: [PATCH 205/519] infra: Fix `pnpm run test` (#67793) --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 11596dffc39897..e933bcd87dfd08 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,8 @@ "test-all": "node --enable-source-maps node_modules/@definitelytyped/dtslint-runner/ --path .", "clean": "node scripts/remove-empty.js", "clean-node-modules": "node scripts/clean-node-modules.js", - "test": "node --enable-source-maps node_modules/@definitelytyped/dtslint/ types/relationship.js", - "lint": "node --enable-source-maps node_modules/@definitelytyped/dtslint/ types/relationship.js", + "test": "node --enable-source-maps node_modules/@definitelytyped/dtslint/ types", + "lint": "node --enable-source-maps node_modules/@definitelytyped/dtslint/ types", "prettier": "prettier" }, "devDependencies": { From 44f7ef84f8746ff679abd187faa5b37c76e30a84 Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Wed, 6 Dec 2023 11:50:17 +0100 Subject: [PATCH 206/519] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67771=20[k?= =?UTF-8?q?6]=20Add=20type=20annotations=20for=20version=20v0.48.0=20=20by?= =?UTF-8?q?=20@olegbespalov?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump k6 v0.48 * Add browser.closeContext() method * Update the reference to a link for clearPermissions * Add example for clearPermissions * Update the reference to a link for grantPermissions * Add example to grantPermissions * Update browserContext.waitForEvent This now reflects the latest changes in the k6 browser module, where the method has been updated to return a promise, and also to only accept a page event (for now). * Update browserContext.waitForEvent tests * Add definition for page.throttleCPU This adds the type definitions for page.throttleCPU and the tests for it. This is part of the k6 browser module. * Add definitions for page.throttleNetwork This adds type definitions for page.throttleNetwork and its tests. This is part of the k6 browser module. * Add type definitions for the k6/experimental/fs module * Update types/k6/experimental/fs.d.ts Co-authored-by: Oleg Bespalov * Apply suggestions from code review * Amend redis client constructor type definition * Adds Joan * Switching docs to the grafana * Apply linter fixes --------- Co-authored-by: ka3de Co-authored-by: ankur22 Co-authored-by: oleiade Co-authored-by: Théo Crevon --- types/k6/crypto.d.ts | 56 ++-- types/k6/data.d.ts | 6 +- types/k6/encoding.d.ts | 14 +- types/k6/execution.d.ts | 4 +- types/k6/experimental/browser.d.ts | 152 ++++++++-- types/k6/experimental/fs.d.ts | 102 +++++++ types/k6/experimental/grpc.d.ts | 4 +- types/k6/experimental/redis.d.ts | 388 ++++++++++++++++++++------ types/k6/experimental/tracing.d.ts | 6 +- types/k6/experimental/webcrypto.d.ts | 2 +- types/k6/experimental/websockets.d.ts | 26 +- types/k6/global.d.ts | 10 +- types/k6/html.d.ts | 198 ++++++------- types/k6/http.d.ts | 84 +++--- types/k6/index.d.ts | 13 +- types/k6/metrics.d.ts | 10 +- types/k6/net/grpc.d.ts | 4 +- types/k6/options.d.ts | 32 +-- types/k6/package.json | 8 +- types/k6/test/browser.ts | 25 +- types/k6/test/experimental/fs.ts | 45 +++ types/k6/test/redis.ts | 59 +++- types/k6/tsconfig.json | 1 + types/k6/ws.d.ts | 24 +- 24 files changed, 911 insertions(+), 362 deletions(-) create mode 100644 types/k6/experimental/fs.d.ts create mode 100644 types/k6/test/experimental/fs.ts diff --git a/types/k6/crypto.d.ts b/types/k6/crypto.d.ts index cbc1c76d468148..207507db3cd32a 100644 --- a/types/k6/crypto.d.ts +++ b/types/k6/crypto.d.ts @@ -13,7 +13,7 @@ export function randomBytes(size: number): ArrayBuffer; /** * Produce HMAC. - * https://k6.io/docs/javascript-api/k6-crypto/hmac-algorithm-secret-data-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/hmac/ * @param algorithm - Hash algorithm. * @param secret - Shared secret. * @param input - Input data. @@ -31,7 +31,7 @@ export function hmac( /** * Hash with MD4. - * https://k6.io/docs/javascript-api/k6-crypto/md4-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/md4/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns MD4 digest. @@ -42,7 +42,7 @@ export function md4(input: string | ArrayBuffer, outp /** * Hash with MD5. - * https://k6.io/docs/javascript-api/k6-crypto/md5-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/md5/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns MD5 digest. @@ -53,7 +53,7 @@ export function md5(input: string | ArrayBuffer, outp /** * Hash with SHA-1. - * https://k6.io/docs/javascript-api/k6-crypto/sha1-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/sha1/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns SHA-1 digest. @@ -64,7 +64,7 @@ export function sha1(input: string | ArrayBuffer, out /** * Hash with SHA-256. - * https://k6.io/docs/javascript-api/k6-crypto/sha256-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/sha256/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns SHA-256 digest. @@ -75,7 +75,7 @@ export function sha256(input: string | ArrayBuffer, o /** * Hash with SHA-384. - * https://k6.io/docs/javascript-api/k6-crypto/sha384-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/sha384/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns SHA-384 digest. @@ -86,7 +86,7 @@ export function sha384(input: string | ArrayBuffer, o /** * Hash with SHA-512. - * https://k6.io/docs/javascript-api/k6-crypto/sha512-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/sha512/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns SHA-512 digest. @@ -97,7 +97,7 @@ export function sha512(input: string | ArrayBuffer, o /** * Hash with SHA-512/224. - * https://k6.io/docs/javascript-api/k6-crypto/sha512_224-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/sha512_224/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns SHA-512/224 digest. @@ -108,7 +108,7 @@ export function sha512_224(input: string | ArrayBuffe /** * Hash with SHA-512/256. - * https://k6.io/docs/javascript-api/k6-crypto/sha512_256-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/sha512_256/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns SHA-512/256 digest. @@ -119,7 +119,7 @@ export function sha512_256(input: string | ArrayBuffe /** * Hash with RIPEMD-160. - * https://k6.io/docs/javascript-api/k6-crypto/ripemd160-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/ripemd160/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns RIPEMD-160 digest. @@ -130,7 +130,7 @@ export function ripemd160(input: string | ArrayBuffer /** * Create a hashing object. - * https://k6.io/docs/javascript-api/k6-crypto/createhash-algorithm/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/createhash/ * @param algorithm - Hash algorithm. * @returns Hashing object. * @example @@ -139,7 +139,7 @@ export function createHash(algorithm: Algorithm): Hasher; /** * Create an HMAC hashing object. - * https://k6.io/docs/javascript-api/k6-crypto/createhmac-algorithm-secret/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/createhmac/ * @param algorithm - Hash algorithm. * @param secret - Shared secret. * @returns HMAC hashing object. @@ -186,14 +186,14 @@ export type Output = OE extends StringEncoding ? stri /** * Hashing object. - * https://k6.io/docs/javascript-api/k6-crypto/hasher/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/hasher/ */ export abstract class Hasher { protected __brand: never; /** * Add more data to the string we want to create a hash of. - * https://k6.io/docs/javascript-api/k6-crypto/hasher/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/hasher/ * @param input - Data to add. * @example * let hasher = crypto.createHMAC('sha256', 'a secret'); @@ -205,7 +205,7 @@ export abstract class Hasher { /** * Return a digest from the data added so far. - * https://k6.io/docs/javascript-api/k6-crypto/hasher/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/hasher/ * @param outputEncoding - Output encoding. * @returns Digest of data added so far. * @example @@ -219,7 +219,7 @@ export abstract class Hasher { /** * This module provides common hashing functionality available in the GoLang crypto package. - * https://k6.io/docs/javascript-api/k6-crypto/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/ */ declare namespace crypto { /** @@ -235,7 +235,7 @@ declare namespace crypto { /** * Produce HMAC. - * https://k6.io/docs/javascript-api/k6-crypto/hmac-algorithm-secret-data-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/hmac/ * @param algorithm - Hash algorithm. * @param secret - Shared secret. * @param input - Input data. @@ -253,7 +253,7 @@ declare namespace crypto { /** * Hash with MD4. - * https://k6.io/docs/javascript-api/k6-crypto/md4-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/md4/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns MD4 digest. @@ -264,7 +264,7 @@ declare namespace crypto { /** * Hash with MD5. - * https://k6.io/docs/javascript-api/k6-crypto/md5-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/md5/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns MD5 digest. @@ -275,7 +275,7 @@ declare namespace crypto { /** * Hash with SHA-1. - * https://k6.io/docs/javascript-api/k6-crypto/sha1-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/sha1/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns SHA-1 digest. @@ -286,7 +286,7 @@ declare namespace crypto { /** * Hash with SHA-256. - * https://k6.io/docs/javascript-api/k6-crypto/sha256-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/sha256/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns SHA-256 digest. @@ -297,7 +297,7 @@ declare namespace crypto { /** * Hash with SHA-384. - * https://k6.io/docs/javascript-api/k6-crypto/sha384-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/sha384/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns SHA-384 digest. @@ -308,7 +308,7 @@ declare namespace crypto { /** * Hash with SHA-512. - * https://k6.io/docs/javascript-api/k6-crypto/sha512-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/sha512/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns SHA-512 digest. @@ -319,7 +319,7 @@ declare namespace crypto { /** * Hash with SHA-512/224. - * https://k6.io/docs/javascript-api/k6-crypto/sha512_224-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/sha512_224/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns SHA-512/224 digest. @@ -330,7 +330,7 @@ declare namespace crypto { /** * Hash with SHA-512/256. - * https://k6.io/docs/javascript-api/k6-crypto/sha512_256-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/sha512_256/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns SHA-512/256 digest. @@ -341,7 +341,7 @@ declare namespace crypto { /** * Hash with RIPEMD-160. - * https://k6.io/docs/javascript-api/k6-crypto/ripemd160-input-outputencoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/ripemd160/ * @param input - Data to hash. * @param outputEncoding - Output encoding. * @returns RIPEMD-160 digest. @@ -352,7 +352,7 @@ declare namespace crypto { /** * Create a hashing object. - * https://k6.io/docs/javascript-api/k6-crypto/createhash-algorithm/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/createhash/ * @param algorithm - Hash algorithm. * @returns Hashing object. * @example @@ -365,7 +365,7 @@ declare namespace crypto { /** * Create an HMAC hashing object. - * https://k6.io/docs/javascript-api/k6-crypto/createhmac-algorithm-secret/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-crypto/createhmac/ * @param algorithm - Hash algorithm. * @param secret - Shared secret. * @returns HMAC hashing object. diff --git a/types/k6/data.d.ts b/types/k6/data.d.ts index 07fb93b670258a..e0bd08c2f8c63b 100644 --- a/types/k6/data.d.ts +++ b/types/k6/data.d.ts @@ -1,16 +1,16 @@ /** * Given a name and a function that returns an array, the SharedArray constructor returns the same array but sharing the array memory between VUs. - * https://k6.io/docs/javascript-api/k6-data/sharedarray/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-data/sharedarray/ */ export const SharedArray: { /** * Given a name and a function that returns an array, the SharedArray constructor returns the same array but sharing the array memory between VUs. - * https://k6.io/docs/javascript-api/k6-data/sharedarray/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-data/sharedarray/ */ new(name: string, callback: () => []): []; /** * Given a name and a function that returns an array, the SharedArray constructor returns the same array but sharing the array memory between VUs. - * https://k6.io/docs/javascript-api/k6-data/sharedarray/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-data/sharedarray/ */ new(name: string, callback: () => T[]): T[]; }; diff --git a/types/k6/encoding.d.ts b/types/k6/encoding.d.ts index 9fabe85e1fa55d..813cf1875fd653 100644 --- a/types/k6/encoding.d.ts +++ b/types/k6/encoding.d.ts @@ -1,6 +1,6 @@ /** * Base64 decode a string. - * https://k6.io/docs/javascript-api/k6-encoding/b64decode-input-encoding-format/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-encoding/b64decode/ * @param input - The string to base64 decode. * @param encoding - Base64 variant. * @returns The base64 decoded version of the input string in either string or ArrayBuffer format, depending on the `format` parameter. @@ -14,7 +14,7 @@ export function b64decode(input: string, encoding?: Base64Variant): ArrayBuffer; /** * Base64 decode a string. - * https://k6.io/docs/javascript-api/k6-encoding/b64decode-input-encoding-format/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-encoding/b64decode/ * @param input - The string to base64 decode. * @param encoding - Base64 variant. * @param format - If 's' return the data as a string, otherwise an ArrayBuffer object . @@ -28,7 +28,7 @@ export function b64decode(input: string, encoding: Base64Variant, format: "s"): /** * Base64 encode a string. - * https://k6.io/docs/javascript-api/k6-encoding/b64encode-input-encoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-encoding/b64encode/ * @param input - String to encode or ArrayBuffer object. * @param encoding - Base64 variant. * @returns Base64 encoded string. @@ -45,12 +45,12 @@ export type Base64Variant = "std" | "rawstd" | "url" | "rawurl"; /** * The encoding module provides base64 encoding/decoding. - * https://k6.io/docs/javascript-api/k6-encoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-encoding/ */ declare namespace encoding { /** * Base64 decode a string. - * https://k6.io/docs/javascript-api/k6-encoding/b64decode-input-encoding-format/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-encoding/b64decode/ * @param input - The string to base64 decode. * @param encoding - Base64 variant. * @returns The base64 decoded version of the input string in either string or ArrayBuffer format, depending on the `format` parameter. @@ -63,7 +63,7 @@ declare namespace encoding { function b64decode(input: string, encoding?: Base64Variant): ArrayBuffer; /** * Base64 decode a string. - * https://k6.io/docs/javascript-api/k6-encoding/b64decode-input-encoding-format/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-encoding/b64decode/ * @param input - The string to base64 decode. * @param encoding - Base64 variant. * @param format - If 's' return the data as a string, otherwise an ArrayBuffer object . @@ -76,7 +76,7 @@ declare namespace encoding { function b64decode(input: string, encoding: Base64Variant, format: "s"): string; /** * Base64 decode a string. - * https://k6.io/docs/javascript-api/k6-encoding/b64decode-input-encoding/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-encoding/b64decode/ * @param input - Base64 encoded string or ArrayBuffer object. * @param encoding - Base64 variant. * @returns Decoded string. diff --git a/types/k6/execution.d.ts b/types/k6/execution.d.ts index 3471227f7726ff..b410b58384f9b7 100644 --- a/types/k6/execution.d.ts +++ b/types/k6/execution.d.ts @@ -2,7 +2,7 @@ import { Options } from "./options"; /* * The execution module provides information about the current test execution state. - * https://k6.io/docs/javascript-api/k6-execution/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-execution/ */ declare namespace execution { /** @@ -67,7 +67,7 @@ declare namespace execution { const test: { /** * Aborts the test run with the exit code 108. - * https://k6.io/docs/javascript-api/k6-execution/#test + * https://grafana.com/docs/k6/latest/javascript-api/k6-execution/#test * @param input - Aborted message. * @example * import exec from "k6/execution"; diff --git a/types/k6/experimental/browser.d.ts b/types/k6/experimental/browser.d.ts index fff04f4e693a29..2a35011438597d 100644 --- a/types/k6/experimental/browser.d.ts +++ b/types/k6/experimental/browser.d.ts @@ -20,6 +20,40 @@ export type Unboxed = Arg extends [infer A0, infer A1] ? [Unboxed, Unbo : Arg extends object ? { [Key in keyof Arg]: Unboxed } : Arg; +/* + * CPUProfile is the mandatory input to be passed into {@link Page}'s + * `throttleCPU` method. + */ +export interface CPUProfile { + /* + * rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc). + */ + rate: number; +} + +/* + * NetworkProfile is the mandatory input to be passed into {@link Page}'s + * `throttleNetwork` method. + */ +export interface NetworkProfile { + /* + * Minimum latency from request sent to response headers received (ms). + */ + latency: number; + + /* + * Maximal aggregated download throughput (bytes/sec). -1 disables download + * throttling. + */ + download: number; + + /* + * Maximal aggregated upload throughput (bytes/sec). -1 disables upload + * throttling. + */ + upload: number; +} + export interface SelectOptionsObject { /** * Matches by `option.value`. @@ -545,6 +579,12 @@ export const browser: Browser; * `Browser` represents the main web browser instance. */ export interface Browser { + /** + * Closes the current `BrowserContext`. If there is no active + * `BrowserContext`, this method will throw an error. + */ + closeContext(): void; + /** * Returns the current `BrowserContext`. There is a 1-to-1 mapping between * `Browser` and `BrowserContext`. If no `BrowserContext` has been @@ -650,7 +690,10 @@ export interface BrowserContext { cookies(...urls: string[]): Cookie[]; /** - * Clears all permission overrides for the `BrowserContext`. + * Clears all permission overrides for the {@link BrowserContext}. + * ```js + * context.clearPermissions(); + * ``` */ clearPermissions(): void; @@ -660,7 +703,10 @@ export interface BrowserContext { close(): void; /** - * Grants specified permissions to the `BrowserContext`. + * Grants specified permissions to the {@link BrowserContext}. + * ```js + * context.grantPermissions(['geolocation']); + * ``` */ grantPermissions( /** @@ -741,40 +787,55 @@ export interface BrowserContext { /** * Waits for the event to fire and passes its value into the predicate - * function. + * function. Currently the only supported event is 'page' which when used will + * return the new {@link Page} that was created after `waitForEvent` was called. + * + * @example + * ```js + * // Call waitForEvent with a predicate which will return true once at least + * // one page has been created. + * const promise = context.waitForEvent("page", { predicate: page => { + * if (++counter >= 1) { + * return true + * } + * return false + * } }) + * + * // Now we create a page. + * const page = context.newPage() + * + * // Wait for the predicate to pass. + * await promise + * ``` */ waitForEvent( /** - * Name of event to wait for. - * - * NOTE: Currently this argument is disregarded, and waitForEvent will - * always wait for 'close' or 'page' events. + * Name of event to wait for. The only supported event is 'page'. If any + * other value is used an error will be thrown. */ - event: string, + event: "page", /** - * The `Page` or null event data will be passed to it and it must - * return true to continue. + * This is an optional argument. It can either be a predicate function or + * an options object. */ - optionsOrPredicate: { + optionsOrPredicate?: { /** - * Function that will be called when the 'Page' event is emitted. - * The event data will be passed to it and it must return true + * Optional function that will be called when the {@link Page} event is + * emitted. The event data will be passed to it and it must return true * to continue. * - * If `Page` is passed to predicate, this signals that a new page + * If {@link Page} is passed to predicate, this signals that a new page * has been created. - * If null is passed to predicate, this signals that the page is - * closing. */ - predicate: (page: Page | null) => boolean; + predicate?: (page: Page) => boolean; /** - * Maximum time to wait in milliseconds. Pass 0 to disable timeout. - * Defaults to 30000 milliseconds. + * Maximum time to wait in milliseconds. Defaults to 30000 milliseconds or + * the timeout set by setDefaultTimeout on the {@link BrowserContext}. */ timeout?: number; - }, - ): Page | null; + } | ((page: Page) => boolean), + ): Promise; } /** @@ -2992,6 +3053,55 @@ export interface Page { }, ): string; + /** + * Throttles the CPU in Chrome/Chromium to slow it down by the specified + * `rate` in {@link CPUProfile}. {@link CPUProfile} is a mandatory + * input argument. The default `rate` is `1`. + * + * **Usage** + * + * ```js + * page.throttleCPU({ rate: 4 }); + * ``` + */ + throttleCPU(profile: CPUProfile): void; + + /** + * Throttles the network in Chrome/Chromium to slow it down by the specified + * fields in {@link NetworkProfile}. {@link NetworkProfile} is a mandatory + * input argument. + * + * **Usage** + * + * ```js + * page.throttleNetwork({ + * latency: 750, + * download: 250, + * upload: 250, + * }); + * ``` + * + * To work with the most commonly tested network profiles, import `networkProfiles` + * from the browser module. There are three profiles available: + * - `'No Throttling'` (default) + * - `'Fast 3G'` + * - `'Slow 3G'` + * + * **Usage** + * + * ```js + * import { browser, networkProfiles } from 'k6/experimental/browser'; + * ... // redacted + * const context = browser.newContext(); + * const page = context.newPage(); + * + * try { + * page.throttleNetwork(networkProfiles['Slow 3G']); + * ... // redacted + * ``` + */ + throttleNetwork(profile: NetworkProfile): void; + /** * Returns the page's title. */ diff --git a/types/k6/experimental/fs.d.ts b/types/k6/experimental/fs.d.ts new file mode 100644 index 00000000000000..a0c82835b377b7 --- /dev/null +++ b/types/k6/experimental/fs.d.ts @@ -0,0 +1,102 @@ +/** + * The k6 experimental filesystem module provides an API for handling file operations + * in your k6 tests. It allows you to read files within your test scripts. + */ + +/** + * Opens a file and returns a promise that resolves to an instance of the `File` class. + * + * Note: As the k6 init context doesn't support 'await', use the following pattern: + * + * Example: + * ``` + * let fileHandle; + * (async function() { + * fileHandle = await open("example.txt"); + * }()); + * ``` + * + * @param path - The file path as a string. Relative paths are resolved relative to the k6 script. + * @returns Promise - A promise that resolves to a `File` instance. + */ +export function open(path: string): Promise; + +/** + * Represents a file and provides methods to interact with file data. + * This class offers read-only access to file contents. + */ +export class File { + /** + * The absolute path of the file. + * + * This is resolved relative to the k6 script. + */ + path: string; + + /** + * Reads the file into a specified buffer type and returns the number of bytes read. + * Resolves to `null` if there's nothing to read (EOF or empty file). + * + * Example: + * ``` + * const buffer = new Uint8Array(100); + * const bytesRead = await file.read(buffer); + * console.log(`Read ${bytesRead} bytes`); + * ``` + * + * @param p - A Uint8Array buffer to read the file into. + * @returns Promise - Number of bytes read or `null`. + */ + read(p: Uint8Array): Promise; + + /** + * Moves the file pointer to a new location, based on `offset` and `whence`. + * Resolves to the new position within the file (in bytes). + * + * When using `SeekMode.Start`, the offset must be greater than or equal to zero. + * When using `SeekMode.Current`, the offset can be positive or negative. + * When using `SeekMode.End`, the offset must be less than or equal to zero. + * + * Example: + * ``` + * const newOffset = await file.seek(10, SeekMode.Start); + * console.log(`Pointer moved to position ${newOffset}`); + * ``` + * + * @param offset - The offset to seek to. + * @param whence - The position from where offset is added (Start, Current, or End). + * @returns Promise - The new position in the file. + */ + seek(offset: number, whence: SeekMode): Promise; + + /** + * Retrieves information about the file. + * Resolves to a `FileInfo` object describing the file. + * + * Example: + * ``` + * const fileInfo = await file.stat(); + * console.log(`File size: ${fileInfo.size} bytes`); + * ``` + * + * @returns Promise - Information about the file. + */ + stat(): Promise; +} + +/** + * Contains information about a file, including its name and size. + */ +export interface FileInfo { + name: string; // The name of the file + size: number; // The size of the file in bytes +} + +/** + * Enumeration for file seek modes. + */ +export enum SeekMode { + Start = 0, // Seek from the start of the file + Current = 1, // Seek from the current file position. + End = 2, // Seek from the end of the file +} diff --git a/types/k6/experimental/grpc.d.ts b/types/k6/experimental/grpc.d.ts index fdb0da05d816b6..c5baa4c69d9589 100644 --- a/types/k6/experimental/grpc.d.ts +++ b/types/k6/experimental/grpc.d.ts @@ -97,12 +97,12 @@ export interface GrpcError { /** * This module provides classes for Remote Procedure Calls over HTTP/2. - * https://k6.io/docs/javascript-api/k6-experimental/grpc/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/grpc/ */ declare namespace grpc { /** * gRPC client to interact with a gRPC server. - * https://k6.io/docs/javascript-api/k6-experimental/grpc/client/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/grpc/client/ */ class Client { protected __brand: never; diff --git a/types/k6/experimental/redis.d.ts b/types/k6/experimental/redis.d.ts index 4d01a1f927a5a6..611a95008de0fb 100644 --- a/types/k6/experimental/redis.d.ts +++ b/types/k6/experimental/redis.d.ts @@ -2,26 +2,52 @@ * This module provides a redis client allowing users to interact with redis, * directly from their k6 scripts. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/ */ /** - * `Client` is a Redis client to interact with a Redis server or cluster. + * `Client` is a Redis client for interacting with a Redis server or cluster. * - * It exposes a promise-based API, allowing users to interact with Redis in an asynchronous manner. + * This client provides a promise-based API, enabling asynchronous operations with the Redis server. + * It supports a wide range of configurations, including single-node connections, cluster mode, and connections through Redis Sentinel. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client + * The client can be configured either by passing a `RedisClientOptions` object for fine-grained configuration, + * or by using a `RedisConnectionURL` string for simpler setups. + * + * For more information on the k6 Redis module, visit: + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client */ export class Client { protected __brand: never; /** - * Instantiate a new Redis client. + * Creates a new instance of the Redis client. + * + * The client can be configured in two ways: + * 1. By providing an object of `RedisClientOptions`, allowing detailed configuration including + * authentication, connection settings, client behaviors, and cluster or sentinel setups. + * 2. By providing a `RedisConnectionURL` string, suitable for straightforward configurations. + * The URL should follow the format: redis[s]://[[username][:password]@][host][:port][/db-number] + * + * Example usage: + * ``` + * // Using RedisClientOptions + * const client = new Client({ + * socket: { + * host: 'localhost', + * port: 6379 + * }, + * password: 'yourpassword' + * }); * - * @param options - Options. - * @returns instantiated Client + * // Using RedisConnectionURL + * const client = new Client('redis://user:password@localhost:6379/0'); + * ``` + * + * @param options - The configuration options for the client, either as a `RedisClientOptions` object or a `RedisConnectionURL` string. + * @returns The instantiated Redis client. */ - constructor(options: Options); + constructor(options: RedisClientOptions | RedisConnectionURL); /** * Sets the value of a key, with a time to live (ttl) value equal to @@ -29,7 +55,7 @@ export class Client { * * If the key already exists, it is overwritten. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-set + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-set * * @param key - key to set * @param value - value to set @@ -41,7 +67,7 @@ export class Client { /** * Gets the value of a key. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-get + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-get * * @param key - key to get * @returns a promise that resolves to the value of the key. @@ -52,7 +78,7 @@ export class Client { * Atomically sets the value of a key and returns the value * previously stored at that key. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-getset + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-getset * * @param key - key to get and set * @param value - value to set @@ -65,7 +91,7 @@ export class Client { * * A key is ignored if it does not exist. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-del + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-del * * @param keys - keys to delete * @returns a promise that resolves to the number of keys that were removed. @@ -75,7 +101,7 @@ export class Client { /** * Get the value of a key and delete it. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-getdel + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-getdel * * @param key - the key to get and delete * @returns a promise that resolves to the value of the key that was deleted. @@ -85,7 +111,7 @@ export class Client { /** * Returns the number of the provided keys arguments that exist. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-exists + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-exists * * @param keys - the keys to check the existence of * @returns a promise that resolves to the number of keys that exist. @@ -98,7 +124,7 @@ export class Client { * If the key does not exist, it is set to 0 before performing the operation. * If the key exists but cannot be treated as a number, the returned promise will be rejected. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-incr + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-incr * * @param key - key to increment the value of * @returns a promise that resolves to the value of the key after the increment. @@ -111,7 +137,7 @@ export class Client { * If the key does not exist, it is set to 0 before performing the operation. * If the key exists but cannot be treated as a number, the returned promise will be rejected. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-incrby + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-incrby * * @param key - key to increment the value of * @param increment - amount to increment the value of the key by @@ -125,7 +151,7 @@ export class Client { * If the key does not exist, it is set to 0 before performing the operation. * If the key exists but cannot be treated as a number, the returned promise will be rejected. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-decr + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-decr * * @param key - key to decrement the value of * @returns a promise that resolves to the value of the key after the decrement. @@ -138,7 +164,7 @@ export class Client { * If the key does not exist, it is set to 0 before performing the operation. * If the key exists but cannot be treated as a number, the returned promise will be rejected. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-decrby + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-decrby * * @param key - key to decrement the value of * @param decrement - amount to decrement the value of the key by @@ -151,7 +177,7 @@ export class Client { * * If the database is empty, the returned promise will be rejected. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-randomkey + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-randomkey * * @returns a promise that resolves to a random key. */ @@ -160,7 +186,7 @@ export class Client { /** * Returns the values of all the specified keys. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-mget + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-mget * * @param keys - the keys to get the values of * @returns a promise that resolves to an array of the values of the keys. @@ -173,7 +199,7 @@ export class Client { * Calling expire with a non-positive timeout value will result in the being deleted rather * than expired. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-expire + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-expire * * @param key - key to set the time to live of * @param seconds - value to set the time to live of the key to (in seconds) @@ -184,7 +210,7 @@ export class Client { /** * Returns the remaining time to live of a key that has a timeout. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-ttl + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-ttl * * @param key - the key to get the time to live of * @returns a promise that resolves to the time to live of the key, in seconds. @@ -194,7 +220,7 @@ export class Client { /** * Removes the existing timeout on a key. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-persist + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-persist * * @param key - the key to remove the timeout of. * @returns a promise that resolves to true if the operation succeeded, false otherwise. @@ -206,7 +232,7 @@ export class Client { * * If the key exists but does not hold a list, the returned promise will be rejected. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-lpush + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-lpush * * @param key - key holding the list to prepend to * @param values - values to prepend to the list @@ -219,7 +245,7 @@ export class Client { * * If the key exists but does not hold a list, the returned promise will be rejected. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-rpush + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-rpush * * @param key - key holding the list to append to * @param values - values to append to the list @@ -230,7 +256,7 @@ export class Client { /** * Removes and returns the value at the head of the list stored at key. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-lpop + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-lpop * * @param key - key holding the list to pop the head of * @returns a promise that resolves to the value that was popped. @@ -240,7 +266,7 @@ export class Client { /** * Removes and returns the value at the tail of the list stored at key. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-rpop + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-rpop * * @param key - key holding the list to pop the tail of * @returns a promise that resolves to the value that was popped. @@ -253,7 +279,7 @@ export class Client { * The offsets are zero-based. These offsets can be negative numbers indicating * offsets starting at the end of the list. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-lrange + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-lrange * * @param key - key holding the list to get the range of * @param start - index of the first element to return @@ -268,7 +294,7 @@ export class Client { * The offsets are zero-based. These offsets can be negative numbers indicating * offsets starting at the end of the list. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-lindex + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-lindex * * @param key - key holding the list to get the element of * @param index - index of the element to get @@ -279,7 +305,7 @@ export class Client { /** * Sets the value of an element in the list stored at key to new value. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-lset + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-lset * * @param key - key holding the list to set the element of * @param index - index of the element to set @@ -295,7 +321,7 @@ export class Client { * If the `count` is 0, all occurrences of `value` are removed. * If the `count` is negative, elements are removed from the tail of the list (from right to left). * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-lrem + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-lrem * * @param key - key holding the list to remove the element of * @param count - the number of elements matching the value to remove @@ -309,7 +335,7 @@ export class Client { * * If the key does not exist, it is interpreted as an empty list and 0 is returned. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-llen + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-llen * * @param key - key holding the list to get the length of * @returns a promise that resolves to the length of the list. @@ -322,7 +348,7 @@ export class Client { * If the key does not exist, a new key holding a hash is created. * If the field already exists, it is overwritten. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-hset + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-hset * * @param key - key holding the hash to set the field's value of * @param field - field to set the value of @@ -337,7 +363,7 @@ export class Client { * If the key does not exist, a new key holding a hash is created. * If the field already exists, the returned promise will be rejected. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-hsetnx + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-hsetnx * * @param key - key holding the hash to set the field's value of * @param field - field to set the value of @@ -349,7 +375,7 @@ export class Client { /** * Returns the value of the specified hash field. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-hget + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-hget * * @param key - key holding the hash to get the field's value of * @param field - field to get the value of @@ -360,7 +386,7 @@ export class Client { /** * Deletes the specified fields from the hash stored at key. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-hdel + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-hdel * * @param key - key holding the hash to delete the fields of * @param fields - fields to delete from the hash @@ -371,7 +397,7 @@ export class Client { /** * Returns all fields and values of the hash stored at key. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-hgetall + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-hgetall * * @param key - the key holding the hash to get the fields of * @returns a promise that resolves to an object of field/value pairs. @@ -381,7 +407,7 @@ export class Client { /** * Returns all fields of the hash stored at key. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-hkeys + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-hkeys * * @param key - the key holding the hash to get the fields of * @returns a promise that resolves to an array of field names. @@ -391,7 +417,7 @@ export class Client { /** * Returns all values of the hash stored at key. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-hvals + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-hvals * * @param key - the key holding the hash to get the fields' values of * @returns a promise that resolves to an array of field values. @@ -401,7 +427,7 @@ export class Client { /** * Return the number of fields contained in the hash stored at key. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-hlen + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-hlen * * @param key - the key holding the hash to get the number of fields of * @returns a promise that resolves to the number of fields in the hash. @@ -415,7 +441,7 @@ export class Client { * If the field does not exist, it is set to 0 before the operation is performed. * If the field does not hold a nummerical value, the returned promise will be rejected. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-hincrby + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-hincrby * * @param key - the key holding the hash to get the number of fields of * @param field - the hash's field to increment the value of @@ -430,7 +456,7 @@ export class Client { * Specified elements that are already a member of the set are ignored. * If the key does not exist, a new set is created before adding the specified elements. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-sadd + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-sadd * * @param key - the key holding the set to add a member to * @param members - the members to add to the set @@ -444,7 +470,7 @@ export class Client { * Specified members that are not a member of this set are ignored. * If key does not exist, it is treated as an empty set and this command returns 0. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-srem + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-srem * * @param key - the key holding the set to remove a member from * @param members - the members to remove from the set @@ -455,7 +481,7 @@ export class Client { /** * Returns whether or not the specified member is a member of the set stored at key. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-sismembers + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-sismember * * @param key - the key holding the set to check the belonging of * @param member - the member to check the belonging of @@ -466,7 +492,7 @@ export class Client { /** * Returns the members of the set stored at key. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-smembers + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-smembers * * @param key - the key holding the set to get the members of * @returns a promise that resolves to an array of members in the set. @@ -476,7 +502,7 @@ export class Client { /** * Returns a random member of the set value stored at key. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-srandmember + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-srandmember * * @param key - the key holding the set to get the random member of * @returns a promise that resolves to a random member of the set. @@ -486,7 +512,7 @@ export class Client { /** * Pops a random member from the set stored at key. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/client/client-spop + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/redis/client/client-spop * * @param key - the key holding the set to pop the random member of * @returns a promise that resolves to the popped member. @@ -495,114 +521,296 @@ export class Client { } /** - * Options for configuring the redis Client. + * Represents a Redis connection URL. + * The URL follows the format: redis[s]://[[username][:password]@][host][:port][/db-number] + * + * - `RedisProtocol` indicates the protocol used ('redis' for standard connections, 'rediss' for secure TLS connections). + * - `RedisUserInfo` optionally includes the username and password for authentication. + * - The `host` is the IP address or hostname of the Redis server. + * - `RedisPort` is the port on which the Redis server is listening (optional, defaults to 6379 if not specified). + * - `RedisDbNumber` specifies a particular database number to connect to (optional). + */ +export type RedisConnectionURL = `${RedisProtocol}://${RedisUserInfo}${string}${RedisPort}${RedisDbNumber}`; + +/** + * Represents the protocol part of a Redis URL. + * - `redis`: Standard, non-encrypted connections. + * - `rediss`: Secure connections using TLS. + */ +export type RedisProtocol = "redis" | "rediss"; + +/** + * Represents the user authentication information part of a Redis URL. + * Formats: + * - `username:password@`: Both username and password are provided for authentication. + * - `username@`: Only username is provided, no password. + * - `"": No authentication information is included. + */ +export type RedisUserInfo = `${string}:${string}@` | `${string}@` | ""; + +export type RedisHost = string; + +/** + * Represents the port part of a Redis URL. + * - `:number`: The port number on which the Redis server is listening. + * - `"": No port is specified, implying the default port (usually 6379). + */ +export type RedisPort = `:${number}` | ""; + +/** + * Represents the database number part of a Redis URL. + * - `/${number}`: Specifies the database number to connect to. + * - `"": No database number is specified, implying the default database (usually 0). + */ +export type RedisDbNumber = `/${number}` | ""; + +/** + * Represents the configuration options for a Redis client. * - * https://k6.io/docs/javascript-api/k6-experimental/redis/options + * These options define how the client connects to and interacts with a Redis server or cluster, + * including authentication, connection settings, and specific Redis features. */ -export interface Options { +export interface RedisClientOptions { /** - * Array of addresses in the 'host:port' defining which connect Redis to connect to. - * Supplying a single entry would connect the client to a single Redis instance. - * Supplying multiple entries would connect the client to a cluster/sentinel nodes. + * Socket connection options for the Redis client. + * + * This includes the host, port, and other socket-level settings such as timeouts and TLS configuration. */ - addrs: string[]; + socket: SocketOptions; /** - * The id of the database to be selected after connecting to the server. - * Only used when connecting to a single-node use. + * Optional username for client authentication. + * + * This is used when the Redis server is configured with ACLs (Access Control Lists), + * requiring a username for authentication in addition to a password. */ - db?: number; + username?: string; /** - * Username to authenticate the client connection with. + * Optional password for client authentication. + * + * If the Redis server is secured with a password, this must be provided to establish a connection. */ - username?: number; + password?: string; /** - * Password to authenticate the client connection with. + * Optional name to assign to the client connection. + * + * This can be used for identifying and tracking connections on the Redis server. + * It's useful for debugging and monitoring purposes. */ - password?: number; + clientName?: string; /** - * Username to authenticate the client connection with when connecting to a sentinel. + * The ID of the database to be selected after connecting to the Redis server. + * + * Redis supports multiple databases (numbered from 0), allowing separate datasets on the same server instance. + * This option is typically used when connecting to a single-node setup. */ - sentinelUsername?: number; + database?: number; /** - * Password to authenticate the client connection with when connecting to a sentinel. + * The name of the master instance to connect to when using Redis Sentinel. + * + * Sentinel manages failover in a Redis deployment, and specifying a master name allows the client to connect to the current master. + * This option is required when connecting through Redis Sentinel. */ - sentinelPassword?: number; + masterName?: string; /** - * The name of the master to connect to when connecting to a Redis cluster. + * Optional username for client authentication with Redis Sentinel. + * + * If the Sentinel servers are secured with ACLs, this username is used for authentication. */ - masterName?: number; + sentinelUsername?: string; /** - * The maximum number of retries to attempt when connecting to a Redis server before giving up. + * Optional password for client authentication with Redis Sentinel. + * + * If the Sentinel servers are secured with a password, it must be provided to connect successfully. */ - maxRetries?: number; + sentinelPassword?: string; /** - * The minimum amount of time to wait between retries when connecting to a Redis server. + * Optional configuration for connecting to a Redis Cluster. + * + * If the client is connecting to a Redis Cluster, this option provides cluster-specific settings such as node addresses and routing options. */ - minRetryBackoff?: number; + cluster?: ClusterOptions; +} +/** + * Represents the configuration options for a socket connection to a Redis server. + * + * These options allow fine-tuning of the connection properties, timeouts, and TLS settings. + */ +export interface SocketOptions { /** - * The maximum amount of time to wait between retries when connecting to a Redis server. + * The IP address or hostname of the Redis server. + * This should be a valid, resolvable address or hostname used to establish the connection. */ - maxRetryBackoff?: number; + host: string; /** - * The maximum amount of time to wait for a connection to a Redis server to be established. + * The port number on which the Redis server is listening. + * + * If omitted, a default port (typically 6379 for Redis) will be used. + */ + port?: number; + + /** + * Optional configuration for TLS (Transport Layer Security). + * + * This is used to establish a secure, encrypted connection to the Redis server. + * If provided, the connection will use TLS; otherwise, it will be a regular, non-encrypted connection. + */ + tls?: TLSOptions; + + /** + * The maximum amount of time, in milliseconds, to wait for a connection attempt to the Redis server to succeed. + * + * If the connection is not established within this time frame, the attempt will be aborted. + * This helps in avoiding long waits if the server is not reachable. */ dialTimeout?: number; /** - * The maximum amount of time to wait for socket reads to succeed. - * Use `-1` for no timeout. + * The maximum amount of time, in milliseconds, the client will wait for a read operation to complete. + * + * A value of `-1` indicates no timeout, meaning the client will wait indefinitely. + * Setting a read timeout can prevent indefinitely blocking operations if the server becomes unresponsive. */ readTimeout?: number; /** - * The maximum amount of time to wait for a socket write to succeed. - * Use `-1` for no timeout. + * The maximum amount of time, in milliseconds, the client will wait for a write operation to complete. + * + * A value of `-1` indicates no timeout, allowing the client to wait indefinitely. + * Similar to readTimeout, this can prevent blocking in case of server issues. */ writeTimeout?: number; /** - * The maximum number of socket connections to keep open in the connection pool. + * The maximum number of socket connections that can be kept open in the pool. + * A larger pool size can handle more concurrent connections, but also uses more resources. */ poolSize?: number; /** - * The minimum number of idle connections to keep open in the connection pool. + * The minimum number of idle connections that the pool maintains for faster access. + * + * Keeping some connections idle can improve performance by avoiding the need to establish new connections. */ minIdleConns?: number; /** - * The maximum number of idle connections to keep open in the connection pool. - */ - maxIdleConns?: number; - - /** - * The maximum amount of time a connection can be idle in the connection pool before being closed. + * The maximum amount of time, in milliseconds, a connection can stay idle in the pool before being closed. + * + * This can help in cycling connections and preventing stale connections. */ maxConnAge?: number; /** - * The maximum amount of time to wait for a connection to the Redis server to be returned from the pool. + * The maximum amount of time, in milliseconds, to wait for a connection from the pool. + * + * If no connections are available within this time frame, the request for a connection will fail. + * This prevents indefinite blocking when all connections are in use. */ poolTimeout?: number; /** - * The maximum amount of time the client waits for a connection to become active before timing out. + * The maximum amount of time, in milliseconds, a connection can be idle in the pool before being considered for closure. + * + * This helps in keeping the pool fresh and closing unused connections. */ idleTimeout?: number; /** - * The frequency at which the client checks for idle connections in the connection pool. - * Use `-1` to disable the checks. + * The frequency, in milliseconds, at which the client checks for idle connections in the pool. + * + * A value of `-1` disables these checks. Regularly checking for idle connections helps in maintaining a healthy connection pool. */ idleCheckFrequency?: number; } + +/** + * Represents the options for configuring TLS (Transport Layer Security) for a Redis connection. + * This configuration is essential for establishing a secure connection using SSL/TLS, + * which ensures data is encrypted during transmission. + */ +export interface TLSOptions { + /** + * Specifies one or multiple Certificate Authority (CA) certificates to use for validating the server certificate. + * + * The CA certificates are essential for ensuring that the server's certificate is issued by a trusted authority. + * This is an array of ArrayBuffer, where each ArrayBuffer represents a CA certificate in a binary format. + */ + ca: ArrayBuffer[]; + + /** + * An optional client certificate used for mutual TLS authentication. + * + * Providing a client certificate is part of mutual TLS (mTLS), where both the client and the server authenticate each other. + * This property should be an ArrayBuffer representing the client's certificate in a binary format. + * If this property is omitted, the client will not use a certificate for authentication. + */ + cert?: ArrayBuffer; + + /** + * An optional private key associated with the client certificate. + * + * This key is required if a client certificate is provided (via the `cert` property). + * The private key must correspond to the public key in the client certificate and should be in a binary format represented by an ArrayBuffer. + * If this property is omitted but a client certificate is provided, the connection attempt will fail due to the lack of a corresponding private key. + */ + key?: ArrayBuffer; +} + +/** + * Represents the configuration options for a Redis Cluster client. + * + * These options define the behavior of the client when connecting to and interacting with a Redis Cluster. + */ +export interface ClusterOptions { + /** + * The maximum number of redirects the client will follow when a command is redirected. + * + * In a Redis Cluster, certain commands may be redirected to other nodes. This option limits the number of such redirections. + * If this value is not set, a default value (typically defined by the client library) will be used. + */ + maxRedirects?: number; + + /** + * Determines if the client operates in read-only mode. + * + * When set to true, the client sends read commands to replica nodes, potentially improving read scalability. + * This is useful in a cluster setup where you want to distribute read operations across multiple replicas. + */ + readOnly?: boolean; + + /** + * Enables routing read commands by latency. + * + * when true, the client attempts to route read commands to the node with the lowest latency. + * This can optimize read performance by utilizing the fastest available node. + */ + routeByLatency?: boolean; + + /** + * Enables random routing for read commands. + * + * When true, read commands are sent to random nodes in the cluster, potentially distributing the load more evenly. + * This can be beneficial in scenarios where distributing read operations evenly is more important than routing based on latency. + */ + routeRandomly?: boolean; + + /** + * A list of nodes in the Redis Cluster. + * + * This can either be a list of connection URLs or a list of socket options for each node. + * The client uses this list to initially connect to the cluster and discover other nodes. + * + * Each node can be specified as a `RedisConnectionURL` string (e.g., 'redis://host:port') or as a `SocketOptions` object defining host and port. + */ + nodes: RedisConnectionURL[] | SocketOptions[]; +} diff --git a/types/k6/experimental/tracing.d.ts b/types/k6/experimental/tracing.d.ts index e3bb224a9cfd23..8566083b4ff6f0 100644 --- a/types/k6/experimental/tracing.d.ts +++ b/types/k6/experimental/tracing.d.ts @@ -5,7 +5,7 @@ * function calls with tracing information. It also exposes a `Client` class that can be used to * instrument HTTP calls in a more fine-grained way. * - * https://k6.io/docs/javascript-api/k6-experimental/tracing/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/tracing/ */ import { RefinedParams, RefinedResponse, RequestBody, ResponseType } from "../http"; @@ -30,7 +30,7 @@ export function instrumentHTTP(options: Options): void; * so that tracing backends (such as Grafana Tempo) can incorporate * their results. * - * https://k6.io/docs/javascript-api/k6-experimental/tracing/client/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/tracing/client/ */ export class Client { protected __brand: never; @@ -176,7 +176,7 @@ export class Client { /** * The Options object allows configuring the tracing instrumentation behavior. * - * https://k6.io/docs/javascript-api/k6-experimental/tracing/options/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/tracing/options/ */ export interface Options { /** diff --git a/types/k6/experimental/webcrypto.d.ts b/types/k6/experimental/webcrypto.d.ts index 0435e4ba877e20..45c30b8f065825 100644 --- a/types/k6/experimental/webcrypto.d.ts +++ b/types/k6/experimental/webcrypto.d.ts @@ -2,7 +2,7 @@ * This module provides a subset of the Web Crypto API. It is an interface * allowing a k6 script to use cryptographic primitives. * - * https://k6.io/docs/javascript-api/k6-experimental/webcrypto/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/webcrypto/ */ export const crypto: Crypto; diff --git a/types/k6/experimental/websockets.d.ts b/types/k6/experimental/websockets.d.ts index 045e38337fa0a7..974e1848ed78ce 100644 --- a/types/k6/experimental/websockets.d.ts +++ b/types/k6/experimental/websockets.d.ts @@ -4,7 +4,7 @@ import { CookieJar } from "../http"; * This module provides an experimental implementation of the WebSocket API * for k6. * - * https://k6.io/docs/javascript-api/k6-experimental/websockets/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/ */ /** @@ -41,7 +41,7 @@ export class WebSocket { /** * The Websocket constructor returns a newly created WebSocket object. - * https://k6.io/docs/javascript-api/k6-experimental/websockets/websocket/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/ * * @param url - The URL to which to connect; this should be the URL to which the WebSocket server will respond. * @param protocols - Either a single protocol string or an array of protocol strings. The param is reserved for future use and will be presently ignored. @@ -51,7 +51,7 @@ export class WebSocket { /** * Enqueues data to be transmitted to the server over the WebSocket connection. - * https://k6.io/docs/javascript-api/k6-experimental/websockets/websocket/websocket-send/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-send/ * * @param data - the data to send to the server */ @@ -60,7 +60,7 @@ export class WebSocket { /** * Bind event names to event handlers to be executed when their * respective event is received by the server. - * https://k6.io/docs/javascript-api/k6-experimental/websockets/websocket/websocket-addeventlistener/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-addeventlistener/ * * @param event - the event to listen for * @param listener - the callback to invoke when the event is emitted @@ -69,7 +69,7 @@ export class WebSocket { /** * Closes the WebSocket connection or connection attempt, if any. - * https://k6.io/docs/javascript-api/k6-experimental/websockets/websocket/websocket-close/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-close/ * * @param code - An integer WebSocket connection close code value indicating a reason for closure. * @param reason - A human-readable string WebSocket connection close reason. No longer than 123 bytes of UTF-8 text. @@ -78,13 +78,13 @@ export class WebSocket { /** * Sends a ping message over the WebSocket connection. - * https://k6.io/docs/javascript-api/k6-experimental/websockets/websocket/websocket-ping/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-ping/ */ ping(): void; /** * Sets an event handler which is invoked when a message event happens. - * https://k6.io/docs/javascript-api/k6-experimental/websockets/websocket/websocket-onmessage/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-onmessage/ * * @param event - the message event */ @@ -92,19 +92,19 @@ export class WebSocket { /** * Sets an event handler which is invoked when the WebSocket connection's opens. - * https://k6.io/docs/javascript-api/k6-experimental/websockets/websocket/websocket-onopen/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-onopen/ */ onopen: () => void; /** * Sets an event handler which is invoked when the WebSocket connection's closes. - * https://k6.io/docs/javascript-api/k6-experimental/websockets/websocket/websocket-onclose/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-onclose/ */ onclose: () => void; /** * Sets an event handler which is invoked when errors occur. - * https://k6.io/docs/javascript-api/k6-experimental/websockets/websocket/websocket-onerror/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-onerror/ * * @param event - the error event */ @@ -112,20 +112,20 @@ export class WebSocket { /** * Sets an event handler which is invoked when a ping message is received. - * https://k6.io/docs/javascript-api/k6-experimental/websockets/websocket/websocket-onping/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-onping/ */ onping: () => void; /** * Sets an event handler which is invoked when a pong message is received. - * https://k6.io/docs/javascript-api/k6-experimental/websockets/websocket/websocket-onpong/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-onpong/ */ onpong: () => void; } /** * k6 specific WebSocket parameters. - * https://k6.io/docs/javascript-api/k6-experimental/websockets/params/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/params/ */ export interface Params { /** Request headers. */ diff --git a/types/k6/global.d.ts b/types/k6/global.d.ts index 90649757e73715..0a8089b98300a0 100644 --- a/types/k6/global.d.ts +++ b/types/k6/global.d.ts @@ -17,7 +17,7 @@ declare global { /** * Opens a file, reading all its contents into memory. - * https://k6.io/docs/javascript-api/init-context/open-filepath-mode/ + * https://grafana.com/docs/k6/latest/javascript-api/init-context/open/ * @param filePath - Path to file. * @returns File contents decoded as UTF-8. * @example @@ -35,7 +35,7 @@ declare global { /** * Opens a file, reading all its contents into memory. - * https://k6.io/docs/javascript-api/init-context/open-filepath-mode/ + * https://grafana.com/docs/k6/latest/javascript-api/init-context/open/ * @param filePath - Path to file. * @returns Binary file contents. * @example @@ -56,7 +56,7 @@ declare global { /** * Environment variables. - * https://k6.io/docs/using-k6/environment-variables/ + * https://grafana.com/docs/k6/latest/using-k6/environment-variables/ */ const __ENV: { [name: string]: string }; @@ -65,13 +65,13 @@ declare global { /** * Current VU number. - * https://k6.io/docs/using-k6/execution-context-variables/ + * https://grafana.com/docs/k6/latest/using-k6/execution-context-variables/ */ const __VU: number; /** * Current iteration number. - * https://k6.io/docs/using-k6/execution-context-variables/ + * https://grafana.com/docs/k6/latest/using-k6/execution-context-variables/ */ const __ITER: number; } diff --git a/types/k6/html.d.ts b/types/k6/html.d.ts index 82a2ac89f5375e..a4069b0f0133ca 100644 --- a/types/k6/html.d.ts +++ b/types/k6/html.d.ts @@ -1,6 +1,6 @@ /* * HTML parsing and access. - * https://k6.io/docs/javascript-api/k6-html/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/ */ // === Main === @@ -18,14 +18,14 @@ export function parseHTML(html: string): Selection; /** * Represents a set of nodes in a DOM tree. - * https://k6.io/docs/javascript-api/k6-html/selection/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/ */ export abstract class Selection { protected __brand: never; /** * Get the value of an attribute for the first element in the Selection. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-attr-name/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-attr/ * @param name - Name of attribute to get. * @returns Attribute value. */ @@ -34,7 +34,7 @@ export abstract class Selection { /** * Get the children of each element in the set of matched elements, * optionally filtered by a selector. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-children-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-children/ * @param selector - Selector expression. * @returns Selected children. */ @@ -44,7 +44,7 @@ export abstract class Selection { * For each element in the set, get the first element that matches the * selector by testing the element itself and traversing up through its * ancestors in the DOM tree. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-closest-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-closest/ * @param selector - Selector expression. * @returns Selected nodes. */ @@ -53,7 +53,7 @@ export abstract class Selection { /** * Get the children of each element in the set of matched elements, * including text and comment nodes. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-contents/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-contents/ * @returns Selected nodes. */ contents(): Selection; @@ -61,7 +61,7 @@ export abstract class Selection { /** * Return the value at the named data store for the first element in the * set of matched elements. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-data-key/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-data/ * @param key - A string naming the piece of data to set.\ * @returns The value at the named data store. */ @@ -70,14 +70,14 @@ export abstract class Selection { /** * Iterate over a Selection (k6/html), executing a function for each * matched element. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-each-fn/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-each/ * @param handler - Logic to execute for each element. */ each(handler: Handler): void; /** * Reduce the set of matched elements to the one at the specified index. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-eq-index/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-eq/ * @param index - An integer indicating the 0-based position of the element. * @returns Unary set of selected element. */ @@ -86,7 +86,7 @@ export abstract class Selection { /** * Reduce the set of matched elements to those that match the selector * or pass the function's test. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-filter-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-filter/ * @param selector - Selector expression. * @returns Selected elements. */ @@ -95,7 +95,7 @@ export abstract class Selection { /** * Reduce the set of matched elements to those that match the selector * or pass the function's test. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-filter-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-filter/ * @param selector - A function used as a test for each element in the set. * @returns Selected elements. */ @@ -104,7 +104,7 @@ export abstract class Selection { /** * Reduce the set of matched elements to those that match the selector * or pass the function's test. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-filter-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-filter/ * @param selector - A selection to match elements against. * @returns Selected elements. */ @@ -112,7 +112,7 @@ export abstract class Selection { /** * Find the selection descendants, filtered by a selector. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-find-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-find/ * @param selector - Selector expression. * @returns Selected elements. */ @@ -120,14 +120,14 @@ export abstract class Selection { /** * Reduce the set of matched elements to the first. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-first/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-first/ * @returns Unary set of first element. */ first(): Selection; /** * Retrieve the element matched by the selector. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-get-index/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-get/ * @param index - A zero-based integer indicating which element to retrieve. * @returns Selected element. */ @@ -136,7 +136,7 @@ export abstract class Selection { /** * Reduce the set of matched elements to those that have a descendant that * matches the selector. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-has-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-has/ * @param selector - Selector expression. * @returns Selected elements. */ @@ -144,7 +144,7 @@ export abstract class Selection { /** * Get the HTML contents of the first element. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-html/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-html/ * @returns The HTML content of the first element. */ html(): string | undefined; @@ -153,7 +153,7 @@ export abstract class Selection { * Check the current matched set of elements against a selector or element * and return true if at least one of these elements matches the given * arguments. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-is-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-is/ * @param selector - Selector expression. * @returns Whether selector matched at least one element. */ @@ -163,7 +163,7 @@ export abstract class Selection { * Check the current matched set of elements against a selector or element * and return true if at least one of these elements matches the given * arguments. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-is-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-is/ * @param selector - A function used as a test for each element in the set. * @returns Whether selector matched at least one element. */ @@ -173,7 +173,7 @@ export abstract class Selection { * Check the current matched set of elements against a selector or element * and return true if at least one of these elements matches the given * arguments. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-is-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-is/ * @param selector - A selection to match against. * @returns Whether selector matched at least one element. */ @@ -181,7 +181,7 @@ export abstract class Selection { /** * Reduce the set of matched elements to the final one. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-last/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-last/ * @returns Unary set of last element. */ last(): Selection; @@ -189,7 +189,7 @@ export abstract class Selection { /** * Pass each element in the current matched set through a function, * producing a new Array containing the return values. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-map-fn/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-map/ * @param mapper - Procedure to execute on each element. * @returns Mapper return values. */ @@ -197,7 +197,7 @@ export abstract class Selection { /** * Get the immediately following sibling of each element. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-next-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-next/ * @param selector - Selector expression. * @returns Selected elements. */ @@ -206,7 +206,7 @@ export abstract class Selection { /** * Get all following siblings of each element, * optionally filtered by a selector. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-nextall-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-nextall/ * @param selector - Selector expression. * @returns Selected elements. */ @@ -215,7 +215,7 @@ export abstract class Selection { /** * Get all following siblings of each element up to but not including the * element matched by the selector. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-nextuntil-selector-filter/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-nextuntil/ * @param selector - Selector expression. * @returns Selected elements. */ @@ -223,7 +223,7 @@ export abstract class Selection { /** * Remove elements. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-not-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/ * @param selector - Selector expression. * @returns Selection with matched elements removed. */ @@ -231,7 +231,7 @@ export abstract class Selection { /** * Remove elements. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-not-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/ * @param selector - A function used as a test for each element in the set. * @returns Selection with matched elements removed. */ @@ -239,7 +239,7 @@ export abstract class Selection { /** * Get the parent of each element, optionally filtered by a selector. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-parent-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-parent/ * @param selector - Selector expression. * @returns Selected elements. */ @@ -247,7 +247,7 @@ export abstract class Selection { /** * Get the ancestors of each element, optionally filtered by a selector. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-parents-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-parents/ * @param selector - Selector expression. * @returns Selected elements. */ @@ -256,7 +256,7 @@ export abstract class Selection { /** * Get the ancestors of each element, * up to but not including the element matched by the selector. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-parentsuntil-selector-filter/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-parentsuntil/ * @param selector - Selector expression. * @returns Selected elements. */ @@ -264,7 +264,7 @@ export abstract class Selection { /** * Get the immediately preceding sibling of each element. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-prev-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-prev/ * @param selector - Selector expression. * @returns Selected elements. */ @@ -273,7 +273,7 @@ export abstract class Selection { /** * Get all preceding siblings of each element, * optionally filtered by a selector. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-prevall-selector/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-prevall/ * @param selector - Selector expression. * @returns Selected elements. */ @@ -282,7 +282,7 @@ export abstract class Selection { /** * Get all preceding siblings of each element * up to but not including the element matched by the selector. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-prevuntil-selector-filter/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-prevuntil/ * @param selector - Selector expression. * @returns Selected elements. */ @@ -291,7 +291,7 @@ export abstract class Selection { /** * Encode a set of form elements as a string * in standard URL-encoded notation for submission. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-serialize/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-serialize/ * @returns URL-encoded representation of the form or form elements. */ serialize(): string; @@ -299,7 +299,7 @@ export abstract class Selection { /** * Encode a set of form elements as an array of name-value objects. * `[{ name: "name", value: "value" }, ... ]` - * https://k6.io/docs/javascript-api/k6-html/selection/selection-serializearray/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-serializearray/ * @returns Array of name value objects of the form or form elements. */ serializeArray(): FormValue[]; @@ -307,7 +307,7 @@ export abstract class Selection { /** * Encode a set of form elements as an object. * `{ inputName: "value", checkboxName: "value", ... }` - * https://k6.io/docs/javascript-api/k6-html/selection/selection-serializeobject/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-serializeobject/ * @returns Object representation of the form or form elements, * key is field name and value is field value. */ @@ -315,14 +315,14 @@ export abstract class Selection { /** * Return the number of elements in the selection. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-size/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-size/ * @returns The number of elements in the selection. */ size(): number; /** * Reduce the set of elements to a subset specified by a range of indices. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-slice-start-end/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-slice/ * @param start - An integer indicating the 0-based position at which the * elements begin to be selected. * @param end - An integer indicating the 0-based position at which the @@ -333,21 +333,21 @@ export abstract class Selection { /** * Get the text content of the selection. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-text/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-text/ * @returns Text content. */ text(): string; /** * Retrieve all the elements contained in the selection as an array. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-toarray/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-toarray/ * @returns A unary selection of each element. */ toArray(): Selection[]; /** * Get the current value of the first element. - * https://k6.io/docs/javascript-api/k6-html/selection/selection-val/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/selection/selection-val/ * @returns The value of the first element. */ val(): string | undefined; @@ -446,7 +446,7 @@ export enum NodeType { /** * HTML node. - * https://k6.io/docs/javascript-api/k6-html/element/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/element/ */ export abstract class Element { protected __brand: never; @@ -621,7 +621,7 @@ export abstract class Element { /** * HTML element. - * https://k6.io/docs/javascript-api/k6-html/element/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/element/ */ export abstract class AnchorElement extends HrefElement { protected __brand: never; @@ -629,7 +629,7 @@ export abstract class AnchorElement extends HrefElement { /** * HTML element. - * https://k6.io/docs/javascript-api/k6-html/element/ + * https://grafana.com/docs/k6/latest/javascript-api/k6-html/element/ */ export abstract class AreaElement extends HrefElement { protected __brand: never; @@ -637,7 +637,7 @@ export abstract class AreaElement extends HrefElement { /** * HTML