Fix all remaining Vue/TS errors flagged in Volar

This commit is contained in:
Keavon Chambers
2022-01-15 17:24:58 -08:00
parent 56599db753
commit e877eea457
14 changed files with 49 additions and 32 deletions
+12 -4
View File
@@ -1,3 +1,5 @@
import { IconName, IconSize } from "@/utilities/icons";
export type Widgets = TextButtonWidget | IconButtonWidget | SeparatorWidget | PopoverButtonWidget | NumberInputWidget;
export type WidgetRow = Widgets[];
export type WidgetLayout = WidgetRow[];
@@ -31,8 +33,8 @@ export interface IconButtonWidget {
export interface IconButtonProps {
// `action` is used via `IconButtonWidget.callback`
icon: string;
size: number;
icon: IconName;
size: IconSize;
gapAfter?: boolean;
}
@@ -48,9 +50,12 @@ export interface PopoverButtonWidget {
export interface PopoverButtonProps {
// `action` is used via `PopoverButtonWidget.callback`
icon?: string;
icon?: PopoverButtonIcon;
}
type Extends<T, U extends T> = U;
export type PopoverButtonIcon = Extends<IconName, "DropdownArrow" | "VerticalEllipsis">;
// Number Input
export interface NumberInputWidget {
kind: "NumberInput";
@@ -63,7 +68,7 @@ export interface NumberInputProps {
value: number;
min?: number;
max?: number;
incrementBehavior?: boolean;
incrementBehavior?: IncrementBehavior;
incrementFactor?: number;
isInteger?: boolean;
unit?: string;
@@ -73,6 +78,9 @@ export interface NumberInputProps {
disabled?: boolean;
}
export type IncrementBehavior = "Add" | "Multiply" | "Callback" | "None";
export type IncrementDirection = "Decrease" | "Increase";
// Separator
export type SeparatorDirection = "Horizontal" | "Vertical";
export type SeparatorType = "Related" | "Unrelated" | "Section" | "List";