-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only use sharedArrayBuffer if it is growable
- Loading branch information
Showing
3 changed files
with
55 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Adds definitions missing from TypeScript, this feature is available since Node.js 20 | ||
|
||
/** | ||
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/grow#specifications | ||
*/ | ||
interface SharedArrayBuffer { | ||
/** | ||
* returns whether this SharedArrayBuffer can be grow or not. | ||
*/ | ||
readonly growable: boolean | ||
|
||
/** | ||
* grows the SharedArrayBuffer to the specified size, in bytes. | ||
*/ | ||
grow(newLength: number): undefined | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters