TypeScript-DOM-lib-generator
                                
                                 TypeScript-DOM-lib-generator copied to clipboard
                                
                                    TypeScript-DOM-lib-generator copied to clipboard
                            
                            
                            
                        Certain types such as MouseEvent.button not defined
I noticed some values for types such as MouseEvent.button are defined in Web API specs but are not defined in lib.dom.ts:
0: Main button pressed, usually the left button or the un-initialized state
1: Auxiliary button pressed, usually the wheel button or the middle button (if present)
2: Secondary button pressed, usually the right button
3: Fourth button, typically the Browser Back button
4: Fifth button, typically the Browser Forward button
If this is intentional, I'm wondering what the rationale is. (I could not find any similar issues or couldn't find the right terms.)
terms: MouseEvent, button
My lib.dom.d.ts from ts4.5 has this in Line 12056:
/** Events that occur due to the user interacting with a pointing device (such as a mouse). Common events using this interface include click, dblclick, mouseup, mousedown. */
interface MouseEvent extends UIEvent {
    readonly altKey: boolean;
    readonly button: number;
Or do you want to have this?
readonly button: 0|1|2|3|4;
Since the spec defines meaning for the values I was looking for something more like:
declare const BUTTON_MAIN: 0;
declare const BUTTON_MIDDLE: 1;
declare const BUTTON_RIGHT: 2;
...
They are not defined in the browsers (others like WebSocket.CLOSED are).
So defining them would be an TypeScript only invention. I don't think this would align to the mission of TypeScript.
I think this is well answered 👍
@github-actions close
Closing because @saschanaz is one of the code-owners of this repository.