diff --git a/notNeededPackages.json b/notNeededPackages.json index c7c8e8c41489a3..503bc676a88077 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -2761,6 +2761,10 @@ "libraryName": "@guardian/prosemirror-invisibles", "asOfVersion": "1.3.3" }, + "gulp-cond": { + "libraryName": "gulp-cond", + "asOfVersion": "2.0.0" + }, "gulp-pug": { "libraryName": "gulp-pug", "asOfVersion": "4.0.0" @@ -4129,6 +4133,10 @@ "libraryName": "lru-cache", "asOfVersion": "7.10.0" }, + "ltijs": { + "libraryName": "ltijs", + "asOfVersion": "7.0.0" + }, "lucasmogari__react-pagination": { "libraryName": "@lucasmogari/react-pagination", "asOfVersion": "1.1.4" @@ -4413,6 +4421,10 @@ "libraryName": "meow", "asOfVersion": "6.0.0" }, + "mercadopago": { + "libraryName": "mercadopago", + "asOfVersion": "2.0.0" + }, "merge-refs": { "libraryName": "merge-refs", "asOfVersion": "1.1.0" @@ -5309,6 +5321,10 @@ "libraryName": "pako", "asOfVersion": "3.0.0" }, + "pangu": { + "libraryName": "pangu", + "asOfVersion": "5.1.1" + }, "paper": { "libraryName": "paper", "asOfVersion": "0.12.3" @@ -5643,6 +5659,10 @@ "libraryName": "postcss-nested", "asOfVersion": "4.2.1" }, + "postcss-prefix-selector": { + "libraryName": "postcss-prefix-selector", + "asOfVersion": "2.2.1" + }, "postcss-preset-env": { "libraryName": "postcss-preset-env", "asOfVersion": "8.0.0" @@ -7643,6 +7663,10 @@ "libraryName": "@survicate/react-native-survicate", "asOfVersion": "4.0.0" }, + "svelte-range-slider-pips": { + "libraryName": "svelte-range-slider-pips", + "asOfVersion": "3.0.0" + }, "svg-pan-zoom": { "libraryName": "svg-pan-zoom", "asOfVersion": "3.4.0" diff --git a/types/async/index.d.ts b/types/async/index.d.ts index 89cc21dee45a40..4a666e81d86b4c 100644 --- a/types/async/index.d.ts +++ b/types/async/index.d.ts @@ -125,26 +125,30 @@ export interface QueueObject { * Instead of a single task, a tasks array can be submitted. * The respective callback is used for every task in the list. */ - push(task: T | T[]): Promise; + push(task: T): Promise; + push(task: T[]): Promise[] | undefined; push(task: T | T[], callback: AsyncResultCallback): void; /** * Add a new task to the front of the queue */ - unshift(task: T | T[]): Promise; + unshift(task: T): Promise; + unshift(task: T[]): Promise[] | undefined; unshift(task: T | T[], callback: AsyncResultCallback): void; /** * The same as `q.push`, except this returns a promise that rejects if an error occurs. * The `callback` arg is ignored */ - pushAsync(task: T | T[]): Promise; + pushAsync(task: T): Promise; + pushAsync(task: T[]): Promise[] | undefined; /** * The same as `q.unshift`, except this returns a promise that rejects if an error occurs. * The `callback` arg is ignored */ - unshiftAsync(task: T | T[]): Promise; + unshiftAsync(task: T): Promise; + unshiftAsync(task: T[]): Promise[] | undefined; /** * Remove items from the queue that match a test function. @@ -239,7 +243,8 @@ export interface QueueObject { */ // FIXME: can not use Omit due to ts version restriction. Replace Pick with Omit, when ts 3.5+ will be allowed export interface AsyncPriorityQueue extends Pick, Exclude, "push" | "unshift">> { - push(task: T | T[], priority?: number): Promise; + push(task: T, priority?: number): Promise; + push(task: T[], priority?: number): undefined | Promise[]; push(task: T | T[], priority: number, callback: AsyncResultCallback): void; } diff --git a/types/async/test/index.ts b/types/async/test/index.ts index baebd947dc33c9..3f3af405c94317 100644 --- a/types/async/test/index.ts +++ b/types/async/test/index.ts @@ -371,22 +371,37 @@ const q2 = async.queue((task: string, callback: () => void) => { callback(); }, 1); +// $ExpectType Promise q2.push("task1"); -q2.push("task2", error => { +// $ExpectType Promise[] | undefined +q2.push(["task2", "task3"]); +q2.push("task4", error => { console.log("Finished tasks"); }); -q2.push(["task3", "task4", "task5"], error => { +q2.push(["task5", "task6", "task7"], error => { console.log("Finished tasks"); }); +// $ExpectType Promise q2.unshift("task1"); -q2.unshift("task2", error => { +// $ExpectType Promise[] | undefined +q2.unshift(["task2", "task3"]); +q2.unshift("task4", error => { console.log("Finished tasks"); }); -q2.unshift(["task3", "task4", "task5"], error => { +q2.unshift(["task5", "task6", "task7"], error => { console.log("Finished tasks"); }); +// $ExpectType Promise +q2.pushAsync("task1"); +// $ExpectType Promise[] | undefined +q2.pushAsync(["task2", "task3"]); +// $ExpectType Promise +q2.unshiftAsync("task1"); +// $ExpectType Promise[] | undefined +q2.unshiftAsync(["task2", "task3"]); + const q2Length = q2.length(); q2.push("testRemovalTask"); q2.remove(x => x.data === "testTaskRemoval"); @@ -420,6 +435,20 @@ q3.error(); q3.push(["task1", "task2", "task3"]); +// tests for the push method of priorityQueue +const q4 = async.priorityQueue((task: string, callback: () => void) => { + console.log("Task: " + task); + callback(); +}, 1); + +// $ExpectType Promise +q4.push("task1"); + +// $ExpectType Promise[] | undefined +q4.push(["task2", "task3"]); + +q4.push("task4", 1, () => {}); + // create a cargo object with payload 2 const cargo = async.cargo<{ name: string }>((tasks, callback) => { for (const task of tasks) { diff --git a/types/gulp-cond/gulp-cond-tests.ts b/types/gulp-cond/gulp-cond-tests.ts deleted file mode 100644 index e65381c4943755..00000000000000 --- a/types/gulp-cond/gulp-cond-tests.ts +++ /dev/null @@ -1,12 +0,0 @@ -import gulp = require("gulp"); -import cond = require("gulp-cond"); -import gzip = require("gulp-gzip"); - -gulp.task("build", () => { - gulp.src("src") - .pipe(cond(true, gzip, gzip)) - .pipe(cond(true, gzip)) - .pipe(cond(true, gzip(), gzip())) - .pipe(cond(true, gzip())) - .pipe(gulp.dest("dest")); -}); diff --git a/types/gulp-cond/index.d.ts b/types/gulp-cond/index.d.ts deleted file mode 100644 index e209f3a1a68784..00000000000000 --- a/types/gulp-cond/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/// - -interface GulpCond { - (condition: GulpCond.Condition, expr1: GulpCond.Expresion, expr2?: GulpCond.Expresion): NodeJS.ReadWriteStream; -} - -declare namespace GulpCond { - type Expresion = NodeJS.ReadWriteStream | (() => NodeJS.ReadWriteStream); - - type Condition = boolean | (() => boolean); -} - -declare const gulpCond: GulpCond; - -export = gulpCond; diff --git a/types/gulp-cond/package.json b/types/gulp-cond/package.json deleted file mode 100644 index eb475c62e9b628..00000000000000 --- a/types/gulp-cond/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "private": true, - "name": "@types/gulp-cond", - "version": "1.0.9999", - "projects": [ - "https://github.com/nfroidure/gulp-cond" - ], - "dependencies": { - "@types/node": "*" - }, - "devDependencies": { - "@types/gulp": "*", - "@types/gulp-cond": "workspace:.", - "@types/gulp-gzip": "*" - }, - "owners": [ - { - "name": "Martin Badin", - "githubUsername": "martin-badin" - } - ] -} diff --git a/types/gulp-cond/tsconfig.json b/types/gulp-cond/tsconfig.json deleted file mode 100644 index b28e99fc75512f..00000000000000 --- a/types/gulp-cond/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictFunctionTypes": true, - "strictNullChecks": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-cond-tests.ts" - ] -} diff --git a/types/gulp-cond/.npmignore b/types/helpscout-beacon/.npmignore similarity index 100% rename from types/gulp-cond/.npmignore rename to types/helpscout-beacon/.npmignore diff --git a/types/helpscout-beacon/helpscout-beacon-tests.ts b/types/helpscout-beacon/helpscout-beacon-tests.ts new file mode 100644 index 00000000000000..4cf435e77b956f --- /dev/null +++ b/types/helpscout-beacon/helpscout-beacon-tests.ts @@ -0,0 +1,36 @@ +// helpscout-beacon-tests.ts + +window.Beacon("init", "1234567890"); + +window.Beacon("init", { + beaconId: "1234567890", + color: "#ff0000", + mode: "askFirst", + display: { + position: "left", + style: "iconAndText", + }, +}); + +window.Beacon("identify", { + name: "Baver Bozdağ", + email: "hello@example.com", + jobTitle: "Frontend Developer", + "Custom-Attribute": "Test", +}); + +window.Beacon("suggest", ["article-1", "article-2"]); +window.Beacon("suggest", [ + "article-1", + { text: "Help Scout", url: "https://www.helpscout.com" }, +]); + +window.Beacon("on", "open", () => { + console.log("Beacon opened!"); +}); + +window.Beacon("logout", { endActiveChat: true, clearMessages: true }); + +if (window.Beacon.readyQueue) { + window.Beacon.readyQueue.push({ method: "open" }); +} diff --git a/types/helpscout-beacon/index.d.ts b/types/helpscout-beacon/index.d.ts new file mode 100644 index 00000000000000..ceebdf8bedaeab --- /dev/null +++ b/types/helpscout-beacon/index.d.ts @@ -0,0 +1,103 @@ +declare function Beacon(method: "init", beaconId: string): void; +declare function Beacon(method: "init", config: { beaconId: string } & Beacon.Config): void; +declare function Beacon(method: "destroy" | "open" | "close" | "toggle" | "reset"): void; +declare function Beacon(method: "search", query: string): void; +declare function Beacon(method: "ask-question", question: string): void; +declare function Beacon(method: "suggest", suggestions?: Array): void; +declare function Beacon(method: "article", articleId: string, options?: { type: "sidebar" | "modal" }): void; +declare function Beacon(method: "navigate", route: string): void; +declare function Beacon(method: "identify", userObject: Beacon.IdentifyUser): void; +declare function Beacon(method: "prefill", formObject: Beacon.PrefillForm): void; +declare function Beacon(method: "logout", options?: { endActiveChat?: boolean; clearMessages?: boolean }): void; +declare function Beacon(method: "config", options: Beacon.Config): void; +declare function Beacon(method: "on" | "once", event: Beacon.Event, callback: (eventData?: unknown) => void): void; +declare function Beacon(method: "off", event: Beacon.Event, callback?: (eventData?: unknown) => void): void; +declare function Beacon(method: "event", eventObject: { type: "page-viewed"; url: string; title: string }): void; +declare function Beacon(method: "session-data", data: Record): void; +declare function Beacon(method: "show-message", messageId: string, options?: { delay?: number; force?: boolean }): void; +declare function Beacon(method: "info"): unknown; + +declare namespace Beacon { + interface DisplayConfig { + style?: "icon" | "text" | "iconAndText" | "manual"; + text?: string; + textAlign?: "left" | "right"; + iconImage?: "message" | "beacon" | "search" | "buoy" | "question"; + position?: "left" | "right"; + zIndex?: number; + horizontalOffset?: number; + verticalOffset?: number; + horizontalMobileOffset?: number; + verticalMobileOffset?: number; + } + + interface MessagingContactFormConfig { + customFieldsEnabled?: boolean; + showName?: boolean; + showSubject?: boolean; + allowAttachments?: boolean; + showGetInTouch?: boolean; + } + + interface MessagingConfig { + chatEnabled?: boolean; + contactForm?: MessagingContactFormConfig; + } + + interface Config { + docsEnabled?: boolean; + messagingEnabled?: boolean; + enableFabAnimation?: boolean; + enablePreviousMessages?: boolean; + enableSounds?: boolean; + reopenBeaconWithActiveChat?: boolean; + color?: string; + mode?: "selfService" | "neutral" | "askFirst"; + hideAvatars?: boolean; + hideFABOnMobile?: boolean; + hideFABLabelOnMobile?: boolean; + disableMessages?: boolean; + showPrefilledCustomFields?: boolean; + display?: DisplayConfig; + messaging?: MessagingConfig; + labels?: Record; + } + + interface IdentifyUser { + name?: string; + email?: string; + company?: string; + jobTitle?: string; + avatar?: string; + signature?: string; + companyProperties?: Record; + [key: string]: string | number | boolean | null | undefined | Record; + } + + interface PrefillForm { + name?: string; + email?: string; + subject?: string; + text?: string; + fields?: Array<{ id: number; value: string | number }>; + attachments?: File[]; + } + + type Event = + | "open" + | "close" + | "ready" + | "article-viewed" + | "chat-started" + | "email-sent" + | "message-clicked" + | "message-closed" + | "message-triggered" + | "search"; +} + +interface Window { + Beacon: typeof Beacon & { + readyQueue?: Array<{ method: string; options?: unknown; data?: unknown }>; + }; +} diff --git a/types/helpscout-beacon/package.json b/types/helpscout-beacon/package.json new file mode 100644 index 00000000000000..1f6b0fb1f398e1 --- /dev/null +++ b/types/helpscout-beacon/package.json @@ -0,0 +1,19 @@ +{ + "private": true, + "name": "@types/helpscout-beacon", + "version": "2.0.9999", + "nonNpm": true, + "nonNpmDescription": "Help Scout Beacon v2 JavaScript API (Browser Script)", + "projects": [ + "https://developer.helpscout.com/beacon-2/web/javascript-api/" + ], + "devDependencies": { + "@types/helpscout-beacon": "workspace:." + }, + "owners": [ + { + "name": "Baver Bozdağ", + "githubUsername": "bawerbozdag" + } + ] +} diff --git a/types/pangu/tsconfig.json b/types/helpscout-beacon/tsconfig.json similarity index 84% rename from types/pangu/tsconfig.json rename to types/helpscout-beacon/tsconfig.json index b59a323a5bd0bc..078dbc1cabd8bd 100644 --- a/types/pangu/tsconfig.json +++ b/types/helpscout-beacon/tsconfig.json @@ -1,20 +1,20 @@ { "compilerOptions": { - "module": "node16", + "module": "commonjs", "lib": [ "es6", "dom" ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": true, "strictFunctionTypes": true, + "strictNullChecks": true, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", - "pangu-tests.ts" + "helpscout-beacon-tests.ts" ] } diff --git a/types/ltijs/.npmignore b/types/ltijs/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/ltijs/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/ltijs/index.d.ts b/types/ltijs/index.d.ts deleted file mode 100644 index 0f221513fc338f..00000000000000 --- a/types/ltijs/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/// - -import { IdToken } from "./lib/IdToken"; -import { PlatformContext } from "./lib/Utils/Platform"; - -declare module "express" { - interface Response = Record> { - locals: Locals & { - token?: IdToken | undefined; - context?: PlatformContext | undefined; - }; - } -} - -export * from "./lib/IdToken"; -export { default as Provider } from "./lib/Provider/Provider"; -export * from "./lib/Provider/Provider"; -export * from "./lib/Provider/Services/DeepLinking"; -export * from "./lib/Provider/Services/GradeService"; -export * from "./lib/Provider/Services/NamesAndRoles"; -export * from "./lib/Utils/Database"; -export * from "./lib/Utils/Platform"; diff --git a/types/ltijs/lib/IdToken.d.ts b/types/ltijs/lib/IdToken.d.ts deleted file mode 100644 index 08bcb47a441d78..00000000000000 --- a/types/ltijs/lib/IdToken.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { PlatformInfo } from "./Utils/Platform"; - -export interface UserInfo { - given_name: string; - family_name: string; - name: string; - email: string; -} - -export interface IdToken { - iss: string; - issuerCode: string; - user: string; - roles: string[]; - userInfo: UserInfo; - platformInfo: PlatformInfo; - endpoint: { - scope: string[]; - lineItems: string; - lineItem: string; - }; -} diff --git a/types/ltijs/lib/Provider/Provider.d.ts b/types/ltijs/lib/Provider/Provider.d.ts deleted file mode 100644 index cfe6dc53603f31..00000000000000 --- a/types/ltijs/lib/Provider/Provider.d.ts +++ /dev/null @@ -1,163 +0,0 @@ -import { Express, NextFunction, Request, Response } from "express"; -import { IdToken } from "../IdToken"; -import { Database, DatabaseOptions } from "../Utils/Database"; -import { PlatformConfig } from "./../Utils/Platform"; -import { Platform } from "../Utils/Platform"; -import { DeepLinkingService } from "./Services/DeepLinking"; -import { GradeService } from "./Services/GradeService"; -import { NamesAndRolesService } from "./Services/NamesAndRoles"; - -export interface ServerAddonFunction { - (app: Express): void; -} - -export interface DeploymentOptions { - port?: number | undefined; - silent?: boolean | undefined; - serverless?: boolean | undefined; -} - -export interface ProviderOptions { - appRoute?: string | undefined; - loginRoute?: string | undefined; - keysetRoute?: string | undefined; - dynregRoute?: string | undefined; - https?: boolean | undefined; - ssl?: { - key: string; - cert: string; - } | undefined; - staticPath?: string | undefined; - logger?: boolean | undefined; - cors?: boolean | undefined; - serverAddon?: ServerAddonFunction | undefined; - cookies?: { - secure?: boolean | undefined; - sameSite?: string | undefined; - domain?: string | undefined; - } | undefined; - devMode?: boolean | undefined; - ltiaas?: boolean | undefined; - tokenMaxAge?: number | undefined; - dynReg?: { - url: string; - name: string; - logo?: string | undefined; - description?: string | undefined; - redirectUris?: string[] | undefined; - customParameters?: any; - autoActivate?: boolean | undefined; - useDeepLinking?: boolean | undefined; - } | undefined; - - /** - * @deprecated Use `appRoute` property instead. - */ - appUrl?: string | undefined; - /** - * @deprecated Use `loginRoute` property instead. - */ - loginUrl?: string | undefined; - /** - * @deprecated Use `keysetRoute` property instead. - */ - keysetUrl?: string | undefined; -} - -export interface RequestCallback { - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - (request: Request, response: Response, next: NextFunction): Response | void; -} - -export interface TokenRequestCallback { - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - (token: IdToken, request: Request, response: Response, next: NextFunction): Response | void; -} - -export interface FinalRequestCallback { - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - (request: Request, response: Response): Response | void; -} - -export interface OnConnectOptions { - sessionTimeout?: ((request: Request, response: Response) => Response) | undefined; - invalidToken?: ((request: Request, response: Response) => Response) | undefined; -} - -export interface RedirectOptions { - isNewResource?: boolean | undefined; - ignoreRoot?: boolean | undefined; -} - -export type GetPlatformFunction = ( - url: string, - clientId?: string, - ENCRYPTIONKEY?: string, - Database?: Database, -) => Promise; - -declare class Provider { - app: Express; - - Database: Database; - Grade: GradeService; - DeepLinking: DeepLinkingService; - NamesAndRoles: NamesAndRolesService; - - setup(encryptionKey: string, database: DatabaseOptions, options?: ProviderOptions): Provider; - - deploy(options?: DeploymentOptions): Promise; - - close(): Promise; - - onConnect(_connectCallback: TokenRequestCallback, options?: OnConnectOptions): true; - - onDeepLinking(_deepLinkingCallback: TokenRequestCallback): true; - - onDynamicRegistration(_dynamicRegistrationCallback: RequestCallback): true; - - onSessionTimeout(_sessionTimeoutCallback: FinalRequestCallback): true; - - onInvalidToken(_invalidTokenCallback: FinalRequestCallback): true; - - onUnregisteredPlatform(_unregisteredPlatformCallback: FinalRequestCallback): true; - - appRoute(): string; - - loginRoute(): string; - - keysetRoute(): string; - - dynRegRoute(): string; - - whitelist(...urls: Array): true; - - registerPlatform( - platform: PlatformConfig, - getPlatform?: GetPlatformFunction, - ENCRYPTIONKEY?: string, - Database?: Database, - ): Promise; - - getPlatform( - url: string, - clientId?: string, - ENCRYPTIONKEY?: string, - Database?: Database, - ): Promise; - - updatePlatformById(platformId: string, platformInfo: PlatformConfig): Promise; - - deletePlatform(url: string, clientId: string): Promise; - - getAllPlatforms(): Promise; - - redirect(response: Response, path: string, options?: RedirectOptions): void; - - appUrl(): string; - loginUrl(): string; - keysetUrl(): string; -} - -declare const defaultProvider: Provider; -export default defaultProvider; diff --git a/types/ltijs/lib/Provider/Services/DeepLinking.d.ts b/types/ltijs/lib/Provider/Services/DeepLinking.d.ts deleted file mode 100644 index a56297465f86f9..00000000000000 --- a/types/ltijs/lib/Provider/Services/DeepLinking.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { IdToken } from "../../IdToken"; - -export interface DeepLinkingMessageOptions { - message?: string | undefined; - errmessage?: string | undefined; - log?: string | undefined; - errlog?: string | undefined; -} - -export interface ContentItem { - type: string; - title: string; - url?: string | undefined; - custom?: any; -} - -export interface DeepLinkingService { - createDeepLinkingForm( - idtoken: IdToken, - contentItems: ContentItem[], - options: DeepLinkingMessageOptions, - ): Promise; - - createDeepLinkingMessage( - idtoken: IdToken, - contentItems: ContentItem[], - options: DeepLinkingMessageOptions, - ): Promise; -} diff --git a/types/ltijs/lib/Provider/Services/GradeService.d.ts b/types/ltijs/lib/Provider/Services/GradeService.d.ts deleted file mode 100644 index 35d9b9f99b499b..00000000000000 --- a/types/ltijs/lib/Provider/Services/GradeService.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { IdToken } from "../../IdToken"; - -export interface PublishedGrade { - scoreGiven: number; - comment?: string | undefined; - activityProgress: string; - gradingProgress: string; -} - -export interface GradeFilters { - resourceLinkId?: boolean | undefined; - tag?: boolean | undefined; - limit?: number | undefined; - userId?: boolean | undefined; -} - -export interface RetrievedGrade { - id: string; - scoreOf: string; - userId: string; - resultScore: number; - resultMaximum: number; - comment: string; -} - -export interface GradeService { - scorePublish(idtoken: IdToken, grade: PublishedGrade): Promise; - - result(idtoken: IdToken, filters?: GradeFilters): Promise; -} diff --git a/types/ltijs/lib/Provider/Services/NamesAndRoles.d.ts b/types/ltijs/lib/Provider/Services/NamesAndRoles.d.ts deleted file mode 100644 index 6000319c06c320..00000000000000 --- a/types/ltijs/lib/Provider/Services/NamesAndRoles.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { IdToken, UserInfo } from "../../IdToken"; - -export interface MemberFilters { - role?: string | undefined; - limit?: number | undefined; - pages?: number | undefined; - url?: string | undefined; -} - -export interface Member extends UserInfo { - status: string; - picture: string; - middle_name: string; - user_id: string; - lis_person_sourcedid: string; - roles: string[]; -} - -export interface MembersResult { - id: string; - context: { - id: string; - label: string; - title: string; - }; - members: Member[]; - next?: string | undefined; -} - -export interface NamesAndRolesService { - getMembers(idtoken: IdToken, filters?: MemberFilters): Promise; -} diff --git a/types/ltijs/lib/Utils/Database.d.ts b/types/ltijs/lib/Utils/Database.d.ts deleted file mode 100644 index 5960b65d2894e1..00000000000000 --- a/types/ltijs/lib/Utils/Database.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -export interface DatabaseConnectionOptions { - url: string; - connection?: { - user: string; - pass: string; - useNewUrlParser?: boolean | undefined; - keepAlive?: boolean | undefined; - keepAliveInitialDelay?: number | undefined; - } | undefined; - plugin?: never; -} - -export interface DatabasePluginOptions { - url?: never; - connection?: never; - plugin: object; -} - -export type DatabaseOptions = DatabaseConnectionOptions | DatabasePluginOptions; - -export interface Database { - setup(): Promise; - - Close(): Promise; - - Get(encryptionKey: string | false, collection: string, query: object): Promise; - - Insert(encryptionKey: string | false, collection: string, item: object, index: object): Promise; - - Modify(encryptionKey: string | false, collection: string, query: object, modification: object): Promise; - - Delete(collection: string, query: object): Promise; - - encrypt(data: string, secret: string): Promise<{ iv: string; data: string }>; - - Decrypt(data: string, _iv: string, secret: string): Promise; -} diff --git a/types/ltijs/lib/Utils/Platform.d.ts b/types/ltijs/lib/Utils/Platform.d.ts deleted file mode 100644 index a35767191e899b..00000000000000 --- a/types/ltijs/lib/Utils/Platform.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -export interface PlatformInfo { - family_code: string; - version: string; - name: string; - description: string; -} - -export interface PlatformAuthConfig { - method: string; - key: string; -} - -export interface PlatformConfig { - url: string; - name: string; - clientId: string; - authenticationEndpoint: string; - accesstokenEndpoint: string; - authConfig: PlatformAuthConfig; -} - -export interface PlatformContext { - context: { - id: string; - label: string; - title: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - type: any[]; - }; - resource: { - title: string; - id: string; - }; - path: string; - user: string; - deploymentId: string; - targetLinkUri: string; - launchPresentation: { - locale: string; - document_target: string; - return_url: string; - }; - messageType: string; - version: string; - createdAt: Date; - __v: number; - __id: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - custom: any; -} - -export interface Platform { - platformName(name?: string): Promise; - - platformUrl(url?: string): Promise; - - platformClientId(clientId?: string): Promise; - - platformKid(): string; - - platformPublicKey(): Promise; - - platformPrivateKey(): Promise; - - platformAuthConfig(method: string, key: string): Promise; - - platformAuthEndpoint(authEndpoint?: string): Promise; - - platformAccessTokenEndpoint(accesstokenEndpoint?: string): Promise; - - platformAccessToken(scopes: string): Promise; - - remove(): Promise; -} diff --git a/types/ltijs/ltijs-tests.ts b/types/ltijs/ltijs-tests.ts deleted file mode 100644 index 6d93e955bdc27b..00000000000000 --- a/types/ltijs/ltijs-tests.ts +++ /dev/null @@ -1,180 +0,0 @@ -import { Request, Response } from "express"; -import { DeploymentOptions, IdToken, Provider } from "ltijs"; - -const ltiMinimal = Provider.setup("EXAMPLEKEY", { - url: "mongodb://localhost/database", -}); - -const ltiPlugin = Provider.setup("EXAMPLEKEY", { - plugin: {}, -}); - -// @ts-expect-error -const ltiInvalid = Provider.setup("EXAMPLEKEY", { - // Can't specify both DB and plugin. - url: "mongodb://localhost/database", - plugin: {}, -}); - -const idToken: IdToken = { - iss: "", - issuerCode: "", - user: "", - roles: [], - userInfo: { - given_name: "Test", - family_name: "Test", - name: "Test Test", - email: "test@test", - }, - platformInfo: { - family_code: "", - version: "1.0", - name: "Test", - description: "Test", - }, - endpoint: { - scope: [], - lineItems: "", - lineItem: "", - }, -}; - -const ltiAdvanced = Provider.setup( - "EXAMPLEKEY", - { - url: "mongodb://localhost/database", - connection: { - user: "user", - pass: "pass", - }, - }, - { - appRoute: "/", - loginRoute: "/login", - keysetRoute: "/keys", - staticPath: "/views", - https: true, - ssl: { - key: "privateKey", - cert: "certificate", - }, - cookies: { - secure: true, - sameSite: "None", - }, - serverAddon: app => {}, - }, -); - -// $ExpectType true -ltiMinimal.onConnect( - (connection, request, response) => { - ltiMinimal.redirect(response, "/main"); - }, - { - sessionTimeout: (req, res) => { - return res.send("Session timed out"); - }, - invalidToken: (req, res) => { - return res.send("Invalid token"); - }, - }, -); - -ltiAdvanced.app.get("/main", (req: Request, res: Response) => { - res.send("It's alive!"); -}); - -// $ExpectType true -ltiAdvanced.whitelist("/main", "/home", { route: "/route", method: "POST" }); - -// $ExpectType true -ltiAdvanced.onDeepLinking((connection, request, response) => { - ltiAdvanced.redirect(response, "/deeplink"); -}); - -const deploymentOptions: DeploymentOptions = { serverless: true }; -// $ExpectType Promise -ltiMinimal.deploy(deploymentOptions); - -// $ExpectType Promise -ltiAdvanced.deploy({ port: 4040, silent: true }); - -// $ExpectType Promise -ltiAdvanced.registerPlatform({ - url: "https://platform.url", - name: "Platform Name", - clientId: "TOOLCLIENTID", - authenticationEndpoint: "https://platform.url/auth", - accesstokenEndpoint: "https://platform.url/token", - authConfig: { method: "JWK_SET", key: "https://platform.url/keyset" }, -}); - -const items = [ - { - type: "ltiResourceLink", - title: "Title", - custom: { - resourceurl: "/path", - resourcename: "Name", - }, - }, -]; - -// $ExpectType Promise -ltiAdvanced.DeepLinking.createDeepLinkingForm(idToken, items, { - message: "Done!", - errmessage: "Not done!", - log: "test", - errlog: "test", -}); - -// $ExpectType Promise -ltiAdvanced.DeepLinking.createDeepLinkingMessage(idToken, items, { - message: "Done!", - errmessage: "Not done!", - log: "test", - errlog: "test", -}); - -const grade = { - scoreGiven: 50, - activityProgress: "Completed", - gradingProgress: "FullyGraded", -}; - -// $ExpectType Promise -ltiAdvanced.Grade.scorePublish(idToken, grade); - -// $ExpectType Promise -ltiAdvanced.Grade.result(idToken, { userId: true }); - -// $ExpectType Promise -ltiAdvanced.NamesAndRoles.getMembers(idToken); - -ltiAdvanced.app.get("/any", (request: Request, response: Response) => { - // $ExpectType PlatformContext | undefined - response.locals.context; - - // $ExpectType IdToken | undefined - response.locals.token; -}); - -ltiAdvanced.getPlatform("https://platform.url").then(async (platform) => { - if (!platform) return; - - const p = Array.isArray(platform) ? platform[0] : platform; - - // $expectType string | boolean - const name = await p.platformName(); -}); - -ltiAdvanced.getPlatform("https://platform.url", "123").then(async (platform) => { - if (!platform) return; - - const p = Array.isArray(platform) ? platform[0] : platform; - - // $expectType string | boolean - const name = await p.platformName(); -}); diff --git a/types/ltijs/package.json b/types/ltijs/package.json deleted file mode 100644 index 0ca5b6737cca46..00000000000000 --- a/types/ltijs/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "private": true, - "name": "@types/ltijs", - "version": "5.9.9999", - "projects": [ - "https://cvmcosta.github.io/ltijs" - ], - "dependencies": { - "@types/express": "*" - }, - "devDependencies": { - "@types/ltijs": "workspace:." - }, - "owners": [ - { - "name": "Paul Schwörer", - "githubUsername": "paulschwoerer" - } - ] -} diff --git a/types/ltijs/tsconfig.json b/types/ltijs/tsconfig.json deleted file mode 100644 index 4e093962bf6670..00000000000000 --- a/types/ltijs/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictFunctionTypes": true, - "strictNullChecks": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "ltijs-tests.ts" - ] -} diff --git a/types/mercadopago/.npmignore b/types/mercadopago/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/mercadopago/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/mercadopago/configuration.d.ts b/types/mercadopago/configuration.d.ts deleted file mode 100644 index e740eea611eed8..00000000000000 --- a/types/mercadopago/configuration.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -export interface ConfigCredentialsOption extends GeneralConfigOptions { - client_id: string; - client_secret: string; -} - -export interface ConfigTokenOption extends GeneralConfigOptions { - access_token: string; -} - -export interface GeneralConfigOptions { - platform_id?: string | undefined; - corporation_id?: string | undefined; - integrator_id?: string | undefined; - sandbox?: MercadoPagoConfig["sandbox"] | undefined; - show_promise_error?: MercadoPagoConfig["show_promise_error"] | undefined; -} - -export type ConfigOptions = ConfigCredentialsOption | ConfigTokenOption; - -export interface MercadoPagoConfig { - sandbox: boolean; - show_promise_error: boolean; - cache_max_size: number; - - configure(options: ConfigOptions): void; - getClientId(): string; - getClientSecret(): string; - getPlatformId(): string; - getCorporationId(): string; - getIntegratorId(): string; - setAccessToken(token: string): MercadoPagoConfig; - getAccessToken(): string; - setRefreshToken(refreshToken: string): MercadoPagoConfig; - getRefreshToken(): string; - /** Get base URL to execute rest operations */ - getBaseUrl(): string; - getProductId(): string; - getTrackingId(): string; - getUserAgent(): string; - /** Check NODE_ENV variable */ - areTestsRunnning(): string; -} diff --git a/types/mercadopago/index.d.ts b/types/mercadopago/index.d.ts deleted file mode 100644 index 4838446ddffa15..00000000000000 --- a/types/mercadopago/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { MercadoPago } from "./interface"; - -declare const mercadopago: MercadoPago; - -export = mercadopago; diff --git a/types/mercadopago/interface.d.ts b/types/mercadopago/interface.d.ts deleted file mode 100644 index ebccccaa38d6e4..00000000000000 --- a/types/mercadopago/interface.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { MercadoPagoConfig } from "./configuration"; -import { MercadoPagoCard } from "./resources/cards"; -import { MercadoPagoCustomer } from "./resources/customers"; -import { MercadoPagoMerchantOrder } from "./resources/merchantOrders"; -import { MercadoPagoPayment } from "./resources/payment"; -import { MercadoPagoPreApproval } from "./resources/preapproval"; -import { MercadoPagoPreference } from "./resources/preferences"; - -export interface MercadoPago { - configure: MercadoPagoConfig["configure"]; - utils: any; - configurations: MercadoPagoConfig; - payment: MercadoPagoPayment; - preferences: MercadoPagoPreference; - preapproval: MercadoPagoPreApproval; - merchant_orders: MercadoPagoMerchantOrder; - customers: MercadoPagoCustomer; - ipn: any; - connect: any; - money_requests: any; - card: MercadoPagoCard; - card_token: any; - refund: any; - discount_campaign: any; -} diff --git a/types/mercadopago/mercadopago-tests.ts b/types/mercadopago/mercadopago-tests.ts deleted file mode 100644 index 1a0363b604ea19..00000000000000 --- a/types/mercadopago/mercadopago-tests.ts +++ /dev/null @@ -1,45 +0,0 @@ -import * as MP from "mercadopago"; -import { MercadoPago } from "mercadopago/interface"; -import { PayerAdditionalInfo } from "mercadopago/models/payment/create-payload.model"; -import { Currency } from "mercadopago/shared/currency"; - -const clientId = "CLIENT_ID"; -const clientSecret = "CLIENT_SECRET"; -const accessToken = "ACCESS_TOKEN"; - -MP.configure({ - access_token: accessToken, -}); - -MP.configurations.configure({ - client_id: clientId, - client_secret: clientSecret, -}); - -const currencyIdIso4217: Currency = "USD"; - -const mpObj: Partial = {}; - -const payerAdditionalInfoWithoutAddress: PayerAdditionalInfo = { - first_name: "John", - last_name: "Doe", -}; - -const payerAdditionalInfoWithAddress: PayerAdditionalInfo = { - first_name: "John", - last_name: "Doe", - address: { - street_name: "Street Name", - street_number: 1234, - zip_code: "00000", - }, -}; - -const payerAdditionalInfoWithEmptyAddress: PayerAdditionalInfo = { - first_name: "John", - last_name: "Doe", - address: {}, -}; - -MP.card.delete("customer_id", "card_id"); -MP.card.delete("customer_id", 123456789); diff --git a/types/mercadopago/models/cards/create-payload.d.ts b/types/mercadopago/models/cards/create-payload.d.ts deleted file mode 100644 index fc3a2670706e2f..00000000000000 --- a/types/mercadopago/models/cards/create-payload.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface CreateCardPayload { - /** Customer's id */ - customer_id: string; - /** Card token */ - token: string; -} diff --git a/types/mercadopago/models/cards/update-payload.d.ts b/types/mercadopago/models/cards/update-payload.d.ts deleted file mode 100644 index a4c4b02c6adf33..00000000000000 --- a/types/mercadopago/models/cards/update-payload.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { CreateCardPayload } from "./create-payload"; - -export interface UpdateCardPayload extends CreateCardPayload { - /** Card id */ - id: number | string; -} diff --git a/types/mercadopago/models/customers/create-payload.model.d.ts b/types/mercadopago/models/customers/create-payload.model.d.ts deleted file mode 100644 index 50e57df342e604..00000000000000 --- a/types/mercadopago/models/customers/create-payload.model.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { SimpleAddressId } from "../../shared/address"; -import { Identification } from "../../shared/payer-identification"; -import { Phone } from "../../shared/phone"; - -export interface CreateCustomerPayload { - /** Email do cliente */ - email?: string | undefined; - /** Nome do cliente. */ - first_name?: string | undefined; - /** Sobrenome do cliente. */ - last_name?: string | undefined; - /** Telefone do cliente. */ - phone?: Omit | undefined; - /** Informações sobre a identificação do cliente. */ - identification?: Identification | undefined; - /** Endereço por defeito do cliente. */ - default_address?: string | undefined; - /** Informação sobre o endereço padrão do cliente. */ - address?: SimpleAddressId | undefined; - /** Data (ISO_8601) de registo do cliente. */ - date_registered?: string | undefined; - /** Descrição do cliente. */ - description?: string | undefined; - /** Metadata do cliente */ - metadata?: any; - /** Cartão padrão do cliente. */ - default_card?: string | undefined; -} diff --git a/types/mercadopago/models/customers/search-configuration.model.d.ts b/types/mercadopago/models/customers/search-configuration.model.d.ts deleted file mode 100644 index 6d30f8935f333c..00000000000000 --- a/types/mercadopago/models/customers/search-configuration.model.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Identification } from "../../shared/payer-identification"; -import { SearchConfiguration } from "../default-configuration.model"; - -export interface CustomerQs { - id?: string | undefined; - email?: string | undefined; - first_name?: string | undefined; - last_name?: string | undefined; - identification?: Identification | undefined; - description?: string | undefined; -} - -export type CustomerSearchConfiguration = SearchConfiguration; diff --git a/types/mercadopago/models/customers/update-payload.model.d.ts b/types/mercadopago/models/customers/update-payload.model.d.ts deleted file mode 100644 index b9573205dab848..00000000000000 --- a/types/mercadopago/models/customers/update-payload.model.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { CreateCustomerPayload } from "./create-payload.model"; - -export interface UpdateCustomerPayload extends CreateCustomerPayload { - /** Customer's id. */ - id: string; -} diff --git a/types/mercadopago/models/default-configuration.model.d.ts b/types/mercadopago/models/default-configuration.model.d.ts deleted file mode 100644 index 6f70fce3a674f2..00000000000000 --- a/types/mercadopago/models/default-configuration.model.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export interface DefaultConfiguration { - /** Query string params. */ - qs?: any; - /** Object with headers to be included in the request. Note that `user-agent` and `x-idempotency-key` headers will be ignored if included in this object. */ - headers?: { [key: string]: string } | undefined; - /** Idempotency value that will be included on the header. */ - idempotency?: string | undefined; -} - -export type DefaultConfigurationOmitQs = Omit; - -export interface SearchConfiguration extends Omit { - /** Query string params. */ - qs: T; -} diff --git a/types/mercadopago/models/merchantOrders/create-payload.d.ts b/types/mercadopago/models/merchantOrders/create-payload.d.ts deleted file mode 100644 index 56f2c570e28b7e..00000000000000 --- a/types/mercadopago/models/merchantOrders/create-payload.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Item } from "../../shared/item"; - -export interface MerchantOrderPayer { - id?: number | undefined; - email?: string | undefined; - nickname?: string | undefined; -} - -export interface MerchantOrderItem extends Item { - /** Id do anúncio. */ - id?: number | undefined; - /** Identificador da moeda utilizada no preço do item. */ - currency_id?: "ARS" | "BRL" | "CLP" | "MXN" | "COP" | "PEN" | "UYU" | undefined; -} - -export interface CreateMerchantOrderPayload { - /** Identificação da preferência de pagamento associados à ordem. */ - preference_id?: string | undefined; - /** Id do aplicativo. */ - application_id?: string | undefined; - /** Identificador do país a que pertence a ordem. */ - site_id?: string | undefined; - /** Informação do comprador. */ - payer?: MerchantOrderPayer | undefined; - /** Sponsor ID in Mercado Pago. */ - sponsor_id?: number | undefined; - /** Informação do item. */ - items?: MerchantOrderItem[] | undefined; - /** URL em que você gostaria de receber uma notificação de status de pagamento. */ - notification_url?: string | undefined; - /** Informações adicionais do pagamento. */ - additional_info?: string | undefined; - /** Referência que pode sincronizar com seu sistema de pagamentos. */ - external_reference?: string | undefined; - /** Origem do pagamento. Valor padrão: 'NONE' */ - marketplace?: string | undefined; -} diff --git a/types/mercadopago/models/merchantOrders/update-payload.d.ts b/types/mercadopago/models/merchantOrders/update-payload.d.ts deleted file mode 100644 index 775244efce76cc..00000000000000 --- a/types/mercadopago/models/merchantOrders/update-payload.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { CreateMerchantOrderPayload, MerchantOrderItem } from "./create-payload"; - -export interface UpdateMerchantOrderItem extends Omit { - /** /** Id do anúncio. */ - id: string; -} - -export interface UpdateMerchantOrderPayload extends Omit { - id: number | string; - items?: UpdateMerchantOrderItem[] | undefined; -} diff --git a/types/mercadopago/models/payment/capture-partial-payload.model.d.ts b/types/mercadopago/models/payment/capture-partial-payload.model.d.ts deleted file mode 100644 index 6c31b8c334747e..00000000000000 --- a/types/mercadopago/models/payment/capture-partial-payload.model.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface CapturePartialPaymentPayload { - /** Payment id. */ - id: number; - - /** New amount. */ - transaction_amount?: number | undefined; -} diff --git a/types/mercadopago/models/payment/create-payload.model.d.ts b/types/mercadopago/models/payment/create-payload.model.d.ts deleted file mode 100644 index 6b2bb05a355b98..00000000000000 --- a/types/mercadopago/models/payment/create-payload.model.d.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { Address, SimpleAddress } from "../../shared/address"; -import { Item } from "../../shared/item"; -import { Identification } from "../../shared/payer-identification"; -import { Phone } from "../../shared/phone"; - -export interface PaymentOrder { - type: "mercadolibre" | "mercadopago"; - id: number; -} - -export interface PaymentPayer { - /** Identificação do pagador associado. */ - id?: string | undefined; - /** Nome do pagador associado. */ - first_name?: string | undefined; - last_name?: string | undefined; - email: string; - /** Telefone do pagador associado. */ - phone?: Phone | undefined; - /** Identificação pessoal. */ - identification?: Identification | undefined; - /** Quando estiver ativado, o pagamento só pode ser aprovado ou rejeitado. De não estar ativado, para além deste estado, o pagamento pode ser pendente (in_process). */ - entity_type?: "individual" | "association" | undefined; - /** Tipo de identificação do pagador associado (se necessário o pagador é um cliente). */ - type?: "customer" | "registered" | "guest" | undefined; -} - -export interface PaymentItem extends Item { - /** Código de anúncio. */ - id?: string | undefined; -} - -export interface PayerAdditionalInfo extends Pick { - /** Telefone do pagador associado. */ - phone?: Omit | undefined; - /** Endereço do pagador. */ - address?: SimpleAddress | undefined; -} - -export interface Shipments extends Address { - /** Endereço do comprador. */ - receiver_address?: string | undefined; -} - -export interface AdditionalInfo { - /** IP do qual provém o request (apenas para transferência bancária). */ - ip_address?: string | undefined; - /** Lista de itens a pagar. */ - items?: PaymentItem[] | undefined; - /** Informação do comprador. */ - payer?: PayerAdditionalInfo | undefined; - /** Data de cadastro do comprador em seu site. */ - registration_date?: string | undefined; - /** Informações de envio. */ - shipments?: Shipments | undefined; -} - -// Properties defined in: https://www.mercadopago.com.br/developers/pt/reference/payments/_payments/post/ -export interface CreatePaymentPayload { - /** Informações sobre o pagador associado. */ - payer: PaymentPayer; - /** Quando estiver ativado, o pagamento só pode ser aprovado ou rejeitado. De não estar ativado, para além deste estado, o pagamento pode ser pendente (in_process). */ - binary_mode?: boolean | undefined; - /** Identificador de ordem. */ - order?: PaymentOrder | undefined; - /** Identificação fornecida pelo vendedor em seu sistema. */ - external_reference?: string | undefined; - /** Razão de pagamento ou título do item. */ - description?: string | undefined; - /** JSON válido que pode ser adicionado ao pagamento para salvar atributos adicionais do comprador. */ - metadata?: any; - /** Custo do produto. */ - transaction_amount: number; - /** Valor do cupom de desconto. */ - coupon_amount?: number | undefined; - /** Data (ISO 8601) de expiração do pagamento. */ - date_of_expiration?: string | undefined; - /** Identificador da campanha de desconto. */ - campaign_id?: number | undefined; - /** Campanha de desconto com um código específico. */ - coupon_code?: string | undefined; - /** Id do esquema de absorção do custo financeiro. */ - differential_pricing_id?: number | undefined; - /** Comissão coletadas pelo mercado ou pelo Mercado Pago. */ - application_fee?: number | undefined; - /** Determina se o pagamento deve ser capturado(true, default value), ou apenas reservado(false). */ - capture?: boolean | undefined; - /** Meio de pagamento escolhido para fazer o pagamento. */ - payment_method_id: string; - /** Id do emitente do meio de pagamento. */ - issuer_id?: string | undefined; - /** Identificador de token card. (Obrigatório para cartão de crédito) */ - token?: string | undefined; - /** Como aparecerá o pagamento no extrato do cartão (ex: o MERCADOPAGO). */ - statement_descriptor?: string | undefined; - /** Quantidade selecionada de cotas. (Obrigatório) */ - installments: number; - /** URL para qual Mercado Pago enviará notificações associadas a mudanças no status do pagamento. */ - notification_url?: string | undefined; - /** URL para a qual o Mercado Pago faz o redirecionamento final (apenas para transferência bancária). */ - callback_url?: string | undefined; - /** Informações que podem melhorar a análise de prevenção de fraude e a taxa de conversão. Trata de enviar-nos toda a informação possível. */ - additional_info?: AdditionalInfo | undefined; -} diff --git a/types/mercadopago/models/payment/update-payload.model.d.ts b/types/mercadopago/models/payment/update-payload.model.d.ts deleted file mode 100644 index 62c68f4549496e..00000000000000 --- a/types/mercadopago/models/payment/update-payload.model.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -export interface UpdatePaymentPayload { - /** Payment id. */ - id: number; - - /** Payment status. */ - status: - | "pending" - | "approved" - | "authorized" - | "in_process" - | "in_mediation" - | "rejected" - | "cancelled" - | "refunded" - | "charged_back"; -} diff --git a/types/mercadopago/models/preapproval/create-payload.model.d.ts b/types/mercadopago/models/preapproval/create-payload.model.d.ts deleted file mode 100644 index c288bb34c52654..00000000000000 --- a/types/mercadopago/models/preapproval/create-payload.model.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Currency } from "../../shared/currency"; - -export interface AutoRecurring { - /** Número de dias de recorrência. */ - frequency: number; - /** Tipo de recorrência (dias ou meses). */ - frequency_type: "days" | "months"; - /** Valor da assinatura. */ - transaction_amount: number; - /** Identificador de moeda local. */ - currency_id: Currency; - /** Data (ISO_8601) de início da assinatura. */ - start_date?: string | undefined; - /** Data (ISO_8601) de término da assinatura. */ - end_date?: string | undefined; -} - -export interface CreatePreApprovalPayload { - /** Email do pagador. */ - payer_email?: string | undefined; - /** Url de retorno. */ - back_url?: string | undefined; - /** Identificador de fornecedor. */ - collector_id?: string | undefined; - /** Status de assinatura. */ - status?: string | undefined; - /** Título da assinatura. */ - reason?: string | undefined; - /** Valor de referência de assinatura. */ - external_reference?: string | undefined; - auto_recurring?: AutoRecurring | undefined; -} diff --git a/types/mercadopago/models/preapproval/update-payload.model.d.ts b/types/mercadopago/models/preapproval/update-payload.model.d.ts deleted file mode 100644 index 245e0e660a3e5a..00000000000000 --- a/types/mercadopago/models/preapproval/update-payload.model.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface UpdatePreApprovalPayload { - /** PreApproval id. */ - id: number; - - /** PreApproval status. */ - status: "pending" | "paused" | "cancelled"; -} diff --git a/types/mercadopago/models/preferences/create-payload.model.d.ts b/types/mercadopago/models/preferences/create-payload.model.d.ts deleted file mode 100644 index fb6b6f6c1f121c..00000000000000 --- a/types/mercadopago/models/preferences/create-payload.model.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { CompleteAddress, SimpleAddress } from "../../shared/address"; -import { Currency } from "../../shared/currency"; -import { Identification } from "../../shared/payer-identification"; -import { Phone } from "../../shared/phone"; - -export interface PreferenceItem { - /** Indentificador do item. */ - id?: string | undefined; - /** Título do item, é apresentado o fluxo de pagamento. */ - title?: string | undefined; - /** Descrição do artigo. */ - description?: string | undefined; - /** URL da imagem do anúncio. */ - picture_url?: string | undefined; - /** Identificador da categoria do item. */ - category_id?: string | undefined; - /** Quantidade de itens. */ - quantity?: number | undefined; - /** Identificador de moeda em formato ISO_4217. */ - currency_id?: Currency | undefined; - /** Preço unitário. */ - unit_price?: number | undefined; -} - -export interface PreferencePayer { - /** Nome do comprador. */ - name?: string | undefined; - /** Apelido do comprador. */ - surname?: string | undefined; - /** Endereço de e-mail do comprador. */ - email?: string | undefined; - /** Telefone do comprador. */ - phone?: Omit | undefined; - /** Identificação pessoal. */ - identification?: Identification | undefined; - /** Endereço do comprador. */ - address?: SimpleAddress | undefined; - /** Data (ISO 8601) de registro. */ - date_created?: string | undefined; -} - -export interface PreferencePaymentMethods { - /** Métodos de pagamento não são permitidos no fluxo de pagamento (à exceção de account_money). */ - excluded_payment_methods?: - | Array<{ - /** Identificador do método de pagamento. */ - id: string; - }> - | undefined; - /** Tipos de pagamento não são permitidos no fluxo de pagamento. */ - excluded_payment_types?: - | Array<{ - /** Identificador de data_type do meio de pagamento. */ - id: string; - }> - | undefined; - /** Meio de pagamento preferido. */ - default_payment_method_id?: string | undefined; - /** Número Máximo de cotas. */ - installments?: number | undefined; - /** Preferência de cotas. */ - default_installments?: number | undefined; -} - -export interface PreferenceShipment { - /** - * custom = Custom shipping. - * me2 = Mercado Envíos. - * not_specified = Shipping mode not specified. - */ - mode?: "custom" | "me2" | "not_specified" | undefined; - /** Preferência de remoção de pacotes em agência(mode:me2 somente). */ - local_pickup?: boolean | undefined; - /** Tamanho do pacote em cm x cm x cm, gr (mode:me2 somente) */ - dimensions?: string | undefined; - /** Escolha um método de envio padrão no _checkout_(mode:me2 somente). */ - default_shipping_method?: number | undefined; - /** Oferecer um método de frete grátis (mode:me2 somente). */ - free_methods?: - | Array<{ - /** Identificador do método de envio. */ - id: number; - }> - | undefined; - /** Custo do transporte (mode:custom somente). */ - cost?: number | undefined; - /** Preferência de frete grátis para mode:custom. */ - free_shipping?: boolean | undefined; - /** Endereço de envio. */ - receiver_address?: CompleteAddress | undefined; -} - -export interface PreferenceBackUrl { - /** URL de retorno ante o pagamento aprovado. */ - success?: string | undefined; - /** URL de retorno ante o pagamento pendente. */ - pending?: string | undefined; - /** URL de retorno ante o pagamento cancelado. */ - failure?: string | undefined; -} - -export interface PreferenceTrack { - /** - * Tipo de rastreio. Especifique a qual ferramenta os valores pertencem. - * google_ad = Configure uma tag de acompanhamento de conversões do Google Ads no GTM. Valores necessários: conversion_id e conversion_label. - * facebook_ad = Permite configurar um pixel do Facebook. Valores necessários: pixel_id. - */ - type: "google_ad" | "facebook_ad"; - values: any; -} - -export interface CreatePreferencePayload { - /** Informações sobre o item. */ - items?: PreferenceItem[] | undefined; - /** Informações sobre o comprador. */ - payer?: PreferencePayer | undefined; - /** Métodos de pagamento a ser excluídos do fluxo de pagamento. */ - payment_methods?: PreferencePaymentMethods | undefined; - /** Informações de envio. */ - shipments?: PreferenceShipment | undefined; - /** Url de retorno ao site do vendedor. */ - back_urls?: PreferenceBackUrl | undefined; - /** URL para a qual você gostaria de receber notificações de pagamentos. */ - notification_url?: string | undefined; - /** Como aparecerá o pagamento no extrato do cartão (ex: o MERCADOPAGO). */ - statement_descriptor?: string | undefined; - /** Informações adicionais. */ - additional_info?: string | undefined; - /** - * No caso de estar especificado o comprador será redirecionado para o seu site imediatamente após a compra. - * approved = The redirection takes place only for approved payments. - * all = The redirection takes place only for approved payments, forward compatibility only if we change the default behavior - */ - auto_return?: "approved" | "all" | undefined; - /** Referência que pode sincronizar com seu sistema de pagamentos. */ - external_reference?: string | undefined; - /** Preferência que determina se uma preferência expira. */ - expires?: boolean | undefined; - /** Data (ISO_8601) de expiração de meios de pagamento em dinheiro. */ - date_of_expiration?: string | undefined; - /** Data (ISO_8601) a partir da qual a preferência estará ativa. */ - expiration_date_from?: string | undefined; - /** Data (ISO_8601) em que a preferência expira. */ - expiration_date_to?: string | undefined; - /** Origem do pagamento. Valor por defeito: NENHUM */ - marketplace?: string | undefined; - /** Comissão de Mercado cobrada pelo proprietário do aplicativo. Valor por default: 0 em moeda local */ - marketplace_fee?: number | undefined; - /** Configuração de preço diferencial para esta preferência. */ - differential_pricing?: { - /** Identificador de preço diferenciado. */ - id: number; - } | undefined; - /** Quando definido como true, o pagamento só pode ter os status approved ou rejected. Caso contrário, o status in_process é adicionado. */ - binary_mode?: boolean | undefined; - /** Definição de impostos diferenciados. Disponível apenas para o Mercado Livre Colombia. */ - taxes?: - | Array<{ - /** Identificador de imposto */ - type: "IVA" | "INC"; - /** Valor do imposto. É suportado no máximo duas casas decimais. Para itens isentos de imposto, zero deve ser relatado. */ - value: number; - }> - | undefined; - /** Tracks que serão executados durante a interação do usuário no fluxo de Pagamento. */ - tracks?: PreferenceTrack[] | undefined; - /** Quando for indicado o valor wallet_purchase, o Checkout aceitará pagamentos exclusivamente de usuários cadastrados no Mercado Pago, com cartão e saldo em conta. */ - purpose?: string | undefined; -} diff --git a/types/mercadopago/models/preferences/update-payload.model.d.ts b/types/mercadopago/models/preferences/update-payload.model.d.ts deleted file mode 100644 index b5cbfc11fd594d..00000000000000 --- a/types/mercadopago/models/preferences/update-payload.model.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { CreatePreferencePayload } from "./create-payload.model"; - -export interface UpdatePreferencePayload extends CreatePreferencePayload { - /** Preference id. */ - id: string; -} diff --git a/types/mercadopago/package.json b/types/mercadopago/package.json deleted file mode 100644 index 170d95dce56ae0..00000000000000 --- a/types/mercadopago/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "private": true, - "name": "@types/mercadopago", - "version": "1.5.9999", - "projects": [ - "https://github.com/mercadopago/dx-nodejs" - ], - "devDependencies": { - "@types/mercadopago": "workspace:." - }, - "owners": [ - { - "name": "Daniel Pereira", - "githubUsername": "danieldspx" - } - ] -} diff --git a/types/mercadopago/resources/cards.d.ts b/types/mercadopago/resources/cards.d.ts deleted file mode 100644 index 6991f90bd58f07..00000000000000 --- a/types/mercadopago/resources/cards.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { CreateCardPayload } from "../models/cards/create-payload"; -import { UpdateCardPayload } from "../models/cards/update-payload"; -import { DefaultConfigurationOmitQs } from "../models/default-configuration.model"; -import { CallbackFunction } from "../shared/types"; -import { ExecOptions, MercadoPagoResponse } from "../utils/mercadopago-respose"; - -export type CardCreateResponse = MercadoPagoResponse>; - -export type CardUpdateResponse = MercadoPagoResponse>; - -export type CardGetResponse = MercadoPagoResponse>; - -export type CardDeleteResponse = MercadoPagoResponse>; - -export interface MercadoPagoCard { - create( - payload: CreateCardPayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - /** Alias for `create` method. */ - save( - payload: CreateCardPayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - update( - payload: UpdateCardPayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - get( - customerId: string, - id: number | string, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - /** Alias for `get` method. */ - findById( - customerId: string, - id: number | string, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - all( - customerId: string, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - delete( - customerId: string, - id: number | string, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; -} diff --git a/types/mercadopago/resources/customers.d.ts b/types/mercadopago/resources/customers.d.ts deleted file mode 100644 index beba78133cac0d..00000000000000 --- a/types/mercadopago/resources/customers.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { CreateCustomerPayload } from "../models/customers/create-payload.model"; -import { CustomerSearchConfiguration } from "../models/customers/search-configuration.model"; -import { UpdateCustomerPayload } from "../models/customers/update-payload.model"; -import { DefaultConfigurationOmitQs } from "../models/default-configuration.model"; -import { CallbackFunction } from "../shared/types"; -import { ExecOptions, MercadoPagoResponse } from "../utils/mercadopago-respose"; -import { MercadoPagoCard } from "./cards"; - -export type CustomerCreateResponse = MercadoPagoResponse< - ExecOptions ->; - -export type CustomerUpdateResponse = MercadoPagoResponse< - ExecOptions ->; - -export type CustomerGetResponse = MercadoPagoResponse>; - -export type CustomerSearchResponse = MercadoPagoResponse>; - -export type CustomerDeleteResponse = MercadoPagoResponse>; - -export interface MercadoPagoCustomer { - create( - payload: CreateCustomerPayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - /** Alias for `create` method. */ - save( - payload: CreateCustomerPayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - update( - payload: UpdateCustomerPayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - get( - id: string, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - /** Alias for `get` method. */ - findById( - id: string, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - search(configuration: CustomerSearchConfiguration, callback?: CallbackFunction): Promise; - - remove( - id: string, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - cards: MercadoPagoCard; -} diff --git a/types/mercadopago/resources/merchantOrders.d.ts b/types/mercadopago/resources/merchantOrders.d.ts deleted file mode 100644 index 57099dc06ef655..00000000000000 --- a/types/mercadopago/resources/merchantOrders.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { DefaultConfigurationOmitQs } from "../models/default-configuration.model"; -import { CreateMerchantOrderPayload } from "../models/merchantOrders/create-payload"; -import { UpdateMerchantOrderPayload } from "../models/merchantOrders/update-payload"; -import { CallbackFunction } from "../shared/types"; -import { ExecOptions, MercadoPagoResponse } from "../utils/mercadopago-respose"; - -export type MerchantOrderCreateResponse = MercadoPagoResponse< - ExecOptions ->; - -export type MerchantOrderUpdateResponse = MercadoPagoResponse< - ExecOptions ->; - -export type MerchantOrderGetResponse = MercadoPagoResponse>; - -export interface MercadoPagoMerchantOrder { - create( - payload: CreateMerchantOrderPayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - /** Alias for `create` method. */ - save( - payload: CreateMerchantOrderPayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - update( - payload: UpdateMerchantOrderPayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - get( - id: number | string, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - /** Alias for `get` method. */ - findById( - id: number | string, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; -} diff --git a/types/mercadopago/resources/payment.d.ts b/types/mercadopago/resources/payment.d.ts deleted file mode 100644 index 9e8c42e22ea4a6..00000000000000 --- a/types/mercadopago/resources/payment.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { DefaultConfigurationOmitQs, SearchConfiguration } from "../models/default-configuration.model"; -import { CapturePartialPaymentPayload } from "../models/payment/capture-partial-payload.model"; -import { CreatePaymentPayload } from "../models/payment/create-payload.model"; -import { UpdatePaymentPayload } from "../models/payment/update-payload.model"; -import { CallbackFunction } from "../shared/types"; -import { ExecOptions, MercadoPagoResponse } from "../utils/mercadopago-respose"; - -export type PaymentCreateResponse = MercadoPagoResponse>; - -export type PaymentUpdateResponse = MercadoPagoResponse>; - -export type PaymentGetResponse = MercadoPagoResponse>; - -export type PaymentSearchResponse = MercadoPagoResponse>; - -export interface MercadoPagoPayment { - create( - payload: CreatePaymentPayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - /** Alias for `create` method. */ - save( - payload: CreatePaymentPayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - update( - payload: UpdatePaymentPayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - get( - id: number, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - capture( - id: number, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - capturePartial( - payload: CapturePartialPaymentPayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - /** Alias for `get` method. */ - findById( - id: number, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - search(configuration: SearchConfiguration, callback?: CallbackFunction): Promise; - - /** Cancel payment */ - cancel( - id: number, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - // Complete and partial refund - refund(id: number): Promise; - refundPartial({ - payment_id, - amount, - }: { - payment_id: number; - amount: number; - }): Promise; -} diff --git a/types/mercadopago/resources/preapproval.d.ts b/types/mercadopago/resources/preapproval.d.ts deleted file mode 100644 index 979c99cee24d04..00000000000000 --- a/types/mercadopago/resources/preapproval.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { DefaultConfigurationOmitQs } from "../models/default-configuration.model"; -import { CreatePreApprovalPayload } from "../models/preapproval/create-payload.model"; -import { UpdatePreApprovalPayload } from "../models/preapproval/update-payload.model"; -import { CallbackFunction } from "../shared/types"; -import { ExecOptions, MercadoPagoResponse } from "../utils/mercadopago-respose"; - -export type PreApprovalCreateResponse = MercadoPagoResponse< - ExecOptions ->; - -export type PreApprovalUpdateResponse = MercadoPagoResponse< - ExecOptions ->; - -export type PreApprovalGetResponse = MercadoPagoResponse>; - -export interface MercadoPagoPreApproval { - create( - payload: CreatePreApprovalPayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - /** Alias for `create` method. */ - save( - payload: CreatePreApprovalPayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - update( - payload: UpdatePreApprovalPayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - get( - id: string, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - /** Alias for `get` method. */ - findById( - id: string, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - /** Cancel a prepparoval */ - cancel( - id: string, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - /** Pause a preapproval */ - pause( - id: string, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; -} diff --git a/types/mercadopago/resources/preferences.d.ts b/types/mercadopago/resources/preferences.d.ts deleted file mode 100644 index b6bbb78834aa8f..00000000000000 --- a/types/mercadopago/resources/preferences.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { DefaultConfigurationOmitQs } from "../models/default-configuration.model"; -import { CreatePreferencePayload } from "../models/preferences/create-payload.model"; -import { UpdatePreferencePayload } from "../models/preferences/update-payload.model"; -import { CallbackFunction } from "../shared/types"; -import { ExecOptions, MercadoPagoResponse } from "../utils/mercadopago-respose"; - -export type PreferenceCreateResponse = MercadoPagoResponse< - ExecOptions ->; - -export type PreferenceUpdateResponse = MercadoPagoResponse< - ExecOptions ->; - -export type PreferenceGetResponse = MercadoPagoResponse>; - -export interface MercadoPagoPreference { - create( - payload: CreatePreferencePayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - /** Alias for `create` method. */ - save( - payload: CreatePreferencePayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - update( - payload: UpdatePreferencePayload, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - get( - id: string, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; - - /** Alias for `get` method. */ - findById( - id: string, - configuration?: DefaultConfigurationOmitQs, - callback?: CallbackFunction, - ): Promise; -} diff --git a/types/mercadopago/shared/address.d.ts b/types/mercadopago/shared/address.d.ts deleted file mode 100644 index c8931ceb36bb39..00000000000000 --- a/types/mercadopago/shared/address.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -export interface SimpleAddress { - zip_code?: string | undefined; - street_name?: string | undefined; - street_number?: number | undefined; -} - -export interface SimpleAddressId extends SimpleAddress { - /** Identificador do endereço do cliente. */ - id?: string | undefined; -} - -export interface Address extends SimpleAddress { - floor?: string | undefined; - apartment?: string | undefined; -} - -export interface CompleteAddress extends Address { - city_name: string; - state_name: string; -} diff --git a/types/mercadopago/shared/currency.d.ts b/types/mercadopago/shared/currency.d.ts deleted file mode 100644 index a3045c9a25f7f7..00000000000000 --- a/types/mercadopago/shared/currency.d.ts +++ /dev/null @@ -1,181 +0,0 @@ -export type Currency = - /** United Arab Emirates dirham */ - | "AED" - | /** Afghan afghani */ "AFN" - | /** Albanian lek */ "ALL" - | /** Armenian dram */ "AMD" - | /** Netherlands Antillean guilder */ "ANG" - | /** Angolan kwanza */ "AOA" - | /** Argentine peso */ "ARS" - | /** Australian dollar */ "AUD" - | /** Aruban florin */ "AWG" - | /** Azerbaijani manat */ "AZN" - | /** Bosnia and Herzegovina convertible mark */ "BAM" - | /** Barbados dollar */ "BBD" - | /** Bangladeshi taka */ "BDT" - | /** Bulgarian lev */ "BGN" - | /** Bahraini dinar */ "BHD" - | /** Burundian franc */ "BIF" - | /** Bermudian dollar */ "BMD" - | /** Brunei dollar */ "BND" - | /** Boliviano */ "BOB" - | /** Bolivian Mvdol (funds code) */ "BOV" - | /** Brazilian real */ "BRL" - | /** Bahamian dollar */ "BSD" - | /** Bhutanese ngultrum */ "BTN" - | /** Botswana pula */ "BWP" - | /** Belarusian ruble */ "BYN" - | /** Belize dollar */ "BZD" - | /** Canadian dollar */ "CAD" - | /** Congolese franc */ "CDF" - | /** WIR euro (complementary currency) */ "CHE" - | /** Swiss franc */ "CHF" - | /** WIR franc (complementary currency) */ "CHW" - | /** Unidad de Fomento (funds code) */ "CLF" - | /** Chilean peso */ "CLP" - | /** Chinese yuan[8] */ "CNY" - | /** Colombian peso */ "COP" - | /** Unidad de Valor Real (UVR) (funds code)[9] */ "COU" - | /** Costa Rican colon */ "CRC" - | /** Cuban convertible peso */ "CUC" - | /** Cuban peso */ "CUP" - | /** Cape Verdean escudo */ "CVE" - | /** Czech koruna */ "CZK" - | /** Djiboutian franc */ "DJF" - | /** Danish krone */ "DKK" - | /** Dominican peso */ "DOP" - | /** Algerian dinar */ "DZD" - | /** Egyptian pound */ "EGP" - | /** Eritrean nakfa */ "ERN" - | /** Ethiopian birr */ "ETB" - | /** Euro */ "EUR" - | /** Fiji dollar */ "FJD" - | /** Falkland Islands pound */ "FKP" - | /** Pound sterling */ "GBP" - | /** Georgian lari */ "GEL" - | /** Ghanaian cedi */ "GHS" - | /** Gibraltar pound */ "GIP" - | /** Gambian dalasi */ "GMD" - | /** Guinean franc */ "GNF" - | /** Guatemalan quetzal */ "GTQ" - | /** Guyanese dollar */ "GYD" - | /** Hong Kong dollar */ "HKD" - | /** Honduran lempira */ "HNL" - | /** Croatian kuna */ "HRK" - | /** Haitian gourde */ "HTG" - | /** Hungarian forint */ "HUF" - | /** Indonesian rupiah */ "IDR" - | /** Israeli new shekel */ "ILS" - | /** Indian rupee */ "INR" - | /** Iraqi dinar */ "IQD" - | /** Iranian rial */ "IRR" - | /** Icelandic króna */ "ISK" - | /** Jamaican dollar */ "JMD" - | /** Jordanian dinar */ "JOD" - | /** Japanese yen */ "JPY" - | /** Kenyan shilling */ "KES" - | /** Kyrgyzstani som */ "KGS" - | /** Cambodian riel */ "KHR" - | /** Comoro franc */ "KMF" - | /** North Korean won */ "KPW" - | /** South Korean won */ "KRW" - | /** Kuwaiti dinar */ "KWD" - | /** Cayman Islands dollar */ "KYD" - | /** Kazakhstani tenge */ "KZT" - | /** Lao kip */ "LAK" - | /** Lebanese pound */ "LBP" - | /** Sri Lankan rupee */ "LKR" - | /** Liberian dollar */ "LRD" - | /** Lesotho loti */ "LSL" - | /** Libyan dinar */ "LYD" - | /** Moroccan dirham */ "MAD" - | /** Moldovan leu */ "MDL" - | /** Malagasy ariary */ "MGA" - | /** Macedonian denar */ "MKD" - | /** Myanmar kyat */ "MMK" - | /** Mongolian tögrög */ "MNT" - | /** Macanese pataca */ "MOP" - | /** Mauritanian ouguiya */ "MRU" - | /** Mauritian rupee */ "MUR" - | /** Maldivian rufiyaa */ "MVR" - | /** Malawian kwacha */ "MWK" - | /** Mexican peso */ "MXN" - | /** Mexican Unidad de Inversion (UDI) (funds code) */ "MXV" - | /** Malaysian ringgit */ "MYR" - | /** Mozambican metical */ "MZN" - | /** Namibian dollar */ "NAD" - | /** Nigerian naira */ "NGN" - | /** Nicaraguan córdoba */ "NIO" - | /** Norwegian krone */ "NOK" - | /** Nepalese rupee */ "NPR" - | /** New Zealand dollar */ "NZD" - | /** Omani rial */ "OMR" - | /** Panamanian balboa */ "PAB" - | /** Peruvian sol */ "PEN" - | /** Papua New Guinean kina */ "PGK" - | /** Philippine peso[12] */ "PHP" - | /** Pakistani rupee */ "PKR" - | /** Polish złoty */ "PLN" - | /** Paraguayan guaraní */ "PYG" - | /** Qatari riyal */ "QAR" - | /** Romanian leu */ "RON" - | /** Serbian dinar */ "RSD" - | /** Russian ruble */ "RUB" - | /** Rwandan franc */ "RWF" - | /** Saudi riyal */ "SAR" - | /** Solomon Islands dollar */ "SBD" - | /** Seychelles rupee */ "SCR" - | /** Sudanese pound */ "SDG" - | /** Swedish krona/kronor */ "SEK" - | /** Singapore dollar */ "SGD" - | /** Saint Helena pound */ "SHP" - | /** Sierra Leonean leone */ "SLL" - | /** Somali shilling */ "SOS" - | /** Surinamese dollar */ "SRD" - | /** South Sudanese pound */ "SSP" - | /** São Tomé and Príncipe dobra */ "STN" - | /** Salvadoran colón */ "SVC" - | /** Syrian pound */ "SYP" - | /** Swazi lilangeni */ "SZL" - | /** Thai baht */ "THB" - | /** Tajikistani somoni */ "TJS" - | /** Turkmenistan manat */ "TMT" - | /** Tunisian dinar */ "TND" - | /** Tongan paʻanga */ "TOP" - | /** Turkish lira */ "TRY" - | /** Trinidad and Tobago dollar */ "TTD" - | /** New Taiwan dollar */ "TWD" - | /** Tanzanian shilling */ "TZS" - | /** Ukrainian hryvnia */ "UAH" - | /** Ugandan shilling */ "UGX" - | /** United States dollar */ "USD" - | /** United States dollar (next day) (funds code) */ "USN" - | /** Uruguay Peso en Unidades Indexadas (URUIURUI) (funds code) */ "UYI" - | /** Uruguayan peso */ "UYU" - | /** Unidad previsional[14] */ "UYW" - | /** Uzbekistan som */ "UZS" - | /** Venezuelan bolívar soberano[12] */ "VES" - | /** Vietnamese đồng */ "VND" - | /** Vanuatu vatu */ "VUV" - | /** Samoan tala */ "WST" - | /** CFA franc BEAC */ "XAF" - | /** Silver (one troy ounce) */ "XAG" - | /** Gold (one troy ounce) */ "XAU" - | /** European Composite Unit (EURCO) (bond market unit) */ "XBA" - | /** European Monetary Unit (E.M.U.-6) (bond market unit) */ "XBB" - | /** European Unit of Account 9 (E.U.A.-9) (bond market unit) */ "XBC" - | /** European Unit of Account 17 (E.U.A.-17) (bond market unit) */ "XBD" - | /** East Caribbean dollar */ "XCD" - | /** Special drawing rights */ "XDR" - | /** CFA franc BCEAO */ "XOF" - | /** Palladium (one troy ounce) */ "XPD" - | /** CFP franc (franc Pacifique) */ "XPF" - | /** Platinum (one troy ounce) */ "XPT" - | /** SUCRE */ "XSU" - | /** Code reserved for testing */ "XTS" - | /** ADB Unit of Account */ "XUA" - | /** No currency */ "XXX" - | /** Yemeni rial */ "YER" - | /** South African rand */ "ZAR" - | /** Zambian kwacha */ "ZMW" - | /** Zimbabwean dollar */ "ZWL"; diff --git a/types/mercadopago/shared/item.d.ts b/types/mercadopago/shared/item.d.ts deleted file mode 100644 index cf9959b2337e48..00000000000000 --- a/types/mercadopago/shared/item.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface Item { - /** Nome do item. */ - title?: string | undefined; - /** Descrição do artigo. */ - description?: string | undefined; - /** URL da imagem. */ - picture_url?: string | undefined; - /** Categoria do item. */ - category_id?: string | undefined; - /** Quantidade de itens. */ - quantity?: number | undefined; - /** Preço unitário. */ - unit_price?: number | undefined; -} diff --git a/types/mercadopago/shared/payer-identification.d.ts b/types/mercadopago/shared/payer-identification.d.ts deleted file mode 100644 index acb3264dc95598..00000000000000 --- a/types/mercadopago/shared/payer-identification.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface Identification { - type: string; - number: string; -} diff --git a/types/mercadopago/shared/phone.d.ts b/types/mercadopago/shared/phone.d.ts deleted file mode 100644 index b6edc3137cfba7..00000000000000 --- a/types/mercadopago/shared/phone.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface Phone { - area_code: string; - number: string; - extension?: string | undefined; -} diff --git a/types/mercadopago/shared/types.d.ts b/types/mercadopago/shared/types.d.ts deleted file mode 100644 index 7669c83562be45..00000000000000 --- a/types/mercadopago/shared/types.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type CallbackFunction = () => any; diff --git a/types/mercadopago/tsconfig.json b/types/mercadopago/tsconfig.json deleted file mode 100644 index a5eff6374b7090..00000000000000 --- a/types/mercadopago/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "mercadopago-tests.ts" - ] -} diff --git a/types/mercadopago/utils/mercadopago-respose.d.ts b/types/mercadopago/utils/mercadopago-respose.d.ts deleted file mode 100644 index 600ee1c310e0a2..00000000000000 --- a/types/mercadopago/utils/mercadopago-respose.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { CallbackFunction } from "../shared/types"; - -export interface ExecOptions { - schema: any; - base_url: string; - path: string; - method: string; - /** Configurations object */ - config: K; - /** Payload to send */ - payload: P; - /** If needs the idempotency header */ - idempotency: boolean; - access_token: string; - platformId: string; - corporationId: string; - integratorId: string; -} - -export interface Pagination { - total: number; - limit: number; - offset: number; -} - -export class MercadoPagoResponse { - body: any; - response: any; - status: number; - idempotency: string; - pagination: unknown; - - /** Execute previous page request */ - prev(callback: CallbackFunction): MercadoPagoResponse; - - /** Execute next page request */ - next(callback: CallbackFunction): MercadoPagoResponse; - - /** Check if it has a previous page */ - hasPrev(): boolean; - - /** Check if it has a next page */ - hasNext(): boolean; - - /** Get exec options */ - getExecOptions(): K; -} diff --git a/types/node-media-server/index.d.ts b/types/node-media-server/index.d.ts index 013d018a1c3bc8..11d7ed71de596b 100644 --- a/types/node-media-server/index.d.ts +++ b/types/node-media-server/index.d.ts @@ -96,7 +96,14 @@ declare class NodeMediaServer { run(): void; on(eventName: string, listener: (id: string, StreamPath: string, args: object) => void): void; stop(): void; - getSession(id: string): Map; + /** + * Looks up a single session by its id. + * + * The returned value is one of the internal session objects (`NodeRtmpSession`, + * `NodeFlvSession`, `NodeRelaySession`, ...), which this package does not + * declare, or `undefined` when no session is registered for `id`. + */ + getSession(id: string): unknown; } export = NodeMediaServer; diff --git a/types/node-media-server/node-media-server-tests.ts b/types/node-media-server/node-media-server-tests.ts index 72c4438acf29d3..75fe6bbf035fba 100644 --- a/types/node-media-server/node-media-server-tests.ts +++ b/types/node-media-server/node-media-server-tests.ts @@ -49,7 +49,7 @@ nms.on("test"); // $ExpectType void nms.on("test", () => {}); -// $ExpectType Map +// $ExpectType unknown nms.getSession("1"); // $ExpectType void diff --git a/types/node/node-tests/globals-non-dom.ts b/types/node/node-tests/globals-non-dom.ts index 8d281b152b76a5..3f7eb17baccbd9 100644 --- a/types/node/node-tests/globals-non-dom.ts +++ b/types/node/node-tests/globals-non-dom.ts @@ -69,3 +69,9 @@ } })(); } + +{ + const transform: ReadableWritablePair = new TransformStream(); + const piped = new ReadableStream().pipeThrough(transform); // $ExpectType ReadableStream + void piped; +} diff --git a/types/node/v22/stream/web.d.ts b/types/node/v22/stream/web.d.ts index fbffa5593f2d0a..64846249a1639b 100644 --- a/types/node/v22/stream/web.d.ts +++ b/types/node/v22/stream/web.d.ts @@ -16,6 +16,8 @@ type _ReadableStreamDefaultController = typeof globalThis extends { onm : import("stream/web").ReadableStreamDefaultController; type _ReadableStreamDefaultReader = typeof globalThis extends { onmessage: any } ? {} : import("stream/web").ReadableStreamDefaultReader; +type _ReadableWritablePair = typeof globalThis extends { onmessage: any } ? {} + : import("stream/web").ReadableWritablePair; type _TextDecoderStream = typeof globalThis extends { onmessage: any } ? {} : import("stream/web").TextDecoderStream; type _TextEncoderStream = typeof globalThis extends { onmessage: any } ? {} @@ -501,6 +503,8 @@ declare module "stream/web" { { onmessage: any; ReadableStreamDefaultReader: infer T } ? T : typeof import("stream/web").ReadableStreamDefaultReader; + interface ReadableWritablePair extends _ReadableWritablePair {} + interface TextDecoderStream extends _TextDecoderStream {} /** * `TextDecoderStream` class is a global reference for `import { TextDecoderStream } from 'node:stream/web'`. diff --git a/types/node/v22/test/globals-non-dom.ts b/types/node/v22/test/globals-non-dom.ts index 8e20bc2b15761f..7ce041e73e7b77 100644 --- a/types/node/v22/test/globals-non-dom.ts +++ b/types/node/v22/test/globals-non-dom.ts @@ -64,3 +64,9 @@ } })(); } + +{ + const transform: ReadableWritablePair = new TransformStream(); + const piped = new ReadableStream().pipeThrough(transform); // $ExpectType ReadableStream + void piped; +} diff --git a/types/node/v24/stream/web.d.ts b/types/node/v24/stream/web.d.ts index fc88e13fff057b..9aaf2c37b18159 100644 --- a/types/node/v24/stream/web.d.ts +++ b/types/node/v24/stream/web.d.ts @@ -16,6 +16,8 @@ type _ReadableStreamDefaultController = typeof globalThis extends { onm : import("stream/web").ReadableStreamDefaultController; type _ReadableStreamDefaultReader = typeof globalThis extends { onmessage: any } ? {} : import("stream/web").ReadableStreamDefaultReader; +type _ReadableWritablePair = typeof globalThis extends { onmessage: any } ? {} + : import("stream/web").ReadableWritablePair; type _TextDecoderStream = typeof globalThis extends { onmessage: any } ? {} : import("stream/web").TextDecoderStream; type _TextEncoderStream = typeof globalThis extends { onmessage: any } ? {} @@ -501,6 +503,8 @@ declare module "stream/web" { { onmessage: any; ReadableStreamDefaultReader: infer T } ? T : typeof import("stream/web").ReadableStreamDefaultReader; + interface ReadableWritablePair extends _ReadableWritablePair {} + interface TextDecoderStream extends _TextDecoderStream {} /** * `TextDecoderStream` class is a global reference for `import { TextDecoderStream } from 'node:stream/web'`. diff --git a/types/node/v24/test/globals-non-dom.ts b/types/node/v24/test/globals-non-dom.ts index 43bc04b55facc7..01be69ad3eb587 100644 --- a/types/node/v24/test/globals-non-dom.ts +++ b/types/node/v24/test/globals-non-dom.ts @@ -69,3 +69,9 @@ } })(); } + +{ + const transform: ReadableWritablePair = new TransformStream(); + const piped = new ReadableStream().pipeThrough(transform); // $ExpectType ReadableStream + void piped; +} diff --git a/types/node/v25/node-tests/globals-non-dom.ts b/types/node/v25/node-tests/globals-non-dom.ts index 8d281b152b76a5..3f7eb17baccbd9 100644 --- a/types/node/v25/node-tests/globals-non-dom.ts +++ b/types/node/v25/node-tests/globals-non-dom.ts @@ -69,3 +69,9 @@ } })(); } + +{ + const transform: ReadableWritablePair = new TransformStream(); + const piped = new ReadableStream().pipeThrough(transform); // $ExpectType ReadableStream + void piped; +} diff --git a/types/node/v25/web-globals/streams.d.ts b/types/node/v25/web-globals/streams.d.ts index 9650ea8ef2eeb4..96d2868d72c0d5 100644 --- a/types/node/v25/web-globals/streams.d.ts +++ b/types/node/v25/web-globals/streams.d.ts @@ -19,6 +19,8 @@ type _ReadableStreamDefaultController = typeof globalThis extends { onm : webstreams.ReadableStreamDefaultController; type _ReadableStreamDefaultReader = typeof globalThis extends { onmessage: any } ? {} : webstreams.ReadableStreamDefaultReader; +type _ReadableWritablePair = typeof globalThis extends { onmessage: any } ? {} + : webstreams.ReadableWritablePair; type _TextDecoderStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.TextDecoderStream; type _TextEncoderStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.TextEncoderStream; type _TransformStream = typeof globalThis extends { onmessage: any } ? {} @@ -82,6 +84,8 @@ declare global { ? T : typeof webstreams.ReadableStreamDefaultReader; + interface ReadableWritablePair extends _ReadableWritablePair {} + interface TextDecoderStream extends _TextDecoderStream {} var TextDecoderStream: typeof globalThis extends { onmessage: any; TextDecoderStream: infer T } ? T : typeof webstreams.TextDecoderStream; diff --git a/types/node/web-globals/streams.d.ts b/types/node/web-globals/streams.d.ts index 9650ea8ef2eeb4..96d2868d72c0d5 100644 --- a/types/node/web-globals/streams.d.ts +++ b/types/node/web-globals/streams.d.ts @@ -19,6 +19,8 @@ type _ReadableStreamDefaultController = typeof globalThis extends { onm : webstreams.ReadableStreamDefaultController; type _ReadableStreamDefaultReader = typeof globalThis extends { onmessage: any } ? {} : webstreams.ReadableStreamDefaultReader; +type _ReadableWritablePair = typeof globalThis extends { onmessage: any } ? {} + : webstreams.ReadableWritablePair; type _TextDecoderStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.TextDecoderStream; type _TextEncoderStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.TextEncoderStream; type _TransformStream = typeof globalThis extends { onmessage: any } ? {} @@ -82,6 +84,8 @@ declare global { ? T : typeof webstreams.ReadableStreamDefaultReader; + interface ReadableWritablePair extends _ReadableWritablePair {} + interface TextDecoderStream extends _TextDecoderStream {} var TextDecoderStream: typeof globalThis extends { onmessage: any; TextDecoderStream: infer T } ? T : typeof webstreams.TextDecoderStream; diff --git a/types/oidc-provider/index.d.ts b/types/oidc-provider/index.d.ts index b7821cee6ef96e..c2a30efd3b8e75 100644 --- a/types/oidc-provider/index.d.ts +++ b/types/oidc-provider/index.d.ts @@ -924,7 +924,7 @@ export type TokenEndpointGrantContext = K /* eslint-disable @typescript-eslint/no-invalid-void-type */ // BEGIN GENERATED OIDC-PROVIDER CONTRACTS -// oidc-provider types artifact "9.12.0"; schema 1; sha256 781afaad6598727ec6dbbfea7486752924eb51914dd4cac579f9244a84041e9a +// oidc-provider types artifact "9.12.2"; schema 1; sha256 11025a446176381071882466ac96dbe5438f648e8e372303501ea1c1c923abd2 export type FindAccount = ( ctx: KoaContextWithOIDC, sub: string, diff --git a/types/oidc-provider/lib/helpers/grants.d.ts b/types/oidc-provider/lib/helpers/grants.d.ts index 9ebf7c29a39413..b5602d2f7f793d 100644 --- a/types/oidc-provider/lib/helpers/grants.d.ts +++ b/types/oidc-provider/lib/helpers/grants.d.ts @@ -57,12 +57,6 @@ export interface DPoPValidationResult { iat: number; } -/** @experimental Not covered by semantic versioning conventions. */ -export interface SenderConstraints { - certificate?: string | crypto.X509Certificate | undefined; - dPoP?: DPoPValidationResult | undefined; -} - /** @experimental Not covered by semantic versioning conventions. */ export type OIDCProviderErrorConstructor = new(...args: any[]) => errors.OIDCProviderError; @@ -137,18 +131,42 @@ export function findAccount( ): Promise; /** @experimental Not covered by semantic versioning conventions. */ -export function validateSenderConstraints( +export function validateDpop( + provider: Provider, + ctx: TokenEndpointGrantContext, + accessToken?: string | undefined, +): Promise; + +/** + * @experimental Not covered by semantic versioning conventions. + * @param ErrorClass Defaults to errors.InvalidGrant. + */ +export function checkMtlsCert( provider: Provider, ctx: TokenEndpointGrantContext, ErrorClass?: OIDCProviderErrorConstructor, -): Promise; +): string | crypto.X509Certificate | undefined; -/** @experimental Not covered by semantic versioning conventions. */ -export function applySenderConstraints( +/** + * @experimental Not covered by semantic versioning conventions. + * @param ErrorClass Defaults to errors.InvalidGrant. + */ +export function checkDpopRequired( provider: Provider, ctx: TokenEndpointGrantContext, - token: AccessToken | ClientCredentials, - constraints: SenderConstraints, + dPoP: DPoPValidationResult | undefined, + ErrorClass?: OIDCProviderErrorConstructor, +): void; + +/** + * @experimental Not covered by semantic versioning conventions. + * @param ErrorClass Defaults to errors.InvalidGrant. + */ +export function checkDpopReplay( + provider: Provider, + ctx: TokenEndpointGrantContext, + dPoP: DPoPValidationResult | undefined, + clientId: string, ErrorClass?: OIDCProviderErrorConstructor, ): Promise; diff --git a/types/oidc-provider/oidc-provider-tests.ts b/types/oidc-provider/oidc-provider-tests.ts index ae069d06aa9937..347e5edef948dc 100644 --- a/types/oidc-provider/oidc-provider-tests.ts +++ b/types/oidc-provider/oidc-provider-tests.ts @@ -1616,15 +1616,30 @@ provider.registerGrantType( const authorizationDetailsSource: grantHelpers.AuthorizationDetailsSource = source; authorizationDetailsSource.rar?.[0].type.substring(0); - const constraints: grantHelpers.SenderConstraints = await grantHelpers.validateSenderConstraints( + const dPoP = await grantHelpers.validateDpop(provider, ctx); + await grantHelpers.validateDpop(provider, ctx, "access-token"); + dPoP?.thumbprint.substring(0); + dPoP?.jti.substring(0); + dPoP?.iat.toFixed(); + const certificate = grantHelpers.checkMtlsCert(provider, ctx); + grantHelpers.checkMtlsCert(provider, ctx, oidc.errors.InvalidRequest); + if (typeof certificate === "string") { + certificate.substring(0); + } else { + certificate?.fingerprint256.substring(0); + } + grantHelpers.checkDpopRequired(provider, ctx, dPoP); + grantHelpers.checkDpopRequired(provider, ctx, undefined, oidc.errors.InvalidRequest); + await grantHelpers.checkDpopReplay(provider, ctx, dPoP, ctx.oidc.client.clientId); + await grantHelpers.checkDpopReplay( provider, ctx, - oidc.errors.InvalidGrant, + undefined, + ctx.oidc.client.clientId, + oidc.errors.InvalidRequest, ); - constraints.dPoP?.thumbprint.substring(0); - constraints.dPoP?.jti.substring(0); - constraints.dPoP?.iat.toFixed(); - await grantHelpers.applySenderConstraints(provider, ctx, accessToken, constraints, oidc.errors.InvalidRequest); + if (certificate) accessToken.setThumbprint("x5t", certificate); + if (dPoP) accessToken.setThumbprint("jkt", dPoP.thumbprint); await grantHelpers.applyAuthorizationDetails(provider, ctx, accessToken, source); const refreshToken = new provider.RefreshToken({ @@ -1664,7 +1679,7 @@ provider.registerGrantType( const errorConstructor: grantHelpers.OIDCProviderErrorConstructor = oidc.errors.InvalidGrant; errorConstructor.name.substring(0); - const dpopResult: grantHelpers.DPoPValidationResult | undefined = constraints.dPoP; + const dpopResult: grantHelpers.DPoPValidationResult | undefined = dPoP; dpopResult?.thumbprint.substring(0); // @ts-expect-error The provider argument must be an oidc-provider instance. diff --git a/types/pangu/.npmignore b/types/pangu/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/pangu/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/pangu/index.d.ts b/types/pangu/index.d.ts deleted file mode 100644 index 6c08bd711fa1a1..00000000000000 --- a/types/pangu/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -export function spacing(text: string): string; - -export function spacingFile(path: string, callback: (error: Error, data: string) => void): void; -export function spacingFile(path: string): Promise; - -export function spacingFileSync(path: string): string; - -export function spacingText(text: string, callback: (error: Error, data: string) => void): void; -export function spacingText(text: string): Promise; - -export function spacingNode(contextNode: HTMLElement): void; -export function spacingElementById(id: string): void; -export function spacingElementByClassName(className: string): void; -export function spacingElementByTagName(tagName: string): void; -export function spacingPageTitle(): void; -export function spacingPageBody(): void; -export function spacingPage(): void; -export function autoSpacingPage(pageDelay?: number, nodeDelay?: number, nodeMaxWait?: number): void; - -export as namespace pangu; diff --git a/types/pangu/package.json b/types/pangu/package.json deleted file mode 100644 index a956746b54f0d0..00000000000000 --- a/types/pangu/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "private": true, - "name": "@types/pangu", - "version": "4.0.9999", - "projects": [ - "https://github.com/vinta/pangu.js" - ], - "devDependencies": { - "@types/pangu": "workspace:." - }, - "owners": [ - { - "name": "York Yao", - "githubUsername": "plantain-00" - }, - { - "name": "AH-dark", - "githubUsername": "AH-dark" - } - ] -} diff --git a/types/pangu/pangu-tests.ts b/types/pangu/pangu-tests.ts deleted file mode 100644 index e84bad85063f3a..00000000000000 --- a/types/pangu/pangu-tests.ts +++ /dev/null @@ -1,22 +0,0 @@ -import pangu = require("pangu"); - -pangu.spacing("Sephiroth見他這等神情,也是悚然一驚:不知我這Ultimate Destructive Magic是否對付得了?"); -// output: Sephiroth 見他這等神情, 也是悚然一驚: 不知我這 Ultimate Destructive Magic 是否對付得了? - -pangu.spacingFile("/path/to/text.txt", (err, data) => { -}); - -pangu.spacingFile("/path/to/text.txt").then(data => { -}); - -pangu.spacingNode(new HTMLElement()); - -const data = pangu.spacingFileSync("/path/to/text.txt"); - -pangu.spacingPage(); -pangu.spacingPageTitle(); -pangu.spacingPageBody(); -pangu.autoSpacingPage(); -pangu.spacingElementById("main"); -pangu.spacingElementByClassName("comment"); -pangu.spacingElementByTagName("p"); diff --git a/types/postcss-prefix-selector/.npmignore b/types/postcss-prefix-selector/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/postcss-prefix-selector/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/postcss-prefix-selector/index.d.ts b/types/postcss-prefix-selector/index.d.ts deleted file mode 100644 index d4c7f887340f83..00000000000000 --- a/types/postcss-prefix-selector/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Root } from "postcss"; - -interface Options { - prefix?: string | undefined; - exclude?: ReadonlyArray | undefined; - ignoreFiles?: ReadonlyArray | undefined; - includeFiles?: ReadonlyArray | undefined; - transform?: - | (( - prefix: Readonly, - selector: Readonly, - prefixedSelector: Readonly, - file: Readonly, - ) => string) - | undefined; -} - -declare function postcssPrefixSelector(options: Readonly): (root: Root) => void; - -export = postcssPrefixSelector; diff --git a/types/postcss-prefix-selector/package.json b/types/postcss-prefix-selector/package.json deleted file mode 100644 index 4ac95bdb71cdf1..00000000000000 --- a/types/postcss-prefix-selector/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "private": true, - "name": "@types/postcss-prefix-selector", - "version": "1.16.9999", - "projects": [ - "https://github.com/RadValentin/postcss-prefix-selector" - ], - "dependencies": { - "postcss": "^8.4.27" - }, - "devDependencies": { - "@types/postcss-prefix-selector": "workspace:." - }, - "owners": [ - { - "name": "robertmaier", - "githubUsername": "robertmaier" - } - ] -} diff --git a/types/postcss-prefix-selector/postcss-prefix-selector-tests.ts b/types/postcss-prefix-selector/postcss-prefix-selector-tests.ts deleted file mode 100644 index ce21c021e96ca0..00000000000000 --- a/types/postcss-prefix-selector/postcss-prefix-selector-tests.ts +++ /dev/null @@ -1,4 +0,0 @@ -import postcssPrefixSelector = require("postcss-prefix-selector"); - -// $ExpectType (root: Root_) => void -postcssPrefixSelector({}); diff --git a/types/postcss-prefix-selector/tsconfig.json b/types/postcss-prefix-selector/tsconfig.json deleted file mode 100644 index 664a75cec8de06..00000000000000 --- a/types/postcss-prefix-selector/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es2018" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictFunctionTypes": true, - "strictNullChecks": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "postcss-prefix-selector-tests.ts" - ] -} diff --git a/types/react-dom/canary.d.ts b/types/react-dom/canary.d.ts index c948464368570c..5e9448dff1b881 100644 --- a/types/react-dom/canary.d.ts +++ b/types/react-dom/canary.d.ts @@ -1,5 +1,3 @@ -/* eslint-disable @definitelytyped/no-self-import -- self-imports in module augmentations aren't self-imports */ -/* eslint-disable @definitelytyped/no-declare-current-package -- The module augmentations are optional */ /** * These are types for things that are present in the upcoming React 18 release. * @@ -33,105 +31,3 @@ import ReactDOM = require("."); import { ErrorInfo } from "./client"; export {}; - -declare const browserUsable: unique symbol; - -export interface BrowserUsable { - readonly [browserUsable]: never; -} - -declare module "." { - /** - * Creates an opaque Usable that opts a subtree into browser-only rendering. - * `reason` is diagnostic metadata: an SSR renderer uses it as the `cause` of - * the recoverable error it reports when deferring the subtree to the browser. - * A function is called lazily by that renderer; in the browser the reason is - * never observed. - */ - function browser(reason?: string | (() => unknown)): BrowserUsable; -} - -declare module "./server" { - interface RenderToPipeableStreamOptions { - /** - * A callback React calls when it recovers from `browser()` by leaving a - * Suspense fallback for the browser to replace. - */ - onBrowserBailout?: ((error: unknown, errorInfo: ErrorInfo) => void) | undefined; - } - - interface RenderToReadableStreamOptions { - /** - * A callback React calls when it recovers from `browser()` by leaving a - * Suspense fallback for the browser to replace. - */ - onBrowserBailout?: ((error: unknown, errorInfo: ErrorInfo) => void) | undefined; - } - - interface ResumeToPipeableStreamOptions { - /** - * A callback React calls when it recovers from `browser()` by leaving a - * Suspense fallback for the browser to replace. - */ - onBrowserBailout?: ((error: unknown, errorInfo: ErrorInfo) => void) | undefined; - } -} - -declare module "./static" { - interface PrerenderOptions { - /** - * A callback React calls when it recovers from `browser()` by leaving a - * Suspense fallback for the browser to replace. - */ - onBrowserBailout?: ((error: unknown, errorInfo: ErrorInfo) => void) | undefined; - } - - interface ResumeOptions { - /** - * A callback React calls when it recovers from `browser()` by leaving a - * Suspense fallback for the browser to replace. - */ - onBrowserBailout?: ((error: unknown, errorInfo: ErrorInfo) => void) | undefined; - } -} - -declare module "react" { - interface RendererUsable { - "react-dom/browser": BrowserUsable; - } - - // @enableViewTransition - interface ViewTransitionPseudoElement extends Animatable { - getComputedStyle: () => CSSStyleDeclaration; - } - - interface ViewTransitionInstance { - group: ViewTransitionPseudoElement; - imagePair: ViewTransitionPseudoElement; - old: ViewTransitionPseudoElement; - new: ViewTransitionPseudoElement; - } - - // @enableFragmentRefs - interface FragmentInstance { - blur: () => void; - focus: (focusOptions?: FocusOptions | undefined) => void; - focusLast: (focusOptions?: FocusOptions | undefined) => void; - observeUsing(observer: IntersectionObserver | ResizeObserver): void; - unobserveUsing(observer: IntersectionObserver | ResizeObserver): void; - getClientRects(): Array; - getRootNode(getRootNodeOptions?: GetRootNodeOptions | undefined): Document | ShadowRoot | FragmentInstance; - addEventListener( - type: string, - listener: EventListener, - optionsOrUseCapture?: Parameters[2], - ): void; - removeEventListener( - type: string, - listener: EventListener, - optionsOrUseCapture?: Parameters[2], - ): void; - dispatchEvent(event: Event): boolean; - scrollIntoView(alignToTop?: boolean): void; - } -} diff --git a/types/react-dom/index.d.ts b/types/react-dom/index.d.ts index efb52b2747aa26..cdf44f818fb1d5 100644 --- a/types/react-dom/index.d.ts +++ b/types/react-dom/index.d.ts @@ -6,9 +6,48 @@ export as namespace ReactDOM; import { Key, ReactNode, ReactPortal } from "react"; +export {}; + declare module "react" { // eslint-disable-next-line @typescript-eslint/no-empty-interface interface CacheSignal extends AbortSignal {} + + interface RendererUsable { + "react-dom/browser": BrowserUsable; + } + + interface ViewTransitionPseudoElement extends Animatable { + getComputedStyle: () => CSSStyleDeclaration; + } + + interface ViewTransitionInstance { + group: ViewTransitionPseudoElement; + imagePair: ViewTransitionPseudoElement; + old: ViewTransitionPseudoElement; + new: ViewTransitionPseudoElement; + } + + interface FragmentInstance { + blur: () => void; + focus: (focusOptions?: FocusOptions | undefined) => void; + focusLast: (focusOptions?: FocusOptions | undefined) => void; + observeUsing(observer: IntersectionObserver | ResizeObserver): void; + unobserveUsing(observer: IntersectionObserver | ResizeObserver): void; + getClientRects(): Array; + getRootNode(getRootNodeOptions?: GetRootNodeOptions | undefined): Document | ShadowRoot | FragmentInstance; + addEventListener( + type: string, + listener: EventListener, + optionsOrUseCapture?: Parameters[2], + ): void; + removeEventListener( + type: string, + listener: EventListener, + optionsOrUseCapture?: Parameters[2], + ): void; + dispatchEvent(event: Event): boolean; + scrollIntoView(alignToTop?: boolean): void; + } } export function createPortal( @@ -131,3 +170,20 @@ export interface PreinitModuleOptions { export function preinitModule(href: string, options?: PreinitModuleOptions): void; export function requestFormReset(form: HTMLFormElement): void; + +declare const browserUsable: unique symbol; + +export interface BrowserUsable { + readonly [browserUsable]: never; +} + +/** + * Creates an opaque Usable that opts a subtree into browser-only rendering. + * `reason` is diagnostic metadata: an SSR renderer uses it as the `cause` of + * the recoverable error it reports when deferring the subtree to the browser. + * A function is called lazily by that renderer; in the browser the reason is + * never observed. + * + * @version 19.3.0 + */ +export function browser(reason?: string | (() => unknown)): BrowserUsable; diff --git a/types/react-dom/package.json b/types/react-dom/package.json index 713aebd50464a0..77b1803f94e290 100644 --- a/types/react-dom/package.json +++ b/types/react-dom/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/react-dom", - "version": "19.2.9999", + "version": "19.3.9999", "projects": [ "https://react.dev/" ], @@ -78,7 +78,7 @@ } }, "peerDependencies": { - "@types/react": "^19.2.0" + "@types/react": "^19.3.0" }, "devDependencies": { "@types/react-dom": "workspace:." diff --git a/types/react-dom/server.d.ts b/types/react-dom/server.d.ts index fca0eb683d71e7..21f60261bd2275 100644 --- a/types/react-dom/server.d.ts +++ b/types/react-dom/server.d.ts @@ -97,6 +97,11 @@ export interface RenderToPipeableStreamOptions { onShellReady?: () => void; onShellError?: (error: unknown) => void; onAllReady?: () => void; + /** + * A callback React calls when it recovers from `browser()` by leaving a + * Suspense fallback for the browser to replace. + */ + onBrowserBailout?: ((error: unknown, errorInfo: ErrorInfo) => void) | undefined; onError?: (error: unknown, errorInfo: ErrorInfo) => string | void; formState?: ReactFormState | null; } @@ -156,6 +161,11 @@ export interface RenderToReadableStreamOptions { maxHeadersLength?: number | undefined; progressiveChunkSize?: number; signal?: AbortSignal; + /** + * A callback React calls when it recovers from `browser()` by leaving a + * Suspense fallback for the browser to replace. + */ + onBrowserBailout?: ((error: unknown, errorInfo: ErrorInfo) => void) | undefined; onError?: (error: unknown, errorInfo: ErrorInfo) => string | void; onHeaders?: ((headers: Headers) => void) | undefined; formState?: ReactFormState | null; @@ -182,6 +192,11 @@ export interface ResumeToPipeableStreamOptions { onShellReady?: (() => void) | undefined; onShellError?: ((error: unknown) => void) | undefined; onAllReady?: (() => void) | undefined; + /** + * A callback React calls when it recovers from `browser()` by leaving a + * Suspense fallback for the browser to replace. + */ + onBrowserBailout?: ((error: unknown, errorInfo: ErrorInfo) => void) | undefined; onError?: ((error: unknown, errorInfo: ErrorInfo) => string | void) | undefined; } diff --git a/types/react-dom/static.d.ts b/types/react-dom/static.d.ts index 902a0f4b82e9a4..48f7258f57f21b 100644 --- a/types/react-dom/static.d.ts +++ b/types/react-dom/static.d.ts @@ -95,6 +95,11 @@ export interface PrerenderOptions { identifierPrefix?: string; importMap?: ReactImportMap | undefined; namespaceURI?: string; + /** + * A callback React calls when it recovers from `browser()` by leaving a + * Suspense fallback for the browser to replace. + */ + onBrowserBailout?: ((error: unknown, errorInfo: ErrorInfo) => void) | undefined; onError?: (error: unknown, errorInfo: ErrorInfo) => string | void; onHeaders?: ((headers: Headers) => void) | undefined; progressiveChunkSize?: number; @@ -137,6 +142,11 @@ export function prerenderToNodeStream( export interface ResumeOptions { nonce?: NonceOption | undefined; signal?: AbortSignal; + /** + * A callback React calls when it recovers from `browser()` by leaving a + * Suspense fallback for the browser to replace. + */ + onBrowserBailout?: ((error: unknown, errorInfo: ErrorInfo) => void) | undefined; onError?: (error: unknown) => string | undefined | void; } diff --git a/types/react-dom/test/canary-tests.tsx b/types/react-dom/test/canary-tests.tsx index 19851100bcef0c..d7857c7449e1c2 100644 --- a/types/react-dom/test/canary-tests.tsx +++ b/types/react-dom/test/canary-tests.tsx @@ -4,134 +4,3 @@ import ReactDOM = require("react-dom"); import ReactDOMClient = require("react-dom/client"); import ReactDOMServer = require("react-dom/server"); import ReactDOMStatic = require("react-dom/static"); - -// @enableViewTransition -function viewTransitionTests() { - const ViewTransition = React.ViewTransition; - - { - if (current !== null) { - // $ExpectType string - current.name; - - // $ExpectType ViewTransitionPseudoElement - current.group; - // $ExpectType ViewTransitionPseudoElement - current.imagePair; - // $ExpectType ViewTransitionPseudoElement - current.old; - // $ExpectType ViewTransitionPseudoElement - current.new; - - // $ExpectType CSSStyleDeclaration - current.old.getComputedStyle(); - // @ts-expect-error -- Implemented on the pseudo elements. - current.getComputedStyle(); - } - }} - > -
- ; -} - -// @enableFragmentRefs -function fragmentRefTest() { - { - // $ExpectType FragmentInstance | null - maybeInstance; - - // See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/69022/commits/57825689c7abb50a79395d1266226cfa1b31a4e1 - const instance = maybeInstance!; - - instance.focus(); - instance.blur(); - instance.focusLast(); - instance.observeUsing(new IntersectionObserver(() => {})); - instance.unobserveUsing(new IntersectionObserver(() => {})); - instance.observeUsing(new ResizeObserver(() => {})); - instance.unobserveUsing(new ResizeObserver(() => {})); - instance.getClientRects(); - instance.getRootNode(); - instance.getRootNode({ composed: true }); - instance.addEventListener("click", () => {}); - instance.addEventListener("click", () => {}, true); - instance.addEventListener("click", () => {}, { capture: true }); - instance.addEventListener("click", () => {}, true); - instance.removeEventListener("click", () => {}); - instance.removeEventListener("click", () => {}, { capture: true }); - instance.removeEventListener("click", () => {}, true); - instance.addEventListener("click", () => {}, { passive: true }); - instance.addEventListener("click", () => {}, { once: true }); - instance.addEventListener("click", () => {}, { signal: new AbortController().signal }); - instance.addEventListener("click", () => {}, { signal: new AbortSignal() }); - instance.addEventListener("click", () => {}, { signal: new AbortSignal(), once: true }); - instance.addEventListener("click", () => {}, { signal: new AbortSignal(), passive: true }); - instance.addEventListener("click", () => {}, { signal: new AbortSignal(), capture: true }); - instance.addEventListener("click", () => {}, { signal: new AbortSignal(), capture: true, once: true }); - instance.addEventListener("click", () => {}, { signal: new AbortSignal(), capture: true, passive: true }); - instance.addEventListener("click", () => {}, { signal: new AbortSignal(), once: true, passive: true }); - instance.addEventListener("click", () => {}, { - signal: new AbortSignal(), - capture: true, - once: true, - passive: true, - }); - instance.removeEventListener("click", () => {}, { capture: true }); - instance.removeEventListener("click", () => {}, true); - instance.removeEventListener("click", () => {}, { - // @ts-expect-error -- Not the same options as addEventListener - passive: true, - }); - instance.scrollIntoView(false); - instance.scrollIntoView(true); - instance.scrollIntoView(undefined); - - instance.scrollIntoView( - // @ts-expect-error -- options are not supported yet - {}, - ); - return () => {}; - }} - > -
-
- ; -} - -function formrelatedEventTests() { -
{ - // $ExpectType HTMLElement | null - event.submitter; - }} - />; -} - -function browserUsableTests() { - // browser() returns an opaque, renderer-specific Usable that React.use accepts - // $ExpectType unknown - React.use(ReactDOM.browser()); - - // The reason can be a string or a lazy initializer whose return value an - // SSR renderer uses as the cause of the recoverable error. - // $ExpectType BrowserUsable - ReactDOM.browser("Only render this content in a browser"); - // $ExpectType BrowserUsable - ReactDOM.browser(() => new Error("Only render this content in a browser")); - - // @ts-expect-error -- the reason is a string or a zero-arg initializer, not an arbitrary value - ReactDOM.browser(new Error("Only render this content in a browser")); -} - -function browserBailoutTests() { - const onBrowserBailout = (error: unknown, errorInfo: ReactDOMClient.ErrorInfo) => {}; - - ReactDOMServer.renderToPipeableStream(React.createElement("div"), { onBrowserBailout }); - ReactDOMServer.renderToReadableStream(React.createElement("div"), { onBrowserBailout }); - ReactDOMServer.resume(React.createElement("div"), null as any, { onBrowserBailout }); - ReactDOMServer.resumeToPipeableStream(React.createElement("div"), null as any, { onBrowserBailout }); - ReactDOMStatic.prerender(React.createElement("div"), { onBrowserBailout }); - ReactDOMStatic.resumeAndPrerender(React.createElement("div"), null, { onBrowserBailout }); -} diff --git a/types/react-dom/test/react-dom-tests.tsx b/types/react-dom/test/react-dom-tests.tsx index 2d84834c341e42..6994edcc1eef88 100644 --- a/types/react-dom/test/react-dom-tests.tsx +++ b/types/react-dom/test/react-dom-tests.tsx @@ -779,10 +779,130 @@ function formrelatedEventTests() { { - // Only passes because program includes React Canary types + // $ExpectType HTMLElement | null event.submitter; // $ExpectType EventTarget & HTMLFormElement event.target; }} />; } + +function browserUsableTests() { + // browser() returns an opaque, renderer-specific Usable that React.use accepts + // $ExpectType unknown + React.use(ReactDOM.browser()); + + // The reason can be a string or a lazy initializer whose return value an + // SSR renderer uses as the cause of the recoverable error. + // $ExpectType BrowserUsable + ReactDOM.browser("Only render this content in a browser"); + // $ExpectType BrowserUsable + ReactDOM.browser(() => new Error("Only render this content in a browser")); + + // @ts-expect-error -- the reason is a string or a zero-arg initializer, not an arbitrary value + ReactDOM.browser(new Error("Only render this content in a browser")); +} + +function browserBailoutTests() { + const onBrowserBailout = (error: unknown, errorInfo: ReactDOMClient.ErrorInfo) => {}; + + ReactDOMServer.renderToPipeableStream(React.createElement("div"), { onBrowserBailout }); + ReactDOMServer.renderToReadableStream(React.createElement("div"), { onBrowserBailout }); + ReactDOMServer.resume(React.createElement("div"), null as any, { onBrowserBailout }); + ReactDOMServer.resumeToPipeableStream(React.createElement("div"), null as any, { onBrowserBailout }); + ReactDOMStatic.prerender(React.createElement("div"), { onBrowserBailout }); + ReactDOMStatic.resumeAndPrerender(React.createElement("div"), null, { onBrowserBailout }); +} + +function viewTransitionTests() { + const ViewTransition = React.ViewTransition; + + { + if (current !== null) { + // $ExpectType string + current.name; + + // $ExpectType ViewTransitionPseudoElement + current.group; + // $ExpectType ViewTransitionPseudoElement + current.imagePair; + // $ExpectType ViewTransitionPseudoElement + current.old; + // $ExpectType ViewTransitionPseudoElement + current.new; + + // $ExpectType CSSStyleDeclaration + current.old.getComputedStyle(); + // @ts-expect-error -- Implemented on the pseudo elements. + current.getComputedStyle(); + } + }} + > +
+ ; +} + +function fragmentRefTest() { + { + // $ExpectType FragmentInstance | null + maybeInstance; + + // See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/69022/commits/57825689c7abb50a79395d1266226cfa1b31a4e1 + const instance = maybeInstance!; + + instance.focus(); + instance.blur(); + instance.focusLast(); + instance.observeUsing(new IntersectionObserver(() => {})); + instance.unobserveUsing(new IntersectionObserver(() => {})); + instance.observeUsing(new ResizeObserver(() => {})); + instance.unobserveUsing(new ResizeObserver(() => {})); + instance.getClientRects(); + instance.getRootNode(); + instance.getRootNode({ composed: true }); + instance.addEventListener("click", () => {}); + instance.addEventListener("click", () => {}, true); + instance.addEventListener("click", () => {}, { capture: true }); + instance.addEventListener("click", () => {}, true); + instance.removeEventListener("click", () => {}); + instance.removeEventListener("click", () => {}, { capture: true }); + instance.removeEventListener("click", () => {}, true); + instance.addEventListener("click", () => {}, { passive: true }); + instance.addEventListener("click", () => {}, { once: true }); + instance.addEventListener("click", () => {}, { signal: new AbortController().signal }); + instance.addEventListener("click", () => {}, { signal: new AbortSignal() }); + instance.addEventListener("click", () => {}, { signal: new AbortSignal(), once: true }); + instance.addEventListener("click", () => {}, { signal: new AbortSignal(), passive: true }); + instance.addEventListener("click", () => {}, { signal: new AbortSignal(), capture: true }); + instance.addEventListener("click", () => {}, { signal: new AbortSignal(), capture: true, once: true }); + instance.addEventListener("click", () => {}, { signal: new AbortSignal(), capture: true, passive: true }); + instance.addEventListener("click", () => {}, { signal: new AbortSignal(), once: true, passive: true }); + instance.addEventListener("click", () => {}, { + signal: new AbortSignal(), + capture: true, + once: true, + passive: true, + }); + instance.removeEventListener("click", () => {}, { capture: true }); + instance.removeEventListener("click", () => {}, true); + instance.removeEventListener("click", () => {}, { + // @ts-expect-error -- Not the same options as addEventListener + passive: true, + }); + instance.scrollIntoView(false); + instance.scrollIntoView(true); + instance.scrollIntoView(undefined); + + instance.scrollIntoView( + // @ts-expect-error -- options are not supported yet + {}, + ); + return () => {}; + }} + > +
+
+ ; +} diff --git a/types/react-is/package.json b/types/react-is/package.json index e4f81c163bab1e..81026cc8fc0732 100644 --- a/types/react-is/package.json +++ b/types/react-is/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/react-is", - "version": "19.2.9999", + "version": "19.3.9999", "projects": [ "https://reactjs.org/" ], diff --git a/types/react-native-material-design-searchbar/index.d.ts b/types/react-native-material-design-searchbar/index.d.ts index 44083d1f396734..13843531bd29fe 100644 --- a/types/react-native-material-design-searchbar/index.d.ts +++ b/types/react-native-material-design-searchbar/index.d.ts @@ -1,10 +1,10 @@ import * as React from "react"; -import { ReturnKeyType, ReturnKeyTypeAndroid, ReturnKeyTypeIOS, TextInputProps, TextStyle } from "react-native"; +import { ReturnKeyTypeOptions, TextInputProps, TextStyle } from "react-native"; export interface SearchBarProps { height: number; autoCorrect?: boolean | undefined; - returnKeyType?: ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS | undefined; + returnKeyType?: ReturnKeyTypeOptions | undefined; placeholder?: string | undefined; padding?: number | undefined; inputStyle?: TextStyle | undefined; diff --git a/types/react-native-material-ripple/index.d.ts b/types/react-native-material-ripple/index.d.ts index 18011c8b92dff0..903b4502bc6c22 100644 --- a/types/react-native-material-ripple/index.d.ts +++ b/types/react-native-material-ripple/index.d.ts @@ -1,8 +1,8 @@ import * as React from "react"; -import { Animated, TouchableWithoutFeedback, ViewProps } from "react-native"; +import { Animated, TouchableWithoutFeedbackProps, ViewProps } from "react-native"; export type RippleProps = - & TouchableWithoutFeedback["props"] + & TouchableWithoutFeedbackProps & Animated.AnimatedProps & { rippleColor?: string | undefined; diff --git a/types/react-native-material-ripple/react-native-material-ripple-tests.tsx b/types/react-native-material-ripple/react-native-material-ripple-tests.tsx index fbe3a1b08be7b4..3e7904413b505d 100644 --- a/types/react-native-material-ripple/react-native-material-ripple-tests.tsx +++ b/types/react-native-material-ripple/react-native-material-ripple-tests.tsx @@ -58,10 +58,8 @@ const RippleTest: React.FC = () => { delayLongPress={aNumber} delayPressIn={aNumber} delayPressOut={aNumber} - hasTVPreferredFocus hitSlop={insets} importantForAccessibility="auto" - isTVSelectable key={aNumber} nativeID={aString} style={[styles.wrapper]} @@ -100,21 +98,6 @@ const RippleTest: React.FC = () => { removeClippedSubviews renderToHardwareTextureAndroid shouldRasterizeIOS - tvParallaxMagnification={aNumber} - // @ts-expect-error -- No longer part of props with latest `react-native` types - tvParallaxProperties={{ - enabled: true, - shiftDistanceX: aNumber, - shiftDistanceY: aNumber, - tiltAngle: aNumber, - magnification: aNumber, - pressMagnification: aNumber, - pressDuration: aNumber, - pressDelay: aNumber, - }} - tvParallaxShiftDistanceX={aNumber} - tvParallaxShiftDistanceY={aNumber} - tvParallaxTiltAngle={aNumber} > diff --git a/types/react-native-modal-filter-picker/react-native-modal-filter-picker-tests.tsx b/types/react-native-modal-filter-picker/react-native-modal-filter-picker-tests.tsx index 06fdf8f39d7b36..0b683fc3c50bc9 100644 --- a/types/react-native-modal-filter-picker/react-native-modal-filter-picker-tests.tsx +++ b/types/react-native-modal-filter-picker/react-native-modal-filter-picker-tests.tsx @@ -34,7 +34,7 @@ const renderPicker = () => ( noResultsText="No matches" visible showFilter - modal={{ animated: true }} + modal={{ animationType: "slide" }} selectedOption="some-option-key" flatListProps={{ accessible: true }} renderOption={(option, isSelected) => ( diff --git a/types/react-native-platform-touchable/index.d.ts b/types/react-native-platform-touchable/index.d.ts index 7c873f70f92aea..a196ab7d022e19 100644 --- a/types/react-native-platform-touchable/index.d.ts +++ b/types/react-native-platform-touchable/index.d.ts @@ -1,10 +1,20 @@ import * as React from "react"; -import { - BackgroundPropType, - RippleBackgroundPropType, - ThemeAttributeBackgroundPropType, - TouchableWithoutFeedbackProps, -} from "react-native"; +import { TouchableWithoutFeedbackProps } from "react-native"; + +// These were removed from react-native's bundled types; they mirror the +// TouchableNativeFeedback background values this library accepts and returns. +export interface ThemeAttributeBackgroundPropType { + type: "ThemeAttrAndroid"; + attribute: "selectableItemBackground" | "selectableItemBackgroundBorderless"; +} + +export interface RippleBackgroundPropType { + type: "RippleAndroid"; + color?: number | null | undefined; + borderless?: boolean | undefined; +} + +export type BackgroundPropType = ThemeAttributeBackgroundPropType | RippleBackgroundPropType; export interface PlatformTouchableProps extends TouchableWithoutFeedbackProps { // TouchableOpacity (default iOS) diff --git a/types/react-native-responsive-image/index.d.ts b/types/react-native-responsive-image/index.d.ts index a4d20dac94d03d..267f2d882f3a88 100644 --- a/types/react-native-responsive-image/index.d.ts +++ b/types/react-native-responsive-image/index.d.ts @@ -2,14 +2,13 @@ import * as React from "react"; import { Image, ImageBackground, - ImageErrorEventData, - ImageLoadEventData, - ImageProgressEventDataIOS, + ImageErrorEvent, + ImageLoadEvent, + ImageProgressEventIOS, ImageResizeMode, ImageSourcePropType, ImageStyle, ImageURISource, - NativeSyntheticEvent, StyleProp, } from "react-native"; @@ -32,13 +31,13 @@ export interface ResponsiveImageProps { /** * Invoked on load error with {nativeEvent: {error}} */ - onError?: ((error: NativeSyntheticEvent) => void) | undefined; + onError?: ((error: ImageErrorEvent) => void) | undefined; /** * Invoked when load completes successfully * { source: { url, height, width } }. */ - onLoad?: ((event: NativeSyntheticEvent) => void) | undefined; + onLoad?: ((event: ImageLoadEvent) => void) | undefined; /** * Invoked when load either succeeds or fails @@ -55,7 +54,7 @@ export interface ResponsiveImageProps { /** * Invoked on download progress with {nativeEvent: {loaded, total}} */ - onProgress?: ((event: NativeSyntheticEvent) => void) | undefined; + onProgress?: ((event: ImageProgressEventIOS) => void) | undefined; /** * The image source (either a remote URL or a local file resource). diff --git a/types/react-native-side-menu/index.d.ts b/types/react-native-side-menu/index.d.ts index 080559a23b3133..f924260a892643 100644 --- a/types/react-native-side-menu/index.d.ts +++ b/types/react-native-side-menu/index.d.ts @@ -1,6 +1,10 @@ import { Component, ReactNode } from "react"; import { Animated, GestureResponderEvent, PanResponderGestureState, ViewStyle } from "react-native"; +// Removed from react-native's bundled type exports; matches the shape Animated +// timing/spring callbacks receive. +export type EndCallback = (result: { finished: boolean }) => void; + export interface ReactNativeSideMenuProps { /** * Menu component @@ -62,7 +66,7 @@ export interface ReactNativeSideMenuProps { /** * Callback when menu animation has completed. */ - onAnimationComplete?: ((event: Animated.EndCallback) => void) | undefined; + onAnimationComplete?: ((event: EndCallback) => void) | undefined; /** * When true, content view will bounce back to openMenuOffset when dragged further * @default true diff --git a/types/react-native-snap-carousel/index.d.ts b/types/react-native-snap-carousel/index.d.ts index b722f7dae1b4e8..1839e453c4d4bb 100644 --- a/types/react-native-snap-carousel/index.d.ts +++ b/types/react-native-snap-carousel/index.d.ts @@ -233,7 +233,7 @@ export interface CarouselProps { */ slideInterpolatedStyle?( index: number, - animatedValue: Animated.AnimatedValue, + animatedValue: Animated.Value, carouselProps: CarouselProps, ): StyleProp; /** diff --git a/types/react-native-typing-animation/index.d.ts b/types/react-native-typing-animation/index.d.ts index d66cb4bad07df1..a948ecf3daa2df 100644 --- a/types/react-native-typing-animation/index.d.ts +++ b/types/react-native-typing-animation/index.d.ts @@ -1,11 +1,11 @@ -import { StyleSheetProperties } from "react-native"; +import { StyleProp, ViewStyle } from "react-native"; import { JSX } from "react"; export interface TypingAnimationProps { - style?: StyleSheetProperties; + style?: StyleProp; dotColor?: string; - dotStyles?: StyleSheetProperties; + dotStyles?: StyleProp; dotRadius?: number; dotMargin?: number; dotAmplitude?: number; diff --git a/types/react-native-web/index.d.ts b/types/react-native-web/index.d.ts index dd91bb1eb69cd3..f905ef9481de28 100644 --- a/types/react-native-web/index.d.ts +++ b/types/react-native-web/index.d.ts @@ -25,7 +25,6 @@ import type { FlatList as FlatListRN, FlatListProps as FlatListPropsRN, GestureResponderEvent, - InteractionManager as InteractionManagerRN, LayoutAnimation as LayoutAnimationRN, MeasureInWindowOnSuccessCallback, MeasureLayoutOnSuccessCallback, @@ -35,8 +34,8 @@ import type { SectionListProps as SectionListPropsRN, StyleProp, StyleSheet as StyleSheetRN, - TextStyle, - ViewStyle, + TextStyle as TextStyleRN, + ViewStyle as ViewStyleRN, VirtualizedList as VirtualizedListRN, VirtualizedListProps as VirtualizedListPropsRN, } from "react-native"; @@ -354,7 +353,7 @@ interface WebViewProps extends WebSharedProps { export interface WebStyle extends CSSProperties { // https://necolas.github.io/react-native-web/docs/styling/#non-standard-properties // Exclusive to react-native-web, "pointerEvents" already included on RN - animationKeyframes?: string | Record; + animationKeyframes?: string | Record; writingDirection?: "auto" | "ltr" | "rtl"; enableBackground?: string; } @@ -467,7 +466,26 @@ export interface Keyboard { removeListener(): void; } -export type InteractionManager = typeof InteractionManagerRN; +// react-native no longer exports InteractionManager types; declared from +// react-native-web's implementation (exports/InteractionManager/index.js). +export interface InteractionManager { + Events: { + interactionStart: string; + interactionComplete: string; + }; + runAfterInteractions(task?: (() => void) | null): { + then: (...args: any[]) => void; + done: (...args: any[]) => void; + cancel: () => void; + }; + createInteractionHandle(): number; + clearInteractionHandle(handle: number): void; + addListener( + eventType: "interactionStart" | "interactionComplete", + listener: () => void, + ): { remove(): void }; + setDeadline(deadline: number): void; +} export type LayoutAnimation = typeof LayoutAnimationRN; @@ -798,6 +816,10 @@ export interface UIManager { setLayoutAnimationEnabledExperimental(value: boolean): void; } +export const UIManager: UIManager; + +export {}; + export interface Vibration { cancel(): void; vibrate(pattern?: VibratePattern): void; @@ -911,7 +933,7 @@ export interface ImageProps extends ViewProps { | "repeat" | "stretch"; source?: number | string | SourceObject | SourceObject[]; - style?: StyleProp; + style?: StyleProp; tintColor?: string | null; } export const Image: FunctionComponent>; @@ -919,14 +941,14 @@ export const Image: FunctionComponent>; export interface ImageBackgroundProps extends ViewProps { animating?: boolean; imageRef?: any; - imageStyle?: StyleProp; - style?: StyleProp; + imageStyle?: StyleProp; + style?: StyleProp; } export const ImageBackground: FunctionComponent>; export interface KeyboardAvoidingViewProps extends ViewProps { behavior?: "height" | "padding" | "position"; - contentContainerStyle?: StyleProp; + contentContainerStyle?: StyleProp; keyboardVerticalOffset: number; } export const KeyboardAvoidingView: ComponentClass; @@ -1003,10 +1025,10 @@ export interface PressableProps extends ViewPropsWithoutStyle { // Called when the press is deactivated to undo visual feedback. onPressOut?: (event: any) => void; style?: - | StyleProp + | StyleProp | ((state: { pressed: boolean; - }) => StyleProp); + }) => StyleProp); } export const Pressable: FunctionComponent>; @@ -1037,7 +1059,7 @@ export const SafeAreaView: FunctionComponent; export interface ScrollViewProps extends ViewProps { centerContent?: boolean; - contentContainerStyle?: ViewStyle; + contentContainerStyle?: ViewStyleRN; horizontal?: boolean; keyboardDismissMode?: "none" | "interactive" | "on-drag"; onContentSizeChange?: (event: any) => void; @@ -1079,7 +1101,7 @@ export interface TextProps extends ViewPropsWithoutStyle { | "text" | "paragraph" | AriaRole; - style?: StyleProp; + style?: StyleProp; testID?: string; // @deprecated accessibilityRole?: @@ -1148,7 +1170,7 @@ export interface TextInputProps extends ViewPropsWithoutStyle { selectionColor?: string | null; showSoftInputOnFocus?: boolean; spellCheck?: boolean; - style?: StyleProp; + style?: StyleProp; value?: string; // deprecated editable?: boolean; @@ -1186,7 +1208,7 @@ export interface TouchableHighlightProps extends ViewProps { activeOpacity?: number; onHideUnderlay?: () => void; onShowUnderlay?: () => void; - style?: ViewStyle; + style?: ViewStyleRN; testOnly_pressed?: boolean; underlayColor?: string | null; } @@ -1196,7 +1218,7 @@ export const TouchableNativeFeedback: ComponentClass; export interface TouchableOpacityProps extends ViewProps { activeOpacity?: number; - style?: StyleProp; + style?: StyleProp; } export const TouchableOpacity: FunctionComponent>; @@ -1217,7 +1239,7 @@ export interface ViewProps extends AccessibilityPropsWeb, EventProps { dir?: "ltr" | "rtl"; id?: string; lang?: string; - style?: StyleProp; + style?: StyleProp; tabIndex?: 0 | -1; testID?: string; // unstable @@ -1232,7 +1254,7 @@ type ViewPropsWithoutStyle = Omit; export const View: FunctionComponent>; -export type VirtualizedListProps = VirtualizedListPropsRN; +export type VirtualizedListProps = VirtualizedListPropsRN; export const VirtualizedList: typeof VirtualizedListRN; export const YellowBox: FunctionComponent; @@ -1266,277 +1288,99 @@ export function useWindowDimensions(): { export const unstable_createElement: typeof createElement; -export {}; - -declare module "react-native" { - interface AccessibilityProps { - "aria-activedescendant"?: idRef; - "aria-atomic"?: boolean; - "aria-autocomplete"?: "none" | "list" | "inline" | "both"; - "aria-busy"?: boolean; - "aria-checked"?: boolean | "mixed"; - "aria-colcount"?: number; - "aria-colindex"?: number; - "aria-colspan"?: number; - "aria-controls"?: idRef; - "aria-current"?: boolean | "page" | "step" | "location" | "date" | "time"; - "aria-describedby"?: idRef; - "aria-details"?: idRef; - "aria-disabled"?: boolean; - "aria-errormessage"?: idRef; - "aria-expanded"?: boolean; - "aria-flowto"?: idRef; - "aria-haspopup"?: "dialog" | "grid" | "listbox" | "menu" | "tree" | false; - "aria-hidden"?: boolean; - "aria-invalid"?: boolean; - "aria-keyshortcuts"?: string; - "aria-label"?: string; - "aria-labelledby"?: idRef; - "aria-level"?: number; - "aria-live"?: "assertive" | "off" | "polite"; - "aria-modal"?: boolean; - "aria-multiline"?: boolean; - "aria-multiselectable"?: boolean; - "aria-orientation"?: "horizontal" | "vertical"; - "aria-owns"?: idRef; - "aria-placeholder"?: string; - "aria-posinset"?: number; - "aria-pressed"?: boolean | "mixed"; - "aria-readonly"?: boolean; - "aria-required"?: boolean; - "aria-roledescription"?: string; - "aria-rowcount"?: number; - "aria-rowindex"?: number; - "aria-rowspan"?: number; - "aria-selected"?: boolean; - "aria-setsize"?: number; - "aria-sort"?: "ascending" | "descending" | "none" | "other"; - "aria-valuemax"?: number; - "aria-valuemin"?: number; - "aria-valuenow"?: number; - "aria-valuetext"?: string; - - // @deprecated - accessibilityActiveDescendant?: idRef; - accessibilityAtomic?: boolean; - accessibilityAutoComplete?: "none" | "list" | "inline" | "both"; - accessibilityBusy?: boolean; - accessibilityChecked?: boolean | "mixed"; - accessibilityColumnCount?: number; - accessibilityColumnIndex?: number; - accessibilityColumnSpan?: number; - accessibilityControls?: idRefList; - accessibilityCurrent?: boolean | "page" | "step" | "location" | "date" | "time"; - accessibilityDescribedBy?: idRefList; - accessibilityDetails?: idRef; - accessibilityDisabled?: boolean; - accessibilityErrorMessage?: idRef; - accessibilityExpanded?: boolean; - accessibilityFlowTo?: idRefList; - accessibilityHasPopup?: "dialog" | "grid" | "listbox" | "menu" | "tree" | false; - accessibilityHidden?: boolean; - accessibilityInvalid?: boolean; - accessibilityKeyShortcuts?: string[]; - accessibilityLabel?: string; - accessibilityLabelledBy?: idRef; - accessibilityLevel?: number; - accessibilityLiveRegion?: "assertive" | "none" | "polite"; - accessibilityModal?: boolean; - accessibilityMultiline?: boolean; - accessibilityMultiSelectable?: boolean; - accessibilityOrientation?: "horizontal" | "vertical"; - accessibilityOwns?: idRefList; - accessibilityPlaceholder?: string; - accessibilityPosInSet?: number; - accessibilityPressed?: boolean | "mixed"; - accessibilityReadOnly?: boolean; - accessibilityRequired?: boolean; - accessibilityRoleDescription?: string; - accessibilityRowCount?: number; - accessibilityRowIndex?: number; - accessibilityRowSpan?: number; - accessibilitySelected?: boolean; - accessibilitySetSize?: number; - accessibilitySort?: "ascending" | "descending" | "none" | "other"; - accessibilityValueMax?: number; - accessibilityValueMin?: number; - accessibilityValueNow?: number; - accessibilityValueText?: string; - } - - // eslint-disable-next-line @typescript-eslint/no-empty-interface - interface ViewProps extends WebViewProps {} - - /** - * Text - * Extracted from react-native-web, packages/react-native-web/src/exports/Text/types.js - */ - interface WebTextProps extends WebSharedProps { - dir?: "auto" | "ltr" | "rtl"; - } - // eslint-disable-next-line @typescript-eslint/no-empty-interface - interface TextProps extends WebTextProps { - role?: - | "button" - | "header" - | "heading" - | "label" - | "link" - | "listitem" - | "none" - | "text" - | "paragraph" - | AriaRole; - // @deprecated - accessibilityRole?: - | "button" - | "header" - | "heading" - | "label" - | "link" - | "listitem" - | "none" - | "text"; - } - - /** - * TextInput - * Extracted from react-native-web, packages/react-native-web/src/exports/TextInput/types.js - */ - interface WebTextInputProps extends WebSharedProps { - dir?: "auto" | "ltr" | "rtl"; - disabled?: boolean; - } - // eslint-disable-next-line @typescript-eslint/no-empty-interface - interface TextInputProps extends WebTextInputProps {} +// Web-specific versions of react-native's prop/style types. These were +// previously applied to "react-native" via module augmentation, which is no +// longer possible: react-native 0.87's bundled types declare these names as +// type aliases, and type aliases cannot be merged with interfaces. +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface AccessibilityProps extends AccessibilityPropsWeb {} + +// https://necolas.github.io/react-native-web/docs/pressable/#interactionstate +export interface PressableStateCallbackType { + readonly focused: boolean; + readonly hovered: boolean; + readonly pressed: boolean; +} - /** - * Image - * Extracted from react-native-web, packages/react-native-web/src/exports/Image/types.js - */ - interface WebImageProps extends WebSharedProps { - dir?: "ltr" | "rtl"; - draggable?: boolean; - } - // eslint-disable-next-line @typescript-eslint/no-empty-interface - interface ImageProps extends WebImageProps {} +export interface ViewStyle extends WebStyle { + // In order to overwrite properties from RN, we need to redefine them inside ViewStyle. + zIndex?: CSSProperties["zIndex"] | undefined; + overflow?: CSSProperties["overflow"] | undefined; + display?: CSSProperties["display"] | undefined; + position?: CSSProperties["position"] | undefined; + top?: CSSProperties["top"] | NonNullable | undefined; + right?: CSSProperties["right"] | NonNullable | undefined; + bottom?: CSSProperties["bottom"] | NonNullable | undefined; + left?: CSSProperties["left"] | NonNullable | undefined; + height?: CSSProperties["height"] | NonNullable | undefined; + width?: CSSProperties["width"] | NonNullable | undefined; + maxHeight?: CSSProperties["maxHeight"] | NonNullable | undefined; + maxWidth?: CSSProperties["maxWidth"] | NonNullable | undefined; + minHeight?: CSSProperties["minHeight"] | NonNullable | undefined; + minWidth?: CSSProperties["minWidth"] | NonNullable | undefined; + margin?: CSSProperties["margin"] | NonNullable | undefined; + marginTop?: CSSProperties["marginTop"] | NonNullable | undefined; + marginRight?: CSSProperties["marginRight"] | NonNullable | undefined; + marginBottom?: CSSProperties["marginBottom"] | NonNullable | undefined; + marginLeft?: CSSProperties["marginLeft"] | NonNullable | undefined; + padding?: CSSProperties["padding"] | NonNullable | undefined; + paddingTop?: CSSProperties["paddingTop"] | NonNullable | undefined; + paddingRight?: CSSProperties["paddingRight"] | NonNullable | undefined; + paddingBottom?: CSSProperties["paddingBottom"] | NonNullable | undefined; + paddingLeft?: CSSProperties["paddingLeft"] | NonNullable | undefined; +} - /** - * ScrollView - * Extracted from react-native-web, packages/react-native-web/src/exports/ScrollView/ScrollViewBase.js - */ - // eslint-disable-next-line @typescript-eslint/no-empty-interface - interface WebScrollViewProps extends WebSharedProps {} - // eslint-disable-next-line @typescript-eslint/no-empty-interface - interface ScrollViewProps extends WebScrollViewProps {} +export interface TextStyle extends WebStyle { + // In order to overwrite properties from RN, we need to redefine them inside TextStyle. + zIndex?: CSSProperties["zIndex"] | undefined; + overflow?: CSSProperties["overflow"] | undefined; + display?: CSSProperties["display"] | undefined; + position?: CSSProperties["position"] | undefined; + top?: CSSProperties["top"] | NonNullable | undefined; + right?: CSSProperties["right"] | NonNullable | undefined; + bottom?: CSSProperties["bottom"] | NonNullable | undefined; + left?: CSSProperties["left"] | NonNullable | undefined; + height?: CSSProperties["height"] | NonNullable | undefined; + width?: CSSProperties["width"] | NonNullable | undefined; + maxHeight?: CSSProperties["maxHeight"] | NonNullable | undefined; + maxWidth?: CSSProperties["maxWidth"] | NonNullable | undefined; + minHeight?: CSSProperties["minHeight"] | NonNullable | undefined; + minWidth?: CSSProperties["minWidth"] | NonNullable | undefined; + margin?: CSSProperties["margin"] | NonNullable | undefined; + marginTop?: CSSProperties["marginTop"] | NonNullable | undefined; + marginRight?: CSSProperties["marginRight"] | NonNullable | undefined; + marginBottom?: CSSProperties["marginBottom"] | NonNullable | undefined; + marginLeft?: CSSProperties["marginLeft"] | NonNullable | undefined; + padding?: CSSProperties["padding"] | NonNullable | undefined; + paddingTop?: CSSProperties["paddingTop"] | NonNullable | undefined; + paddingRight?: CSSProperties["paddingRight"] | NonNullable | undefined; + paddingBottom?: CSSProperties["paddingBottom"] | NonNullable | undefined; + paddingLeft?: CSSProperties["paddingLeft"] | NonNullable | undefined; +} - /** - * Pressable - */ - // https://necolas.github.io/react-native-web/docs/pressable/#interactionstate - // Extracted from react-native-web, packages/react-native-web/src/exports/Pressable/index.js - interface WebPressableStateCallbackType { - readonly focused: boolean; - readonly hovered: boolean; - readonly pressed: boolean; - } - // eslint-disable-next-line @typescript-eslint/no-empty-interface - interface PressableStateCallbackType extends WebPressableStateCallbackType {} - - // Extracted from react-native-web, packages/react-native-web/src/exports/Pressable/index.js - interface WebPressableProps extends WebSharedProps { - /** Duration (in milliseconds) from `onPressStart` is called after pointerdown. */ - delayPressIn?: number; - /** Duration (in milliseconds) from `onPressEnd` is called after pointerup. */ - delayPressOut?: number; - /** Called when a touch is moving, after `onPressIn`. */ - onPressMove?: (event: GestureResponderEvent) => void; - } - // eslint-disable-next-line @typescript-eslint/no-empty-interface - interface PressableProps extends WebPressableProps {} - - interface ViewStyle extends WebStyle { - // In order to overwrite properties from RN, we need to redefine them inside ViewStyle. - zIndex?: CSSProperties["zIndex"] | undefined; - overflow?: CSSProperties["overflow"] | undefined; - display?: CSSProperties["display"] | undefined; - position?: CSSProperties["position"] | undefined; - top?: CSSProperties["top"] | DimensionValue | undefined; - right?: CSSProperties["right"] | DimensionValue | undefined; - bottom?: CSSProperties["bottom"] | DimensionValue | undefined; - left?: CSSProperties["left"] | DimensionValue | undefined; - height?: CSSProperties["height"] | DimensionValue | undefined; - width?: CSSProperties["width"] | DimensionValue | undefined; - maxHeight?: CSSProperties["maxHeight"] | DimensionValue | undefined; - maxWidth?: CSSProperties["maxWidth"] | DimensionValue | undefined; - minHeight?: CSSProperties["minHeight"] | DimensionValue | undefined; - minWidth?: CSSProperties["minWidth"] | DimensionValue | undefined; - margin?: CSSProperties["margin"] | DimensionValue | undefined; - marginTop?: CSSProperties["marginTop"] | DimensionValue | undefined; - marginRight?: CSSProperties["marginRight"] | DimensionValue | undefined; - marginBottom?: CSSProperties["marginBottom"] | DimensionValue | undefined; - marginLeft?: CSSProperties["marginLeft"] | DimensionValue | undefined; - padding?: CSSProperties["padding"] | DimensionValue | undefined; - paddingTop?: CSSProperties["paddingTop"] | DimensionValue | undefined; - paddingRight?: CSSProperties["paddingRight"] | DimensionValue | undefined; - paddingBottom?: CSSProperties["paddingBottom"] | DimensionValue | undefined; - paddingLeft?: CSSProperties["paddingLeft"] | DimensionValue | undefined; - } - - interface TextStyle extends WebStyle { - // In order to overwrite properties from RN, we need to redefine them inside TextStyle. - zIndex?: CSSProperties["zIndex"] | undefined; - overflow?: CSSProperties["overflow"] | undefined; - display?: CSSProperties["display"] | undefined; - position?: CSSProperties["position"] | undefined; - top?: CSSProperties["top"] | DimensionValue | undefined; - right?: CSSProperties["right"] | DimensionValue | undefined; - bottom?: CSSProperties["bottom"] | DimensionValue | undefined; - left?: CSSProperties["left"] | DimensionValue | undefined; - height?: CSSProperties["height"] | DimensionValue | undefined; - width?: CSSProperties["width"] | DimensionValue | undefined; - maxHeight?: CSSProperties["maxHeight"] | DimensionValue | undefined; - maxWidth?: CSSProperties["maxWidth"] | DimensionValue | undefined; - minHeight?: CSSProperties["minHeight"] | DimensionValue | undefined; - minWidth?: CSSProperties["minWidth"] | DimensionValue | undefined; - margin?: CSSProperties["margin"] | DimensionValue | undefined; - marginTop?: CSSProperties["marginTop"] | DimensionValue | undefined; - marginRight?: CSSProperties["marginRight"] | DimensionValue | undefined; - marginBottom?: CSSProperties["marginBottom"] | DimensionValue | undefined; - marginLeft?: CSSProperties["marginLeft"] | DimensionValue | undefined; - padding?: CSSProperties["padding"] | DimensionValue | undefined; - paddingTop?: CSSProperties["paddingTop"] | DimensionValue | undefined; - paddingRight?: CSSProperties["paddingRight"] | DimensionValue | undefined; - paddingBottom?: CSSProperties["paddingBottom"] | DimensionValue | undefined; - paddingLeft?: CSSProperties["paddingLeft"] | DimensionValue | undefined; - } - - interface ImageStyle extends WebStyle { - // In order to overwrite properties from RN, we need to redefine them inside ImageStyle. - zIndex?: CSSProperties["zIndex"] | undefined; - display?: CSSProperties["display"] | undefined; - position?: CSSProperties["position"] | undefined; - top?: CSSProperties["top"] | DimensionValue | undefined; - right?: CSSProperties["right"] | DimensionValue | undefined; - bottom?: CSSProperties["bottom"] | DimensionValue | undefined; - left?: CSSProperties["left"] | DimensionValue | undefined; - height?: CSSProperties["height"] | DimensionValue | undefined; - width?: CSSProperties["width"] | DimensionValue | undefined; - maxHeight?: CSSProperties["maxHeight"] | DimensionValue | undefined; - maxWidth?: CSSProperties["maxWidth"] | DimensionValue | undefined; - minHeight?: CSSProperties["minHeight"] | DimensionValue | undefined; - minWidth?: CSSProperties["minWidth"] | DimensionValue | undefined; - margin?: CSSProperties["margin"] | DimensionValue | undefined; - marginTop?: CSSProperties["marginTop"] | DimensionValue | undefined; - marginRight?: CSSProperties["marginRight"] | DimensionValue | undefined; - marginBottom?: CSSProperties["marginBottom"] | DimensionValue | undefined; - marginLeft?: CSSProperties["marginLeft"] | DimensionValue | undefined; - padding?: CSSProperties["padding"] | DimensionValue | undefined; - paddingTop?: CSSProperties["paddingTop"] | DimensionValue | undefined; - paddingRight?: CSSProperties["paddingRight"] | DimensionValue | undefined; - paddingBottom?: CSSProperties["paddingBottom"] | DimensionValue | undefined; - paddingLeft?: CSSProperties["paddingLeft"] | DimensionValue | undefined; - } - // eslint-disable-next-line @typescript-eslint/no-empty-interface - interface UIManagerStatic extends UIManager {} +export interface ImageStyle extends WebStyle { + // In order to overwrite properties from RN, we need to redefine them inside ImageStyle. + zIndex?: CSSProperties["zIndex"] | undefined; + display?: CSSProperties["display"] | undefined; + position?: CSSProperties["position"] | undefined; + top?: CSSProperties["top"] | NonNullable | undefined; + right?: CSSProperties["right"] | NonNullable | undefined; + bottom?: CSSProperties["bottom"] | NonNullable | undefined; + left?: CSSProperties["left"] | NonNullable | undefined; + height?: CSSProperties["height"] | NonNullable | undefined; + width?: CSSProperties["width"] | NonNullable | undefined; + maxHeight?: CSSProperties["maxHeight"] | NonNullable | undefined; + maxWidth?: CSSProperties["maxWidth"] | NonNullable | undefined; + minHeight?: CSSProperties["minHeight"] | NonNullable | undefined; + minWidth?: CSSProperties["minWidth"] | NonNullable | undefined; + margin?: CSSProperties["margin"] | NonNullable | undefined; + marginTop?: CSSProperties["marginTop"] | NonNullable | undefined; + marginRight?: CSSProperties["marginRight"] | NonNullable | undefined; + marginBottom?: CSSProperties["marginBottom"] | NonNullable | undefined; + marginLeft?: CSSProperties["marginLeft"] | NonNullable | undefined; + padding?: CSSProperties["padding"] | NonNullable | undefined; + paddingTop?: CSSProperties["paddingTop"] | NonNullable | undefined; + paddingRight?: CSSProperties["paddingRight"] | NonNullable | undefined; + paddingBottom?: CSSProperties["paddingBottom"] | NonNullable | undefined; + paddingLeft?: CSSProperties["paddingLeft"] | NonNullable | undefined; } diff --git a/types/react-native-web/react-native-web-tests.tsx b/types/react-native-web/react-native-web-tests.tsx index d3c9b914d49655..0ecb246676560b 100644 --- a/types/react-native-web/react-native-web-tests.tsx +++ b/types/react-native-web/react-native-web-tests.tsx @@ -1,18 +1,6 @@ import { + // web-extended versions of react-native's types AccessibilityProps, - ImageStyle, - PressableProps, - PressableStateCallbackType, - ScrollViewProps, - TextInputProps, - TextProps, - TextStyle, - UIManager, - ViewProps, - ViewStyle, -} from "react-native"; - -import { // components ActivityIndicator, Button, @@ -24,24 +12,32 @@ import { Image, ImageBackground, ImageProps, + ImageStyle, KeyboardAvoidingView, KeyboardProps, Modal, Picker, Pressable, + PressableProps, + PressableStateCallbackType, ProgressBar, RefreshControl, SafeAreaView, ScrollView, + ScrollViewProps, SectionList, StatusBar, Switch, Text, TextInput, + TextInputProps, + TextProps, + TextStyle, TouchableHighlight, TouchableNativeFeedback, TouchableOpacity, TouchableWithoutFeedback, + UIManager, // unstable APIs unstable_createElement, // hooks @@ -49,6 +45,8 @@ import { useLocaleContext, useWindowDimensions, View, + ViewProps, + ViewStyle, VirtualizedList, YellowBox, } from "react-native-web"; @@ -100,6 +98,7 @@ const scrollViewProps: ScrollViewProps = { }; const pressableProps: PressableProps = { + children: null, delayPressIn: 1, delayPressOut: 1, onPressMove: (event) => { @@ -379,6 +378,8 @@ const virtualizedList = ( console.log(item); return "key"; }} + getItem={(data, index) => data[index]} + getItemCount={(data) => data.length} /> ); const yellowBox = ; diff --git a/types/react-router-navigation-core/package.json b/types/react-router-navigation-core/package.json index f4214c59cb7625..9e36b680fda219 100644 --- a/types/react-router-navigation-core/package.json +++ b/types/react-router-navigation-core/package.json @@ -7,7 +7,7 @@ ], "dependencies": { "@types/history": "^4.7.11", - "@types/react": "^17", + "@types/react": "*", "react-native": "*", "@types/react-native-tab-view": "^1.0.6", "@types/react-router": "^5.1.0" diff --git a/types/react-router-navigation-core/tsconfig.json b/types/react-router-navigation-core/tsconfig.json index 5e42162b196ef1..8dbda3860c69de 100644 --- a/types/react-router-navigation-core/tsconfig.json +++ b/types/react-router-navigation-core/tsconfig.json @@ -11,12 +11,7 @@ "noImplicitAny": true, "noImplicitThis": true, "forceConsistentCasingInFileNames": true, - "noEmit": true, - "paths": { - "react": [ - "../react/v17/index.d.ts" - ] - } + "noEmit": true }, "files": [ "index.d.ts", diff --git a/types/react-router-navigation/package.json b/types/react-router-navigation/package.json index 2b6ba278c48572..193377ee76b866 100644 --- a/types/react-router-navigation/package.json +++ b/types/react-router-navigation/package.json @@ -6,7 +6,7 @@ "https://github.com/LeoLeBras/react-router-navigation#readme" ], "dependencies": { - "@types/react": "^17", + "@types/react": "*", "react-native": "*", "@types/react-navigation": "3.0.8", "@types/react-router-navigation-core": "*" diff --git a/types/react-router-navigation/tsconfig.json b/types/react-router-navigation/tsconfig.json index 5bb02f19f834dd..9ed3a53cf70d74 100644 --- a/types/react-router-navigation/tsconfig.json +++ b/types/react-router-navigation/tsconfig.json @@ -11,12 +11,7 @@ "noImplicitAny": true, "noImplicitThis": true, "forceConsistentCasingInFileNames": true, - "noEmit": true, - "paths": { - "react": [ - "../react/v17/index.d.ts" - ] - } + "noEmit": true }, "files": [ "index.d.ts", diff --git a/types/react-test-renderer/package.json b/types/react-test-renderer/package.json index ae9b457422c171..35a4a13a9e69a3 100644 --- a/types/react-test-renderer/package.json +++ b/types/react-test-renderer/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/react-test-renderer", - "version": "19.1.9999", + "version": "19.3.9999", "projects": [ "https://react.dev/" ], diff --git a/types/react/canary.d.ts b/types/react/canary.d.ts index e9a4312fcb27cb..9215a16bb87bab 100644 --- a/types/react/canary.d.ts +++ b/types/react/canary.d.ts @@ -30,100 +30,6 @@ export {}; declare const UNDEFINED_VOID_ONLY: unique symbol; type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never }; -type NativeSubmitEvent = SubmitEvent; - declare module "." { export function unstable_useCacheRefresh(): () => void; - - // @enableViewTransition - export interface ViewTransitionInstance { - /** - * The {@link ViewTransitionProps name} that was used in the corresponding {@link ViewTransition} component or `"auto"` if the `name` prop was omitted. - */ - name: string; - } - - export type ViewTransitionClassPerType = Record<"default" | (string & {}), "none" | "auto" | (string & {})>; - export type ViewTransitionClass = ViewTransitionClassPerType | ViewTransitionClassPerType[string]; - - export interface ViewTransitionProps { - children?: ReactNode | undefined; - /** - * Assigns the {@link https://developer.chrome.com/blog/view-transitions-update-io24#view-transition-class `view-transition-class`} class to the underlying DOM node. - */ - default?: ViewTransitionClass | undefined; - /** - * Combined with {@link className} if this `` or its parent Component is mounted and there's no other with the same name being deleted. - * `"none"` is a special value that deactivates the view transition name under that condition. - */ - enter?: ViewTransitionClass | undefined; - /** - * Combined with {@link className} if this `` or its parent Component is unmounted and there's no other with the same name being deleted. - * `"none"` is a special value that deactivates the view transition name under that condition. - */ - exit?: ViewTransitionClass | undefined; - /** - * "auto" will automatically assign a view-transition-name to the inner DOM node. - * That way you can add a View Transition to a Component without controlling its DOM nodes styling otherwise. - * - * A difference between this and the browser's built-in view-transition-name: auto is that switching the DOM nodes within the `` component preserves the same name so this example cross-fades between the DOM nodes instead of causing an exit and enter. - * @default "auto" - */ - name?: "auto" | (string & {}) | undefined; - /** - * The `` or its parent Component is mounted and there's no other `` with the same name being deleted. - */ - onEnter?: (instance: ViewTransitionInstance, types: Array) => void | (() => void); - /** - * The `` or its parent Component is unmounted and there's no other `` with the same name being deleted. - */ - onExit?: (instance: ViewTransitionInstance, types: Array) => void | (() => void); - /** - * This `` is being mounted and another `` instance with the same name is being unmounted elsewhere. - */ - onShare?: (instance: ViewTransitionInstance, types: Array) => void | (() => void); - /** - * The content of `` has changed either due to DOM mutations or because an inner child `` has resized. - */ - onUpdate?: (instance: ViewTransitionInstance, types: Array) => void | (() => void); - ref?: Ref | undefined; - /** - * Combined with {@link className} if this `` is being mounted and another instance with the same name is being unmounted elsewhere. - * `"none"` is a special value that deactivates the view transition name under that condition. - */ - share?: ViewTransitionClass | undefined; - /** - * Combined with {@link className} if the content of this `` has changed either due to DOM mutations or because an inner child has resized. - * `"none"` is a special value that deactivates the view transition name under that condition. - */ - update?: ViewTransitionClass | undefined; - } - - /** - * Opt-in for using {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API View Transitions} in React. - * View Transitions only trigger for async updates like {@link startTransition}, {@link useDeferredValue}, Actions or <{@link Suspense}> revealing from fallback to content. - * Synchronous updates provide an opt-out but also guarantee that they commit immediately which View Transitions can't. - * - * @see {@link https://react.dev/reference/react/ViewTransition `` reference documentation} - */ - export const ViewTransition: ExoticComponent; - - /** - * @see {@link https://react.dev/reference/react/addTransitionType `addTransitionType` reference documentation} - */ - export function addTransitionType(type: string): void; - - // @enableFragmentRefs - export interface FragmentInstance {} - - export interface FragmentProps { - ref?: Ref | undefined; - } - - interface SubmitEvent extends SyntheticEvent { - /** - * Only available in react@canary - */ - submitter: HTMLElement | null; - } } diff --git a/types/react/index.d.ts b/types/react/index.d.ts index fb9e4ceeb0e175..3a2f677611e307 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -732,8 +732,15 @@ declare namespace React { toArray(children: ReactNode | ReactNode[]): Array>; }; + /** + * The value of a ref on a ``. + * Empty by default; renderers (e.g. `react-dom`) augment this interface via `declare module "react"`. + */ + export interface FragmentInstance {} + export interface FragmentProps { children?: React.ReactNode; + ref?: Ref | undefined; } /** * Lets you group elements without a wrapper node. @@ -2014,6 +2021,85 @@ declare namespace React { */ export const Activity: ExoticComponent; + export interface ViewTransitionInstance { + /** + * The {@link ViewTransitionProps name} that was used in the corresponding {@link ViewTransition} component or `"auto"` if the `name` prop was omitted. + */ + name: string; + } + + export type ViewTransitionClassPerType = Record<"default" | (string & {}), "none" | "auto" | (string & {})>; + export type ViewTransitionClass = ViewTransitionClassPerType | ViewTransitionClassPerType[string]; + + export interface ViewTransitionProps { + children?: ReactNode | undefined; + /** + * Assigns the {@link https://developer.chrome.com/blog/view-transitions-update-io24#view-transition-class `view-transition-class`} class to the underlying DOM node. + */ + default?: ViewTransitionClass | undefined; + /** + * Combined with {@link className} if this `` or its parent Component is mounted and there's no other with the same name being deleted. + * `"none"` is a special value that deactivates the view transition name under that condition. + */ + enter?: ViewTransitionClass | undefined; + /** + * Combined with {@link className} if this `` or its parent Component is unmounted and there's no other with the same name being deleted. + * `"none"` is a special value that deactivates the view transition name under that condition. + */ + exit?: ViewTransitionClass | undefined; + /** + * "auto" will automatically assign a view-transition-name to the inner DOM node. + * That way you can add a View Transition to a Component without controlling its DOM nodes styling otherwise. + * + * A difference between this and the browser's built-in view-transition-name: auto is that switching the DOM nodes within the `` component preserves the same name so this example cross-fades between the DOM nodes instead of causing an exit and enter. + * @default "auto" + */ + name?: "auto" | (string & {}) | undefined; + /** + * The `` or its parent Component is mounted and there's no other `` with the same name being deleted. + */ + onEnter?: (instance: ViewTransitionInstance, types: Array) => void | (() => void); + /** + * The `` or its parent Component is unmounted and there's no other with the same name being deleted. + */ + onExit?: (instance: ViewTransitionInstance, types: Array) => void | (() => void); + /** + * This `` is being mounted and another `` instance with the same name is being unmounted elsewhere. + */ + onShare?: (instance: ViewTransitionInstance, types: Array) => void | (() => void); + /** + * The content of `` has changed either due to DOM mutations or because an inner child `` has resized. + */ + onUpdate?: (instance: ViewTransitionInstance, types: Array) => void | (() => void); + ref?: Ref | undefined; + /** + * Combined with {@link className} if this `` is being mounted and another instance with the same name is being unmounted elsewhere. + * `"none"` is a special value that deactivates the view transition name under that condition. + */ + share?: ViewTransitionClass | undefined; + /** + * Combined with {@link className} if the content of this `` has changed either due to DOM mutations or because an inner child has resized. + * `"none"` is a special value that deactivates the view transition name under that condition. + */ + update?: ViewTransitionClass | undefined; + } + + /** + * Opt-in for using {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API View Transitions} in React. + * View Transitions only trigger for async updates like {@link startTransition}, {@link useDeferredValue}, Actions or <{@link Suspense}> revealing from fallback to content. + * Synchronous updates provide an opt-out but also guarantee that they commit immediately which View Transitions can't. + * + * @see {@link https://react.dev/reference/react/ViewTransition `` reference documentation} + * @version 19.3.0 + */ + export const ViewTransition: ExoticComponent; + + /** + * @see {@link https://react.dev/reference/react/addTransitionType `addTransitionType` reference documentation} + * @version 19.3.0 + */ + export function addTransitionType(type: string): void; + /** * Warning: Only available in development builds. * @@ -2175,8 +2261,7 @@ declare namespace React { } interface SubmitEvent extends SyntheticEvent { - // `submitter` is available in react@canary - // submitter: HTMLElement | null; + submitter: HTMLElement | null; // SubmitEvents are always targetted at HTMLFormElements. target: EventTarget & HTMLFormElement; } diff --git a/types/react/package.json b/types/react/package.json index 29ab995c7ace00..28cd5814cd6822 100644 --- a/types/react/package.json +++ b/types/react/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/react", - "version": "19.2.9999", + "version": "19.3.9999", "projects": [ "https://react.dev/" ], diff --git a/types/react/test/canary.tsx b/types/react/test/canary.tsx index e81622f42eae10..117711db251c7e 100644 --- a/types/react/test/canary.tsx +++ b/types/react/test/canary.tsx @@ -25,141 +25,3 @@ function useCacheTest() { refresh(() => "refresh"); } } - -function viewTransitionTests() { - const ViewTransition = React.ViewTransition; - const addTransitionType = React.addTransitionType; - - ; - ; - ; - ; - ; - ; - ; - - { - // $ExpectType ViewTransitionInstance - instance; - // $ExpectType string[] - types; - return function cleanup() {}; - }} - onExit={(instance, types) => { - // $ExpectType ViewTransitionInstance - instance; - // $ExpectType string[] - types; - return function cleanup() {}; - }} - onShare={(instance, types) => { - // $ExpectType ViewTransitionInstance - instance; - // $ExpectType string[] - types; - return function cleanup() {}; - }} - onUpdate={(instance, types) => { - // $ExpectType ViewTransitionInstance - instance; - // $ExpectType string[] - types; - return function cleanup() {}; - }} - />; - - { - return 5; - }} - // @ts-expect-error -- onExit can return void or a cleanup function. - onExit={() => { - return 5; - }} - // @ts-expect-error -- onShare can return void or a cleanup function. - onShare={() => { - return 5; - }} - // @ts-expect-error -- onUpdate can return void or a cleanup function. - onUpdate={() => { - return 5; - }} - />; - - { - if (current !== null) { - // $ExpectType string - current.name; - } - }} - > -
- ; - - -
- ; - - const Null = () => null; - - - ; - - const Div = ({ children }: { children?: React.ReactNode }) =>
{children}
; - -
- ; - - function Component() { - function handleNavigation() { - React.startTransition(() => { - // @ts-expect-error - addTransitionType(); - // @ts-expect-error - addTransitionType(undefined); - addTransitionType("navigation"); - }); - } - } -} - -// @enableFragmentRefs -function fragmentRefTest() { - { - // $ExpectType FragmentInstance | null - maybeInstance; - - // See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/69022/commits/57825689c7abb50a79395d1266226cfa1b31a4e1 - const instance = maybeInstance!; - - // @ts-expect-error -- Not implemented by isomorphic renderer but react-dom. - instance.focus; - - return () => {}; - }} - > -
-
- ; -} diff --git a/types/react/test/tsx.tsx b/types/react/test/tsx.tsx index 58db3f3a1bab37..67dcf8f564c6af 100644 --- a/types/react/test/tsx.tsx +++ b/types/react/test/tsx.tsx @@ -911,3 +911,140 @@ function activityTest() { />; ; } + +function viewTransitionTests() { + const ViewTransition = React.ViewTransition; + const addTransitionType = React.addTransitionType; + + ; + ; + ; + ; + ; + ; + ; + + { + // $ExpectType ViewTransitionInstance + instance; + // $ExpectType string[] + types; + return function cleanup() {}; + }} + onExit={(instance, types) => { + // $ExpectType ViewTransitionInstance + instance; + // $ExpectType string[] + types; + return function cleanup() {}; + }} + onShare={(instance, types) => { + // $ExpectType ViewTransitionInstance + instance; + // $ExpectType string[] + types; + return function cleanup() {}; + }} + onUpdate={(instance, types) => { + // $ExpectType ViewTransitionInstance + instance; + // $ExpectType string[] + types; + return function cleanup() {}; + }} + />; + + { + return 5; + }} + // @ts-expect-error -- onExit can return void or a cleanup function. + onExit={() => { + return 5; + }} + // @ts-expect-error -- onShare can return void or a cleanup function. + onShare={() => { + return 5; + }} + // @ts-expect-error -- onUpdate can return void or a cleanup function. + onUpdate={() => { + return 5; + }} + />; + + { + if (current !== null) { + // $ExpectType string + current.name; + } + }} + > +
+ ; + + +
+ ; + + const Null = () => null; + + + ; + + const Div = ({ children }: { children?: React.ReactNode }) =>
{children}
; + +
+ ; + + function Component() { + function handleNavigation() { + React.startTransition(() => { + // @ts-expect-error + addTransitionType(); + // @ts-expect-error + addTransitionType(undefined); + addTransitionType("navigation"); + }); + } + } +} + +function fragmentRefTest() { + { + // $ExpectType FragmentInstance | null + maybeInstance; + + // See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/69022/commits/57825689c7abb50a79395d1266226cfa1b31a4e1 + const instance = maybeInstance!; + + // @ts-expect-error -- Not implemented by isomorphic renderer but react-dom. + instance.focus; + + return () => {}; + }} + > +
+
+ ; +} diff --git a/types/react/ts5.0/canary.d.ts b/types/react/ts5.0/canary.d.ts index e9a4312fcb27cb..9215a16bb87bab 100644 --- a/types/react/ts5.0/canary.d.ts +++ b/types/react/ts5.0/canary.d.ts @@ -30,100 +30,6 @@ export {}; declare const UNDEFINED_VOID_ONLY: unique symbol; type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never }; -type NativeSubmitEvent = SubmitEvent; - declare module "." { export function unstable_useCacheRefresh(): () => void; - - // @enableViewTransition - export interface ViewTransitionInstance { - /** - * The {@link ViewTransitionProps name} that was used in the corresponding {@link ViewTransition} component or `"auto"` if the `name` prop was omitted. - */ - name: string; - } - - export type ViewTransitionClassPerType = Record<"default" | (string & {}), "none" | "auto" | (string & {})>; - export type ViewTransitionClass = ViewTransitionClassPerType | ViewTransitionClassPerType[string]; - - export interface ViewTransitionProps { - children?: ReactNode | undefined; - /** - * Assigns the {@link https://developer.chrome.com/blog/view-transitions-update-io24#view-transition-class `view-transition-class`} class to the underlying DOM node. - */ - default?: ViewTransitionClass | undefined; - /** - * Combined with {@link className} if this `` or its parent Component is mounted and there's no other with the same name being deleted. - * `"none"` is a special value that deactivates the view transition name under that condition. - */ - enter?: ViewTransitionClass | undefined; - /** - * Combined with {@link className} if this `` or its parent Component is unmounted and there's no other with the same name being deleted. - * `"none"` is a special value that deactivates the view transition name under that condition. - */ - exit?: ViewTransitionClass | undefined; - /** - * "auto" will automatically assign a view-transition-name to the inner DOM node. - * That way you can add a View Transition to a Component without controlling its DOM nodes styling otherwise. - * - * A difference between this and the browser's built-in view-transition-name: auto is that switching the DOM nodes within the `` component preserves the same name so this example cross-fades between the DOM nodes instead of causing an exit and enter. - * @default "auto" - */ - name?: "auto" | (string & {}) | undefined; - /** - * The `` or its parent Component is mounted and there's no other `` with the same name being deleted. - */ - onEnter?: (instance: ViewTransitionInstance, types: Array) => void | (() => void); - /** - * The `` or its parent Component is unmounted and there's no other `` with the same name being deleted. - */ - onExit?: (instance: ViewTransitionInstance, types: Array) => void | (() => void); - /** - * This `` is being mounted and another `` instance with the same name is being unmounted elsewhere. - */ - onShare?: (instance: ViewTransitionInstance, types: Array) => void | (() => void); - /** - * The content of `` has changed either due to DOM mutations or because an inner child `` has resized. - */ - onUpdate?: (instance: ViewTransitionInstance, types: Array) => void | (() => void); - ref?: Ref | undefined; - /** - * Combined with {@link className} if this `` is being mounted and another instance with the same name is being unmounted elsewhere. - * `"none"` is a special value that deactivates the view transition name under that condition. - */ - share?: ViewTransitionClass | undefined; - /** - * Combined with {@link className} if the content of this `` has changed either due to DOM mutations or because an inner child has resized. - * `"none"` is a special value that deactivates the view transition name under that condition. - */ - update?: ViewTransitionClass | undefined; - } - - /** - * Opt-in for using {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API View Transitions} in React. - * View Transitions only trigger for async updates like {@link startTransition}, {@link useDeferredValue}, Actions or <{@link Suspense}> revealing from fallback to content. - * Synchronous updates provide an opt-out but also guarantee that they commit immediately which View Transitions can't. - * - * @see {@link https://react.dev/reference/react/ViewTransition `` reference documentation} - */ - export const ViewTransition: ExoticComponent; - - /** - * @see {@link https://react.dev/reference/react/addTransitionType `addTransitionType` reference documentation} - */ - export function addTransitionType(type: string): void; - - // @enableFragmentRefs - export interface FragmentInstance {} - - export interface FragmentProps { - ref?: Ref | undefined; - } - - interface SubmitEvent extends SyntheticEvent { - /** - * Only available in react@canary - */ - submitter: HTMLElement | null; - } } diff --git a/types/react/ts5.0/index.d.ts b/types/react/ts5.0/index.d.ts index ab91a0ee6e1906..1642ca6086266e 100644 --- a/types/react/ts5.0/index.d.ts +++ b/types/react/ts5.0/index.d.ts @@ -733,8 +733,15 @@ declare namespace React { toArray(children: ReactNode | ReactNode[]): Array>; }; + /** + * The value of a ref on a ``. + * Empty by default; renderers (e.g. `react-dom`) augment this interface via `declare module "react"`. + */ + export interface FragmentInstance {} + export interface FragmentProps { children?: React.ReactNode; + ref?: Ref | undefined; } /** * Lets you group elements without a wrapper node. @@ -2013,6 +2020,85 @@ declare namespace React { */ export const Activity: ExoticComponent; + export interface ViewTransitionInstance { + /** + * The {@link ViewTransitionProps name} that was used in the corresponding {@link ViewTransition} component or `"auto"` if the `name` prop was omitted. + */ + name: string; + } + + export type ViewTransitionClassPerType = Record<"default" | (string & {}), "none" | "auto" | (string & {})>; + export type ViewTransitionClass = ViewTransitionClassPerType | ViewTransitionClassPerType[string]; + + export interface ViewTransitionProps { + children?: ReactNode | undefined; + /** + * Assigns the {@link https://developer.chrome.com/blog/view-transitions-update-io24#view-transition-class `view-transition-class`} class to the underlying DOM node. + */ + default?: ViewTransitionClass | undefined; + /** + * Combined with {@link className} if this `` or its parent Component is mounted and there's no other with the same name being deleted. + * `"none"` is a special value that deactivates the view transition name under that condition. + */ + enter?: ViewTransitionClass | undefined; + /** + * Combined with {@link className} if this `` or its parent Component is unmounted and there's no other with the same name being deleted. + * `"none"` is a special value that deactivates the view transition name under that condition. + */ + exit?: ViewTransitionClass | undefined; + /** + * "auto" will automatically assign a view-transition-name to the inner DOM node. + * That way you can add a View Transition to a Component without controlling its DOM nodes styling otherwise. + * + * A difference between this and the browser's built-in view-transition-name: auto is that switching the DOM nodes within the `` component preserves the same name so this example cross-fades between the DOM nodes instead of causing an exit and enter. + * @default "auto" + */ + name?: "auto" | (string & {}) | undefined; + /** + * The `` or its parent Component is mounted and there's no other `` with the same name being deleted. + */ + onEnter?: (instance: ViewTransitionInstance, types: Array) => void | (() => void); + /** + * The `` or its parent Component is unmounted and there's no other with the same name being deleted. + */ + onExit?: (instance: ViewTransitionInstance, types: Array) => void | (() => void); + /** + * This `` is being mounted and another `` instance with the same name is being unmounted elsewhere. + */ + onShare?: (instance: ViewTransitionInstance, types: Array) => void | (() => void); + /** + * The content of `` has changed either due to DOM mutations or because an inner child `` has resized. + */ + onUpdate?: (instance: ViewTransitionInstance, types: Array) => void | (() => void); + ref?: Ref | undefined; + /** + * Combined with {@link className} if this `` is being mounted and another instance with the same name is being unmounted elsewhere. + * `"none"` is a special value that deactivates the view transition name under that condition. + */ + share?: ViewTransitionClass | undefined; + /** + * Combined with {@link className} if the content of this `` has changed either due to DOM mutations or because an inner child has resized. + * `"none"` is a special value that deactivates the view transition name under that condition. + */ + update?: ViewTransitionClass | undefined; + } + + /** + * Opt-in for using {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API View Transitions} in React. + * View Transitions only trigger for async updates like {@link startTransition}, {@link useDeferredValue}, Actions or <{@link Suspense}> revealing from fallback to content. + * Synchronous updates provide an opt-out but also guarantee that they commit immediately which View Transitions can't. + * + * @see {@link https://react.dev/reference/react/ViewTransition `` reference documentation} + * @version 19.3.0 + */ + export const ViewTransition: ExoticComponent; + + /** + * @see {@link https://react.dev/reference/react/addTransitionType `addTransitionType` reference documentation} + * @version 19.3.0 + */ + export function addTransitionType(type: string): void; + /** * Warning: Only available in development builds. * @@ -2174,8 +2260,7 @@ declare namespace React { } interface SubmitEvent extends SyntheticEvent { - // `submitter` is available in react@canary - // submitter: HTMLElement | null; + submitter: HTMLElement | null; // SubmitEvents are always targetted at HTMLFormElements. target: EventTarget & HTMLFormElement; } diff --git a/types/react/ts5.0/test/canary.tsx b/types/react/ts5.0/test/canary.tsx index e81622f42eae10..117711db251c7e 100644 --- a/types/react/ts5.0/test/canary.tsx +++ b/types/react/ts5.0/test/canary.tsx @@ -25,141 +25,3 @@ function useCacheTest() { refresh(() => "refresh"); } } - -function viewTransitionTests() { - const ViewTransition = React.ViewTransition; - const addTransitionType = React.addTransitionType; - - ; - ; - ; - ; - ; - ; - ; - - { - // $ExpectType ViewTransitionInstance - instance; - // $ExpectType string[] - types; - return function cleanup() {}; - }} - onExit={(instance, types) => { - // $ExpectType ViewTransitionInstance - instance; - // $ExpectType string[] - types; - return function cleanup() {}; - }} - onShare={(instance, types) => { - // $ExpectType ViewTransitionInstance - instance; - // $ExpectType string[] - types; - return function cleanup() {}; - }} - onUpdate={(instance, types) => { - // $ExpectType ViewTransitionInstance - instance; - // $ExpectType string[] - types; - return function cleanup() {}; - }} - />; - - { - return 5; - }} - // @ts-expect-error -- onExit can return void or a cleanup function. - onExit={() => { - return 5; - }} - // @ts-expect-error -- onShare can return void or a cleanup function. - onShare={() => { - return 5; - }} - // @ts-expect-error -- onUpdate can return void or a cleanup function. - onUpdate={() => { - return 5; - }} - />; - - { - if (current !== null) { - // $ExpectType string - current.name; - } - }} - > -
- ; - - -
- ; - - const Null = () => null; - - - ; - - const Div = ({ children }: { children?: React.ReactNode }) =>
{children}
; - -
- ; - - function Component() { - function handleNavigation() { - React.startTransition(() => { - // @ts-expect-error - addTransitionType(); - // @ts-expect-error - addTransitionType(undefined); - addTransitionType("navigation"); - }); - } - } -} - -// @enableFragmentRefs -function fragmentRefTest() { - { - // $ExpectType FragmentInstance | null - maybeInstance; - - // See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/69022/commits/57825689c7abb50a79395d1266226cfa1b31a4e1 - const instance = maybeInstance!; - - // @ts-expect-error -- Not implemented by isomorphic renderer but react-dom. - instance.focus; - - return () => {}; - }} - > -
-
- ; -} diff --git a/types/react/ts5.0/test/tsx.tsx b/types/react/ts5.0/test/tsx.tsx index 28be7ca67c4159..7e9206c00abae5 100644 --- a/types/react/ts5.0/test/tsx.tsx +++ b/types/react/ts5.0/test/tsx.tsx @@ -915,3 +915,140 @@ function activityTest() { />; ; } + +function viewTransitionTests() { + const ViewTransition = React.ViewTransition; + const addTransitionType = React.addTransitionType; + + ; + ; + ; + ; + ; + ; + ; + + { + // $ExpectType ViewTransitionInstance + instance; + // $ExpectType string[] + types; + return function cleanup() {}; + }} + onExit={(instance, types) => { + // $ExpectType ViewTransitionInstance + instance; + // $ExpectType string[] + types; + return function cleanup() {}; + }} + onShare={(instance, types) => { + // $ExpectType ViewTransitionInstance + instance; + // $ExpectType string[] + types; + return function cleanup() {}; + }} + onUpdate={(instance, types) => { + // $ExpectType ViewTransitionInstance + instance; + // $ExpectType string[] + types; + return function cleanup() {}; + }} + />; + + { + return 5; + }} + // @ts-expect-error -- onExit can return void or a cleanup function. + onExit={() => { + return 5; + }} + // @ts-expect-error -- onShare can return void or a cleanup function. + onShare={() => { + return 5; + }} + // @ts-expect-error -- onUpdate can return void or a cleanup function. + onUpdate={() => { + return 5; + }} + />; + + { + if (current !== null) { + // $ExpectType string + current.name; + } + }} + > +
+ ; + + +
+ ; + + const Null = () => null; + + + ; + + const Div = ({ children }: { children?: React.ReactNode }) =>
{children}
; + +
+ ; + + function Component() { + function handleNavigation() { + React.startTransition(() => { + // @ts-expect-error + addTransitionType(); + // @ts-expect-error + addTransitionType(undefined); + addTransitionType("navigation"); + }); + } + } +} + +function fragmentRefTest() { + { + // $ExpectType FragmentInstance | null + maybeInstance; + + // See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/69022/commits/57825689c7abb50a79395d1266226cfa1b31a4e1 + const instance = maybeInstance!; + + // @ts-expect-error -- Not implemented by isomorphic renderer but react-dom. + instance.focus; + + return () => {}; + }} + > +
+
+ ; +} diff --git a/types/rn-material-ui-textfield/index.d.ts b/types/rn-material-ui-textfield/index.d.ts index 03442c155cdd44..100440568c9760 100644 --- a/types/rn-material-ui-textfield/index.d.ts +++ b/types/rn-material-ui-textfield/index.d.ts @@ -1,14 +1,5 @@ import * as React from "react"; -import { - ColorValue, - NativeSyntheticEvent, - StyleProp, - TextInputChangeEventData, - TextInputFocusEventData, - TextInputProps, - TextStyle, - ViewStyle, -} from "react-native"; +import { ColorValue, NativeSyntheticEvent, StyleProp, TextInputProps, TextStyle, ViewStyle } from "react-native"; export interface ContentInset { top?: number | undefined; diff --git a/types/scheduler/package.json b/types/scheduler/package.json index 22efad03925a5e..9938a87819c742 100644 --- a/types/scheduler/package.json +++ b/types/scheduler/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/scheduler", - "version": "0.26.9999", + "version": "0.28.9999", "projects": [ "https://react.dev/" ], diff --git a/types/selectize/index.d.ts b/types/selectize/index.d.ts index e9cd923d1dd618..3f64fec5b0c3b5 100644 --- a/types/selectize/index.d.ts +++ b/types/selectize/index.d.ts @@ -444,12 +444,12 @@ declare namespace Selectize { /** * Removes the option identified by the given value. */ - removeOption(value: T): void; + removeOption(value: T, silent?: boolean): void; /** * Removes all options from the control. */ - clearOptions(): void; + clearOptions(silent?: boolean): void; /** * Retrieves the jQuery element for the option identified by the given value. @@ -504,7 +504,7 @@ declare namespace Selectize { /** * Re-renders the selected item lists. */ - refreshItems(): void; + refreshItems(silent?: boolean): void; // Optgroups // ------------------------------------------------------------------------------------------------------------ diff --git a/types/selectize/selectize-tests.ts b/types/selectize/selectize-tests.ts index 07f2048a309083..9028ced42c4711 100644 --- a/types/selectize/selectize-tests.ts +++ b/types/selectize/selectize-tests.ts @@ -36,6 +36,7 @@ $("#button-clear").on("click", function() { }); $("#button-clearoptions").on("click", function() { control.clearOptions(); + control.clearOptions(true); }); $("#button-addoption").on("click", function() { control.addOption({ @@ -55,6 +56,14 @@ $("#button-additems").on("click", function() { control.addItems([2, 3]); control.addItems([2, 3], true); }); +$("#button-removeoption").on("click", function() { + control.removeOption(2); + control.removeOption(2, true); +}); +$("#button-refreshitems").on("click", function() { + control.refreshItems(); + control.refreshItems(true); +}); $("#button-removeoptiongroup").on("click", function() { control.removeOptionGroup("dodge"); }); diff --git a/types/svelte-range-slider-pips/.npmignore b/types/svelte-range-slider-pips/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/svelte-range-slider-pips/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/svelte-range-slider-pips/index.d.ts b/types/svelte-range-slider-pips/index.d.ts deleted file mode 100644 index 9f544d4450b854..00000000000000 --- a/types/svelte-range-slider-pips/index.d.ts +++ /dev/null @@ -1,170 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; - -declare namespace RangeSlider { - interface OnStart { - value: number; - values: number[]; - activeHandle: number; - } - - interface OnStop extends OnStart { - startValue: number; - } - - interface OnChange extends OnStop { - previousValue: number; - } - - type Formater = (v: number, i?: number, p?: number) => string; - - interface SpringValues { - stiffness: number; - damping: number; - } - - interface RangeSliderProps { - // dom references - /** - * DOM reference for binding to the main
of the component (bind:slider='ref') - */ - slider?: HTMLDivElement | null; - - // range slider props - /** - * Whether to style as a range picker. - * Use range='min' or range='max' for min/max variants - */ - range?: boolean | string; - /** - * If range is true, then this boolean decides if one handle will push the other along - */ - pushy?: boolean; - /** - * Minimum value for the slider (should be < max) - */ - min?: number; - /** - * Maximum value for the slider (should be > min) - */ - max?: number; - /** - * Every nth value to allow handle to stop at (should be a positive value) - */ - step?: number; - /** - * Array of values to apply on the slider. - * Multiple values creates multiple handles. - * (note: A slider with range property set can only have two values max) - */ - values?: number[]; - /** - * Make the slider render vertically (lower value on bottom) - */ - vertical?: boolean; - /** - * Set true to add a floating label above focussed handles - */ - float?: boolean; - /** - * Reverse the orientation of min/max - */ - reversed?: boolean; - /** - * Whether hover styles are enabled for both handles and pips/values - */ - hoverable?: boolean; - /** - * Determine if the slider is disabled, or enabled - * (only disables interactions, and events) - */ - disabled?: boolean; - /** - * An array of strings to use for the aria-label attribute on the handles - */ - ariaLabels?: string[]; - - // range pips / values props - /** - * Whether to show pips/notches on the slider - */ - pips?: boolean; - /** - * Every nth step to show a pip for. - * This has multiple defaults depending on values property - */ - pipstep?: number; - /** - * Whether to show a pip or label for all values. - * Same as combining first, last and rest. Use all='label' to show a label value - */ - all?: boolean | string; - /** - * Whether to show a pip or label for the first value on slider. - * Use first='label' to show a label value - */ - first?: boolean | string; - /** - * Whether to show a pip or label for the last value on slider. - * Use last='label' to show a label value - */ - last?: boolean | string; - /** - * Whether to show a pip or label for all other values. - * Use rest='label' to show a label value - */ - rest?: boolean | string; - - // formatting props - /** - * Give the slider a unique ID for use in styling - */ - id?: string; - /** - * A string to prefix to all displayed values - */ - prefix?: string; - /** - * A string to suffix to all displayed values - */ - suffix?: string; - /** - * A function to re-format values before they are displayed (v = value, i = pip index, p = percent) - */ - formatter?: Formater; - /** - * A function to re-format values on the handle/float before they are displayed. Defaults to the same function given to the formatter property (v = value, i = handle index, p = percent) - */ - handleFormatter?: Formater; - - // stylistic props - precision?: number; - /** - * Svelte spring physics object to change the behaviour of the handle when moving - */ - springValues?: SpringValues; - } - - interface RangeSliderEvents { - /** - * Event fired when the user begins interaction with the slider - */ - start: CustomEvent; - /** - * Event fired when the user changes the value; returns the previous value, also - */ - change: CustomEvent; - /** - * Event fired when the user stops interacting with slider; returns the beginning value, also - */ - stop: CustomEvent; - } - - type RangeSliderSlots = never; -} - -type Props = RangeSlider.RangeSliderProps; -type Events = RangeSlider.RangeSliderEvents; -type Slots = RangeSlider.RangeSliderSlots; - -declare class RangeSlider extends SvelteComponentTyped {} -export = RangeSlider; diff --git a/types/svelte-range-slider-pips/package.json b/types/svelte-range-slider-pips/package.json deleted file mode 100644 index 7cebca9c2df031..00000000000000 --- a/types/svelte-range-slider-pips/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "private": true, - "name": "@types/svelte-range-slider-pips", - "version": "2.0.9999", - "projects": [ - "https://github.com/simeydotme/svelte-range-slider-pips" - ], - "dependencies": { - "svelte": "^3.0.0" - }, - "devDependencies": { - "@types/svelte-range-slider-pips": "workspace:." - }, - "owners": [ - { - "name": "Nick K", - "githubUsername": "i7N3" - } - ] -} diff --git a/types/svelte-range-slider-pips/svelte-range-slider-pips-tests.ts b/types/svelte-range-slider-pips/svelte-range-slider-pips-tests.ts deleted file mode 100644 index 7b09d03aa0e088..00000000000000 --- a/types/svelte-range-slider-pips/svelte-range-slider-pips-tests.ts +++ /dev/null @@ -1,7 +0,0 @@ -import RangeSliderPips = require("svelte-range-slider-pips"); - -{ - const slider = new RangeSliderPips({ - target: document.body, - }); -} diff --git a/types/svelte-range-slider-pips/tsconfig.json b/types/svelte-range-slider-pips/tsconfig.json deleted file mode 100644 index e7549e03cca9c7..00000000000000 --- a/types/svelte-range-slider-pips/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictFunctionTypes": true, - "strictNullChecks": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "svelte-range-slider-pips-tests.ts" - ] -} diff --git a/types/use-subscription/package.json b/types/use-subscription/package.json index 996c2af50ce2f0..ae6beb8c39dbc2 100644 --- a/types/use-subscription/package.json +++ b/types/use-subscription/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/use-subscription", - "version": "1.0.9999", + "version": "1.13.9999", "projects": [ "https://github.com/facebook/react/" ], diff --git a/types/use-sync-external-store/package.json b/types/use-sync-external-store/package.json index df83325a13cdd1..9fa02783ff711b 100644 --- a/types/use-sync-external-store/package.json +++ b/types/use-sync-external-store/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/use-sync-external-store", - "version": "1.5.9999", + "version": "1.7.9999", "projects": [ "https://react.dev/" ],