[TS] TS type fix & nits (#801)

Fixes downstream type specificity issues with UUID template type. No
real benefit from template literal type at present.
This commit is contained in:
filtered
2025-03-18 00:52:59 +11:00
committed by GitHub
parent 0b4b420445
commit 7845be9b15
2 changed files with 7 additions and 1 deletions

View File

@@ -3,7 +3,12 @@ import type { Point, ReadOnlyRect, Rect, Rect32 } from "./interfaces"
import { EaseFunction } from "./litegraph"
export interface DragAndScaleState {
/**
* The offset from the top-left of the current canvas viewport to `[0, 0]` in graph space.
* Or said another way, the inverse offset of the viewport.
*/
offset: Point
/** The scale of the graph. */
scale: number
}

View File

@@ -1,4 +1,5 @@
export type UUID = `${string}-${string}-${string}-${string}-${string}`
// Using a template string for this is resulting in complex type workarounds. No current benefit beyond dev reading.
export type UUID = string
/** Special-case zero-UUID, consisting entirely of zeros. Used as a default value. */
export const zeroUuid = "00000000-0000-0000-0000-000000000000"