@react-types/shared 3.0.0-nightly.2816 → 3.0.0-nightly.2822

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/dom.d.ts +13 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/shared",
3
- "version": "3.0.0-nightly.2816+3ebcc660d",
3
+ "version": "3.0.0-nightly.2822+0b2a838b3",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "types": "src/index.d.ts",
@@ -14,5 +14,5 @@
14
14
  "publishConfig": {
15
15
  "access": "public"
16
16
  },
17
- "gitHead": "3ebcc660dd5abfae62ec9002a938916828ce05aa"
17
+ "gitHead": "0b2a838b36ad6d86eee13abaf68b7e4d2b4ada6c"
18
18
  }
package/src/dom.d.ts CHANGED
@@ -169,10 +169,19 @@ export interface TextInputDOMProps extends DOMProps, InputDOMProps, TextInputDOM
169
169
  inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'
170
170
  }
171
171
 
172
+ /**
173
+ * This type allows configuring link props with router options and type-safe URLs via TS module augmentation.
174
+ * By default, this is an empty type. Extend with `href` and `routerOptions` properties to configure your router.
175
+ */
176
+ export interface RouterConfig {}
177
+
178
+ export type Href = RouterConfig extends {href: infer H} ? H : string;
179
+ export type RouterOptions = RouterConfig extends {routerOptions: infer O} ? O : never;
180
+
172
181
  // Make sure to update filterDOMProps.ts when updating this.
173
182
  export interface LinkDOMProps {
174
183
  /** A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href). */
175
- href?: string,
184
+ href?: Href,
176
185
  /** Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang). */
177
186
  hrefLang?: string,
178
187
  /** The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target). */
@@ -184,7 +193,9 @@ export interface LinkDOMProps {
184
193
  /** A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping). */
185
194
  ping?: string,
186
195
  /** 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). */
187
- referrerPolicy?: HTMLAttributeReferrerPolicy
196
+ referrerPolicy?: HTMLAttributeReferrerPolicy,
197
+ /** Options for the configured client side router. */
198
+ routerOptions?: RouterOptions
188
199
  }
189
200
 
190
201
  /** Any focusable element, including both HTML and SVG elements. */