0.0.5 • Published 9 months ago

rs2ts v0.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

RUST TO TYPESCRIPT

create ts interface define from rust struct (serde)

from rust

#[derive(Serialize,Default)]
pub struct Connect<T> {
    index: usize,
    source: String,
    target: String,
    list: Vec<T>,
}
  

#[derive(Serialize)]
pub struct Cons2{
    pub source_ip: Vec<String>,
    pub count: u16,
}

to ts

export interface IConnect<T> {
    index: number;
    source: string;
    target: string;
    list: T[];
}

export interface ICons2 {
    source_ip: string[];
    count: number;
}

install

npm install rs2ts -g

usage

rs2ts -i ../demo/common.rs -o ./target/cm.ts

rs2ts --help

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago