Comments (9)
Heh. If you rewrote terminal-kit in TypeScript, you could easily get a JS version and a typings file. It would also be much easier to maintain on your end...
I learned TypeScript in a week, I think it would be a fun project for you. Besides, every good library has TypeScript typings. TypeScript is like JavaScript for sane developers.
I understand if you're busy though or have other things to do. No maintainer I've ever seen has the time to rewrite their library.
from terminal-kit.
@ShadSterling https://www.npmjs.com/package/@types/terminal-kit
@cronvel this feature request is implemented and can be closed now.
from terminal-kit.
Who is maintaining those type definitions - because they aren't any good anymore.
from terminal-kit.
@ShadSterling Sorry, but I know nothing about Typescript beside the name. Type declaration works with some formatted comment in the code?
from terminal-kit.
No, Typescript is a superset of javascript which gets compiled down to javascript (after checking that every value matches the declared types). The compiler also generates type declarations as separate files, so if you compile foo.ts
the normal output is foo.js
(containing executable javascript) and foo.d.ts
(containing type declarations). The type declarations can be used to check types when importing foo
into another typescript project, which is commonly done when a typescript project depends on npm modules. If the original code wasn't written in typescript, the type declarations can also be written by hand, which has been done for a large number of npm modules, the node standard library, and the standard browser apis.
So, the feature I'm requesting is handmade typescript declarations the represent the method names and expected parameter and return types for terminal-kit.
I just found this library, and I find the code completion available for typescript far more helpful than what's available for plain javascript, especially when learning a new library.
I'd be happy to contribute, but I'm not familiar enough with hand-making type declarations to get it started myself. If someone else can get it started I'll be happy to help complete it, or if no-one beats me to it I might come back and get it started myself once I know how.
from terminal-kit.
+1
from terminal-kit.
As for Low-level API, ".d.ts" content seems like below.
(...values: any[]): Terminal;
might be (...values: Array<string|number|boolean|null|undefined>): Terminal;
declare module "terminal-kit" {
export var terminal: Terminal;
interface Terminal {
(...values: any[]): Terminal;
//Properties
width: number;
height: number;
//Foreground colors
defaultColor: Terminal;
black: Terminal;
red: Terminal;
green: Terminal;
yellow: Terminal;
blue: Terminal;
magenta: Terminal;
cyan: Terminal;
white: Terminal;
brightBlack: Terminal;
gray: Terminal;
brightRed: Terminal;
brightGreen: Terminal;
brightYellow: Terminal;
brightBlue: Terminal;
brightMagenta: Terminal;
brightCyan: Terminal;
brightWhite: Terminal;
color: Terminal;
darkColor: Terminal;
brightColor: Terminal;
color256: Terminal;
colorRgb: Terminal;
colorRgbHex: Terminal;
colorGrayscale: Terminal;
//Background colors
bgDefaultColor: Terminal;
bgBlack: Terminal;
bgRed: Terminal;
bgGreen: Terminal;
bgYellow: Terminal;
bgBlue: Terminal;
bgMagenta: Terminal;
bgCyan: Terminal;
bgWhite: Terminal;
bgDarkColor: Terminal;
bgBrightBlack: Terminal;
bgGray: Terminal;
bgBrightRed: Terminal;
bgBrightGreen: Terminal;
bgBrightYellow: Terminal;
bgBrightBlue: Terminal;
bgBrightMagenta: Terminal;
bgBrightCyan: Terminal;
bgColor: Terminal;
bgBrightWhite: Terminal;
bgBrightColor: Terminal;
bgColor256: Terminal;
bgColorRgb: Terminal;
bgColorRgbHex: Terminal;
bgColorGrayscale: Terminal;
//Styles
styleReset: Terminal;
bold: Terminal;
dim: Terminal;
italic: Terminal;
underline: Terminal;
blink: Terminal;
inverse: Terminal;
hidden: Terminal;
strike: Terminal;
//Moving the Cursor
saveCursor: Terminal;
restoreCursor: Terminal;
up: Terminal;
down: Terminal;
right: Terminal;
left: Terminal;
nextLine: Terminal;
previousLine: Terminal;
column: Terminal;
scrollUp: Terminal;
scrollDown: Terminal;
scrollingRegion: Terminal;
resetScrollingRegion: Terminal;
moveTo: Terminal;
move: Terminal;
hideCursor: Terminal;
tabSet: Terminal;
tabClear: Terminal;
tabClearAll: Terminal;
forwardTab: Terminal;
backwardTab: Terminal;
//Editing the Screen
clear: Terminal;
eraseDisplayBelow: Terminal;
eraseDisplayAbove: Terminal;
eraseDisplay: Terminal;
eraseScrollback: Terminal;
eraseLineAfter: Terminal;
eraseLineBefore: Terminal;
eraseLine: Terminal;
eraseArea: Terminal;
insertLine: Terminal;
deleteLine: Terminal;
insert: Terminal;
delete: Terminal;
backDelete: Terminal;
// scrollUp: Terminal;
// scrollDown: Terminal;
alternateScreenBuffer: Terminal;
//Input/Output
requestCursorLocation: Terminal;
requestScreenSize: Terminal;
requestColor: Terminal;
applicationKeypad: Terminal;
//Internal input/output (do not use directly, use grabInput() instead)
mouseButton: Terminal;
mouseDrag: Terminal;
mouseMotion: Terminal;
mouseSGR: Terminal;
focusEvent: Terminal;
//Operating System
cwd: Terminal;
windowTitle: Terminal;
iconName: Terminal;
notify: Terminal;
//Modifiers
error: Terminal;
str: Terminal;
noFormat: Terminal;
markupOnly: Terminal;
bindArgs: Terminal;
//Misc
reset: Terminal;
bell: Terminal;
setCursorColor: Terminal;
setCursorColorRgb: Terminal;
resetCursorColorRgb: Terminal;
setDefaultColorRgb: Terminal;
resetDefaultColorRgb: Terminal;
setDefaultBgColorRgb: Terminal;
resetDefaultBgColorRgb: Terminal;
setHighlightBgColorRgb: Terminal;
resetHighlightBgColorRgb: Terminal;
}
}
from terminal-kit.
Please...
from terminal-kit.
@LoganDark Like I said, I know nothing about TypeScript, so someone has to do it.
Moreover, that person has to maintain it.
from terminal-kit.
Related Issues (20)
- terminalkit.TextBox is not a constructor HOT 3
- document: InlineInputField only widthPercent breaks input
- Redraw window every "frame" HOT 1
- Word/Line wrap ERROR when x,y,width or height of TextBox are non integers
- Unable to draw the correct image in vscode dark-mode terminal!
- Can't run after packed with pkg HOT 3
- Cannot input after using term.inputField() HOT 4
- Issue: Terminal stuck in while-loop when initating another terminal with stdin/stdout
- Form control event and validation
- form render issue - hide/show control
- Erase Everything - How?
- Possible EventEmitter memory leak
- Multiple Documents in Same Terminal Screen
- support for fonts
- term.table does not work in Azure pipeline HOT 6
- term.table does not work in Azure pipeline HOT 1
- Unable to bundle code with dependencies HOT 5
- inputField Inline support? HOT 1
- Documentation request: cannot chain .inputField
- Unable to add left padding to singleLineMenu?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terminal-kit.