mod.d.ts 560 B

1234567891011121314151617181920212223
  1. import 'dns2';
  2. declare module 'dns2' {
  3. import DNS2 from 'dns2';
  4. declare namespace DNS2 {
  5. interface DoHClientOption {
  6. /** @example dns.google.com */
  7. dns: string,
  8. /** @description whether to use HTTP or HTTPS */
  9. http: boolean
  10. }
  11. export type PacketQuestion = keyof typeof Packet.TYPE;
  12. export type DnsResolver<T = DnsResponse> = (name: string, type: PacketQuestion) => Promise<T>;
  13. declare function DOHClient(opt: DoHClientOption): DnsResolver;
  14. export type $DnsResponse = DnsResponse;
  15. }
  16. export = DNS2;
  17. }