mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
🤖 Merge PR #50015 @types/auto-sni: allow callback or async callback by @jankal
* @types/auto-sni: update tests * @types/auto-sni: update type to allow callback for domains option * fix(@types/auto-sni): add parentheses * fix(@types/auto-sni): update test * feat(@types/auto-sni): add dir option * feat(@types/auto-sni): add dir to test
This commit is contained in:
@@ -2,5 +2,18 @@ import autosni = require("auto-sni");
|
||||
const a = autosni({
|
||||
agreeTos: true,
|
||||
email: '',
|
||||
dir: '',
|
||||
domains: ['']
|
||||
});
|
||||
|
||||
const b = autosni({
|
||||
agreeTos: true,
|
||||
email: '',
|
||||
domains: () => []
|
||||
});
|
||||
|
||||
const c = autosni({
|
||||
agreeTos: true,
|
||||
email: '',
|
||||
domains: () => Promise.resolve([])
|
||||
});
|
||||
|
||||
4
types/auto-sni/index.d.ts
vendored
4
types/auto-sni/index.d.ts
vendored
@@ -8,10 +8,12 @@
|
||||
import { Server } from "https";
|
||||
|
||||
declare namespace createServer {
|
||||
type DomainList = Array<string | string[]>;
|
||||
interface Options {
|
||||
email: string;
|
||||
agreeTos: boolean;
|
||||
domains: Array<string | string[]>;
|
||||
domains: DomainList | (() => (DomainList | Promise<DomainList>));
|
||||
dir?: string;
|
||||
ports?: {
|
||||
http?: number,
|
||||
https?: number
|
||||
|
||||
Reference in New Issue
Block a user