mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-03 04:00:31 +00:00
[Schema] Update zod schema on zVector2 (#3152)
This commit is contained in:
@@ -130,7 +130,7 @@ type SimpleApiEvents = keyof PickNevers<ApiEventTypes>
|
||||
/** Keys (names) of API events that pass a {@link CustomEvent} `detail` object. */
|
||||
type ComplexApiEvents = keyof NeverNever<ApiEventTypes>
|
||||
|
||||
/** EventTarget typing has no generic capability. This interface enables tsc strict. */
|
||||
/** EventTarget typing has no generic capability. */
|
||||
export interface ComfyApi extends EventTarget {
|
||||
addEventListener<TEvent extends keyof ApiEvents>(
|
||||
type: TEvent,
|
||||
|
||||
@@ -1129,9 +1129,6 @@ export class ComfyApp {
|
||||
useSettingStore().get('Comfy.EnableWorkflowViewRestore') &&
|
||||
graphData.extra?.ds
|
||||
) {
|
||||
// @ts-expect-error
|
||||
// Need to set strict: true for zod to match the type [number, number]
|
||||
// https://github.com/colinhacks/zod/issues/3056
|
||||
this.canvas.ds.offset = graphData.extra.ds.offset
|
||||
this.canvas.ds.scale = graphData.extra.ds.scale
|
||||
}
|
||||
@@ -1616,7 +1613,8 @@ export class ComfyApp {
|
||||
|
||||
app.graph.arrange()
|
||||
|
||||
// @ts-expect-error zod type issue on ComfyWorkflowJSON. Should be resolved after enabling ts-strict globally.
|
||||
// @ts-expect-error zod type issue on ComfyWorkflowJSON. ComfyWorkflowJSON
|
||||
// is stricter than LiteGraph's serialisation schema.
|
||||
useWorkflowService().afterLoadNewGraph(fileName, this.serializeGraph())
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,8 @@ export class ChangeTracker {
|
||||
|
||||
checkState() {
|
||||
if (!this.app.graph || this.changeCount) return
|
||||
// @ts-expect-error zod types issue. Will be fixed after we enable ts-strict
|
||||
// @ts-expect-error zod type issue on ComfyWorkflowJSON. ComfyWorkflowJSON
|
||||
// is stricter than LiteGraph's serialisation schema.
|
||||
const currentState = clone(this.app.graph.serialize()) as ComfyWorkflowJSON
|
||||
if (!this.activeState) {
|
||||
this.activeState = currentState
|
||||
|
||||
Reference in New Issue
Block a user