ErnstHot / TypeScript-for-Max

TypeScript for Cycling '74 Max
Other
90 stars 12 forks source link

Buffer Methods Defined as properties #33

Open devanecondition opened 6 months ago

devanecondition commented 6 months ago

The Buffer has two methods, framecount and channelcount like so:

const buffer = new Buffer("example");
const bufferLength = buffer.framecount();
const channelCount = buffer.channelcount();

However, they are defined as properties, so calling them gets errors like this:

Screen Shot 2024-04-21 at 12 30 36 PM

Would be happy to make a pull request for it, but I'm not quite sure how with this repo.

devanecondition commented 6 months ago

Also .peek() is defined as returning number[], which is actually what max's docs say it returns, but it's wrong, it just returns a number.

Screen Shot 2024-04-21 at 12 33 59 PM
twhiston commented 6 months ago

Hi, thanks for this. This repo is just some examples, the actual types are in the Definitely Typed repository so it would be great if you made a PR over there! https://github.com/DefinitelyTyped/DefinitelyTyped/blob/e536587970063e73aea4c2ed48e13158772ea0a8/types/maxmsp/index.d.ts#L2