/** * Descriptor-based protobuf mask operations. Helpers return copies of messages. * * @packageDocumentation */ import { Mask } from './fieldmask.js'; import { type MessageDescriptor, type MessageFieldDescriptor, type MessageFns } from './protos/core.js'; import type { MaskConversionOptions } from './resetmask.js'; /** Lists all protobuf field paths, including wildcard collection elements. */ export declare function knownFieldsFromDescriptor(desc: MessageDescriptor, options?: MaskConversionOptions, depth?: number): Mask; /** Lists the fields defined by a generated message. Recursive schemas throw at depth 1,000. */ export declare function knownFieldsFromMessage(message: object, options?: MaskConversionOptions): Mask; /** Identifies formerly populated fields that now need an explicit reset. */ export declare function resetMaskFromModified(initial: T, modified: T, options?: MaskConversionOptions): Mask; /** Filters a copy; unselected list indexes retain default placeholders unless reduceLists is true. */ export declare function filterWithSelectMask(type: MessageFns, message: T, mask: Mask | string, reduceLists?: boolean): T; /** Applies a patch to a copy, preserving output-only fields and unmasked default values. */ export declare function patchWithResetMask(type: MessageFns, data: T, patch: P, mask?: Mask | string | null, patchType?: MessageFns): T; /** Reads a protobuf path, using field names, map keys, and list indexes. */ export declare function getAtFieldPath(message: object, path: import('./fieldmask.js').FieldPath | string): unknown; /** Replaces a field in a copy. Undefined clears fields or removes collection entries. */ export declare function replaceAtFieldPath(type: MessageFns, message: T, path: import('./fieldmask.js').FieldPath | string, replacement: unknown): T; /** Defines one selected value visited by protobuf traversal. */ export interface ProtobufVisit { /** Contains the visited value in its native JS representation. */ value: unknown; /** Describes the visited protobuf field or collection element. */ descriptor: MessageFieldDescriptor; /** Contains field names and collection keys leading to this value. */ path: readonly string[]; /** Contains the selection applied beneath this path. */ innerMask: Mask | null; } /** Visits populated selected fields. Return false to stop. Leaf masks stop descent. */ export declare function traverseMessage(message: object, mask: Mask | string | null, visit: (entry: ProtobufVisit) => boolean | void, order?: 'depth' | 'breadth'): void; //# sourceMappingURL=protobuf_mask.d.ts.map