Tram-One / tram-one

🚋 Legacy View Framework For Vanilla Javascript
http://tram-one.io/
MIT License
36 stars 8 forks source link

Expose Tram-One type interfaces #199

Open JRJurman opened 2 years ago

JRJurman commented 2 years ago

Summary

In the following example, it's not possible to define a strict type for ref, since we don't explicitly export TramOneHTMLElement.

const notesRef = useStore<{ ref: any }>({ ref: null });
useEffect((ref) => {
  notesRef.ref = ref;
});

Ideally we'd like to do the following:

const notesRef = useStore<{ ref: TramOneHTMLElement | null }>({ ref: null });

We should look into how we can expose this interface in a way that consumers can easily import these types. We should probably also update the website to reflect the exposed types.