From 6ed9f3da53af804011df27ec515bc6c67664008c Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sat, 23 Apr 2022 14:32:43 -0500 Subject: [PATCH] Improved tooltip typing --- src/features/tooltips/tooltip.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/features/tooltips/tooltip.ts b/src/features/tooltips/tooltip.ts index cd16bd3..ad8cf65 100644 --- a/src/features/tooltips/tooltip.ts +++ b/src/features/tooltips/tooltip.ts @@ -15,7 +15,7 @@ import { ProcessedComputable } from "util/computed"; import { VueFeature } from "util/vue"; -import { readonly, ref, Ref } from "vue"; +import { Ref } from "vue"; import { persistent } from "game/persistence"; declare module "@vue/runtime-dom" { @@ -49,7 +49,8 @@ export interface BaseTooltip { export type Tooltip = Replace< T & BaseTooltip, { - pinnable: T["pinnable"] extends unknown ? true : T["pinnable"]; + pinnable: T["pinnable"] extends undefined ? false : T["pinnable"]; + pinned: T["pinnable"] extends true ? Ref : undefined; display: GetComputableType; classes: GetComputableType; style: GetComputableType; @@ -63,6 +64,7 @@ export type GenericTooltip = Replace< Tooltip, { pinnable: boolean; + pinned: Ref | undefined; direction: ProcessedComputable; } >;