wangzhibo
2026-05-09 53418655c061ac26f66058253f39200aced1ab1d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { inspect } from 'node:util';
interface CoerceTypeMap {
    string: string;
    number: number;
    boolean: boolean;
}
export type CoerceType = keyof CoerceTypeMap;
type InferSchema<T extends SchemaDefinition> = {
    [K in keyof T]: T[K]['type'] extends CoerceType ? CoerceTypeMap[T[K]['type']] : string;
};
export interface SchemaItem<T extends CoerceType = 'string'> {
    type?: T;
    default?: CoerceTypeMap[T];
    aliases?: string[];
}
export type SchemaDefinition = Record<string, SchemaItem<any>>;
export declare class ConnectionString implements ReadonlyMap<string, string> {
    #private;
    constructor(connectionString: string);
    [inspect.custom](): ReadonlyMap<string, string>;
    get size(): number;
    get<T extends CoerceType = 'string'>(key: string, coerceType?: T): CoerceTypeMap[T] | undefined;
    keys(): MapIterator<string>;
    values(): MapIterator<string>;
    [Symbol.iterator](): MapIterator<[string, string]>;
    entries(): MapIterator<[string, string]>;
    toString(): string;
    has(key: string): boolean;
    forEach(callbackfn: (value: string, key: string, map: ReadonlyMap<string, string>) => void, thisArg?: any): void;
    toSchema<T extends SchemaDefinition>(schema: T, { includeMissing }?: {
        includeMissing?: boolean;
    }): InferSchema<T>;
}
export {};
//# sourceMappingURL=connection-string.d.ts.map