Improved tooltip typing
This commit is contained in:
parent
c0ee60ee4b
commit
7654810e50
1 changed files with 4 additions and 2 deletions
|
@ -15,7 +15,7 @@ import {
|
||||||
ProcessedComputable
|
ProcessedComputable
|
||||||
} from "util/computed";
|
} from "util/computed";
|
||||||
import { VueFeature } from "util/vue";
|
import { VueFeature } from "util/vue";
|
||||||
import { readonly, ref, Ref } from "vue";
|
import { Ref } from "vue";
|
||||||
import { persistent } from "game/persistence";
|
import { persistent } from "game/persistence";
|
||||||
|
|
||||||
declare module "@vue/runtime-dom" {
|
declare module "@vue/runtime-dom" {
|
||||||
|
@ -49,7 +49,8 @@ export interface BaseTooltip {
|
||||||
export type Tooltip<T extends TooltipOptions> = Replace<
|
export type Tooltip<T extends TooltipOptions> = Replace<
|
||||||
T & BaseTooltip,
|
T & BaseTooltip,
|
||||||
{
|
{
|
||||||
pinnable: T["pinnable"] extends unknown ? true : T["pinnable"];
|
pinnable: T["pinnable"] extends undefined ? false : T["pinnable"];
|
||||||
|
pinned: T["pinnable"] extends true ? Ref<boolean> : undefined;
|
||||||
display: GetComputableType<T["display"]>;
|
display: GetComputableType<T["display"]>;
|
||||||
classes: GetComputableType<T["classes"]>;
|
classes: GetComputableType<T["classes"]>;
|
||||||
style: GetComputableType<T["style"]>;
|
style: GetComputableType<T["style"]>;
|
||||||
|
@ -63,6 +64,7 @@ export type GenericTooltip = Replace<
|
||||||
Tooltip<TooltipOptions>,
|
Tooltip<TooltipOptions>,
|
||||||
{
|
{
|
||||||
pinnable: boolean;
|
pinnable: boolean;
|
||||||
|
pinned: Ref<boolean> | undefined;
|
||||||
direction: ProcessedComputable<TooltipDirection>;
|
direction: ProcessedComputable<TooltipDirection>;
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
|
|
Loading…
Reference in a new issue