Skip to content

DataView: jsdoc about some methods #48557

@dev-itsheng

Description

@dev-itsheng

lib Update Request

Configuration Check

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

Missing / Incorrect Definition

In the process of using TypeScript, I found that some method prompts are missing some parameters:

see this playground link

The setFloat32 method takes three parameters, as does the tsdoc prompt:

image

The getFloat32 method has two parameters, but the tsdoc prompt only has one:

image

I realized this needed to be fixed, so tried making this change.

Originally, I wanted to submit a Pull Request directly, but it is required that a PR must be associated with an Issue, so I will raise an Issue here first, and then fix it.

Sample Code

// create an ArrayBuffer with a size in bytes
const buffer = new ArrayBuffer(16);

const view = new DataView(buffer);
view.setFloat32(1, Math.PI);

console.log(view.getFloat32(1));
// expected output: 3.1415927410125732

Besides that, I have one more question:

In order to understand how TypeScript works, I tried to read part of its source code, but there are also problems with some jsdoc in the source code, like here, this function has two parameters, but the jsdoc only writes one, and I observed that Pull Request does not allow to submit issues about typo, should I try to fix them?

I have modified incorrect jsdoc for 21 files under src/compiler folder, I can submit them if needed.

Documentation Link

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions