@reach/utils
Advanced tools
Comparing version 0.8.6 to 0.9.0
import React from "react"; | ||
import { As, AssignableRef, ComponentWithAs, ComponentWithForwardedRef, DistributiveOmit, PropsFromAs, PropsWithAs, SingleOrArray } from "./types"; | ||
import { As, AssignableRef, ComponentWithAs, ComponentWithForwardedRef, DistributiveOmit, PropsFromAs, PropsWithAs, SingleOrArray, ThenArg } from "./types"; | ||
/** | ||
@@ -212,2 +212,2 @@ * React currently throws a warning when using useLayoutEffect on the server. | ||
export declare function wrapEvent<EventType extends React.SyntheticEvent | Event>(theirHandler: ((event: EventType) => any) | undefined, ourHandler: (event: EventType) => any): (event: EventType) => any; | ||
export { As, AssignableRef, ComponentWithAs, ComponentWithForwardedRef, DistributiveOmit, PropsFromAs, PropsWithAs, SingleOrArray, }; | ||
export { As, AssignableRef, ComponentWithAs, ComponentWithForwardedRef, DistributiveOmit, PropsFromAs, PropsWithAs, SingleOrArray, ThenArg, }; |
@@ -0,8 +1,7 @@ | ||
'use strict'; | ||
'use strict' | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./utils.cjs.production.min.js') | ||
module.exports = require('./utils.cjs.production.min.js'); | ||
} else { | ||
module.exports = require('./utils.cjs.development.js') | ||
} | ||
module.exports = require('./utils.cjs.development.js'); | ||
} |
@@ -50,2 +50,16 @@ import * as React from "react"; | ||
export declare type ComponentWithForwardedRef<ElementType extends React.ElementType, ComponentProps> = React.ForwardRefExoticComponent<ComponentProps & React.HTMLProps<React.ElementType<ElementType>> & React.ComponentPropsWithRef<ElementType>>; | ||
/** | ||
* Returns the type inferred by a promise's return value. | ||
* | ||
* @example | ||
* async function getThing() { | ||
* // return type is a number | ||
* let result: number = await fetchValueSomewhere(); | ||
* return result; | ||
* } | ||
* | ||
* type Thing = ThenArg<ReturnType<typeof getThing>>; | ||
* // number | ||
*/ | ||
export declare type ThenArg<T> = T extends PromiseLike<infer U> ? U : T; | ||
export interface ComponentWithAs<ComponentType extends As, ComponentProps> { | ||
@@ -52,0 +66,0 @@ <TT extends As>(props: PropsWithAs<TT, ComponentProps>): ReactElement | null; |
{ | ||
"name": "@reach/utils", | ||
"version": "0.8.6", | ||
"version": "0.9.0", | ||
"description": "Internal, shared utilities for Reach UI.", | ||
@@ -13,5 +13,3 @@ "author": "React Training <hello@reacttraining.com>", | ||
"scripts": { | ||
"build": "yarn clean && yarn compile", | ||
"clean": "rm -rf ./dist", | ||
"compile": "cross-env NODE_ENV=production tsdx build --format=cjs,esm --tsconfig tsconfig.build.json" | ||
"build": "ts-node ../../scripts/build" | ||
}, | ||
@@ -33,3 +31,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "0c71a018a11055b17815f0fb127cdcd981cd760e" | ||
"gitHead": "0c789bb48554bf13c62dd09210ebdf2f9af33d30" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
110845
1143