Skip to content

Simplify generated method signatures when implementing ServiceImpl in Connect-ES #1601

Description

@fawzibazari

Hey everyone, 👋:
i’m working with connect-es (helper-types) and was wondering if there’s a way to simplify the output when implementing this interface:

export class Eliza implements ServiceImpl<typeof ElizaService>

what i mean by this is when i click “Implement Interface” in the IDE, i’d like it to generate something clean like:

say(request: SayRequest, context: HandlerContext): SayResponse {
  throw new Error("Method not implemented.");
}

instead of the huge expanded type:

say: UnaryImpl<
  Omit<DescMessage, "typeName" | "field"> & {
    field: Record<"sentence", DescField>;
    typeName: "connectrpc.eliza.v1.SayRequest";
  } & brandv2<SayRequest, { jsonType?: unknown; validType?: unknown; }> & DescMessage,
  Omit<DescMessage, "typeName" | "field"> & {
    field: Record<"sentence", DescField>;
    typeName: "connectrpc.eliza.v1.SayResponse";
  } & brandv2<SayResponse, { jsonType?: unknown; validType?: unknown; }> & DescMessage
>;

is there a way to make it ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions