From f69de3148ee0f1e6319e7e0674ceb4d2d93d2ee2 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Sat, 24 Aug 2024 12:20:26 +1000 Subject: [PATCH] feat(ui): autocomplete on getPrefixeId --- .../frontend/web/src/features/controlLayers/konva/util.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/web/src/features/controlLayers/konva/util.ts b/invokeai/frontend/web/src/features/controlLayers/konva/util.ts index adc8504bf1..003448929c 100644 --- a/invokeai/frontend/web/src/features/controlLayers/konva/util.ts +++ b/invokeai/frontend/web/src/features/controlLayers/konva/util.ts @@ -1,4 +1,4 @@ -import type { Coordinate, Rect } from 'features/controlLayers/store/types'; +import type { CanvasEntityIdentifier, Coordinate, Rect } from 'features/controlLayers/store/types'; import type Konva from 'konva'; import type { KonvaEventObject } from 'konva/lib/Node'; import type { Vector2d } from 'konva/lib/types'; @@ -335,7 +335,7 @@ export function loadImage(src: string): Promise { */ export const nanoid = customAlphabet('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', 10); -export function getPrefixedId(prefix: string): string { +export function getPrefixedId(prefix: CanvasEntityIdentifier['type'] | (string & Record)): string { return `${prefix}:${nanoid()}`; }