import type { Extension } from "../extension.js"; import type { AnyMessage, Message } from "../message.js"; import type { FieldInfo, OneofInfo, PartialFieldInfo } from "../field.js"; import { WireType } from "../binary-encoding.js"; import type { ProtoRuntime } from "./proto-runtime.js"; import type { MessageType } from "../message-type.js"; export type ExtensionFieldSource = extensionFieldRules | extensionFieldRules | (() => extensionFieldRules) | (() => extensionFieldRules); type extensionFieldRules = T extends { kind: "map"; } ? never : T extends { oneof: string; } ? never : T extends { oneof: OneofInfo; } ? never : Omit & Partial>; /** * Create a new extension using the given runtime. */ export declare function makeExtension = AnyMessage, V = unknown>(runtime: ProtoRuntime, typeName: string, extendee: MessageType, field: ExtensionFieldSource): Extension; /** * Create a container that allows us to read extension fields into it with the * same logic as regular fields. */ export declare function createExtensionContainer = AnyMessage, V = unknown>(extension: Extension): [Record, () => V]; type UnknownField = { no: number; wireType: WireType; data: Uint8Array; }; type UnknownFields = ReadonlyArray; /** * Helper to filter unknown fields, optimized based on field type. */ export declare function filterUnknownFields(unknownFields: UnknownFields, field: Pick): UnknownField[]; export {};