Skip to content

Commit

Permalink
🚨 修改ts类型
Browse files Browse the repository at this point in the history
  • Loading branch information
zty012 committed Dec 7, 2024
1 parent ec59260 commit fc0bf4e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/types/node.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { StageDumper } from "../core/stage/StageDumper";

export namespace Serialized {
export type Vector = [number, number];
export type Color = [number, number, number, number];

export type StageObject = {
uuid: string;
type: string;
}
};

export type Entity = StageObject & {
location: Vector;
}
};

export type Node = Entity & {
type: "core:text_node";
Expand All @@ -26,19 +28,19 @@ export namespace Serialized {
text: string;
color: Color;

children: string[]; // uuid[]
children: string[]; // uuid[]
isHidden: boolean;
isCollapsed: boolean;
};

export type ConnectPoint = Entity & {
type: "core:connect_point";
}
};
export type ImageNode = Entity & {
path: string;
size: Vector;
type: "core:image_node";
}
};
export type Edge = StageObject & {
type: "core:edge";
source: string;
Expand All @@ -47,7 +49,7 @@ export namespace Serialized {
};

export type File = {
version: 10; // 最新版本 src\core\stage\StageDumper.tsx latestVersion
version: typeof StageDumper.latestVersion;
nodes: (Node | Section | ConnectPoint | ImageNode)[];
edges: Edge[];
tags: string[];
Expand Down

0 comments on commit fc0bf4e

Please sign in to comment.