src/types.ts

visual-json · packages/@visual-json/core/src/types.ts · typescript · Apache-2.0
ui, tag:embed-classified

types.ts from vercel-labs/visual-json

// Source: https://github.com/vercel-labs/visual-json | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
export type JsonPrimitive = string | number | boolean | null;
export type JsonArray = JsonValue[];
export type JsonObject = { [key: string]: JsonValue };
export type JsonValue = JsonPrimitive | JsonArray | JsonObject;

export type NodeType =
  | "string"
  | "number"
  | "boolean"
  | "null"
  | "object"
  | "array";

export interface TreeNode {
  id: string;
  key: string;
  path: string;
  type: NodeType;
  value: JsonPrimitive | undefined;
  children: TreeNode[];
  parentId: string | null;
}

export interface TreeState {
  root: TreeNode;
  nodesById: Map<string, TreeNode>;
}



... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key