nori/codegen/typescript/types
TypeScript type definition generator.
Generates types.generated.ts from CodegenIR.
Types
Configuration for TypeScript type generation.
pub type Config {
Config(
use_exports: Bool,
use_interfaces: Bool,
readonly_properties: Bool,
)
}
Constructors
-
Config( use_exports: Bool, use_interfaces: Bool, readonly_properties: Bool, )Arguments
- use_exports
-
Add “export” before type declarations
- use_interfaces
-
Use “interface” instead of “type” for record types
- readonly_properties
-
Add readonly modifier to properties
Values
pub fn generate(ir: ir.CodegenIR) -> String
Generate TypeScript types with default config.
pub fn generate_with_config(
ir: ir.CodegenIR,
config: Config,
) -> String
Generate TypeScript types with custom config.