import { n as __exportAll, r as __name } from "./rolldown-runtime.mjs"; import { $r as EdgeId, Ca as ReorderedArray, Gr as Any, Pi as Fqn, ha as IteratorLike, ma as IterableContainer, vi as Unknown } from "./index.mjs"; import { C as ElementModel, S as NodeModel, T as RelationshipModel, a as DeploymentNodeModel, c as NestedElementOfDeployedInstanceModel, i as DeploymentElementModel, l as RelationshipsAccum, r as DeployedInstanceModel, s as DeploymentRelationModel, w as AnyRelationshipModel, x as EdgeModel, y as LikeC4ViewModel } from "./LikeC4Model.mjs"; //#region src/model/connection/Connection.d.ts interface Connection | DeploymentElementModel, Id = string> { readonly id: Id; readonly source: Elem; readonly target: Elem; /** * Common ancestor of the source and target elements. * Represents the boundary of the connection. */ readonly boundary: Elem | null; /** * Human readable expression of the connection * Mostly used for testing and debugging */ readonly expression: string; mergeWith(this: Connection, other: typeof this): typeof this; nonEmpty(): boolean; difference(this: Connection, other: typeof this): typeof this; intersect(this: Connection, other: typeof this): typeof this; equals(other: Connection): boolean; } declare namespace Connection { type ConnectionPredicate = >(connection: C) => boolean; type ElementId = Fqn | string; export const isInside: (fqn: ElementId) => ConnectionPredicate; export const isDirectedBetween: (source: ElementId, target: ElementId) => ConnectionPredicate; export const isAnyBetween: (source: ElementId, target: ElementId) => ConnectionPredicate; export const isIncoming: (target: ElementId) => ConnectionPredicate; export const isOutgoing: (source: ElementId) => ConnectionPredicate; export const isAnyInOut: (source: ElementId) => ConnectionPredicate; export {}; } //#endregion //#region src/utils/const.d.ts declare const customInspectSymbol: unique symbol; //#endregion //#region src/model/connection/deployment/DeploymentConnectionModel.d.ts /** * Connection is ephemeral entity, result of a resolving relationships between source and target. * Includes direct relationships and/or between their nested elements. */ declare class DeploymentConnectionModel implements Connection, EdgeId> { readonly source: DeploymentElementModel; readonly target: DeploymentElementModel; readonly relations: RelationshipsAccum; readonly id: EdgeId; constructor(source: DeploymentElementModel, target: DeploymentElementModel, relations: RelationshipsAccum); /** * Human readable expression of the connection * Mostly used for testing and debugging */ get expression(): string; private _boundary; /** * Common ancestor of the source and target elements. * Represents the boundary of the connection. */ get boundary(): DeploymentNodeModel | null; nonEmpty(): boolean; [customInspectSymbol](_depth: any, _inspectOptions: any, _inspect: any): string; toString(): string; /** * Check if connection contains deployment relation, * that is directly connected to source or target. */ hasDirectDeploymentRelation(): boolean; values(): IteratorLike | DeploymentRelationModel>; /** * Merge with another connections, if it has the same source and target. * Returns new connection with union of relationships. */ mergeWith(others: DeploymentConnectionModel[]): DeploymentConnectionModel; /** * Merge with another connection, if it has the same source and target. * Returns new connection with union of relationships. */ mergeWith(other: DeploymentConnectionModel): DeploymentConnectionModel; difference(other: DeploymentConnectionModel): DeploymentConnectionModel; intersect(other: DeploymentConnectionModel): DeploymentConnectionModel; equals(other: Connection): boolean; /** * Creates a clone of the current `DeploymentConnectionModel` instance with optional overrides. * if `null` is provided in overrides, the corresponding relation set will be empty. */ update(overrides?: { model?: ReadonlySet> | null; deployment?: ReadonlySet> | null; }): DeploymentConnectionModel; } //#endregion //#region src/model/connection/model/ConnectionModel.d.ts /** * Connection refers to any relationships between two elements, * both direct and implicit ones (between their nested elements). * * Merges relationships together to an single edge on the diagram. */ declare class ConnectionModel implements Connection, EdgeId> { readonly source: ElementModel; readonly target: ElementModel; readonly relations: ReadonlySet>; readonly id: EdgeId; constructor(source: ElementModel, target: ElementModel, relations?: ReadonlySet>); private _boundary; /** * Common ancestor of the source and target elements. * Represents the boundary of the connection. */ get boundary(): ElementModel | null; /** * Human readable expression of the connection * Mostly used for testing and debugging */ get expression(): string; /** * Returns true if only includes relations between the source and target elements. */ get isDirect(): boolean; /** * Returns true if includes relations between nested elements of the source and target elements. */ get isImplicit(): boolean; get directRelations(): ReadonlySet>; nonEmpty(): boolean; mergeWith(other: ConnectionModel): ConnectionModel; difference(other: ConnectionModel): ConnectionModel; intersect(other: ConnectionModel): ConnectionModel; equals(other: Connection): boolean; /** * Returns a new instance with the updated relations. * * @param relations - A readonly set of `RelationshipModel` instances representing the new relations. * @returns A new `ConnectionModel` instance with the updated relations. */ update(relations: ReadonlySet>): ConnectionModel; [customInspectSymbol](_depth: any, _inspectOptions: any, _inspect: any): string; toString(): string; /** * Creates a new connection with reversed direction (target becomes source and vice versa) */ reversed(): ConnectionModel; } //#endregion //#region src/model/connection/ops.d.ts /** * Check if connection is nested inside another connection * (i.e. between descendants) */ declare function isNestedConnection(parent: WithSourceTarget>): (nested: WithSourceTarget) => boolean; declare function isNestedConnection(nested: WithSourceTarget, parent: WithSourceTarget): boolean; type ConnectionElemId = Connection<{ readonly id: string; }, any>; declare function findDeepestNestedConnection(connections: ReadonlyArray, connection: C): C | null; declare function sortDeepestFirst(connections: ReadonlyArray): C[]; type WithBoundary = { id: string; boundary: null | { id: string; }; }; declare function sortConnectionsByBoundaryHierarchy(sort?: 'asc' | 'desc'): >(array: A) => ReorderedArray; declare function sortConnectionsByBoundaryHierarchy>(array: A, sort?: 'asc' | 'desc'): ReorderedArray; /** * Find connections that includes given connection (i.e between it's ancestors) */ declare function findAscendingConnections(connections: ReadonlyArray, connection: C): Array; /** * Find connections that given connection includes (i.e between it's descendants) */ declare function findDescendantConnections(connections: ReadonlyArray, connection: C): Array; declare function mergeConnections>>(connections: C): Array; /** * Excludes the values existing in `other` array. * The output maintains the same order as the input. */ declare function differenceConnections>(source: Iterable, exclude: Iterable): C[]; type WithSourceTarget = { source: T; target: T; }; declare function hasSameSourceTarget(a: WithSourceTarget>): (b: WithSourceTarget) => boolean; declare function hasSameSourceTarget(a: WithSourceTarget, b: WithSourceTarget): boolean; declare function hasSameSource(a: WithSourceTarget>): (b: WithSourceTarget) => boolean; declare function hasSameSource(a: WithSourceTarget, b: WithSourceTarget): boolean; declare function hasSameTarget(a: WithSourceTarget>): (b: WithSourceTarget) => boolean; declare function hasSameTarget(a: WithSourceTarget, b: WithSourceTarget): boolean; type WithId = { id: T; }; declare function isOutgoing(source: WithId>): (a: WithSourceTarget>) => boolean; declare function isOutgoing(a: WithSourceTarget>, source: WithId): boolean; declare function isIncoming(target: WithId>): (a: WithSourceTarget>) => boolean; declare function isIncoming(a: WithSourceTarget>, target: WithId): boolean; declare function isAnyInOut(source: WithId>): (a: WithSourceTarget>) => boolean; declare function isAnyInOut(a: WithSourceTarget>, source: WithId): boolean; declare namespace find_d_exports$1 { export { findConnection$1 as findConnection, findConnectionsBetween$1 as findConnectionsBetween, findConnectionsWithin$1 as findConnectionsWithin }; } /** * Resolve connection from source to target * If direction is `both`, also look for reverse connection * * @default direction directed */ declare function findConnection$1(source: DeploymentElementModel, target: DeploymentElementModel>, direction: 'directed'): readonly [DeploymentConnectionModel] | readonly []; declare function findConnection$1(source: DeploymentElementModel, target: DeploymentElementModel>, direction: 'both'): readonly [DeploymentConnectionModel, DeploymentConnectionModel] | readonly [DeploymentConnectionModel] | readonly []; declare function findConnection$1(source: DeploymentElementModel, target: DeploymentElementModel>, direction?: 'directed' | 'both'): readonly [DeploymentConnectionModel, DeploymentConnectionModel] | readonly [DeploymentConnectionModel] | readonly []; /** * Resolve all connections between element and others * By default, look for both directions. * * @default direction both */ declare function findConnectionsBetween$1(element: DeploymentElementModel, others: Iterable>>, direction?: 'directed' | 'both'): readonly DeploymentConnectionModel[]; /** * Resolve all connections within a given set of elements */ declare function findConnectionsWithin$1(elements: Iterable>): readonly DeploymentConnectionModel[]; declare namespace find_d_exports { export { findConnection, findConnectionsBetween, findConnectionsWithin }; } /** * Resolve connection from source to target * * @param direction - if 'both', also returns connection from target to source * @default `directed` */ declare function findConnection(source: ElementModel, target: ElementModel, direction?: 'directed' | 'both'): [ConnectionModel, ConnectionModel] | [ConnectionModel] | []; /** * Resolve all connections between element and others * @param direction - if 'directed', only look for outgoing connections from the element to others * @default `both` */ declare function findConnectionsBetween(element: ElementModel, others: Iterable>, direction?: 'directed' | 'both'): readonly ConnectionModel[]; /** * Resolve all connections within a given set of elements */ declare function findConnectionsWithin(elements: Iterable>): readonly ConnectionModel[]; //#endregion //#region src/model/guards.d.ts type AnyModel = DeploymentNodeModel | DeployedInstanceModel | DeploymentRelationModel | AnyRelationshipModel | NestedElementOfDeployedInstanceModel | ElementModel | RelationshipModel | LikeC4ViewModel | NodeModel | EdgeModel; declare function isDeploymentNodeModel(model: AnyModel): model is DeploymentNodeModel; declare function isDeployedInstanceModel(model: AnyModel): model is DeployedInstanceModel; declare function isDeploymentElementModel(model: AnyModel): model is DeploymentElementModel; declare function isNestedElementOfDeployedInstanceModel(model: AnyModel): model is NestedElementOfDeployedInstanceModel; declare function isDeploymentRelationModel(x: AnyModel): x is DeploymentRelationModel; declare function isRelationModel(x: AnyModel): x is RelationshipModel; declare function isElementModel(element: AnyModel): element is ElementModel; declare function isLikeC4ViewModel(view: AnyModel): view is LikeC4ViewModel; declare function isNodeModel(node: AnyModel): node is NodeModel; declare function isEdgeModel(edge: AnyModel): edge is EdgeModel; //#endregion //#region src/model/utils/view-title-path.d.ts declare const VIEW_FOLDERS_SEPARATOR = "/"; /** * Normalizes view path by removing spaces from segments, removing empty segments, * and removing leading/trailing slashes * @example * normalizeViewPath('One / Tw o / Thre e') === 'One/Tw o/Thre e' */ declare const normalizeViewPath: (title: string) => string; /** * Returns view group path if it is used as a path * Returns empty string if it is not a path * @example * getViewFolderPath('One / Tw o / Thre e') === 'One/Tw o' * getViewFolderPath('One') === '' */ declare const getViewFolderPath: (title: string) => string | null; /** * Returns view title if it is used as a path * @example * getViewTitleFromPath('One / Tw o / Thre e') === 'Thre e' * getViewTitleFromPath('One') === 'One' */ declare const extractViewTitleFromPath: (title: string) => string; //#endregion export { sortDeepestFirst as A, hasSameTarget as C, isOutgoing as D, isNestedConnection as E, DeploymentConnectionModel as M, Connection as N, mergeConnections as O, hasSameSourceTarget as S, isIncoming as T, differenceConnections as _, isDeployedInstanceModel as a, findDescendantConnections as b, isDeploymentRelationModel as c, isLikeC4ViewModel as d, isNestedElementOfDeployedInstanceModel as f, find_d_exports$1 as g, find_d_exports as h, normalizeViewPath as i, ConnectionModel as j, sortConnectionsByBoundaryHierarchy as k, isEdgeModel as l, isRelationModel as m, extractViewTitleFromPath as n, isDeploymentElementModel as o, isNodeModel as p, getViewFolderPath as r, isDeploymentNodeModel as s, VIEW_FOLDERS_SEPARATOR as t, isElementModel as u, findAscendingConnections as v, isAnyInOut as w, hasSameSource as x, findDeepestNestedConnection as y };