index.d.ts
2.52 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { URL } from 'whatwg-url';
import { redactConnectionString, ConnectionStringRedactionOptions } from './redact';
export { redactConnectionString, ConnectionStringRedactionOptions };
declare class CaseInsensitiveMap<K extends string = string> extends Map<K, string> {
delete(name: K): boolean;
get(name: K): string | undefined;
has(name: K): boolean;
set(name: K, value: any): this;
_normalizeKey(name: any): K;
}
declare abstract class URLWithoutHost extends URL {
abstract get host(): never;
abstract set host(value: never);
abstract get hostname(): never;
abstract set hostname(value: never);
abstract get port(): never;
abstract set port(value: never);
abstract get href(): string;
abstract set href(value: string);
}
export interface ConnectionStringParsingOptions {
looseValidation?: boolean;
}
export declare class ConnectionString extends URLWithoutHost {
_hosts: string[];
constructor(uri: string, options?: ConnectionStringParsingOptions);
get host(): never;
set host(_ignored: never);
get hostname(): never;
set hostname(_ignored: never);
get port(): never;
set port(_ignored: never);
get href(): string;
set href(_ignored: string);
get isSRV(): boolean;
get hosts(): string[];
set hosts(list: string[]);
toString(): string;
clone(): ConnectionString;
redact(options?: ConnectionStringRedactionOptions): ConnectionString;
typedSearchParams<T extends {}>(): {
append(name: keyof T & string, value: any): void;
delete(name: keyof T & string): void;
get(name: keyof T & string): string | null;
getAll(name: keyof T & string): string[];
has(name: keyof T & string): boolean;
set(name: keyof T & string, value: any): void;
keys(): IterableIterator<keyof T & string>;
values(): IterableIterator<string>;
entries(): IterableIterator<[keyof T & string, string]>;
_normalizeKey(name: keyof T & string): string;
[Symbol.iterator](): IterableIterator<[keyof T & string, string]>;
sort(): void;
forEach<THIS_ARG = void>(callback: (this: THIS_ARG, value: string, name: string, searchParams: any) => void, thisArg?: THIS_ARG | undefined): void;
readonly [Symbol.toStringTag]: "URLSearchParams";
};
}
export declare class CommaAndColonSeparatedRecord<K extends {} = Record<string, unknown>> extends CaseInsensitiveMap<keyof K & string> {
constructor(from?: string | null);
toString(): string;
}
export default ConnectionString;