mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Fixed ANSI typings.
This commit is contained in:
parent
0d341f3723
commit
c1ec00f135
@ -20,5 +20,5 @@ Object.keys({
|
||||
, brightCyan: 96
|
||||
, brightWhite: 97
|
||||
}).forEach((color) => {
|
||||
cursor[color]().bold().write(`Hello, bold ${color.replace(/([a-z])([A-Z])/g, (_: string, l: string, u: string): string => `${l} ${u.toLowerCase()}`)} world!\n`).reset();
|
||||
(<{ [key: string]: (..._: any[]) => ansi.Cursor }> cursor)[color]().bold().write(`Hello, bold ${color.replace(/([a-z])([A-Z])/g, (_: string, l: string, u: string): string => `${l} ${u.toLowerCase()}`)} world!\n`).reset();
|
||||
});
|
||||
|
||||
12
types/ansi/index.d.ts
vendored
12
types/ansi/index.d.ts
vendored
@ -168,11 +168,13 @@ declare namespace ansi {
|
||||
brightWhite(): Cursor;
|
||||
}
|
||||
|
||||
/* Removed index signatures due to conflicts. Now you have to
|
||||
* add them in consumer code:
|
||||
*
|
||||
* <{ [key: string]: (..._: any[]) => Cursor }> myCursorOrColorer;
|
||||
*/
|
||||
interface Cursor {
|
||||
[key: string]: ((...anything: any[]) => Cursor) | Colorer;
|
||||
}
|
||||
|
||||
interface Colorer {
|
||||
[key: string]: (...anything: any[]) => (Cursor | Colorer);
|
||||
}
|
||||
}
|
||||
|
||||
export = ansi;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user