notion-sdk-js icon indicating copy to clipboard operation
notion-sdk-js copied to clipboard

DatabasePropertyConfigResponse is a local type

Open aDogCalledSpot opened this issue 8 months ago • 2 comments

Describe the bug When fetching a database, there isn't a way to properly cast a property to the proper type it's supposed to be since these types aren't exported.

To Reproduce Notion JS library version: current master

Relevant line of code

example:

const response = await notion.databases.retrieve({ database_id });
const options = response.properties["My Select Property"].select; // Won't compile

Expected behavior I would expect type safety when inspecting the properties in my database.

aDogCalledSpot avatar Dec 03 '23 09:12 aDogCalledSpot

Same deal with UpdateDatabaseBodyParameters

aDogCalledSpot avatar Dec 03 '23 10:12 aDogCalledSpot

Yep, it's very painful to work with these types unavailable, especially when using Typescript.

The same stands for DatabaseObjectResponse

LoganTann avatar Feb 08 '24 15:02 LoganTann