import type { AnyType, TClass, ValueOrPromise } from '@venizia/ignis-helpers/common'; import { BaseHelper } from '@venizia/ignis-helpers/core'; import type { IDataSource, IDataSourceCapabilities, ITransaction, ITransactionOptions, TAnyDataSourceSchema } from './common'; /** * Brands the datasource root so `@repository` can recognise a subclass WITHOUT `instanceof`. * * Two copies of this package give two `AbstractDataSource` classes, and `instanceof` across them is * false - the same trap `isApplicationError` exists to avoid for `ApplicationError`. `Symbol.for` is * realm-keyed, so both copies produce this exact symbol, and a static is inherited by every * subclass however deep. */ export declare const DATA_SOURCE_BRAND: unique symbol; /** True for `AbstractDataSource` itself and for any class extending it, across package copies. */ export declare const isDataSourceClass: (value: unknown) => value is TClass; /** Engine-neutral datasource root - NO SQL members. Every connector family extends this. */ export declare abstract class AbstractDataSource extends BaseHelper implements IDataSource { /** Read by {@link isDataSourceClass}. Static, so every subclass inherits it. */ static readonly [DATA_SOURCE_BRAND] = true; name: string; settings: Settings; schema: Schema; abstract configure(opts?: ConfigurableOptions): ValueOrPromise; getSettings(): Settings; getSchema(): Schema; /** Capability probe, overridden by connectors that support it (e.g. postgres reports `{ transactions: true }`). */ getCapabilities(): IDataSourceCapabilities; /** Nothing to release at this root; a family that holds a connection overrides it. */ close(): Promise; /** Defaults to throwing NotSupported - only connectors with real transaction support override this; async so callers get a rejected promise, not a synchronous throw that skips try/catch. */ beginTransaction(_opts?: ITransactionOptions): Promise; /** Model classes bound to this datasource via `@repository` metadata - paradigm-free (no schema/relation resolution). */ protected getBoundModelClasses(): Array>; /** Walks model classes bound to this datasource, reads a connector-specific artifact via `read`, and returns a name-keyed registry - skips undefined reads, throws on duplicate names, honors `autoDiscovery: false`. */ protected discoverDefinitions(opts: { read: (modelClass: TClass) => TDefinition | undefined; kind: string; }): Record; } //# sourceMappingURL=abstract.d.ts.map