Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dts): Update type of ArrayBuffer #54636

Open
indrajitbnikam opened this issue Jun 13, 2023 · 3 comments · May be fixed by #57858
Open

fix(dts): Update type of ArrayBuffer #54636

indrajitbnikam opened this issue Jun 13, 2023 · 3 comments · May be fixed by #57858
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this
Milestone

Comments

@indrajitbnikam
Copy link

indrajitbnikam commented Jun 13, 2023

lib Update Request

The problem is that proper types are not available when Resizable ArrayBuffer need to be created by passing options in the constructor.

Configuration Check

My compilation target is ESnext and my lib is the default.

Missing / Incorrect Definition

ArrayBuffer Constructor signature.

Sample Code

const buff = new ArrayBuffer(10, {
  maxByteLength: 100,
});

console.debug(buff.resizable);
console.debug(buff.byteLength);

buff.resize(100);
console.debug(buff.byteLength);

Documentation Link

You can check the signature over here.

ArrayBuffer() constructor

@RyanCavanaugh RyanCavanaugh added Working as Intended The behavior described is the intended behavior; this is not a bug Help Wanted You can do this Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Bug A bug in TypeScript and removed Working as Intended The behavior described is the intended behavior; this is not a bug labels Jun 14, 2023
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Jun 14, 2023
@RyanCavanaugh
Copy link
Member

Please post code, not screenshots of code.

This isn't part of a merged ECMAScript 2015, see https://github.com/tc39/proposal-resizablearraybuffer . This needs to go into ESnext first.

@indrajitbnikam
Copy link
Author

Sorry about the screenshots. I'll update the description with code.

@julien-c
Copy link

Note that https://github.com/tc39/proposal-resizablearraybuffer has landed in the spec now. So I think we could move ahead with this now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this
Projects
None yet
3 participants