madonoharu / tsify

A library for generating TypeScript definitions from rust code.
Apache License 2.0
300 stars 41 forks source link

Allow custom `DECL` TypeScript definition string #55

Open CinchBlue opened 2 months ago

CinchBlue commented 2 months ago

Sometimes your type might look like this:

pub struct Color {
  r: i8,
  g: i8,
  b: i8,
}

but you want a custom serde impl + string representation in TypeScript:

// So it can look like #abcdef
export type Color = `#${string}{string}{string}`