Skip to content

[2.x] Incomplete type for mouseButton object - missing properties. (Types only) #8231

@nbogie

Description

@nbogie

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • p5.strands
  • WebGL
  • DevOps, Build process, Unit testing
  • Internationalization (i18n)
  • Friendly Errors
  • Other (specify if possible)

p5.js version

v2.1.0-rc.2

Web browser and version

n/a

Operating system

n/a

Steps to reproduce this

Steps:

Either:

Search for declare const mouseButton or middle in https://cdn.jsdelivr.net/npm/p5@2.1.0-rc.2/types/p5.d.ts

Or:

  1. import the v2.1.0-rc2 release into a typescript project

  2. write a sketch including any/all of these statements:

const a = p.mouseButton.left;
const b = p.mouseButton.right;
const c = p.mouseButton.middle;
  1. type-check the code
    It will fail to type-check as the properties left, right, middle are not in the generated types, though are present on the object at runtime, and an attempt has been made to add them in the jsdoc.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions