Skip to content

Commit ae453f3

Browse files
committed
fix all the types for the upgrade
1 parent 9d6cbc4 commit ae453f3

35 files changed

+112
-66
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/buffer.d.ts b/buffer.d.ts
2+
index 5d6c97d6b5d47fd189f795498aefd6b8d7713b7d..b9a22c4634fa6308006ae17d3527ff3c518a789d 100644
3+
--- a/buffer.d.ts
4+
+++ b/buffer.d.ts
5+
@@ -629,7 +629,7 @@ declare module "buffer" {
6+
*/
7+
poolSize: number;
8+
}
9+
- interface Buffer extends Uint8Array {
10+
+ interface Buffer extends Uint8Array<ArrayBuffer> {
11+
/**
12+
* Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did
13+
* not contain enough space to fit the entire string, only part of `string` will be

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,10 @@
235235
"recast": "0.23.6",
236236
"ast-types": "0.16.1",
237237
"svgo": "^3",
238-
"@testing-library/user-event": "patch:@testing-library/user-event@npm%3A14.6.1#~/.yarn/patches/@testing-library-user-event-npm-14.6.1-5da7e1d4e2.patch"
238+
"@testing-library/user-event": "patch:@testing-library/user-event@npm%3A14.6.1#~/.yarn/patches/@testing-library-user-event-npm-14.6.1-5da7e1d4e2.patch",
239+
"@types/node@npm:*": "patch:@types/node@npm%3A20.14.13#~/.yarn/patches/@types-node-npm-20.14.13-41f92d384c.patch",
240+
"@types/node@npm:^18.0.0": "patch:@types/node@npm%3A20.14.13#~/.yarn/patches/@types-node-npm-20.14.13-41f92d384c.patch",
241+
"@types/node@npm:>= 8": "patch:@types/node@npm%3A20.14.13#~/.yarn/patches/@types-node-npm-20.14.13-41f92d384c.patch"
239242
},
240243
"@parcel/transformer-css": {
241244
"cssModules": {

packages/@react-spectrum/calendar/stories/Calendar.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ const calendars = [
203203

204204
function Example(props) {
205205
let [locale, setLocale] = React.useState('');
206-
let [calendar, setCalendar] = React.useState<Key>(calendars[0].key);
206+
let [calendar, setCalendar] = React.useState<Key | null>(calendars[0].key);
207207
let {locale: defaultLocale} = useLocale();
208208

209209
let pref = preferences.find(p => p.locale === locale)!;

packages/@react-spectrum/datepicker/stories/DateField.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export const IsDateUnavailable: DateFieldStory = {
212212
...Default,
213213
args: {
214214
isDateUnavailable: (date) => {
215-
return date.compare(new CalendarDate(1980, 1, 1)) >= 0
215+
return date.compare(new CalendarDate(1980, 1, 1)) >= 0
216216
&& date.compare(new CalendarDate(1980, 1, 8)) <= 0;
217217
},
218218
errorMessage: 'Date unavailable.',
@@ -310,7 +310,7 @@ const calendars = [
310310

311311
function Example(props) {
312312
let [locale, setLocale] = React.useState('');
313-
let [calendar, setCalendar] = React.useState<Key>(calendars[0].key);
313+
let [calendar, setCalendar] = React.useState<Key | null>(calendars[0].key);
314314
let {locale: defaultLocale} = useLocale();
315315

316316
let pref = preferences.find(p => p.locale === locale);

packages/@react-spectrum/datepicker/stories/DatePicker.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ const calendars = [
332332

333333
function Example(props) {
334334
let [locale, setLocale] = React.useState('');
335-
let [calendar, setCalendar] = React.useState<Key>(calendars[0].key);
335+
let [calendar, setCalendar] = React.useState<Key | null>(calendars[0].key);
336336
let {locale: defaultLocale} = useLocale();
337337

338338
let pref = preferences.find(p => p.locale === locale);

packages/@react-spectrum/datepicker/stories/DateRangePicker.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ const calendars = [
235235

236236
function Example(props) {
237237
let [locale, setLocale] = React.useState('');
238-
let [calendar, setCalendar] = React.useState<Key>(calendars[0].key);
238+
let [calendar, setCalendar] = React.useState<Key | null>(calendars[0].key);
239239
let {locale: defaultLocale} = useLocale();
240240

241241
let pref = preferences.find(p => p.locale === locale);

packages/@react-spectrum/form/stories/Form.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ function FormWithControls(props: any = {}) {
482482
let [firstName, setFirstName] = useState('hello');
483483
let [isHunter, setIsHunter] = useState(true);
484484
let [favoritePet, setFavoritePet] = useState('cats');
485-
let [favoriteColor, setFavoriteColor] = useState('green' as Key);
485+
let [favoriteColor, setFavoriteColor] = useState<Key | null>('green');
486486
let [howIFeel, setHowIFeel] = useState('I feel good, o I feel so good!');
487487
let [birthday, setBirthday] = useState<CalendarDate | null>(new CalendarDate(1732, 2, 22));
488488
let [money, setMoney] = useState(50);

packages/@react-spectrum/s2/src/Breadcrumbs.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
DefaultCollectionRenderer,
2121
HeadingContext,
2222
Link,
23+
LinkRenderProps,
2324
Provider,
2425
Breadcrumbs as RACBreadcrumbs
2526
} from 'react-aria-components';
@@ -97,7 +98,7 @@ const wrapper = style<BreadcrumbsStyleProps>({
9798

9899
const InternalBreadcrumbsContext = createContext<Partial<BreadcrumbsProps<any>>>({});
99100

100-
/** Breadcrumbs show hierarchy and navigational context for a users location within an application. */
101+
/** Breadcrumbs show hierarchy and navigational context for a user's location within an application. */
101102
export const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: DOMRef<HTMLOListElement>) {
102103
[props, ref] = useSpectrumContextProps(props, ref, BreadcrumbsContext);
103104
let domRef = useDOMRef(ref);
@@ -200,7 +201,7 @@ let HiddenBreadcrumbs = function (props: {listRef: RefObject<HTMLDivElement | nu
200201
);
201202
};
202203

203-
const breadcrumbStyles = style({
204+
const breadcrumbStyles = style<BreadcrumbsStyleProps & {isMenu?: boolean, isCurrent?: boolean}>({
204205
display: 'flex',
205206
alignItems: 'center',
206207
justifyContent: 'start',
@@ -245,7 +246,7 @@ const chevronStyles = style({
245246
}
246247
});
247248

248-
const linkStyles = style({
249+
const linkStyles = style<LinkRenderProps & {size?: 'M' | 'L', isCurrent?: boolean}>({
249250
...focusRing(),
250251
borderRadius: 'sm',
251252
font: 'control',
@@ -255,7 +256,8 @@ const linkStyles = style({
255256
isCurrent: 'neutral',
256257
forcedColors: {
257258
default: 'LinkText',
258-
isDisabled: 'GrayText'
259+
isDisabled: 'GrayText',
260+
isCurrent: 'GrayText'
259261
}
260262
},
261263
transition: 'default',
@@ -337,7 +339,7 @@ export const Breadcrumb = /*#__PURE__*/ (forwardRef as forwardRefType)(function
337339
ping={ping}
338340
referrerPolicy={referrerPolicy}
339341
isDisabled={isDisabled || isCurrent}
340-
className={({isFocused, isFocusVisible, isHovered, isDisabled, isPressed}) => linkStyles({isFocused, isFocusVisible, isHovered, isDisabled, size, isPressed})}>
342+
className={({isFocused, isFocusVisible, isHovered, isDisabled, isPressed}) => linkStyles({isFocused, isFocusVisible, isHovered, isDisabled, size, isPressed, isCurrent})}>
341343
{children}
342344
</Link>
343345
<ChevronIcon

packages/@react-spectrum/s2/src/CloseButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const hoverBackground = {
3939
isStaticColor: 'transparent-overlay-200'
4040
} as const;
4141

42-
const styles = style({
42+
const styles = style<CloseButtonProps & {isHovered: boolean, isFocusVisible: boolean, isPressed: boolean, isStaticColor: boolean}>({
4343
...focusRing(),
4444
...staticColor(),
4545
display: 'flex',

packages/@react-spectrum/s2/src/ComboBox.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
ListBoxSection as AriaListBoxSection,
1717
PopoverProps as AriaPopoverProps,
1818
Button,
19+
ButtonRenderProps,
1920
ContextValue,
2021
InputContext,
2122
ListBox,
@@ -95,7 +96,7 @@ export interface ComboBoxProps<T extends object> extends
9596

9697
export const ComboBoxContext = createContext<ContextValue<Partial<ComboBoxProps<any>>, TextFieldRef>>(null);
9798

98-
const inputButton = style({
99+
const inputButton = style<ButtonRenderProps & {isOpen: boolean, size: 'S' | 'M' | 'L' | 'XL'}>({
99100
display: 'flex',
100101
outlineStyle: 'none',
101102
textAlign: 'center',

0 commit comments

Comments
 (0)