Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Command = require('./lib/command')
import Seeli = require('./lib/seeli')

declare const seeli: Seeli & {
Seeli: typeof Seeli
Command: typeof Command
list: string[]
[key: string]: any
}

export = seeli
2 changes: 1 addition & 1 deletion lib/command/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ declare class Command extends Map<any, any> {
* Will be passed the contents return by the command
* @return String|undefined Will return the result from the command specific run directive if there is any.
*/
run(cmd?: any, depth?: number): Promise<any>;
run(cmd?: any, depth?: number): Promise<any> | undefined;

/**
* Validates the current data set before running the command
Expand Down
59 changes: 4 additions & 55 deletions lib/seeli.d.ts
Original file line number Diff line number Diff line change
@@ -1,73 +1,22 @@
import Command = require('./command')

/**
* Seeli Entrypoint used for registering and managing commands
* @module module:seeli/lib/seeli
* @author Eric Satterwhite
*/
declare class Seeli extends Command {
/**
* Get configuration value
* @param args Arguments to pass to config.get
*/
static get(...args: any[]): any;

/**
* Set configuration value
* @param args Arguments to pass to config.set
*/
static set(...args: any[]): any;

/**
* Colorize text with a specific color
* @param txt Text to colorize
* @param color Color to use
*/
static colorize(txt: string, color: string): string;

/**
* Get the Command class
*/
static get Command(): typeof Command;

/**
* Get the Command class
*/
get Command(): typeof Command;

/**
* Constructor for Seeli class
* @param args Arguments to pass to the constructor
*/
Comment on lines -36 to -39
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bcornish1797 out of curiosity, why remove the comments?

constructor(...args: any[]);

/**
* Colorize text with a specific color
* @param txt Text to colorize
* @param color Color to use
*/
colorize(txt: string, color: string): string;

/**
* Get or set configuration values
* @param args Arguments to pass to config
*/
config(...args: any[]): any;

/**
* Run the Seeli application
*/
run(): void;

/**
* Reset the Seeli instance
*/
run(...args: any[]): Promise<any> | undefined;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. I don't know if that is true that it would return undefined. I think it always returns a promise at the least.

reset(): Seeli;

/**
* Load plugins
* @param args Plugin arguments
*/
plugin(...args: any[]): Seeli;
}

export = Seeli;

export = Seeli
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"files": [
"index.js",
"index.d.ts",
"lib/",
"README.md",
"LICENSE",
Expand Down Expand Up @@ -130,5 +131,6 @@
"files": [
"test/**/*.js"
]
}
},
"types": "./index.d.ts"
}
2 changes: 1 addition & 1 deletion test/flag-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test('flagType', async (t) => {
, [{type: [Number, Array]}, 'number', '[Number, Array] === number']
, [{type: String, mask: true}, 'password', 'mask=true === password']
, [{type: String, choices: []}, 'select', 'choices === select']
, [{type: String, choices: [], multi: true}, 'checkbox', 'choices + multi === checkbox'] // eslint-disable-line max-len
, [{type: String, choices: [], multi: true}, 'checkbox', 'choices + multi === checkbox']
, [{type: Function}, 'input', 'unexpected type === input']
]

Expand Down