Skip to content

Bug: Generics are not handled correctly in TypeScript definition output聽#39

Description

@mattatz

Thank you for updating Tsify project! 馃槂

I encountered an issue while using the tsify_next::Tsify derive macro.
When defining a struct with generics, the generated TypeScript definition does not handle the generics correctly.

Specifically, when I define:

#[derive(tsify_next::Tsify)]
pub struct Polyline<const D: usize> {
    pub points: Vec<Point<f64, D>>,
}

the index.d.ts file incorrectly outputs:

export interface Polyline {
    points: Point<number, D>[];
}

The generic D is not handled properly, which causes type definition issues in TypeScript.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions