Skip to content

piu typings: fix onTouchEnded typo, Image.frameCount, firstThat/lastThat return#1651

Open
meganetaaan wants to merge 1 commit into
Moddable-OpenSource:publicfrom
meganetaaan:fix/piu-typings-bugs
Open

piu typings: fix onTouchEnded typo, Image.frameCount, firstThat/lastThat return#1651
meganetaaan wants to merge 1 commit into
Moddable-OpenSource:publicfrom
meganetaaan:fix/piu-typings-bugs

Conversation

@meganetaaan

Copy link
Copy Markdown
Contributor

Summary

Three small, verified bug fixes in the Piu MC TypeScript definitions (typings/piu/MC-types.d.ts). No runtime code is touched.

  • Behavior.onTouchendedonTouchEnded — the callback was mis-spelled, so the typed handler never matched Piu's actual onTouchEnded event and was silently ignored. Confirmed against documentation/piu/piu.md (uses onTouchEnded throughout).
  • Image.frameCount: nevernumbernever is incorrect; the native getter returns an integer (xsIntegerValue frameCount in modules/piu/MC/piuMC.h).
  • Container.firstThat / lastThat: voidContent | undefined — both return the content whose handler returned true, otherwise undefined. Confirmed in modules/piu/All/piuContainer.c (xsResult = xsVar(1)), consistent with the docs describing traversal halting when a distributed event returns true.

Verification

tsc --noEmit --strict passes on the edited definition file.

…hat return

- Behavior.onTouchended -> onTouchEnded (matches Piu's event name; the
  mis-spelled callback was never invoked at runtime)
- Image.frameCount: never -> number (native getter returns an integer)
- Container.firstThat/lastThat: void -> Content | undefined (they return
  the content whose handler returned true, else undefined)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant