flatiron / prompt

a beautiful command-line prompt for node.js

Home Page:http://github.com/flatiron/prompt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeScript support

lazarljubenovic opened this issue · comments

Are there any plans to add type definitions to this module so it can be used with TypeScript?

I created a PR on DefinitelyTyped: DefinitelyTyped/DefinitelyTyped#51247

I created a PR on DefinitelyTyped: DefinitelyTyped/DefinitelyTyped#51247

These types don't work for nested Properties. I had to modify RevalidatorSchema like so:

type RevalidatorSchema = Partial<Revalidator.ISchema<any> & Schema>;

interface Properties {
  [name: string]: RevalidatorSchema | string;
}
interface Schema {
  properties: Properties;
}

How do you people handle the types for the GetCallback? It seems cumbersome to have my internal objects as a supertype of Properties.