Class Box
Hierarchy
- Cell<V>
- Box (View Summary)
Accessors
area
Returns Num
bottom
Returns Vec
center
Returns Vec
h
Returns this extends WritableBrand ? Writable<Num> : Num
left
Returns Vec
right
Returns Vec
top
Returns Vec
w
Returns this extends WritableBrand ? Writable<Num> : Num
x
Returns this extends WritableBrand ? Writable<Num> : Num
y
Returns this extends WritableBrand ? Writable<Num> : Num
Methods
add
Parameters
- b: Val<V>
Returns this
at
Parameters
- u: number
- v: number
Returns Vec
contains
True when
pis inside the box. A writableVecyields aWritable<Bool>: flipping it clampspto the nearest in-box point (true) or ejects it past the nearest edge (false). Literal/RO inputs yield a read-onlyBool.Type Parameters
- P extends Val<V>
Parameters
- p: P
Returns P extends WritableBrand ? Writable<Bool> : Bool
derive
Read-only same-type view: the RO dual of the endo
.lens. For a cross-type view use the typed staticTarget.derive(src, fn).Parameters
- this: Cell<V>
- fn: (v: V) => V
Returns this
expand
Parameters
- n: Val<number>
Returns this
lens
Endomorphic lens. A 2-arg
bwd(view, current)consults the current source; a 1-argbwd(view)reconstructs it from the view alone.Parameters
- this: Cell<V>
- fwd: (v: V) => V
- bwd: (target: V, current: V) => V
Returns this
lerp
merge
peek
Returns V
scale
Parameters
- k: Val<number>
Returns this
sub
Parameters
- b: Val<V>
Returns this
through
to
Staticcoerce
Staticderive
Staticis
Staticlens
- lens<C extends AnyCellCtor, P>(
this: C,
parent: Read<P>,
fwd: (v: P) => Inner<InstanceType<C>>,
bwd: (target: Inner<InstanceType<C>>, v: P) => P,
): Writable<InstanceType<C>>Writable lens.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N; a 2-argbwdreads the source, a 1-argbwdreconstructs it.Cls.lens(parent(s), spec)builds a complement-carrying lens from{ init, step, fwd, bwd }.Type Parameters
- C extends AnyCellCtor
- P
Parameters
Returns Writable<InstanceType<C>>
- lens<C extends AnyCellCtor, P extends readonly Read<unknown>[]>(
this: C,
parents: P,
fwd: (vals: ReadValues<P>) => Inner<InstanceType<C>>,
bwd: (
target: Inner<InstanceType<C>>,
vals: ReadValues<P>,
) => BackUpdates<ReadValuesOrSkip<P>>,
): Writable<InstanceType<C>>Writable lens.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N; a 2-argbwdreads the source, a 1-argbwdreconstructs it.Cls.lens(parent(s), spec)builds a complement-carrying lens from{ init, step, fwd, bwd }.Type Parameters
- C extends AnyCellCtor
- P extends readonly Read<unknown>[]
Parameters
Returns Writable<InstanceType<C>>
- lens<C extends AnyCellCtor, P, Cm>(
this: C,
parent: Read<P>,
spec: StatefulLensSpec1<P, Inner<InstanceType<C>>, Cm>,
): Writable<InstanceType<C>>Writable lens.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N; a 2-argbwdreads the source, a 1-argbwdreconstructs it.Cls.lens(parent(s), spec)builds a complement-carrying lens from{ init, step, fwd, bwd }.Type Parameters
- C extends AnyCellCtor
- P
- Cm
Returns Writable<InstanceType<C>>
- lens<C extends AnyCellCtor, P extends readonly Read<unknown>[], Cm>(
this: C,
parents: P,
spec: StatefulLensSpec<ReadValues<P>, Inner<InstanceType<C>>, Cm>,
): Writable<InstanceType<C>>Writable lens.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N; a 2-argbwdreads the source, a 1-argbwdreconstructs it.Cls.lens(parent(s), spec)builds a complement-carrying lens from{ init, step, fwd, bwd }.Type Parameters
- C extends AnyCellCtor
- P extends readonly Read<unknown>[]
- Cm
Returns Writable<InstanceType<C>>
Staticpin
Properties
Readonly_t
name
Optional debug label (cell(0, { name })); used by errors and graph dumps.
Vec at parametric
(u, v)in[0,1]². Not memoised; use the named edge getters (.center,.top, …) for stable identity.