UNPKG

rc-js-util

Version:

A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.

19 lines (17 loc) 645 B
import type { IManagedObject } from "../../lifecycle/manged-resources.js"; import type { ENumberIdentifier } from "../../runtime/rtti-interop.js"; import type { TTypedArrayCtor } from "./t-typed-array-ctor.js"; /** * @public * Wraps a buffer of some sort, providing a typed array view and some other metadata useful for interop. */ export interface IBuffer<TCtor extends TTypedArrayCtor> { readonly ctor: TCtor; readonly numberId: ENumberIdentifier; // size of the shared array readonly byteSize: number; getSharedObjectHandle(): IManagedObject | null; getDataView(): DataView; getArray(): InstanceType<TCtor>; }