@remnawave/xtls-sdk
Version:
A Typescript SDK for XRAY (XTLS) Core GRPC Api
111 lines • 4.22 kB
TypeScript
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export declare const protobufPackage = "xray.common.geodata";
export interface Domain {
$type: "xray.common.geodata.Domain";
/** Domain matching type. */
type: Domain_Type;
/** Domain value. */
value: string;
/** Attributes of this domain. May be used for filtering. */
attribute: Domain_Attribute[];
}
/** Type of domain value. */
export declare enum Domain_Type {
/** Substr - The value is used as a sub string. */
Substr = 0,
/** Regex - The value is used as a regular expression. */
Regex = 1,
/** Domain - The value is a domain. */
Domain = 2,
/** Full - The value is a full domain. */
Full = 3,
UNRECOGNIZED = -1
}
export declare function domain_TypeFromJSON(object: any): Domain_Type;
export declare function domain_TypeToJSON(object: Domain_Type): string;
export interface Domain_Attribute {
$type: "xray.common.geodata.Domain.Attribute";
key: string;
boolValue?: boolean | undefined;
intValue?: number | undefined;
}
export interface GeoSite {
$type: "xray.common.geodata.GeoSite";
code: string;
domain: Domain[];
}
export interface GeoSiteList {
$type: "xray.common.geodata.GeoSiteList";
entry: GeoSite[];
}
export interface GeoSiteRule {
$type: "xray.common.geodata.GeoSiteRule";
file: string;
code: string;
attrs: string;
}
export interface DomainRule {
$type: "xray.common.geodata.DomainRule";
geosite?: GeoSiteRule | undefined;
custom?: Domain | undefined;
}
export interface CIDR {
$type: "xray.common.geodata.CIDR";
/** IP address, should be either 4 or 16 bytes. */
ip: Uint8Array;
/** Number of leading ones in the network mask. */
prefix: number;
}
export interface CIDRRule {
$type: "xray.common.geodata.CIDRRule";
cidr: CIDR | undefined;
reverseMatch: boolean;
}
export interface GeoIP {
$type: "xray.common.geodata.GeoIP";
code: string;
cidr: CIDR[];
reverseMatch: boolean;
}
export interface GeoIPList {
$type: "xray.common.geodata.GeoIPList";
entry: GeoIP[];
}
export interface GeoIPRule {
$type: "xray.common.geodata.GeoIPRule";
file: string;
code: string;
reverseMatch: boolean;
}
export interface IPRule {
$type: "xray.common.geodata.IPRule";
geoip?: GeoIPRule | undefined;
custom?: CIDRRule | undefined;
}
export declare const Domain: MessageFns<Domain, "xray.common.geodata.Domain">;
export declare const Domain_Attribute: MessageFns<Domain_Attribute, "xray.common.geodata.Domain.Attribute">;
export declare const GeoSite: MessageFns<GeoSite, "xray.common.geodata.GeoSite">;
export declare const GeoSiteList: MessageFns<GeoSiteList, "xray.common.geodata.GeoSiteList">;
export declare const GeoSiteRule: MessageFns<GeoSiteRule, "xray.common.geodata.GeoSiteRule">;
export declare const DomainRule: MessageFns<DomainRule, "xray.common.geodata.DomainRule">;
export declare const CIDR: MessageFns<CIDR, "xray.common.geodata.CIDR">;
export declare const CIDRRule: MessageFns<CIDRRule, "xray.common.geodata.CIDRRule">;
export declare const GeoIP: MessageFns<GeoIP, "xray.common.geodata.GeoIP">;
export declare const GeoIPList: MessageFns<GeoIPList, "xray.common.geodata.GeoIPList">;
export declare const GeoIPRule: MessageFns<GeoIPRule, "xray.common.geodata.GeoIPRule">;
export declare const IPRule: MessageFns<IPRule, "xray.common.geodata.IPRule">;
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
[K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
} : Partial<T>;
export interface MessageFns<T, V extends string> {
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>): T;
fromPartial(object: DeepPartial<T>): T;
}
export {};
//# sourceMappingURL=geodat.d.ts.map