Elius94 / console-gui-tools

A simple library to draw option menu or other popup inputs and layout on Node.js console.
MIT License
106 stars 17 forks source link

[Feature]: Change all class constructors parameters with one single object with optional props #60

Closed Elius94 closed 1 year ago

Elius94 commented 1 year ago

What do you want?

Convert all class constructors with a single parameter: An object with a type (Interface) defined, in order to better handle optional parameters, and to simplify coding.

Why do you want it?

To conform with current coding style standards and to facilitate the declaration of new classes.

@h-sifat mentioned this possibility in #54

// with a single object parameter
new Progress({
    x: 3,
    y: 23,
    length: 20,
    id: "prog1",
    thickness: 1,
    style: pStyle,
    theme: "htop",
    orientation: "horizontal",
});

// with multiple parameters
new Progress("prog1", 20, 1, 3, 23, pStyle, "htop", "horizontal")

How do you implement it?

To implement it you need to

All of this will go into forming the new Major Release (v3), as it compromises backwards compatibility because of the syntax change.

Are you interested in developing this feature?