feat: track images with git lfs

This commit is contained in:
2024-04-04 19:17:27 +02:00
parent 5f2b2f59be
commit 9776b5a84a
193 changed files with 3295 additions and 4620 deletions

View File

@@ -1,3 +1,67 @@
interface Node {
import type { NodeInput } from "./inputs";
export type { NodeInput } from "./inputs";
export type Node = {
id: number;
type: string;
props?: Record<string, any>,
tmp?: {
depth?: number;
mesh?: any;
parents?: Node[],
children?: Node[],
inputNodes?: Record<string, Node>
type?: NodeType;
downX?: number;
downY?: number;
x?: number;
y?: number;
ref?: HTMLElement;
visible?: boolean;
isMoving?: boolean;
},
meta?: {
title?: string;
lastModified?: string;
},
position: [x: number, y: number]
}
export type NodeType = {
id: string;
inputs?: Record<string, NodeInput>
outputs?: string[];
meta?: {
title?: string;
},
execute?: (inputs: Record<string, string | number | boolean>) => unknown;
}
export type Socket = {
node: Node;
index: number | string;
position: [number, number];
};
export interface NodeRegistry {
getNode: (id: string) => NodeType | undefined;
getAllNodes: () => NodeType[];
}
export interface RuntimeExecutor {
execute: (graph: Graph) => void;
}
export type Edge = [Node, number, Node, string];
export type Graph = {
id: number;
meta?: {
title?: string;
lastModified?: string;
},
nodes: Node[];
edges: [number, number, number, string][];
}

36
packages/types/inputs.ts Normal file
View File

@@ -0,0 +1,36 @@
type NodeInputFloat = {
type: "float";
value?: number;
min?: number;
max?: number;
step?: number;
}
type NodeInputInteger = {
type: "integer";
value?: number;
min?: number;
max?: number;
}
type NodeInputBoolean = {
type: "boolean";
value?: boolean;
}
type NodeInputSelect = {
type: "select";
labels: string[];
value?: number;
}
type DefaultOptions = {
internal?: boolean;
}
export type NodeInput = (NodeInputBoolean | NodeInputFloat | NodeInputInteger | NodeInputSelect) & DefaultOptions;
export type NodeInputType<T extends Record<string, NodeInput>> = {
[K in keyof T]: T[K]["value"]
};

View File

@@ -1,8 +1,8 @@
{
"name": "types",
"name": "@nodes/types",
"version": "1.0.0",
"description": "",
"main": "index.js",
"main": "index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},