contextDecls
contextDecls(
desc):Decl[]
Defined in: packages/aip/src/filtering/context.ts:21
Generate filter type declarations from a protobuf message descriptor. Each field on the message becomes a top-level ident declaration, allowing filter expressions to reference fields directly without a prefix.
Parameters
Section titled “Parameters”DescMessage
Returns
Section titled “Returns”Decl[]
Example
Section titled “Example”import { TimestampSchema } from "@bufbuild/protobuf/wkt";
const decls = contextDecls(TimestampSchema);// → [ident("seconds", INT64), ident("nanos", INT64)]
const { checkedExpr } = check(parsed, { decls });// filter: "seconds < 4 AND nanos > 50"