diagrams-js
Version:
A TypeScript port of the diagrams Python library for drawing cloud system architecture diagrams as code
64 lines (63 loc) • 2.75 kB
TypeScript
/**
* C4 Model support for diagrams-js
*
* A set of nodes and edges to visualize software architecture using the C4 model.
* Based on https://c4model.com/
*/
import { Node } from "../../Node.js";
import { Edge } from "../../Edge.js";
import { Cluster } from "../../Cluster.js";
/**
* Represents a person (user, actor, role, persona)
*
* @param name - The name of the person
* @param description - Optional description
* @param external - Whether this is an external person (uses gray instead of blue)
* @param options - Additional Graphviz node attributes
*/
export declare function Person(name: string, description?: string, external?: boolean, options?: Record<string, unknown>): ReturnType<typeof Node>;
/**
* Represents a container (applications, web apps, etc.)
*
* @param name - The name of the container
* @param technology - Optional technology (e.g., "Java", "Node.js", "PostgreSQL")
* @param description - Optional description
* @param options - Additional Graphviz node attributes
*/
export declare function Container(name: string, technology?: string, description?: string, options?: Record<string, unknown>): ReturnType<typeof Node>;
/**
* Represents a database (data storage)
*
* @param name - The name of the database
* @param technology - Optional technology (e.g., "PostgreSQL", "MongoDB")
* @param description - Optional description
* @param options - Additional Graphviz node attributes
*/
export declare function Database(name: string, technology?: string, description?: string, options?: Record<string, unknown>): ReturnType<typeof Node>;
/**
* Represents a software system
*
* @param name - The name of the system
* @param description - Optional description
* @param external - Whether this is an external system (uses gray instead of blue)
* @param options - Additional Graphviz node attributes
*/
export declare function System(name: string, description?: string, external?: boolean, options?: Record<string, unknown>): ReturnType<typeof Node>;
/**
* Creates a C4 relationship (edge)
*
* @param label - Optional relationship label/description
* @param options - Additional Graphviz edge attributes
*/
export declare function Relationship(label?: string, options?: Record<string, unknown>): ReturnType<typeof Edge>;
/**
* Creates a system boundary (cluster)
*
* @param label - The name/label of the boundary
* @param diagram - The diagram this boundary belongs to
* @param options - Additional Graphviz graph attributes
*/
export declare function SystemBoundary(label: string, diagram: {
cluster: (label: string) => ReturnType<typeof Cluster>;
["~subgraph"]: (cluster: ReturnType<typeof Cluster>) => void;
}, options?: Record<string, unknown>): ReturnType<typeof Cluster>;