interface GrpcServiceDefinition
Since 0.3.0

A gRPC service definition that satisfies the plugin's expectations. This is a structural constraint satisfied by generated descriptor objects from @bufbuild/protobuf. It contains only the fields the plugin needs to route requests and build reflection data.

Type Parameters

TMethod = unknown

Properties

readonly
typeName: string

The fully qualified name of the service, e.g. "package.ServiceName".

readonly
method: Readonly<Record<string, TMethod>>

Methods keyed by their camelCase local name.

This is deliberately method (singular), matching the record a Protobuf-ES DescService exposes alongside its methods ARRAY. The array form is not assignable to Record<string, TMethod>, so constraining on methods would reject every real generated descriptor and force callers into a cast — the opposite of what this structural constraint exists for.

Usage

import { type GrpcServiceDefinition } from "grpc-plugin/src/index.ts";