[auto-generated][maxmsp] Correct several signatures verified against Max for Live 8#74975
[auto-generated][maxmsp] Correct several signatures verified against Max for Live 8#74975nemtsov wants to merge 1 commit into
Conversation
Fixes verified against Max for Live 8 runtime, real-world public M4L
JS code, and the Cycling '74 apiref:
- Max.appath -> Max.apppath (typo; 13+ real usages of `apppath`, zero of `appath`).
- SQLite.begintransaction() -> SQLite.starttransaction() (runtime check:
`typeof db.starttransaction === "function"`, begintransaction is undefined).
- Removed Folder.append() (no such method; JSDoc was a duplicate of reset()'s).
Also replaced the stale "Documentation is faulty" JSDoc on Folder.reset().
- Sketch.glbegin(draw_prim: any[]) -> glbegin(draw_prim: string). Real
usages pass strings ('quad_strip', 'lines'); same class's shapeprim()
already takes a string with the same valid set.
- LiveAPI.id: number -> LiveAPI.id: string. Runtime check:
`typeof api.id === "string"` (returns e.g. "1"). Legacy vignette agrees
("Dynamic string identifier").
- Added LiveAPI.valid: number (readonly). Documented in apiref, present at
runtime, missing from the declaration.
- Added MGraphics methods missing from the file but present at runtime and
in widespread use: paint(), paint_with_alpha(), clear_surface(),
new_path(), image_surface_draw_fast().
- Task constructor JSDoc: clarified that the third+ args are spread as
separate arguments, not collected into one array (verified at runtime).
Updated maxmsp-tests.ts to match: testmax.apppath, mySQLite.starttransaction(),
sketchInstance.glbegin("lines").
|
@nemtsov Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through. This is a live comment that I will keep updated. 1 package in this PRCode ReviewsBecause you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it. You can test the changes of this PR in the Playground. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 74975,
"author": "nemtsov",
"headCommitOid": "1eeb3b5388ab73afdedb52017963143d698067fe",
"mergeBaseOid": "dafc26dc3da728f912025f73d2629374a9b1aba9",
"lastPushDate": "2026-05-10T13:54:49.000Z",
"lastActivityDate": "2026-05-10T15:10:20.000Z",
"hasMergeConflict": false,
"isFirstContribution": true,
"tooManyFiles": false,
"hugeChange": false,
"tooManyCommits": false,
"tooManyReviews": false,
"popularityLevel": "Well-liked by everyone",
"pkgInfo": [
{
"name": "maxmsp",
"kind": "edit",
"files": [
{
"path": "types/maxmsp/index.d.ts",
"kind": "definition"
},
{
"path": "types/maxmsp/maxmsp-tests.ts",
"kind": "test"
}
],
"owners": [
"twhiston",
"FrancescElies"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
}
],
"reviews": [],
"mainBotCommentID": 4415458707,
"ciResult": "pass"
} |
|
🔔 @twhiston @FrancescElies — please review this PR in the next few days. Be sure to explicitly select |
|
This PR creation was a bit premature. I'll reopen it when it's ready and I've manually tested all of the changes. Apologies for the notifications. |
|
No worries. I know these types generally need some updates for max 9 as well. Whenever these are ready I’ll be sure to give them a look. |
|
Thanks @twhiston ! I now ran the manual tests for everything in Update — runtime verification I verified each assertion in this PR against Max for Live 8 (8.5.8) using a small test script (bang-triggered, prints to the Max console). Results:
Notes on environment: probes ran in M4L 8.5.8 on macOS. The Happy to share the verification scripts if useful. |
|
I would suggest testing against the v8 object since js is effectively deprecated in modern max and these types will be targeting v8 from now on (you’d still be able to use an old version with the js object but since I don’t expect that cycling will make any future changes to it, but are actively improving v8, and most people are porting their stuff over to v8, it makes more sense for these to target that from now on) |
|
I'm, unfortunately, still on Live 11 with Max 8 (and without a |
This PR corrects several declarations in
types/maxmsp/index.d.tsthat wereverified against actual Max for Live 8 runtime behavior, public M4L source
code on GitHub, and the C74 apiref pages.
Changes
Max.appath→Max.apppath— typo. 13+ real-world usages on GitHub(
gh search code 'max.apppath' --language=javascript); zero usages ofmax.appath. C74 apiref also listsapppath(https://docs.cycling74.com/apiref/js/max/).
SQLite.begintransaction()→SQLite.starttransaction()— verified atruntime:
typeof db.starttransaction === "function",typeof db.begintransaction === "undefined". The C74 apiref names itstarttransaction(https://docs.cycling74.com/apiref/js/sqlite/).Removed
Folder.append()— the JSDoc was a duplicate ofreset()'sdescription and no Max code uses it. C74 apiref lists no such method
(https://docs.cycling74.com/apiref/js/folder/). Also replaced the stale
"Documentation is faulty, this has been reported." comment on
Folder.reset()with a real description.Sketch.glbegin(draw_prim: any[])→glbegin(draw_prim: string)—real usages pass strings (
'quad_strip',"lines"); the same class'sshapeprim(draw_prim: string)JSDoc enumerates the valid string primitives.LiveAPI.id: number→LiveAPI.id: string— runtime check:typeof api.id === "string"(returns e.g."1"). The legacy vignettecorrectly described it as "Dynamic string identifier"
(https://docs.cycling74.com/legacy/max8/vignettes/jsliveapi).
Added
LiveAPI.valid: number(readonly) — documented in the apirefand present at runtime, but missing from the declaration. JSDoc notes
that the property's reported value has been observed as
0even whenidis non-zero, so it is not a reliable guard in all Live versions.Added five
MGraphicsmethods previously missing —paint(),paint_with_alpha(),clear_surface(),new_path(),image_surface_draw_fast(). All are referenced either in widespreadpublic M4L code or in the Cycling '74 SDK's own
jsurfaceHTML doc.Taskconstructor JSDoc: clarified that the third+ arguments arespread as separate
arguments[i]entries, not collected into a singlearray. Verified at runtime:
new Task(fn, this, ["a","b","c"])resultsin
arguments.length === 1, witharguments[0]being the array.Test file
maxmsp-tests.tsupdated to match:testmax.apppath,mySQLite.starttransaction(),sketchInstance.glbegin("lines"). No newpublic symbols required new test cases beyond the renames.
Verification
dtslint types/maxmsp/runs clean (exit 0).cc @twhiston @FrancescElies (current owners per
package.json).