memory.d.ts 775 B

123456789101112131415161718
  1. import { EitherModule } from "./emscripten-types";
  2. import { OwnedHeapCharPointer, JSContextPointerPointer, JSValueConstPointerPointer, JSValuePointerPointer } from "./types-ffi";
  3. import { Lifetime } from "./lifetime";
  4. import { QuickJSHandle } from "./types";
  5. /**
  6. * @private
  7. */
  8. export declare class ModuleMemory {
  9. module: EitherModule;
  10. constructor(module: EitherModule);
  11. toPointerArray(handleArray: QuickJSHandle[]): Lifetime<JSValueConstPointerPointer>;
  12. newMutablePointerArray<T extends JSContextPointerPointer | JSValuePointerPointer>(length: number): Lifetime<{
  13. typedArray: Int32Array;
  14. ptr: T;
  15. }>;
  16. newHeapCharPointer(string: string): Lifetime<OwnedHeapCharPointer>;
  17. consumeHeapCharPointer(ptr: OwnedHeapCharPointer): string;
  18. }