@react-types/shared
Advanced tools
Comparing version 3.22.1 to 3.23.0
{ | ||
"name": "@react-types/shared", | ||
"version": "3.22.1", | ||
"version": "3.23.0", | ||
"description": "Spectrum UI components in React", | ||
@@ -17,3 +17,3 @@ "license": "Apache-2.0", | ||
}, | ||
"gitHead": "de9f84a22583fc741c29b341d14cd35ef4cca161" | ||
"gitHead": "f645f29edc1322153fd60af4640cbcab1d992dbd" | ||
} |
@@ -172,6 +172,17 @@ /* | ||
/** | ||
* This type allows configuring link props with router options and type-safe URLs via TS module augmentation. | ||
* By default, this is an empty type. Extend with `href` and `routerOptions` properties to configure your router. | ||
*/ | ||
export interface RouterConfig {} | ||
export type Href = RouterConfig extends {href: infer H} ? H : string; | ||
export type RouterOptions = RouterConfig extends {routerOptions: infer O} ? O : never; | ||
// Make sure to update filterDOMProps.ts when updating this. | ||
export interface LinkDOMProps { | ||
/** A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href). */ | ||
href?: string, | ||
href?: Href, | ||
/** Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang). */ | ||
hrefLang?: string, | ||
/** The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target). */ | ||
@@ -186,3 +197,5 @@ target?: HTMLAttributeAnchorTarget, | ||
/** How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy). */ | ||
referrerPolicy?: HTMLAttributeReferrerPolicy | ||
referrerPolicy?: HTMLAttributeReferrerPolicy, | ||
/** Options for the configured client side router. */ | ||
routerOptions?: RouterOptions | ||
} | ||
@@ -189,0 +202,0 @@ |
@@ -21,3 +21,3 @@ /* | ||
export interface Validation<T> { | ||
export interface Validation<T = unknown> { | ||
/** Whether user input is required on the input before form submission. */ | ||
@@ -24,0 +24,0 @@ isRequired?: boolean, |
@@ -23,3 +23,3 @@ /* | ||
/** Handler that is called when the selection changes. */ | ||
onSelectionChange?: (key: Key) => any | ||
onSelectionChange?: (key: Key) => void | ||
} | ||
@@ -40,3 +40,3 @@ | ||
/** Handler that is called when the selection changes. */ | ||
onSelectionChange?: (keys: Selection) => any, | ||
onSelectionChange?: (keys: Selection) => void, | ||
/** The currently disabled keys in the collection (controlled). */ | ||
@@ -43,0 +43,0 @@ disabledKeys?: Iterable<Key> |
85116
1771
18
37
4
206