Skip to content

Conversation

@guan404ming
Copy link

Resolves #8415

Changes:

Previously, chainable methods on the main p5 class (like background(), stroke(), fill(), translate(), etc.) were typed to return void instead of p5 in the generated TypeScript definitions. This was due to an explicit exclusion condition options.currentClass !== 'p5' in the type generation logic.

  • Removes the exclusion so chainable methods on p5 return p5
  • Adds special handling for global mode to use P5 (the imported type) instead of p5 (which is a namespace in global.d.ts)

Screenshots of the change:

PR Checklist

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