Debian Codegraph @

node/@bufbuild/protobuf/dist/commonjs/fields.d.ts

raw
1 import type { MessageShape } from "./types.js";
2 import type { DescField, DescMessage } from "./descriptors.js";
3 /**
4 * Returns true if the field is set.
5 *
6 * - Scalar and enum fields with implicit presence (proto3):
7 * Set if not a zero value.
8 *
9 * - Scalar and enum fields with explicit presence (proto2, oneof):
10 * Set if a value was set when creating or parsing the message, or when a
11 * value was assigned to the field's property.
12 *
13 * - Message fields:
14 * Set if the property is not undefined.
15 *
16 * - List and map fields:
17 * Set if not empty.
18 */
19 export declare function isFieldSet<Desc extends DescMessage>(message: MessageShape<Desc>, field: DescField): boolean;
20 /**
21 * Resets the field, so that isFieldSet() will return false.
22 */
23 export declare function clearField<Desc extends DescMessage>(message: MessageShape<Desc>, field: DescField): void;