Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions types/invity-api/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -168,6 +174,7 @@ export interface BuyTradeQuoteRequest {
fiatCurrency: string; // USD
receiveCurrency: CryptoId; // bitcoin
country?: string | undefined;
subdivision?: string | undefined;
paymentMethod?: BuyCryptoPaymentMethod | undefined;
}

Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 4 additions & 0 deletions types/invity-api/invity-api-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ const providerInfo: BuyProviderInfo = {
tradedCoins: [],
tradedFiatCurrencies: [],
supportedCountries: [],
supportedSubdivisions: {},
disabledSubdivisions: {},
paymentMethods: [],
statusUrl: "https://test-finance.invity.io/#status/{{paymentId}}",
supportUrl: "",
Expand Down Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions types/postcss-fail-on-warn/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!**/*.d.ts
!**/*.d.cts
!**/*.d.mts
!**/*.d.*.ts
5 changes: 5 additions & 0 deletions types/postcss-fail-on-warn/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Plugin } from "postcss";

declare const postcssFailOnWarn: Plugin<{}>;

export = postcssFailOnWarn;
15 changes: 15 additions & 0 deletions types/postcss-fail-on-warn/package.json
Original file line number Diff line number Diff line change
@@ -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": []
}
5 changes: 5 additions & 0 deletions types/postcss-fail-on-warn/postcss-fail-on-warn-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import postcss = require("postcss");
import failOnWarn from "postcss-fail-on-warn";

postcss([failOnWarn]);
postcss([failOnWarn()]);
19 changes: 19 additions & 0 deletions types/postcss-fail-on-warn/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
10 changes: 10 additions & 0 deletions types/react-dom/test/experimental-tests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ function swipeTransitionTest() {
},
);
}

<React.ViewTransition
onGestureEnter={(timeline, options, instance, types) => {
// $ExpectType CSSNumberish | null
timeline.currentTime;
// $ExpectType ViewTransitionPseudoElement
instance.group;
}}
>
</React.ViewTransition>;
}

// @enableSrcObject
Expand Down
8 changes: 4 additions & 4 deletions types/react/canary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ declare module "." {
/**
* The `<ViewTransition>` or its parent Component is mounted and there's no other `<ViewTransition>` with the same name being deleted.
*/
onEnter?: (instance: ViewTransitionInstance, types: Array<string>) => void;
onEnter?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
/**
* The `<ViewTransition>` or its parent Component is unmounted and there's no other `<ViewTransition>` with the same name being deleted.
*/
onExit?: (instance: ViewTransitionInstance, types: Array<string>) => void;
onExit?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
/**
* This `<ViewTransition>` is being mounted and another `<ViewTransition>` instance with the same name is being unmounted elsewhere.
*/
onShare?: (instance: ViewTransitionInstance, types: Array<string>) => void;
onShare?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
/**
* The content of `<ViewTransition>` has changed either due to DOM mutations or because an inner child `<ViewTransition>` has resized.
*/
onUpdate?: (instance: ViewTransitionInstance, types: Array<string>) => void;
onUpdate?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
ref?: Ref<ViewTransitionInstance> | undefined;
/**
* Combined with {@link className} if this `<ViewTransition>` is being mounted and another instance with the same name is being unmounted elsewhere.
Expand Down
30 changes: 30 additions & 0 deletions types/react/experimental.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,43 @@ declare module "." {
rangeStart?: number | undefined;
rangeEnd?: number | undefined;
}
export type GestureOptionsRequired = {
[P in keyof GestureOptions]-?: NonNullable<GestureOptions[P]>;
};
/** */
export function unstable_startGestureTransition(
provider: GestureProvider,
scope: () => void,
options?: GestureOptions,
): () => void;

interface ViewTransitionProps {
onGestureEnter?: (
timeline: GestureProvider,
options: GestureOptionsRequired,
instance: ViewTransitionInstance,
types: Array<string>,
) => void | (() => void);
onGestureExit?: (
timeline: GestureProvider,
options: GestureOptionsRequired,
instance: ViewTransitionInstance,
types: Array<string>,
) => void | (() => void);
onGestureShare?: (
timeline: GestureProvider,
options: GestureOptionsRequired,
instance: ViewTransitionInstance,
types: Array<string>,
) => void | (() => void);
onGestureUpdate?: (
timeline: GestureProvider,
options: GestureOptionsRequired,
instance: ViewTransitionInstance,
types: Array<string>,
) => void | (() => void);
}

// @enableSrcObject
interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_IMG_SRC_TYPES {
srcObject: Blob;
Expand Down
23 changes: 23 additions & 0 deletions types/react/test/canary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {};
}}
/>;

<ViewTransition
// @ts-expect-error -- onEnter can return void or a cleanup function.
onEnter={() => {
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;
}}
/>;

Expand Down
30 changes: 30 additions & 0 deletions types/react/test/experimental.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,34 @@ function swipeTransitionTest() {
// options can be empty
startGestureTransition(gestureProvider, () => {}, {});
}

<React.ViewTransition
onGestureEnter={(timeline, options, instance, types) => {
// @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;
}}
>
</React.ViewTransition>;

<React.ViewTransition
// @ts-expect-error -- Either void or a function must be returned
onGestureEnter={() => {
return 5;
}}
>
</React.ViewTransition>;

<React.ViewTransition
onGestureEnter={() => {
return function cleanup() {};
}}
>
</React.ViewTransition>;
}
8 changes: 4 additions & 4 deletions types/react/ts5.0/canary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ declare module "." {
/**
* The `<ViewTransition>` or its parent Component is mounted and there's no other `<ViewTransition>` with the same name being deleted.
*/
onEnter?: (instance: ViewTransitionInstance, types: Array<string>) => void;
onEnter?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
/**
* The `<ViewTransition>` or its parent Component is unmounted and there's no other `<ViewTransition>` with the same name being deleted.
*/
onExit?: (instance: ViewTransitionInstance, types: Array<string>) => void;
onExit?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
/**
* This `<ViewTransition>` is being mounted and another `<ViewTransition>` instance with the same name is being unmounted elsewhere.
*/
onShare?: (instance: ViewTransitionInstance, types: Array<string>) => void;
onShare?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
/**
* The content of `<ViewTransition>` has changed either due to DOM mutations or because an inner child `<ViewTransition>` has resized.
*/
onUpdate?: (instance: ViewTransitionInstance, types: Array<string>) => void;
onUpdate?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
ref?: Ref<ViewTransitionInstance> | undefined;
/**
* Combined with {@link className} if this `<ViewTransition>` is being mounted and another instance with the same name is being unmounted elsewhere.
Expand Down
30 changes: 30 additions & 0 deletions types/react/ts5.0/experimental.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,43 @@ declare module "." {
rangeStart?: number | undefined;
rangeEnd?: number | undefined;
}
export type GestureOptionsRequired = {
[P in keyof GestureOptions]-?: NonNullable<GestureOptions[P]>;
};
/** */
export function unstable_startGestureTransition(
provider: GestureProvider,
scope: () => void,
options?: GestureOptions,
): () => void;

interface ViewTransitionProps {
onGestureEnter?: (
timeline: GestureProvider,
options: GestureOptionsRequired,
instance: ViewTransitionInstance,
types: Array<string>,
) => void | (() => void);
onGestureExit?: (
timeline: GestureProvider,
options: GestureOptionsRequired,
instance: ViewTransitionInstance,
types: Array<string>,
) => void | (() => void);
onGestureShare?: (
timeline: GestureProvider,
options: GestureOptionsRequired,
instance: ViewTransitionInstance,
types: Array<string>,
) => void | (() => void);
onGestureUpdate?: (
timeline: GestureProvider,
options: GestureOptionsRequired,
instance: ViewTransitionInstance,
types: Array<string>,
) => void | (() => void);
}

// @enableSrcObject
interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_IMG_SRC_TYPES {
srcObject: Blob;
Expand Down
23 changes: 23 additions & 0 deletions types/react/ts5.0/test/canary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {};
}}
/>;

<ViewTransition
// @ts-expect-error -- onEnter can return void or a cleanup function.
onEnter={() => {
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;
}}
/>;

Expand Down
Loading