spencermountain / compromise

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

chore: export view types #1104

Closed Fdawgs closed 6 months ago

Fdawgs commented 7 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 6 months ago

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