xpl / ololog

A better console.log for the log-driven debugging junkies
https://www.npmjs.com/package/ololog
The Unlicense
215 stars 8 forks source link

Typescript definition "object" types issue #21

Closed josesan9 closed 3 years ago

josesan9 commented 3 years ago

Hi, When importing into my typescript project, I was forced to import it as a js library and not use the type definition. This was due to several parameters defined as object types. Typescript does not like this, and so it should either be changed to any or an interface should be created for such parameters. example:

type StageCallback = (input: any, config?: object) => any;

the config?: object means that we are unable to send in any config parameters. It should either be config?: any or config?: IStageCallbackConfig where you define the interface elsewhere. There are several appearances of this which need fixing in the definition file

xpl commented 3 years ago

I was too lazy to provide definitions for all the entities, and also I thought that object is stricter than any, but maybe I was wrong.

_Any_way, I've just replaced object with any. Is it good now? Yeah, it isn't good in a sense that it does not provide the full typings for everything, but can it at least be imported now?