mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-24 08:48:12 +08:00
Fix all remaining Vue/TS errors flagged in Volar
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user