-
Notifications
You must be signed in to change notification settings - Fork 4.7k
SlotFill: Migrate to Typescript. #51350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
a0bbcbf
353f3bf
46e4983
49b7807
f7f3c07
e7dbaf1
f3d474f
e4f205c
94219ca
83466fc
e333f1b
681a0e8
c7419ed
7703647
7862088
e03bc11
b50ae79
4e0a665
499f8bd
228fd5f
fe872f9
ebfd7f3
bbffb58
1182668
e5a828e
79951ea
4deef29
5e26c79
0f6d79c
46ff121
68f277c
cf48aee
9695182
09b23ce
d515975
d650f5f
3b12a6d
191a45d
82349c0
78ab5e7
821f4d4
0607a32
81bd81d
2e7e367
d5773d4
f169e67
2cc685f
31ba069
656a45d
ff18ed5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,37 +3,30 @@ | |
| */ | ||
| import type { MutableRefObject, ReactNode } from 'react'; | ||
|
|
||
| export type FillProps = { | ||
| /** | ||
| * Slot name. | ||
| */ | ||
| export type BubblesVirtuallySlotProps = { | ||
| name: string; | ||
|
|
||
| /** | ||
| * The children to stack. | ||
| */ | ||
| children: ReactNode; | ||
| fillProps: any; | ||
| }; | ||
|
|
||
| export type SlotRegistry = { | ||
| slots: Map< | ||
| string, | ||
| { | ||
| ref: MutableRefObject< HTMLElement >; | ||
| fillProps: FillProps; | ||
| ref: MutableRefObject< HTMLElement | undefined >; | ||
| fillProps: any; | ||
| } | ||
| >; | ||
| fills: Map< string, MutableRefObject< { rerender: () => {} } >[] >; | ||
| registerSlot: ( | ||
| name: string, | ||
| ref: MutableRefObject< HTMLElement >, | ||
| fillProps: FillProps | ||
| ref: MutableRefObject< HTMLElement | undefined >, | ||
| fillProps: any | ||
| ) => void; | ||
| unregisterSlot: ( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are a lot of similarities between the two different context types. Should we try to generalize them a little bit? One way could be with some generic types under the hood.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That would be neat, although not a blocker IMO. Maybe it can be a timeboxed effort? |
||
| name: string, | ||
| ref: MutableRefObject< HTMLElement > | ||
| ref: MutableRefObject< HTMLElement | undefined > | ||
| ) => void; | ||
| updateSlot: ( name: string, fillProps: FillProps ) => void; | ||
| updateSlot: ( name: string, fillProps: any ) => void; | ||
| registerFill: ( | ||
| name: string, | ||
| ref: MutableRefObject< { rerender: () => {} } > | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.