13 lines
425 B
TypeScript
13 lines
425 B
TypeScript
import type { Type } from "protobufjs";
|
|
import type { HttpMethod } from "../transport/HttpManager";
|
|
|
|
export type CodecKind = "json" | "proto";
|
|
|
|
export interface Endpoint<Req, Res> {
|
|
path: string;
|
|
method: HttpMethod;
|
|
codec: CodecKind; // 编解码类型,"json", "proto"
|
|
reqType?: Type; // codec=proto 时必填
|
|
resType?: Type; // codec=proto 时必填
|
|
needsAuth?: boolean; // 是否需要token
|
|
} |