Skip to content

Commit

Permalink
EventHandlerAsync type extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
Stassi committed Nov 18, 2024
1 parent 19701c6 commit 90b550d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/leaf/map/fullscreen/control/anchor/anchor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ export type ControlAnchorOptions = {
export type ControlAnchorAssign = (
props: ControlAnchorAttributes,
) => HTMLElement

type EventHandlerAsync = EventHandler<true>
export type ControlAnchor = {
assign: ControlAnchorAssign
onClick: (handler: EventHandler<true>) => void
onClick: (handler: EventHandlerAsync) => void
}

export function controlAnchor({
Expand All @@ -26,7 +28,7 @@ export function controlAnchor({

return {
assign,
onClick(handler: EventHandler<true>): void {
onClick(handler: EventHandlerAsync): void {
domEventOn({ element, event: 'click', handler })
},
}
Expand Down

0 comments on commit 90b550d

Please sign in to comment.