IMessageTypeRegistry provides look-up for message types.

You can conveniently create a registry using the createRegistry() function:

import { createRegistry } from "@bufbuild/protobuf";
import { MyMessage, MyOtherMessage } from "./gen/my_message_pb.js";

const reg: IMessageTypeRegistry = createRegistry(
MyMessage,
MyOtherMessage,
);
interface IMessageTypeRegistry {
    findMessage(typeName): undefined | MessageType<AnyMessage>;
}

Methods

Methods

  • Find a message type by its protobuf type name.

    Parameters

    • typeName: string

    Returns undefined | MessageType<AnyMessage>

Generated using TypeDoc