import type { BaseConfig } from '@mwcp/share';
import type { MiddlewareConfig as MWConfig } from '@waiting/shared-types';
import type { KmoreFactoryOpts, PropagationType, RowLockOptions } from 'kmore';
export type { WrapIdentifierIgnoreRule } from 'kmore';
export declare enum ConfigKey {
    config = "kmoreConfig",
    middlewareConfig = "kmoreMiddlewareConfig",
    namespace = "kmore",
    componentName = "kmoreComponent",
    middlewareName = "kmoreMiddleware",
    dbSourceManager = "DbSourceManager",
    dbManager = "DbManager",
    propagationConfig = "kmorePropagationConfig",
    Transactional = "Transactional"
}
export declare enum Msg {
    hello = "hello world",
    insufficientCallstacks = "Insufficient call stacks by getCallerStack",
    callerKeyNotRegisteredOrNotEntry = "callerKey is not registered or not entry caller",
    propagationConfigIsUndefined = "propagationConfig is undefined",
    registerPropagationFailed = "registerPropagation() failed"
}
export interface Config<SourceName extends string = string> extends BaseConfig, KmoreSourceConfig<SourceName> {
}
export interface MiddlewareOptions {
    debug: boolean;
}
export type MiddlewareConfig = MWConfig<MiddlewareOptions>;
/** midway DataSource */
export interface KmoreSourceConfig<SourceName extends string = string> {
    dataSource: DataSource<SourceName>;
    default?: DbConfig;
}
export type DataSource<SourceName extends string = string> = Record<SourceName, DbConfig>;
export interface DbConfig<T = any> extends KmoreFactoryOpts<T> {
    /**
     * Enable open telemetry via @mwcp/otel
     * @default true
     */
    enableTrace?: boolean;
    /**
     * Whether add event on span
     * @default all
     */
    traceEvents?: Set<KmoreAttrNames> | 'all';
    /**
     * Tracing database connection (including connection secret!)
     * @default false
     */
    traceInitConnection?: boolean;
    /**
     * 强制采样请求处理时间（毫秒）阈值
     * 负数不采样
     * @description NOT used currently
     * @default 3000
     */
    sampleThrottleMs?: number;
}
export declare enum KmoreAttrNames {
    BuilderCompile = "builder.compile",
    BuilderTransacting = "builder.transacting",
    QueryStart = "query.start",
    QueryQuerying = "query.querying",
    QueryResponse = "query.response",
    QueryError = "query.error",
    TrxCreateStart = "trx.create.start",
    TrxCreateEnd = "trx.create.end",
    TrxCommitStart = "trx.commit.start",
    TrxCommitEnd = "trx.commit.end",
    TrxRollbackStart = "trx.rollback.start",
    TrxRollbackEnd = "trx.rollback.end",
    getDataSourceStart = "getDataSource.start",
    getDataSourceEndFromCache = "getDataSource.end.fromCache",
    getDataSourceEnd = "getDataSource.end"
}
/**
 * Transaction propagation config for declarative transaction
 */
export interface KmorePropagationConfig extends RowLockOptions {
    /**
     * @default PropagationType.REQUIRED,
     */
    propagationType: PropagationType;
}
export interface ConnectionConfig {
    host: string;
    port?: number;
    user: string;
    password: string;
    database: string;
    domain?: string;
    instanceName?: string;
    debug?: boolean;
    requestTimeout?: number;
}
//# sourceMappingURL=types.d.ts.map