Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
Publish MCP to npm / Build, test, and publish MCP (push) Waiting to run
Publish SDK to npm / Build, test, and publish SDK (push) Waiting to run
Sync action catalog to docs / sync (push) Waiting to run
Publish UI to npm / Build and publish UI (push) Waiting to run
Build and Release / preflight (push) Waiting to run
50 lines
2.2 KiB
TypeScript
50 lines
2.2 KiB
TypeScript
// ── Protobuf field markers ────────────────────────────────────────────
|
|
/** Marks a singular protobuf field: `name: pb<fieldNumber, Type>` */
|
|
export type pb<_ProtoNumber extends number, Type> = Type;
|
|
/** Marks a repeated protobuf field: `ids: pb_repeated<fieldNumber, Type>` → Type[] */
|
|
export type pb_repeated<_ProtoNumber extends number, Type> = Type[];
|
|
/**
|
|
* Marks a singular field with **explicit presence** (proto3 `optional`): it
|
|
* serialises whenever the value is present, INCLUDING its zero/default value
|
|
* — unlike `pb<>`, which omits zeros. Use when the wire peer needs the field
|
|
* present to disambiguate, e.g. an OIDB sub-command keyed on body shape where
|
|
* a zero must still appear on the wire. `name: pb_optional<fieldNumber, Type>`.
|
|
*/
|
|
export type pb_optional<_ProtoNumber extends number, Type> = Type;
|
|
|
|
// ── Protobuf primitive types ──────────────────────────────────────────
|
|
export type uint_32 = number;
|
|
export type int_32 = number;
|
|
export type uint_64 = bigint;
|
|
export type int_64 = bigint;
|
|
export type sint_32 = number;
|
|
export type sint_64 = bigint;
|
|
export type bool = boolean;
|
|
export type float = number;
|
|
export type double = number;
|
|
export type fixed_32 = number;
|
|
export type fixed_64 = bigint;
|
|
export type sfixed_32 = number;
|
|
export type sfixed_64 = bigint;
|
|
export type bytes = Uint8Array;
|
|
|
|
// ── Encode / decode (replaced at compile-time by the vite plugin) ────
|
|
export function protobuf_encode<T>(params: T): Uint8Array;
|
|
export function protobuf_decode<T>(data: Uint8Array): T;
|
|
|
|
/** Non-enumerable metadata retained for protobuf tags unknown to the schema. */
|
|
export interface ProtobufUnknownField {
|
|
fieldNumber: number;
|
|
wireType: number;
|
|
count: number;
|
|
totalByteLength: number;
|
|
}
|
|
export interface ProtobufUnknownFieldMetadata {
|
|
fields: readonly ProtobufUnknownField[];
|
|
totalOccurrences: number;
|
|
omittedOccurrences: number;
|
|
omittedByteLength: number;
|
|
}
|
|
export function protobuf_getUnknownFields(value: unknown): readonly ProtobufUnknownField[];
|
|
export function protobuf_getUnknownFieldMetadata(value: unknown): ProtobufUnknownFieldMetadata;
|