chore: move some more components to svelte 5
Some checks failed
Deploy to GitHub Pages / build_site (push) Has been cancelled

This commit is contained in:
Max Richter
2025-11-23 19:35:33 +01:00
parent 716df245ab
commit 6ca1ff2a34
25 changed files with 470 additions and 550 deletions

View File

@@ -1,4 +1,4 @@
import { Graph, NodeDefinition, NodeId } from "./types";
import { Graph, NodeDefinition, NodeType } from "./types";
export interface NodeRegistry {
/**
@@ -13,13 +13,13 @@ export interface NodeRegistry {
* @throws An error if the nodes could not be loaded
* @remarks This method should be called before calling getNode or getAllNodes
*/
load: (nodeIds: NodeId[]) => Promise<NodeDefinition[]>;
load: (nodeIds: NodeType[]) => Promise<NodeDefinition[]>;
/**
* Get a node by id
* @param id - The id of the node to get
* @returns The node with the given id, or undefined if no such node exists
*/
getNode: (id: NodeId | string) => NodeDefinition | undefined;
getNode: (id: NodeType | string) => NodeDefinition | undefined;
/**
* Get all nodes
* @returns An array of all nodes

View File

@@ -9,9 +9,9 @@ export type {
Node,
NodeDefinition,
Socket,
NodeType as NodeId,
NodeType,
Edge,
Graph,
} from "./types";
export { NodeSchema, GraphSchema, NodeType } from "./types";
export { NodeSchema, GraphSchema } from "./types";
export { NodeDefinitionSchema } from "./types";

View File

@@ -44,7 +44,7 @@ export type Node = {
} & z.infer<typeof NodeSchema>;
export const NodeDefinitionSchema = z.object({
id: z.string(),
id: NodeTypeSchema,
inputs: z.record(z.string(), NodeInputSchema).optional(),
outputs: z.array(z.string()).optional(),
meta: z

View File

@@ -3,7 +3,7 @@
ctrl?: boolean;
shift?: boolean;
alt?: boolean;
key: string;
key: string | string[];
}
let {