IntervalParts
An interval's two ends as written, and whether each one is in it.
@internote/canvas-sdkOn this page
import { IntervalParts } from '@internote/canvas-sdk';The brackets are decoration: [a, b] and (a, b) say the same thing, and either kind may be used as long as it balances — which is the whole reason this reads markers instead of brackets. [a, b) is the notation everyone knows and the compiler will not accept it: it counts brackets before it ever reaches an attribute value, and an unmatched [ ends the document.
So each END carries its own mark, and both combinations are writable:
[0, 8]is 0 ≤ x ≤ 8: an end with no mark is IN the interval.[0, <8]is 0 ≤ x < 8:<is up to but not including.[>0, 8]is 0 < x ≤ 8:>is from but not including.[>0, <8]is 0 < x < 8.[=0, 8]is 0 ≤ x ≤ 8:=says "and equal to", if you want it said.
An end left empty is unbounded, which is how a one-sided interval is written — the mark on the end that IS there still applies:
[, =4]is x ≤ 4: everything up to and including 4.[, <4]is x < 4.[=-5, ]is x ≥ -5.[>-5, ]is x > -5.
Splitting is done by counting depth rather than by matching, so an endpoint may be any expression: [0, exp(1)] and [>k, <2 * k] both read.
#Fields
endinf where it was left empty.stringinclusiveEnd< and for an unbounded end.booleaninclusiveStart> and for an unbounded end.booleanstart-inf where it was left empty.stringDeclared in packages/canvas-sdk/src/refine/value-refiners.ts:69.