//#region src/schema-runtime/schema.d.ts interface Schema { package: string | null; definitions: Definition[]; } type DefinitionKind = 'ENUM' | 'STRUCT' | 'MESSAGE'; interface Definition { name: string; line: number; column: number; kind: DefinitionKind; fields: Field[]; } interface Field { name: string; line: number; column: number; type: string | null; isArray: boolean; isDeprecated: boolean; value: number; } //#endregion //#region src/schema-runtime/bb.d.ts declare class ByteBuffer { private _data; private _index; length: number; constructor(data?: Uint8Array); get offset(): number; set offset(value: number); /** The bytes this buffer reads, as a view rather than a copy. */ get bytes(): Uint8Array; /** * Returns a view into the internal buffer, not a copy. * * Consumers transferring this Uint8Array across thread boundaries (e.g. via * postMessage with transferables) MUST copy first: `new Uint8Array(buffer)`. * Otherwise, if multiple Uint8Arrays share the same underlying ArrayBuffer and * one is transferred, all views into that buffer become detached. */ toUint8Array(): Uint8Array; readByte(): number; readByteArray(): Uint8Array; skipByteArray(): void; readVarFloat(): number; readVarUint(): number; readVarInt(): number; readVarUint64(): bigint; readVarInt64(): bigint; readString(): string; skipString(): void; private findStringTerminator; private _growBy; writeByte(value: number): void; writeByteArray(value: Uint8Array): void; writeVarFloat(value: number): void; writeVarUint(value: number): void; writeVarInt(value: number): void; writeVarUint64(value: bigint | string): void; writeVarInt64(value: bigint | string): void; writeString(value: string): void; } //#endregion //#region src/schema-runtime/interpreter.d.ts type RuntimeEnum = { [name: string]: string | number; }; type RuntimeValue = boolean | number | string | bigint | Uint8Array | RuntimeMessage | RuntimeValue[]; type RuntimeMessage = { [name: string]: RuntimeValue; }; type DecodeFunction = (bb: ByteBuffer | Uint8Array) => RuntimeMessage; type EncodeFunction = (message: RuntimeMessage, bb?: ByteBuffer) => Uint8Array | undefined; type RuntimeEntry = typeof ByteBuffer | RuntimeEnum | RuntimeValue | DecodeFunction | EncodeFunction | undefined; type RuntimeCodec = { ByteBuffer: typeof ByteBuffer; encodeMessage?: EncodeFunction; decodeMessage?: DecodeFunction; encodePaint?: EncodeFunction; encodeNodeChange?: EncodeFunction; [name: string]: RuntimeEntry; }; /** * Message types decoded as headers: only the named fields are read, and the rest stay in the * message bytes until `decodeWhole` reads the message in full. A large message of many such * messages then holds a little of each rather than every value of every one. */ type HeaderFields = Readonly>; /** * A header read again in full from the bytes it came from, as a new message the caller owns, * or undefined for a message that was decoded whole. */ declare function decodeWhole(message: object): RuntimeMessage | undefined; declare function compileSchemaRuntime(schema: Schema, headers?: HeaderFields): RuntimeCodec; //#endregion //#region src/schema-runtime/binary.d.ts declare function decodeBinarySchema(buffer: Uint8Array | ByteBuffer): Schema; declare function encodeBinarySchema(schema: Schema): Uint8Array; //#endregion //#region src/schema-runtime/parser.d.ts declare function parseSchema(text: string): Schema; //#endregion //#region src/schema-runtime/skip.d.ts /** * Moves a buffer past encoded values without building them, so a reader can find where each * value lies in a large message and copy the bytes of the ones it does not change. */ interface SchemaSkipper { definition(name: string): Definition; /** A definition's fields by their IDs, built once per definition. */ fieldsById(name: string): ReadonlyMap; /** Past one value of a field, its array included. */ skipField(field: Field, bb: ByteBuffer): void; /** Past one value of a type: a native type, an enum, a struct or a message. */ skipValue(type: string, bb: ByteBuffer): void; } declare function createSchemaSkipper(schema: Schema): SchemaSkipper; //#endregion //#region src/schema-runtime/validate.d.ts declare function findDefinition(schema: Schema, name: string): Definition | null; declare function findField(schema: Schema, definitionName: string, fieldName: string): Field | null; declare function expectFieldNumber(schema: Schema, definitionName: string, fieldName: string, expectedValue: number): void; declare function expectEnumValue(schema: Schema, enumName: string, memberName: string, expectedValue: number): void; declare function validateSchema(schema: Schema): void; //#endregion export { ByteBuffer, Definition, Field, HeaderFields, Schema, SchemaSkipper, compileSchemaRuntime, createSchemaSkipper, decodeBinarySchema, decodeWhole, encodeBinarySchema, expectEnumValue, expectFieldNumber, findDefinition, findField, parseSchema, validateSchema }; //# sourceMappingURL=index.d.ts.map