API reference@evolu/commonlocal‑first/Protocol › createProtocolMessageBuffer

function createProtocolMessageBuffer(ownerId: string & Brand<"Id"> & Brand<"OwnerId">, options: {
  rangesMaxSize?: number & Brand<"Int"> & Brand<"Between3000-100000">;
  totalMaxSize?: number & Brand<"Int"> & Brand<"Between1000000-100000000">;
  version?: number & Brand<"Int"> & Brand<"NonNegative">;
} &
  | {
  messageType: 0;
  subscriptionFlag?: SubscriptionFlag | undefined;
  writeKey?: Uint8Array<ArrayBufferLike> & Brand<"Entropy"> & Brand<"Length16"> & Brand<"OwnerWriteKey">;
}
  | {
  errorCode: ProtocolErrorCode;
  messageType: 1;
}
  | {
  messageType: 2;
}): ProtocolMessageBuffer;

Defined in: packages/common/src/local-first/Protocol.ts:606