StringFilterFields
A field's criteria accept its decoded shape as well as the text tmux sends: where({ active: true }) and where({ active: "1" }) are the same query, and serialize identically. A null criterion matches any wire value that the field decoder treats as absent or invalid, rather than one particular wire spelling.
Source and package
- Qualified name
-
StringFilter Fields - Module
- selection
- Package
- libtmux
- Source
- packages/libtmux/src/selection.ts
- type selection.StringFilterFields<Value = never, Raw extends string = string> = { readonly contains?: string; readonly endsWith?: string; readonly equals?: Value | Raw | null; readonly in?: readonly (Value | Raw)[]; readonly mode?: "insensitive"; readonly notIn?: readonly (Value | Raw)[]; readonly regex?: Regex
Criteria ; readonly startsWith?: string; }Data -
Description#
The text side exists because the wire does.
encodeFormatValuelowers every criterion to tmux's text before a query is serialized, andWhereDocumentV1types both what a caller writes and whatdecodeWhereDocument()gives back — so a type that refused text would be lying about the documents this library's own encoder produces. That is the difference from an ORM, whose query AST never round-trips through a type the caller also authors.Rawis therefore not a taste."0" | "1"is the exact wire domain for a flag, while an integer uses${bigint}intersected with a decimal prefix. That rules out fractions, exponents, radix prefixes, leading zeroes,-0,NaN, and prose. TypeScript cannot bound an integer's magnitude, so the query validator also requires safe range at runtime.format_values.test.tsholds the layers in step.The substring operations stay
stringdeliberately:containsasks about the characters tmux sent, and a numeric field's text has characters like any other.