Skip to content

Using Typescript & Adding Typescript to the docs #78

@lm93547

Description

@lm93547

I am trying to strictly type my Node array & while using the sort functionality, I see errors such as Type 'TableNode[]' is not assignable to type 'NodeType[]', any idea how to fix this? I have tried extending my type with TableNode, but when doing this the error Type 'TableNode' is missing the following properties from type 'NodeType': platform, position, openInterest, APY, and 2 more. shows. Any ideas or documentation to support this use case?

NodeType:

interface NodeType extends TableNode {
    id: string;
    platform: string;
    position: string;
    openInterest: string;
    APY: string;
    fixedYield: string;
    variableYield: string;
}

I also believe the docs should include some documentation for using the library with typescript. I can help with this if necessary. Love the library though! Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions