alexanderatallah / window.ai

Use your own AI models on the web
https://windowai.io
MIT License
806 stars 70 forks source link

adding types package #7

Closed cfortuner closed 1 year ago

cfortuner commented 1 year ago

I was able to get this to work by creating a @types/window.ai package.

In this implementation,

in the web app, typescript is able to find the types for window.ai after installing @types/window.ai with no other changes required.


I also tried to get this to work by just creating a package windowai and including the types in the package.json as types: 'index.d.ts'

But in this case, I wasn't able to get typescript to find the types without requiring the user to modify their tsconfig.json


I think there should be a way to publish a npm package, that includes types that are found by ts without requiring any other changes, but i'm not sure how to do this yet.