patorjk / figlet.js

A FIG Driver written in JavaScript which aims to fully implement the FIGfont spec.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing parseFont typescript definition

andytan0727 opened this issue · comments

I got an error from typescript when using parseFont with the font from importable-fonts, following the instruction from #32:

import figlet from "figlet";
import banner3 from "figlet/importable-fonts/Banner3";

figlet.parseFont("Banner3", banner3);

On the 4th line: Property 'parseFont' does not exist on type 'typeof figlet'.

More information:

os: Windows 10
node: 10.12.0
figlet: ^1.2.4
typescript: 3.5.2

This library was written in JavaScript. I’m not very familiar with TypeScript but I can add support if you know what needs to be done to resolve this.

I just realized the declaration file(index.d.ts) required by TypeScript is not included in figlet, instead it is found in @types/figlet (source: https://www.npmjs.com/package/@types/figlet) package which is updated one year ago. Perhaps this is the main reason the new parseFont method is not defined.

If the declaration file in @types/figlet is updated with the new method I think the problem will be solved :)

Sounds good, just put in an issue to get it updated. I @-ed you so you can follow it.

Thanks @patorjk. Now I would mark this issue as closed and follow up on DefinitelyTyped.