Let’s say i have a type Screen
, defined as such:
export type Screen = {
gui: ScreenGui,
closeButton: GuiButton,
onVisibilityChanged: BindableEvent,
}
What if I wanted to make a type Unregistered
that extended Screen
, changing the type of onVisibilityChanged
to a function: (v:boolean) -> nil
and keeping the rest intact?
I tried to do:
export type Unregistered = Screen & {
onVisibilityChanged: (v:boolean) -> nil
}
But the autocomplete still thought that onVisibilityChanged
was a BindableEvent
How would I achieve this overwriting/extending effect with custom types?