Debian Codegraph @

node/@bufbuild/protobuf/dist/esm/txtpb/is-group-like.d.ts

raw
1 import type { DescField, DescMessage } from "../descriptors.js";
2 /**
3 * Returns true if the field is structured like a proto2 group: a delimited
4 * message field whose name is the lowercase of its message type name, declared
5 * in the same scope as that message.
6 *
7 * The text format addresses such fields by their message type name (e.g.
8 * `MyGroup`) rather than their field name. This is a faithful port of
9 * protobuf-go's isGroupLike (internal/filedesc/desc.go), so editions delimited
10 * fields are treated exactly like proto2 groups.
11 *
12 * Testing `field.message` first narrows the DescField union to its three
13 * message-bearing variants (singular, list, and map value) — all of which carry
14 * `delimitedEncoding` — so it is in scope below without a cast. Maps are
15 * excluded automatically, because their `delimitedEncoding` is always false.
16 */
17 export declare function isGroupLike(field: DescField): field is DescField & {
18 message: DescMessage;
19 };