import { InMemoryApp } from "./adapters"; import { Builder } from "./builder"; import { Broker, Disposable, Logger, Store, SubscriptionStore } from "./interfaces"; import { Client } from "./types"; /** * @category Ports * @remarks Global port to configuration */ export declare const config: (arg?: { name: string; dispose: () => Promise; description: string; env: "development" | "test" | "staging" | "production"; logLevel: "error" | "info" | "data" | "trace"; service: string; version: string; author: { email: string; name: string; }; license: string; dependencies: Record; } | undefined) => { name: string; dispose: () => Promise; description: string; env: "development" | "test" | "staging" | "production"; logLevel: "error" | "info" | "data" | "trace"; service: string; version: string; author: { email: string; name: string; }; license: string; dependencies: Record; }; /** * @category Ports * @remarks Global port to application builder * @example Bootstrapping a service ```ts void bootstrap(async (): Promise => { // Seed the stores (this should be done by CI/CD pipelines) // Register artifacts, build the app const express = app(new ExpressApp()) .with(Room) .with(Hotel, { projector: { store: PostgresProjectorStore("hotel"), indexes: [{ type: "asc" }] } }) .with(Next30Days, { projector: { store: PostgresProjectorStore("next30"), indexes: [{}] } }) .build(); // To seed the stores (CI/CD) await seed(); // Start listing to incoming messages await app().listen(); }); ``` */ export declare const app: (arg?: T | undefined) => T; /** * @category Ports * @remarks Global port to event store * @example Bootstrapping a service with a Postgres store adapter ```ts void bootstrap(async (): Promise => { store(PostgresStore("hotel")); // Register artifacts, build the app const express = app(new ExpressApp()) .with(Room) .build(); // Start listing to incoming messages await app().listen(); }); ``` */ export declare const store: (arg?: Store | undefined) => Store; /** * @category Ports * @remarks Global port to subscriptions store */ export declare const subscriptions: (arg?: SubscriptionStore | undefined) => SubscriptionStore; /** * @category Ports * @remarks Global port to logging */ export declare const log: (arg?: Logger | undefined) => Logger; /** * @category Ports * @remarks Global port to client api * @example Calling a command via the client port ```ts await client().command(Room, "OpenRoom", room, { id: id || room.number.toString() }); ``` */ export declare const client: (arg?: (Client & Disposable) | undefined) => Client & Disposable; /** * @category Ports * @remarks Global port to internal broker */ export declare const broker: (arg?: Broker | undefined) => Broker; /** * @category Ports * @remarks Global port to in-memory projection store * - this is used only in dev/testing mode */ export declare const _imps: (arg?: import("./interfaces").ProjectorStore | undefined) => import("./interfaces").ProjectorStore; //# sourceMappingURL=ports.d.ts.map