Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(dts): add missing types to support resizable arraybuffer
  • Loading branch information
indrajitbnikam committed Jun 13, 2023
commit 541081d463c775e000e028a972502932a3bbde4d
24 changes: 23 additions & 1 deletion src/lib/es5.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1668,6 +1668,21 @@ interface ArrayBuffer {
*/
readonly byteLength: number;

/**
* Read-only. The maximum length that this ArrayBuffer can be resized to (in bytes).
*/
readonly maxByteLength: number;

/**
* Read-only. Whether this ArrayBuffer can be resized or not.
*/
readonly resizable: boolean;

/**
* Resizes the ArrayBuffer to the specified size (in bytes).
*/
resize(newLength: number): undefined;

/**
* Returns a section of an ArrayBuffer.
*/
Expand All @@ -1682,9 +1697,16 @@ interface ArrayBufferTypes {
}
type ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes];

/**
* ArrayBuffer constructor options
*/
interface ArrayBufferOptions {
maxByteLength?: number;
}

interface ArrayBufferConstructor {
readonly prototype: ArrayBuffer;
new(byteLength: number): ArrayBuffer;
new(byteLength: number, options?: ArrayBufferOptions): ArrayBuffer;
isView(arg: any): arg is ArrayBufferView;
Comment thread
indrajitbnikam marked this conversation as resolved.
}
declare var ArrayBuffer: ArrayBufferConstructor;
Expand Down