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.
27 lines • 1.55 kB
TypeScript
import { TTypedArrayCtor } from "../../array/typed-array/t-typed-array-ctor.js";
import { IEmscriptenWrapper } from "../emscripten/i-emscripten-wrapper.js";
import { ISharedArray } from "./i-shared-array.js";
import { ISharedArrayBindings } from "./i-shared-array-bindings.js";
import { IdSpecialization } from "../../runtime/rtti-interop.js";
import { type IManagedResourceNode } from "../../lifecycle/manged-resources.js";
import { SharedBufferView } from "../shared-memory/shared-buffer-view.js";
/**
* @public
*/
export declare const sharedArraySpecialization: IdSpecialization;
/**
* @public
* Typed array shared between wasm and javascript.
*/
export declare class SharedArray<TCtor extends TTypedArrayCtor> extends SharedBufferView<TCtor> implements ISharedArray<TCtor> {
/**
* @throws exception if allocation cannot be performed.
*/
static createOne<TCtor extends TTypedArrayCtor>(wrapper: IEmscriptenWrapper<ISharedArrayBindings>, containerType: TCtor, bindToReference: IManagedResourceNode | null, length: number, clearMemory?: boolean): SharedArray<TCtor>;
static createOne<TCtor extends TTypedArrayCtor>(wrapper: IEmscriptenWrapper<ISharedArrayBindings>, containerType: TCtor, bindToReference: IManagedResourceNode | null, length: number, clearMemory?: boolean, allocationFailThrows?: boolean): SharedArray<TCtor> | null;
readonly length: number;
readonly pointer: number;
getWrapper(): IEmscriptenWrapper<ISharedArrayBindings>;
private readonly cleanup;
}
//# sourceMappingURL=shared-array.d.ts.map