pub trait ExportLanguage {
    // Required methods
    fn globals() -> String;
    fn render_functions(
        function_types: Vec<FunctionDataType>,
        cfg: &ExportConfiguration
    ) -> Result<String, TsExportError>;
    fn render(
        function_types: Vec<FunctionDataType>,
        type_map: TypeDefs,
        cfg: &ExportConfiguration
    ) -> Result<String, TsExportError>;
}
Expand description

A set of functions that produce language-specific code

Required Methods§

source

fn globals() -> String

Type definitions and constants that the generated functions rely on

source

fn render_functions( function_types: Vec<FunctionDataType>, cfg: &ExportConfiguration ) -> Result<String, TsExportError>

Renders a collection of FunctionDataType into a string.

source

fn render( function_types: Vec<FunctionDataType>, type_map: TypeDefs, cfg: &ExportConfiguration ) -> Result<String, TsExportError>

Renders the output of [globals], [render_functions] and all dependant types into a TypeScript string.

Implementors§

source§

impl ExportLanguage for tauri_specta::js::Language

Available on crate feature javascript only.
source§

impl ExportLanguage for tauri_specta::ts::Language

Available on crate feature typescript only.