UNPKG

@oselvar/c4

Version:

Test helpers for Cloudflare Workers

67 lines (64 loc) 2.18 kB
import { C as C4Model, a as C4Name, b as C4ObjectType, c as C4Object, d as C4Call } from './C4Model-C1kukjQy.js'; type C4ObjectParams = { tags?: readonly string[]; }; type C4SoftwareSystemParams = C4ObjectParams & { parentName?: string; }; type C4GroupParams = C4ObjectParams & { parentName?: string; }; type C4PersonParams = C4ObjectParams & { parentName?: string; }; type C4ContainerParams = C4ObjectParams & { softwareSystem: string; }; type C4ComponentParams = C4ObjectParams & { container: string; }; declare class C4ModelBuilder { private readonly ready; private readonly objectByName; private readonly callchains; private callchain; private endSpan; constructor(c4Model: C4Model | undefined, ready: Promise<void>); /** * Add a person to the model. */ addPerson(name: C4Name, params?: C4PersonParams): string; /** * Add a group to the model. */ addGroup(name: C4Name, params?: C4GroupParams): string; /** * Add a software system to the model. */ addSoftwareSystem(name: C4Name, params?: C4SoftwareSystemParams): string; /** * Add a container to the model. */ addContainer(name: C4Name, params: C4ContainerParams): string; addComponent(name: C4Name, params: C4ComponentParams): string; startCallchain(name: string): void; /** * Add a dependency between two objects. */ addCall(callerName: C4Name, calleeName: C4Name, operationName: string): void; hasObject(name: C4Name): boolean; /** * Get an object by id. */ getObject(name: C4Name, type?: C4ObjectType): C4Object; calls(c4Object: C4Object): readonly C4Call[]; children(c4Object: C4Object): readonly C4Object[]; nestedChildren(c4Object: C4Object): readonly C4Object[]; isChildOf(c4Object: C4Object, parentId: string): boolean; rootObjects(): readonly C4Object[]; /** * Build the final C4 model */ build(): C4Model; } export { C4ModelBuilder as C, type C4SoftwareSystemParams as a, type C4ContainerParams as b, type C4ComponentParams as c, type C4ObjectParams as d, type C4GroupParams as e, type C4PersonParams as f };