Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 of 2 tasks
Elius94 opened this issue Jan 12, 2023 · 0 comments
Closed
1 of 2 tasks
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Elius94
Copy link
Owner

Elius94 commented Jan 12, 2023

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

  • Take some time to create the Typescript interfaces of each constructor
  • Update all constructors and all class instances already called internally
  • Test that EVERYTHING works exactly as before
  • Document the newly created types
  • Run npm run docs to update the code documentation
  • Update the README.md and explain how to migrate to the new version.

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?

  • Yes, I am interested in developing this feature
  • No, I am not interested in developing this feature
@Elius94 Elius94 added the enhancement New feature or request label Jan 12, 2023
@Elius94 Elius94 modified the milestones: 2.2.0, 3.0.0 Jan 12, 2023
@Elius94 Elius94 self-assigned this Jan 24, 2023
Elius94 added a commit that referenced this issue Jan 26, 2023
…bject with optional props

Fixes #60

Added Config object to progress
Added HTOP example

Fixed ESBUILD Script
Elius94 added a commit that referenced this issue Jan 26, 2023
…bject with optional props

Fixes #60

Edited ConsoleManager Class
Elius94 added a commit that referenced this issue Jan 27, 2023
…bject with optional props

Fixes #60

Updated docstrings and added return types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant