UNPKG

@remnawave/xtls-sdk

Version:

A Typescript SDK for XRAY (XTLS) Core GRPC Api

74 lines 3.32 kB
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { TypedMessage } from "../common/serial/typed_message"; export declare const protobufPackage = "xray.core"; /** * Config is the master config of Xray. Xray takes this config as input and * functions accordingly. */ export interface Config { $type: "xray.core.Config"; /** Inbound handler configurations. Must have at least one item. */ inbound: InboundHandlerConfig[]; /** * Outbound handler configurations. Must have at least one item. The first * item is used as default for routing. */ outbound: OutboundHandlerConfig[]; /** * App is for configurations of all features in Xray. A feature must * implement the Feature interface, and its config type must be registered * through common.RegisterConfig. */ app: TypedMessage[]; /** * Configuration for extensions. The config may not work if corresponding * extension is not loaded into Xray. Xray will ignore such config during * initialization. */ extension: TypedMessage[]; } /** InboundHandlerConfig is the configuration for inbound handler. */ export interface InboundHandlerConfig { $type: "xray.core.InboundHandlerConfig"; /** * Tag of the inbound handler. The tag must be unique among all inbound * handlers */ tag: string; /** Settings for how this inbound proxy is handled. */ receiverSettings: TypedMessage | undefined; /** Settings for inbound proxy. Must be one of the inbound proxies. */ proxySettings: TypedMessage | undefined; } /** OutboundHandlerConfig is the configuration for outbound handler. */ export interface OutboundHandlerConfig { $type: "xray.core.OutboundHandlerConfig"; /** Tag of this outbound handler. */ tag: string; /** Settings for how to dial connection for this outbound handler. */ senderSettings: TypedMessage | undefined; /** Settings for this outbound proxy. Must be one of the outbound proxies. */ proxySettings: TypedMessage | undefined; /** If not zero, this outbound will be expired in seconds. Not used for now. */ expire: number; /** Comment of this outbound handler. Not used for now. */ comment: string; } export declare const Config: MessageFns<Config, "xray.core.Config">; export declare const InboundHandlerConfig: MessageFns<InboundHandlerConfig, "xray.core.InboundHandlerConfig">; export declare const OutboundHandlerConfig: MessageFns<OutboundHandlerConfig, "xray.core.OutboundHandlerConfig">; 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=config.d.ts.map