Appearance
meos.js / TBool
Class: TBool
Defined in: core/types/basic/tbool/TBool.ts:52
Temporal boolean type.
Wraps a MEOS TBool pointer and exposes boolean-specific operations on top of the generic Temporal API defined in Temporal.ts.
Supports all three subtypes (Instant, Sequence, SequenceSet) through the same class - the subtype is determined by the WKT string at parse time.
Example
ts
await initMeos();
const t = TBool.fromString('{true@2001-01-01, false@2001-01-02}');
console.log(t.startValue()); // true
console.log(t.toString()); // {t@2001-01-01 00:00:00+00, f@2001-01-02 00:00:00+00}
t.free();Extends
Temporal<boolean>
Extended by
Constructors
Constructor
ts
new TBool(inner): TBool;Defined in: core/types/basic/tbool/TBool.ts:61
Wrap a raw WASM pointer. The caller must ensure the pointer is a valid MEOS TBool*.
Parameters
inner
number
Returns
TBool
Overrides
ts
Temporal<boolean>.constructorAccessors
inner
Get Signature
ts
get inner(): number;Defined in: core/types/temporal/Temporal.ts:173
Raw WASM pointer. Use when passing this value to low-level functions.
Returns
number
Inherited from
ts
Temporal.innerMethods
[dispose]()
ts
dispose: void;Defined in: core/types/temporal/Temporal.ts:191
Explicit Resource Management support. Allows using t = TBool.fromString(...) to free automatically.
Returns
void
Inherited from
ts
Temporal.[dispose]alwaysEq()
ts
alwaysEq(b): boolean;Defined in: core/types/basic/tbool/TBool.ts:234
Returns true if the value is always equal to b.
See everEq for the > 0 conversion rationale.
MEOS: always_eq_tbool_bool
Parameters
b
boolean
Returns
boolean
and()
ts
and(other): TBool;Defined in: core/types/basic/tbool/TBool.ts:175
Temporal conjunction with another TBool or a constant boolean. MEOS: tand_tbool_tbool / tand_tbool_bool
Parameters
other
boolean | TBool
Returns
TBool
appendInstant()
ts
appendInstant(
inst,
maxdist?,
maxt?,
expand?): this;Defined in: core/types/temporal/Temporal.ts:528
Appends an instant to this temporal, returning a new temporal. MEOS: temporal_append_tinstant
Parameters
inst
this
The instant to append (same subtype as this).
maxdist?
number = 0
Maximum distance gap allowed (0 = no limit).
maxt?
number = 0
Maximum time gap as interval pointer (0 = no limit).
expand?
boolean = false
Whether to expand the sequence in-place.
Returns
this
Inherited from
ts
Temporal.appendInstantappendSequence()
ts
appendSequence(seq, expand?): this;Defined in: core/types/temporal/Temporal.ts:538
Appends a sequence to this temporal, returning a new temporal. MEOS: temporal_append_tsequence
Parameters
seq
this
expand?
boolean = false
Returns
this
Inherited from
ts
Temporal.appendSequenceasHexWKB()
ts
asHexWKB(): string;Defined in: core/types/temporal/Temporal.ts:213
Returns the hex-encoded WKB representation.
Uses the hand-written temporal_as_hexwkb_w wrapper which internally passes variant=4 (extended WKB) and discards size_out.
MEOS: temporal_as_hexwkb
Returns
string
Inherited from
ts
Temporal.asHexWKBasMFJSON()
ts
asMFJSON(
withBbox?,
flags?,
precision?,
srs?): string;Defined in: core/types/temporal/Temporal.ts:235
Returns the MF-JSON representation.
The hand-written wrapper converts an empty srs string to C NULL so that callers can omit the SRS without passing a null pointer directly.
MEOS: temporal_as_mfjson
Parameters
withBbox?
boolean = true
Include bounding box in the output (default true)
flags?
number = 3
Output flags (default 3)
precision?
number = 6
Coordinate decimal precision (default 6)
srs?
string | null
Spatial Reference System string, or null to omit
Returns
string
Inherited from
ts
Temporal.asMFJSONat()
ts
at(b): TBool;Defined in: core/types/basic/tbool/TBool.ts:199
Restrict to instants where the value equals b. MEOS: tbool_at_value
Parameters
b
boolean
Returns
TBool
atMax()
ts
atMax(): this;Defined in: core/types/temporal/Temporal.ts:406
Restricts to instants where the value is the maximum. MEOS: temporal_at_max
Returns
this
Inherited from
ts
Temporal.atMaxatMin()
ts
atMin(): this;Defined in: core/types/temporal/Temporal.ts:401
Restricts to instants where the value is the minimum. MEOS: temporal_at_min
Returns
this
Inherited from
ts
Temporal.atMinatTsTzSet()
ts
atTsTzSet(s): this;Defined in: core/types/temporal/Temporal.ts:425
Restricts to the given timestamp set. MEOS: temporal_at_tstzset
Parameters
s
number
Returns
this
Inherited from
ts
Temporal.atTsTzSetatTsTzSpan()
ts
atTsTzSpan(s): this;Defined in: core/types/temporal/Temporal.ts:430
Restricts to the given timestamp span. MEOS: temporal_at_tstzspan
Parameters
s
number
Returns
this
Inherited from
ts
Temporal.atTsTzSpanatTsTzSpanSet()
ts
atTsTzSpanSet(ss): this;Defined in: core/types/temporal/Temporal.ts:435
Restricts to the given timestamp span set. MEOS: temporal_at_tstzspanset
Parameters
ss
number
Returns
this
Inherited from
ts
Temporal.atTsTzSpanSetcopy()
ts
copy(): this;Defined in: core/types/temporal/Temporal.ts:199
Returns a deep copy of this temporal value. MEOS: temporal_copy
Returns
this
Inherited from
ts
Temporal.copydurationMs()
ts
durationMs(ignoreGaps?): number;Defined in: core/types/temporal/Temporal.ts:385
Returns the total duration as a number of milliseconds.
Uses the hand-written temporal_duration_us_w wrapper which converts the MEOS Interval* return value to a plain int64 (total microseconds). The result is divided by 1000 to return milliseconds.
Pass ignoreGaps=true to sum only sequence durations, ignoring the time gaps between sequences in a SequenceSet.
MEOS: temporal_duration
Parameters
ignoreGaps?
boolean = false
Returns
number
Inherited from
ts
Temporal.durationMsendInstant()
ts
endInstant(): this;Defined in: core/types/temporal/Temporal.ts:286
Returns the last instant as a new instance of the same subtype. MEOS: temporal_end_instant
Returns
this
Inherited from
ts
Temporal.endInstantendTimestamp()
ts
endTimestamp(): number;Defined in: core/types/temporal/Temporal.ts:362
Returns the last timestamp as microseconds since 2000-01-01 UTC. MEOS: temporal_end_timestamptz
Returns
number
Inherited from
ts
Temporal.endTimestampendValue()
ts
endValue(): boolean;Defined in: core/types/basic/tbool/TBool.ts:155
Ending value of the temporal. MEOS: tbool_end_value
Returns
boolean
Overrides
ts
Temporal.endValueequals()
ts
equals(other): boolean;Defined in: core/types/temporal/Temporal.ts:558
Pointer-based identity check. For value equality, use the generated teq_* / temporal_eq functions.
Parameters
other
Temporal<boolean>
Returns
boolean
Inherited from
ts
Temporal.equalseverEq()
ts
everEq(b): boolean;Defined in: core/types/basic/tbool/TBool.ts:223
Returns true if the value is ever equal to b.
MEOS ever/always functions return int (-1 on error, 0 for false, 1 for true). The > 0 conversion maps this to a boolean, treating errors as false.
MEOS: ever_eq_tbool_bool
Parameters
b
boolean
Returns
boolean
free()
ts
free(): void;Defined in: core/types/temporal/Temporal.ts:183
Frees the underlying MEOS allocation.
After calling free(), the instance must not be used. Calls the hand-written meos_free wrapper from res/bindings_c_header.txt.
Returns
void
Inherited from
ts
Temporal.freeinstantN()
ts
instantN(n): this;Defined in: core/types/temporal/Temporal.ts:320
Returns the n-th instant (0-based index).
Uses the hand-written temporal_instant_n_w wrapper which converts the 0-based JS index to the 1-based index expected by MEOS internally.
MEOS: temporal_instant_n
Parameters
n
number
Returns
this
Inherited from
ts
Temporal.instantNinterpolation()
ts
interpolation(): TInterpolation;Defined in: core/types/temporal/Temporal.ts:248
Returns the interpolation mode of this temporal value. MEOS: temporal_interp
Returns
Inherited from
ts
Temporal.interpolationmaxInstant()
ts
maxInstant(): this;Defined in: core/types/temporal/Temporal.ts:306
Returns the instant with the maximum value. MEOS: temporal_max_instant
Returns
this
Inherited from
ts
Temporal.maxInstantmerge()
ts
merge(other): this;Defined in: core/types/temporal/Temporal.ts:546
Merges this temporal with another, returning a new temporal. MEOS: temporal_merge
Parameters
other
this
Returns
this
Inherited from
ts
Temporal.mergeminInstant()
ts
minInstant(): this;Defined in: core/types/temporal/Temporal.ts:296
Returns the instant with the minimum value. MEOS: temporal_min_instant
Returns
this
Inherited from
ts
Temporal.minInstantminus()
ts
minus(b): TBool;Defined in: core/types/basic/tbool/TBool.ts:207
Restrict to instants where the value differs from b. MEOS: tbool_minus_value
Parameters
b
boolean
Returns
TBool
minusMax()
ts
minusMax(): this;Defined in: core/types/temporal/Temporal.ts:416
Excludes instants where the value is the maximum. MEOS: temporal_minus_max
Returns
this
Inherited from
ts
Temporal.minusMaxminusMin()
ts
minusMin(): this;Defined in: core/types/temporal/Temporal.ts:411
Excludes instants where the value is the minimum. MEOS: temporal_minus_min
Returns
this
Inherited from
ts
Temporal.minusMinminusTsTzSet()
ts
minusTsTzSet(s): this;Defined in: core/types/temporal/Temporal.ts:440
Excludes the given timestamp set. MEOS: temporal_minus_tstzset
Parameters
s
number
Returns
this
Inherited from
ts
Temporal.minusTsTzSetminusTsTzSpan()
ts
minusTsTzSpan(s): this;Defined in: core/types/temporal/Temporal.ts:445
Excludes the given timestamp span. MEOS: temporal_minus_tstzspan
Parameters
s
number
Returns
this
Inherited from
ts
Temporal.minusTsTzSpanminusTsTzSpanSet()
ts
minusTsTzSpanSet(ss): this;Defined in: core/types/temporal/Temporal.ts:450
Excludes the given timestamp span set. MEOS: temporal_minus_tstzspanset
Parameters
ss
number
Returns
this
Inherited from
ts
Temporal.minusTsTzSpanSetneverEq()
ts
neverEq(b): boolean;Defined in: core/types/basic/tbool/TBool.ts:242
Returns true if the value is never equal to b. Implemented as the logical complement of everEq.
Parameters
b
boolean
Returns
boolean
not()
ts
not(): TBool;Defined in: core/types/basic/tbool/TBool.ts:167
Temporal negation: returns a new TBool with all values flipped. MEOS: tnot_tbool
Returns
TBool
numInstants()
ts
numInstants(): number;Defined in: core/types/temporal/Temporal.ts:263
Returns the number of distinct instants in this temporal value. MEOS: temporal_num_instants
Returns
number
Inherited from
ts
Temporal.numInstantsnumTimestamps()
ts
numTimestamps(): number;Defined in: core/types/temporal/Temporal.ts:334
Returns the number of distinct timestamps. MEOS: temporal_num_timestamps
Returns
number
Inherited from
ts
Temporal.numTimestampsor()
ts
or(other): TBool;Defined in: core/types/basic/tbool/TBool.ts:185
Temporal disjunction with another TBool or a constant boolean. MEOS: tor_tbool_tbool / tor_tbool_bool
Parameters
other
boolean | TBool
Returns
TBool
scaleTime()
ts
scaleTime(duration): this;Defined in: core/types/temporal/Temporal.ts:464
Scales the temporal domain to the given duration interval pointer. MEOS: temporal_scale_time
Parameters
duration
number
Returns
this
Inherited from
ts
Temporal.scaleTimesetInterp()
ts
setInterp(interp): this;Defined in: core/types/temporal/Temporal.ts:478
Returns a new temporal with the interpolation changed to interp. Pass TInterpolation values as numbers: Discrete=0, Stepwise=1, Linear=2. MEOS: temporal_set_interp
Parameters
interp
Returns
this
Inherited from
ts
Temporal.setInterpshiftScaleTime()
ts
shiftScaleTime(shift, duration): this;Defined in: core/types/temporal/Temporal.ts:469
Shifts and scales the temporal domain. MEOS: temporal_shift_scale_time
Parameters
shift
number
duration
number
Returns
this
Inherited from
ts
Temporal.shiftScaleTimeshiftTime()
ts
shiftTime(shift): this;Defined in: core/types/temporal/Temporal.ts:459
Shifts the temporal domain by the given interval pointer. MEOS: temporal_shift_time
Parameters
shift
number
Returns
this
Inherited from
ts
Temporal.shiftTimestartInstant()
ts
startInstant(): this;Defined in: core/types/temporal/Temporal.ts:276
Returns the first instant as a new instance of the same subtype. MEOS: temporal_start_instant
Returns
this
Inherited from
ts
Temporal.startInstantstartTimestamp()
ts
startTimestamp(): number;Defined in: core/types/temporal/Temporal.ts:347
Returns the first timestamp as microseconds since 2000-01-01 UTC. MEOS: temporal_start_timestamptz
Returns
number
Inherited from
ts
Temporal.startTimestampstartValue()
ts
startValue(): boolean;Defined in: core/types/basic/tbool/TBool.ts:147
Starting value of the temporal. MEOS: tbool_start_value
Returns
boolean
Overrides
ts
Temporal.startValuetemporalEq()
ts
temporalEq(b): TBool;Defined in: core/types/basic/tbool/TBool.ts:254
Returns a TBool that is true at each instant where this equals b. MEOS: teq_tbool_bool
Parameters
b
boolean
Returns
TBool
temporalNe()
ts
temporalNe(b): TBool;Defined in: core/types/basic/tbool/TBool.ts:262
Returns a TBool that is true at each instant where this differs from b. MEOS: tne_tbool_bool
Parameters
b
boolean
Returns
TBool
toInstant()
ts
toInstant(): this;Defined in: core/types/temporal/Temporal.ts:489
Converts to TInstant (must already be an instant). MEOS: temporal_to_tinstant
Returns
this
Inherited from
ts
Temporal.toInstanttoSequence()
ts
toSequence(interp): this;Defined in: core/types/temporal/Temporal.ts:494
Converts to TSequence with the given interpolation. MEOS: temporal_to_tsequence
Parameters
interp
Returns
this
Inherited from
ts
Temporal.toSequencetoSequenceSet()
ts
toSequenceSet(interp): this;Defined in: core/types/temporal/Temporal.ts:505
Converts to TSequenceSet with the given interpolation. MEOS: temporal_to_tsequenceset
Parameters
interp
Returns
this
Inherited from
ts
Temporal.toSequenceSettoString()
ts
toString(): string;Defined in: core/types/basic/tbool/TBool.ts:139
WKT string representation. MEOS: tbool_out
Returns
string
Overrides
ts
Temporal.toStringtoTInt()
ts
toTInt(): number;Defined in: core/types/basic/tbool/TBool.ts:328
Converts this TBool to a TInt (true → 1, false → 0) and returns the raw WASM pointer. Use new TInt(ptr) to obtain a typed object. MEOS: tbool_to_tint
Returns
number
valueAtTimestamp()
ts
valueAtTimestamp(t): boolean | null;Defined in: core/types/basic/tbool/TBool.ts:311
Evaluates the temporal at a specific timestamp. Returns null when the timestamp is outside the temporal's domain.
Parameters
t
number
Timestamp in microseconds since 2000-01-01 UTC.
Returns
boolean | null
valueN()
ts
valueN(n): boolean;Defined in: core/types/basic/tbool/TBool.ts:298
Returns the n-th distinct value (0-based index) across all instants.
Parameters
n
number
0-based index (MEOS internally uses 1-based indexing). MEOS: tbool_value_n
Returns
boolean
whenFalse()
ts
whenFalse(): TsTzSpanSet;Defined in: core/types/basic/tbool/TBool.ts:282
Returns the set of time periods where this temporal is false. MEOS: tnot_tbool + tbool_when_true
Returns
whenTrue()
ts
whenTrue(): TsTzSpanSet;Defined in: core/types/basic/tbool/TBool.ts:274
Returns the set of time periods where this temporal is true. MEOS: tbool_when_true
Returns
fromBaseTemporal()
ts
static fromBaseTemporal(b, domain): TBool;Defined in: core/types/basic/tbool/TBool.ts:91
Create a TBool with constant value b spanning the same domain as domain. MEOS: tbool_from_base_temp
Parameters
b
boolean
domain
TBool
Returns
TBool
fromBaseTime()
ts
static fromBaseTime(
b,
time,
type): TBool;Defined in: core/types/basic/tbool/TBool.ts:100
Create a TBool with constant value b over a time object. Accepts a raw Ptr to a TsTzSet, TsTzSpan, or TsTzSpanSet. MEOS: tboolseq_from_base_tstzset / tstzspan / tboolseqset_from_base_tstzspanset
Parameters
b
boolean
time
number
type
"tstzset" | "tstzspan" | "tstzspanset"
Returns
TBool
fromInstant()
ts
static fromInstant(value, timestamp): TBool;Defined in: core/types/basic/tbool/TBool.ts:123
Create a TBoolInst from a boolean value and a timestamp.
Parameters
value
boolean
The boolean value.
timestamp
number
Microseconds since 2000-01-01 UTC (TimestampTz).
MEOS: tboolinst_make
Returns
TBool
fromMFJSON()
ts
static fromMFJSON(mfjson): TBool;Defined in: core/types/basic/tbool/TBool.ts:83
Parse a TBool from a MF-JSON string. MEOS: tbool_from_mfjson
Parameters
mfjson
string
Returns
TBool
fromString()
ts
static fromString(wkt): TBool;Defined in: core/types/basic/tbool/TBool.ts:75
Parse a TBool from a WKT string.
Accepts all subtypes: Instant: "true@2001-01-01" Sequence: "[true@2001-01-01, false@2001-01-02]" SequenceSet: "{[true@2001-01-01, false@2001-01-02], [true@2001-01-03]}"
MEOS: tbool_in
Parameters
wkt
string
Returns
TBool