romgrk / node-todoist

nodejs implementation of todoist sync API
21 stars 12 forks source link

Confusion with types (typescript) #26

Open theexplay opened 2 years ago

theexplay commented 2 years ago

Hi, trying to use your library and having difficulties with return type

For example, trying to add task

items: {
...
add: (args: TodoistV8Types.ItemAdd) => Promise<TodoistV8Types.NodeType | undefined>;
...
}

It returns TodoistV8Types.NodeType, but i except to get TodoistV8Types.Item with result from response to update my locale store with new task

Data returned from request: image

Request: image

Can you explain why the type is returned everywhere equals to NodeType?

theexplay commented 2 years ago

Also confused with SectionAdd and SectionUpdate types. id param missed

image

image