feat(ext/net): add CAA DNS record support in Deno.resolveDns() API (#14624)

This commit is contained in:
Craig Morten 2022-05-16 10:20:41 +01:00 committed by GitHub
parent eb5ffab1cb
commit 10a68a5635
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 90 additions and 14 deletions

View file

@ -2953,6 +2953,7 @@ declare namespace Deno {
| "A"
| "AAAA"
| "ANAME"
| "CAA"
| "CNAME"
| "MX"
| "NAPTR"
@ -2974,6 +2975,13 @@ declare namespace Deno {
};
}
/** If `resolveDns` is called with "CAA" record type specified, it will return an array of this interface. */
export interface CAARecord {
critical: boolean;
tag: string;
value: string;
}
/** If `resolveDns` is called with "MX" record type specified, it will return an array of this interface. */
export interface MXRecord {
preference: number;
@ -3015,6 +3023,12 @@ declare namespace Deno {
options?: ResolveDnsOptions,
): Promise<string[]>;
export function resolveDns(
query: string,
recordType: "CAA",
options?: ResolveDnsOptions,
): Promise<CAARecord[]>;
export function resolveDns(
query: string,
recordType: "MX",
@ -3068,6 +3082,7 @@ declare namespace Deno {
options?: ResolveDnsOptions,
): Promise<
| string[]
| CAARecord[]
| MXRecord[]
| NAPTRRecord[]
| SOARecord[]