*Update SSL types
This commit is contained in:
parent
3ae45da896
commit
3231c18e08
23
src/ssl.ts
23
src/ssl.ts
|
@ -1,18 +1,25 @@
|
||||||
import type tls from "tls";
|
import type tls from "tls";
|
||||||
|
|
||||||
export type SSLManagerRenewHandler = (domain: string) => Promise<boolean>;
|
export type SSLManagerRenewHandler = (domain: string) => Promise<boolean>;
|
||||||
|
export type SSLCert = string | Buffer | Array<string | Buffer>;
|
||||||
|
|
||||||
declare class SSLManager {
|
declare class SSLManager {
|
||||||
private _context?;
|
|
||||||
private _key?;
|
|
||||||
private _cert?;
|
|
||||||
private _domain;
|
|
||||||
private _renewHandler?;
|
|
||||||
constructor(domain: string);
|
constructor(domain: string);
|
||||||
|
|
||||||
get context(): tls.SecureContext;
|
get context(): tls.SecureContext;
|
||||||
|
|
||||||
set privateKey(key: Buffer);
|
set privateKey(key: Buffer);
|
||||||
set cert(cert: Buffer);
|
|
||||||
private _maybeUpdateContext;
|
set cert(cert: SSLCert);
|
||||||
|
|
||||||
renew(): Promise<boolean>;
|
renew(): Promise<boolean>;
|
||||||
get enabled(): any;
|
|
||||||
|
get enabled(): boolean;
|
||||||
|
|
||||||
|
get ready(): boolean;
|
||||||
|
|
||||||
|
get renewHandler(): SSLManagerRenewHandler;
|
||||||
|
set renewHandler(value: SSLManagerRenewHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default SSLManager;
|
export default SSLManager;
|
||||||
|
|
Loading…
Reference in New Issue