import { ComponentType } from '../types/components.ts'; import type { ComponentConfig } from '../types/components.ts'; import type { CacheConfig, ClientConfig, DatabaseConfig, LoadBalancerConfig, QueueConfig, ServerConfig, ThrottleConfig } from '../types/configs.ts'; import { Connection } from './connection.ts'; import type { ConnectionOptions } from './connection.ts'; export type ClientProps = Omit; export type CacheProps = Omit; export type ServerProps = ServerConfig; export type DatabaseProps = DatabaseConfig; export type QueueProps = QueueConfig; export type LoadBalancerProps = LoadBalancerConfig; export type ThrottleProps = ThrottleConfig; /** Base class for objects that represent components in a Scenario. */ export declare abstract class Component { #private; readonly id: string; readonly type: TType; readonly props: Readonly; protected constructor(id: string, type: TType, props: TProps); /** @internal Used by Scenario synthesis after connections are resolved. */ abstract toConfig(downstreamId?: string): ComponentConfig; /** @internal Return a defensive copy of this component's outgoing connections. */ getDeclaredConnections(): readonly Connection[]; /** @internal Register a connection created by a construct relationship method. */ declareConnection(connection: Connection): void; } export declare class Client extends Component { constructor(id: string, props: ClientProps); toConfig(downstreamId?: string): ComponentConfig; sendsTo(target: TTarget, options?: ConnectionOptions): Connection; } export declare class Server extends Component { constructor(id: string, props: ServerProps); toConfig(): ComponentConfig; } export declare class Database extends Component { constructor(id: string, props: DatabaseProps); toConfig(): ComponentConfig; } export declare class Cache extends Component { constructor(id: string, props: CacheProps); toConfig(downstreamId?: string): ComponentConfig; sendsTo(target: TTarget, options?: ConnectionOptions): Connection; } export declare class LoadBalancer extends Component { constructor(id: string, props: LoadBalancerProps); toConfig(): ComponentConfig; routesTo(target: TTarget, options?: ConnectionOptions): Connection; } export declare class Queue extends Component { constructor(id: string, props?: QueueProps); toConfig(): ComponentConfig; sendsTo(target: TTarget, options?: ConnectionOptions): Connection; } export declare class Throttle extends Component { constructor(id: string, props: ThrottleProps); toConfig(): ComponentConfig; sendsTo(target: TTarget, options?: ConnectionOptions): Connection; } export type AnyComponent = Client | Server | Database | Cache | LoadBalancer | Queue | Throttle; export type ConnectableComponent = Client | Cache | LoadBalancer | Queue | Throttle; export type TargetComponent = Server | Database | Cache | LoadBalancer | Queue | Throttle; export type TerminalComponent = Server | Database; export declare function isConnectableComponent(component: AnyComponent): component is ConnectableComponent; export declare function isTargetComponent(component: AnyComponent): component is TargetComponent; /** @internal Return connections declared by a construct relationship method. */ export declare function getDeclaredConnections(component: AnyComponent): readonly Connection[]; /** @internal Restore a validated low-level connection through the typed object model. */ export declare function connectDeclaredComponents(source: TSource, target: TTarget, options?: ConnectionOptions): Connection; //# sourceMappingURL=components.d.ts.map