diff --git a/src/leaf/map/fullscreen/control/set-control-anchor-title.ts b/src/leaf/map/fullscreen/control/set-control-anchor-title.ts index 0c80c86..adf0855 100644 --- a/src/leaf/map/fullscreen/control/set-control-anchor-title.ts +++ b/src/leaf/map/fullscreen/control/set-control-anchor-title.ts @@ -1,23 +1,27 @@ -import { type UseAnchor } from '../state/use-anchor' +import { type AnchorAssign } from '../state/use-anchor' +import { type UseBooleanGet } from '../state/use-boolean' + +export type ControlAnchorTitleStates = Record<'false' | 'true', string> +export type AnchorAssignTitleOptions = { + assign: AnchorAssign + titleStates: ControlAnchorTitleStates +} export type SetControlAnchorTitleOptions = { - anchor: { - assign: UseAnchor['assign'] - titleStates: Record<'false' | 'true', string> - } - fullscreen: boolean + anchor: AnchorAssignTitleOptions + fullscreen: { state: { get: UseBooleanGet } } } export function setControlAnchorTitle({ anchor: { assign: anchorAssign, titleStates: anchorTitleStates }, - fullscreen, + fullscreen: { + state: { get: getFullscreenState }, + }, }: SetControlAnchorTitleOptions): HTMLElement { return anchorAssign({ title: anchorTitleStates[ - ( - fullscreen.toString() - ) + getFullscreenState().toString() ], }) }