Skip to main content
Module

x/structurae/view-types.ts>ContainerView

Data structures for high-performance JavaScript applications.
Latest
interface ContainerView
implements DataView
import { type ContainerView } from "https://deno.land/x/structurae@4.0.1/view-types.ts";

Properties

size: number

The amount of items in the view.

Methods

[[Symbol.iterator]](): Generator<ViewInstance<T> | undefined>
at(index: number): T | undefined

Get the JavaScript value of an item.

get(index: number): T | undefined

Get the JavaScript value of an item.

getLength(index: number): number

Returns the byte length of an item at a given index.

getView(index: number): ViewInstance<T> | undefined

Returns the view of an item at a given index

indexOf(value: T, start?: number): number

Returns the index within the view of the first occurrence of the specified value, starting the search at start. Returns -1 if the value is not found.

set(index: number, value: T): void

Sets a given JavaScript value to an item at a given index.

setView(index: number, view: DataView): void

Sets a given view to an item at a given index.

toJSON(): Array<T | undefined>

Returns the JavaScript value of the view.