Open uonr opened 5 years ago
Additional workarounds:
#[derive(Serialize, TypeScriptify)]
pub enum LinkType {
Inline,
Autolink,
Email,
Unsupported(#[serde(skip)] ()),
}
export type LinkType =
| "Inline"
| "Autolink"
| "Email"
| "Unsupported";
#[derive(Serialize, TypeScriptify)]
pub enum LinkType {
Inline,
Autolink,
Email,
Unsupported,
}
export enum LinkType { Inline = "Inline" , Autolink = "Autolink" , Email = "Email" , Unsupported = "Unsupported" };
// then alias the enum like this
export type LinkTypeString = keyof typeof LinkType;
/* That's equivalent to:
export type LinkTypeString =
| "Inline"
| "Autolink"
| "Email"
| "Unsupported";
*/
Problem
output:
error
Workaround