Skip to content

[V] $lib

const $lib: TypeSpecLibrary<{
"anonymous-model": {
default: "anonymous models cannot be used in Protobuf messages";
};
"enum-value-name-collision": {
default: CallableMessage<["name", "kind", "owner"]>;
};
"field-index": {
duplicate: CallableMessage<["name", "index", "other"]>;
invalid: CallableMessage<["index"]>;
missing: CallableMessage<["name"]>;
"out-of-bounds": CallableMessage<["index", "max"]>;
reserved: CallableMessage<["index"]>;
"user-reserved": CallableMessage<["index"]>;
"user-reserved-range": CallableMessage<["index"]>;
};
"field-name": {
duplicate: CallableMessage<["name"]>;
"user-reserved": CallableMessage<["name"]>;
};
"illegal-reservation": {
default: "reservation value must be a string literal, uint32 literal, or a tuple of two uint32 literals denoting a range";
};
"invalid-oneof": {
empty: CallableMessage<["name"]>;
"invalid-member-name": CallableMessage<["name"]>;
"invalid-name": CallableMessage<["name"]>;
"map-variant": CallableMessage<["name"]>;
"repeated-variant": CallableMessage<["name"]>;
required: CallableMessage<["name"]>;
"unnamed-variant": "every variant of a union emitted as a oneof must be named";
};
"invalid-package-name": {
default: CallableMessage<["name"]>;
};
"long-running-type": {
default: CallableMessage<["role"]>;
};
"model-not-in-package": {
default: CallableMessage<["name"]>;
union: CallableMessage<["name"]>;
};
"namespace-collision": {
default: CallableMessage<["name"]>;
};
"nested-array": {
default: "nested arrays are not supported by the Protobuf emitter";
};
"optional-array-field": {
default: "optional array fields cannot preserve unset versus empty in protobuf; emitting a repeated field without the 'optional' label";
};
"optional-map-field": {
default: "optional map fields cannot preserve unset versus empty in protobuf; emitting a map field without the 'optional' label";
};
package: {
"disallowed-option-type": CallableMessage<["name", "type"]>;
};
"root-operation": {
default: "operations in the root namespace are not supported (no associated Protobuf service)";
};
"unconvertible-enum": {
default: "enums must explicitly assign exactly one integer to each member to be used in a Protobuf message";
"no-zero-first": "the first variant of an enum must be set to zero to be used in a Protobuf message";
};
"unspeakable-template-argument": {
default: CallableMessage<["name"]>;
};
"unsupported-field-type": {
"recursive-map": "a protobuf map's 'value' type may not refer to another map";
unconvertible: CallableMessage<["type"]>;
union: "a message field's type may not be an anonymous union (declare a named union with '@field' on each variant)";
"unknown-intrinsic": CallableMessage<["name"]>;
"unknown-scalar": CallableMessage<["name"]>;
};
"unsupported-input-type": {
unconvertible: "input parameters cannot be converted to a Protobuf message";
"wrong-number": "Protobuf methods must accept exactly one Model input (an empty model will do)";
"wrong-type": "Protobuf methods may only accept a named Model as an input";
};
"unsupported-intrinsic": {
default: CallableMessage<["name"]>;
};
"unsupported-return-type": {
default: "Protobuf methods must return a named Model";
};
}, ProtobufEmitterOptions, never> = TypeSpecProtobufLibrary;

Library definition used by the compiler to register Protobuf diagnostics and emitter options.