kwicherbelliaken / better-brain-blogging

a personal blog logging my learnings as they come
0 stars 0 forks source link

[CHORE]: add better type safety to exported loaders #64

Closed slackermorris closed 1 year ago

slackermorris commented 1 year ago

See KCD's talk on PodRocket.

slackermorris commented 1 year ago

This turned out to be helpful.

slackermorris commented 1 year ago

I have chosen to follow KCD advice and solution: https://egghead.io/lessons/remix-integrate-typescript-into-a-remix-loader-function.

The ☝️ above article by Francisco didn't seem to work.

slackermorris commented 1 year ago

I'm currently typing braindumps.list.$braindumpId.tsx. I am finding it hard to find the type defs for pages and blocks for a Notion page.

I am thinking it might be easier just using the typings library that has already been created.

https://www.npmjs.com/package/notion-api-types

slackermorris commented 1 year ago

I was having an issue extending the types of a library.

"SOLUTION" In the end I didn't have to do much. I didn't add a typeRoots field in my tsconfig. I just created a typings directory and added a .d.ts file of the same name of the library that I wanted to extend.