Typing issue with 0.4.0
See original GitHub issueReport bugs here only for the Node JavaScript library.
If you’re having problems using Notion’s API, or have any other feedback about the API including feature requests for the JavaScript library, please email support at developers@notion.com.
Describe the bug
A clear and concise description of what the bug is.
Upon upgrading to 0.4.0, typings have gone crazy. api-types
is now replaced by api-endpoints
. The problem is the type for each Block
is now gone.
To Reproduce
Node version: 14
Notion JS library version: 0.4.0
Steps to reproduce the behavior:
Expected behavior Typing for each Block type should be defined separately and exposed.
Screenshots
Like trying to get HeadingOneBlock
out of this type union is a nightmare
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:13
- Comments:9
Top GitHub Comments
just learned that we can extract nested
types
from othertypes
.Typescript is awesome!
new 0.4 package defeats the whole purpose of
Typescript
if they aren’t allowing us to import the types. Earlier I could just importPage
type from notionhq pkg but now it’s replaced with 200+ lines of inline definitions. How are we supposed to import this in our code? copy-paste?And it’s not just
Page
but many other useful definitions are goneRichTextText
,PagesUpdateParameters
,PagesCreateParameters
,InputPropertyValueMap
,RichText
,PropertyValueMap
etc.New inline typings may suit Notion team internally but it’s no use to people who are using this
TS
package in production.reverted back to
0.3
for now.