import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { Endpoint } from "../../common/net/destination"; import { GeoIP } from "../router/config"; export declare const protobufPackage = "xray.app.dns"; export declare enum DomainMatchingType { Full = 0, Subdomain = 1, Keyword = 2, Regex = 3, UNRECOGNIZED = -1 } export declare function domainMatchingTypeFromJSON(object: any): DomainMatchingType; export declare function domainMatchingTypeToJSON(object: DomainMatchingType): string; export declare enum QueryStrategy { USE_IP = 0, USE_IP4 = 1, USE_IP6 = 2, USE_SYS = 3, UNRECOGNIZED = -1 } export declare function queryStrategyFromJSON(object: any): QueryStrategy; export declare function queryStrategyToJSON(object: QueryStrategy): string; export interface NameServer { $type: "xray.app.dns.NameServer"; address: Endpoint | undefined; clientIp: Uint8Array; skipFallback: boolean; prioritizedDomain: NameServer_PriorityDomain[]; expectedGeoip: GeoIP[]; originalRules: NameServer_OriginalRule[]; queryStrategy: QueryStrategy; actPrior: boolean; tag: string; timeoutMs: number; disableCache?: boolean | undefined; serveStale?: boolean | undefined; serveExpiredTTL?: number | undefined; finalQuery: boolean; unexpectedGeoip: GeoIP[]; actUnprior: boolean; policyID: number; } export interface NameServer_PriorityDomain { $type: "xray.app.dns.NameServer.PriorityDomain"; type: DomainMatchingType; domain: string; } export interface NameServer_OriginalRule { $type: "xray.app.dns.NameServer.OriginalRule"; rule: string; size: number; } export interface Config { $type: "xray.app.dns.Config"; /** * NameServer list used by this DNS client. * A special value 'localhost' as a domain address can be set to use DNS on local system. */ nameServer: NameServer[]; /** * Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes * (IPv6). */ clientIp: Uint8Array; staticHosts: Config_HostMapping[]; /** Tag is the inbound tag of DNS client. */ tag: string; /** DisableCache disables DNS cache */ disableCache: boolean; serveStale: boolean; serveExpiredTTL: number; queryStrategy: QueryStrategy; disableFallback: boolean; disableFallbackIfMatch: boolean; enableParallelQuery: boolean; } export interface Config_HostMapping { $type: "xray.app.dns.Config.HostMapping"; type: DomainMatchingType; domain: string; ip: Uint8Array[]; /** * ProxiedDomain indicates the mapped domain has the same IP address on this * domain. Xray will use this domain for IP queries. */ proxiedDomain: string; } export declare const NameServer: MessageFns; export declare const NameServer_PriorityDomain: MessageFns; export declare const NameServer_OriginalRule: MessageFns; export declare const Config: MessageFns; export declare const Config_HostMapping: MessageFns; type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in Exclude]?: DeepPartial; } : Partial; export interface MessageFns { readonly $type: V; encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; fromJSON(object: any): T; toJSON(message: T): unknown; create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; } export {};