diff --git a/types/invity-api/index.d.ts b/types/invity-api/index.d.ts index a2728cddcc2c38..0c0caf9fc5ff8c 100644 --- a/types/invity-api/index.d.ts +++ b/types/invity-api/index.d.ts @@ -74,6 +74,10 @@ export interface ClientVersion { version: string; } +export interface Subdivisions { + [country: string]: string[]; +} + export interface ProviderMetadata { name: string; // unique internal name, e.g. "changenow" companyName: string; // name visible to clients, e.g. "ChangeNow" @@ -91,7 +95,9 @@ export interface ProviderMetadata { export interface BuySellProviderMetadata extends ProviderMetadata { supportedCountries: string[]; // ['AT', 'BE'] + supportedSubdivisions: Subdivisions; // { 'US': ['AL', 'NY', 'WA'] } tradedCoins: CryptoId[]; // ['BTC', 'BCH', 'LTC', 'XRP', 'ETH', 'bitcoin', 'ethereum', 'litecoin', 'ethereum--0xdac17f958d2ee523a2206206994597c13d831ec7'] + disabledSubdivisions?: Subdivisions; } // buy types @@ -168,6 +174,7 @@ export interface BuyTradeQuoteRequest { fiatCurrency: string; // USD receiveCurrency: CryptoId; // bitcoin country?: string | undefined; + subdivision?: string | undefined; paymentMethod?: BuyCryptoPaymentMethod | undefined; } @@ -501,6 +508,7 @@ export interface SellFiatTradeQuoteRequest { cryptoStringAmount?: string | undefined; // 0.3 - requested amount in crypto currency cryptoCurrency: CryptoId; // bitcoin country?: string | undefined; + subdivision?: string | undefined; paymentMethod?: SellCryptoPaymentMethod | undefined; flows?: SellFiatFlowType[] | undefined; } diff --git a/types/invity-api/invity-api-tests.ts b/types/invity-api/invity-api-tests.ts index 74412b7324ae8c..7e9c8b8043fb54 100644 --- a/types/invity-api/invity-api-tests.ts +++ b/types/invity-api/invity-api-tests.ts @@ -66,6 +66,8 @@ const providerInfo: BuyProviderInfo = { tradedCoins: [], tradedFiatCurrencies: [], supportedCountries: [], + supportedSubdivisions: {}, + disabledSubdivisions: {}, paymentMethods: [], statusUrl: "https://test-finance.invity.io/#status/{{paymentId}}", supportUrl: "", @@ -124,6 +126,8 @@ const sellProviderInfo: SellProviderInfo = { tradedCoins: ["bitcoin", "ethereum"] as CryptoId[], tradedFiatCurrencies: ["USD"], supportedCountries: ["US"], + supportedSubdivisions: { "US": ["WA"] }, + disabledSubdivisions: {}, statusUrl: "https://example.com/txs/{{orderId}}", supportUrl: " https://support.example.com", termsUrl: "https://example.com/legal/terms-of-use", diff --git a/types/postcss-fail-on-warn/.npmignore b/types/postcss-fail-on-warn/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/postcss-fail-on-warn/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/postcss-fail-on-warn/index.d.ts b/types/postcss-fail-on-warn/index.d.ts new file mode 100644 index 00000000000000..ec5c13b3ed1cf1 --- /dev/null +++ b/types/postcss-fail-on-warn/index.d.ts @@ -0,0 +1,5 @@ +import { Plugin } from "postcss"; + +declare const postcssFailOnWarn: Plugin<{}>; + +export = postcssFailOnWarn; diff --git a/types/postcss-fail-on-warn/package.json b/types/postcss-fail-on-warn/package.json new file mode 100644 index 00000000000000..684371c43969dd --- /dev/null +++ b/types/postcss-fail-on-warn/package.json @@ -0,0 +1,15 @@ +{ + "private": true, + "name": "@types/postcss-fail-on-warn", + "version": "0.2.9999", + "projects": [ + "https://github.com/postcss/postcss-fail-on-warn#readme" + ], + "dependencies": { + "postcss": "^6.0.17" + }, + "devDependencies": { + "@types/postcss-fail-on-warn": "workspace:." + }, + "owners": [] +} diff --git a/types/postcss-fail-on-warn/postcss-fail-on-warn-tests.ts b/types/postcss-fail-on-warn/postcss-fail-on-warn-tests.ts new file mode 100644 index 00000000000000..44845d6416cb4c --- /dev/null +++ b/types/postcss-fail-on-warn/postcss-fail-on-warn-tests.ts @@ -0,0 +1,5 @@ +import postcss = require("postcss"); +import failOnWarn from "postcss-fail-on-warn"; + +postcss([failOnWarn]); +postcss([failOnWarn()]); diff --git a/types/postcss-fail-on-warn/tsconfig.json b/types/postcss-fail-on-warn/tsconfig.json new file mode 100644 index 00000000000000..360b0d83ee2dc5 --- /dev/null +++ b/types/postcss-fail-on-warn/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "postcss-fail-on-warn-tests.ts" + ] +} diff --git a/types/react-dom/test/experimental-tests.tsx b/types/react-dom/test/experimental-tests.tsx index 9f250c62e5b290..4db75043cdd7b4 100644 --- a/types/react-dom/test/experimental-tests.tsx +++ b/types/react-dom/test/experimental-tests.tsx @@ -25,6 +25,16 @@ function swipeTransitionTest() { }, ); } + + { + // $ExpectType CSSNumberish | null + timeline.currentTime; + // $ExpectType ViewTransitionPseudoElement + instance.group; + }} + > + ; } // @enableSrcObject diff --git a/types/react/canary.d.ts b/types/react/canary.d.ts index 22b1807e699a62..b1cac75e162f5d 100644 --- a/types/react/canary.d.ts +++ b/types/react/canary.d.ts @@ -71,19 +71,19 @@ declare module "." { /** * The `` or its parent Component is mounted and there's no other `` with the same name being deleted. */ - onEnter?: (instance: ViewTransitionInstance, types: Array) => void; + 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; + 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; + 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; + 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. diff --git a/types/react/experimental.d.ts b/types/react/experimental.d.ts index e6ebe93124e6aa..49ff8620cd9b8c 100644 --- a/types/react/experimental.d.ts +++ b/types/react/experimental.d.ts @@ -129,6 +129,9 @@ declare module "." { rangeStart?: number | undefined; rangeEnd?: number | undefined; } + export type GestureOptionsRequired = { + [P in keyof GestureOptions]-?: NonNullable; + }; /** */ export function unstable_startGestureTransition( provider: GestureProvider, @@ -136,6 +139,33 @@ declare module "." { options?: GestureOptions, ): () => void; + interface ViewTransitionProps { + onGestureEnter?: ( + timeline: GestureProvider, + options: GestureOptionsRequired, + instance: ViewTransitionInstance, + types: Array, + ) => void | (() => void); + onGestureExit?: ( + timeline: GestureProvider, + options: GestureOptionsRequired, + instance: ViewTransitionInstance, + types: Array, + ) => void | (() => void); + onGestureShare?: ( + timeline: GestureProvider, + options: GestureOptionsRequired, + instance: ViewTransitionInstance, + types: Array, + ) => void | (() => void); + onGestureUpdate?: ( + timeline: GestureProvider, + options: GestureOptionsRequired, + instance: ViewTransitionInstance, + types: Array, + ) => void | (() => void); + } + // @enableSrcObject interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_IMG_SRC_TYPES { srcObject: Blob; diff --git a/types/react/test/canary.tsx b/types/react/test/canary.tsx index cc72b615ddd282..e81622f42eae10 100644 --- a/types/react/test/canary.tsx +++ b/types/react/test/canary.tsx @@ -61,24 +61,47 @@ function viewTransitionTests() { 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; }} />; diff --git a/types/react/test/experimental.tsx b/types/react/test/experimental.tsx index c80881e117ab94..dc46c65d62f4c5 100644 --- a/types/react/test/experimental.tsx +++ b/types/react/test/experimental.tsx @@ -178,4 +178,34 @@ function swipeTransitionTest() { // options can be empty startGestureTransition(gestureProvider, () => {}, {}); } + + { + // @ts-expect-error -- Only implemented by react-dom + timeline.currentTime; + // passed options are non-nullable + // $ExpectType number + options.rangeStart; + // $ExpectType number + options.rangeEnd; + // @ts-expect-error -- Only implemented by react-dom + instance.group; + }} + > + ; + + { + return 5; + }} + > + ; + + { + return function cleanup() {}; + }} + > + ; } diff --git a/types/react/ts5.0/canary.d.ts b/types/react/ts5.0/canary.d.ts index 22b1807e699a62..b1cac75e162f5d 100644 --- a/types/react/ts5.0/canary.d.ts +++ b/types/react/ts5.0/canary.d.ts @@ -71,19 +71,19 @@ declare module "." { /** * The `` or its parent Component is mounted and there's no other `` with the same name being deleted. */ - onEnter?: (instance: ViewTransitionInstance, types: Array) => void; + 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; + 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; + 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; + 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. diff --git a/types/react/ts5.0/experimental.d.ts b/types/react/ts5.0/experimental.d.ts index e6ebe93124e6aa..49ff8620cd9b8c 100644 --- a/types/react/ts5.0/experimental.d.ts +++ b/types/react/ts5.0/experimental.d.ts @@ -129,6 +129,9 @@ declare module "." { rangeStart?: number | undefined; rangeEnd?: number | undefined; } + export type GestureOptionsRequired = { + [P in keyof GestureOptions]-?: NonNullable; + }; /** */ export function unstable_startGestureTransition( provider: GestureProvider, @@ -136,6 +139,33 @@ declare module "." { options?: GestureOptions, ): () => void; + interface ViewTransitionProps { + onGestureEnter?: ( + timeline: GestureProvider, + options: GestureOptionsRequired, + instance: ViewTransitionInstance, + types: Array, + ) => void | (() => void); + onGestureExit?: ( + timeline: GestureProvider, + options: GestureOptionsRequired, + instance: ViewTransitionInstance, + types: Array, + ) => void | (() => void); + onGestureShare?: ( + timeline: GestureProvider, + options: GestureOptionsRequired, + instance: ViewTransitionInstance, + types: Array, + ) => void | (() => void); + onGestureUpdate?: ( + timeline: GestureProvider, + options: GestureOptionsRequired, + instance: ViewTransitionInstance, + types: Array, + ) => void | (() => void); + } + // @enableSrcObject interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_IMG_SRC_TYPES { srcObject: Blob; diff --git a/types/react/ts5.0/test/canary.tsx b/types/react/ts5.0/test/canary.tsx index cc72b615ddd282..e81622f42eae10 100644 --- a/types/react/ts5.0/test/canary.tsx +++ b/types/react/ts5.0/test/canary.tsx @@ -61,24 +61,47 @@ function viewTransitionTests() { 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; }} />; diff --git a/types/react/ts5.0/test/experimental.tsx b/types/react/ts5.0/test/experimental.tsx index c80881e117ab94..dc46c65d62f4c5 100644 --- a/types/react/ts5.0/test/experimental.tsx +++ b/types/react/ts5.0/test/experimental.tsx @@ -178,4 +178,34 @@ function swipeTransitionTest() { // options can be empty startGestureTransition(gestureProvider, () => {}, {}); } + + { + // @ts-expect-error -- Only implemented by react-dom + timeline.currentTime; + // passed options are non-nullable + // $ExpectType number + options.rangeStart; + // $ExpectType number + options.rangeEnd; + // @ts-expect-error -- Only implemented by react-dom + instance.group; + }} + > + ; + + { + return 5; + }} + > + ; + + { + return function cleanup() {}; + }} + > + ; }