spencermountain / compromise

modest natural-language processing
http://compromise.cool
MIT License
11.43k stars 656 forks source link

chore: export view types #1104

Closed Fdawgs closed 5 months ago

Fdawgs commented 5 months ago

I was previously able to declare a variable's type in VS Code using the following:

/** @type {import('compromise/types/view/three').default} */`
const test = nlp.view;

console.log(test.sentences());

This would allow Intellisense to kick in, so if i hovered over test.sentences() i'd get the following: image

However it seems the latest minor version of TypeScript which shipped with VS Code has removed that. This PR updates package.json to explicitly export the view types, so that the type can continue to be declared like so:

/** @type {import('compromise/view/three').default} */
const test = nlp.view
spencermountain commented 5 months ago

thank you! sorry, not sure what's happened with the github script. I owe ya a drink, Frazer.