import type { Message } from "./message.js"; import type { BinaryReadOptions, BinaryWriteOptions } from "./binary-format.js"; import type { Extension } from "./extension.js"; /** * Retrieve an extension value from a message. * * The function never returns undefined. Use hasExtension() to check whether an * extension is set. If the extension is not set, this function returns the * default value (if one was specified in the protobuf source), or the zero value * (for example `0` for numeric types, `[]` for repeated extension fields, and * an empty message instance for message fields). * * Extensions are stored as unknown fields on a message. To mutate an extension * value, make sure to store the new value with setExtension() after mutating. * * If the extension does not extend the given message, an error is raised. */ export declare function getExtension, V>(message: E, extension: Extension, options?: Partial): V; /** * Set an extension value on a message. If the message already has a value for * this extension, the value is replaced. * * If the extension does not extend the given message, an error is raised. */ export declare function setExtension, V>(message: E, extension: Extension, value: V, options?: Partial): void; /** * Remove an extension value from a message. * * If the extension does not extend the given message, an error is raised. */ export declare function clearExtension, V>(message: E, extension: Extension): void; /** * Check whether an extension is set on a message. */ export declare function hasExtension, V>(message: E, extension: Extension): boolean;