{"type":"data","nodes":[null,null,{"type":"data","data":[{"version":1,"api":2},"0.1.77",{"expand_sync":3,"ExpandResult":26,"MacroDiagnostic":33,"SourceMappingResult":39},{"name":4,"kind":5,"signature":6,"description":7,"params":8,"returns":22,"examples":24},"expand_sync","function","pub fn expand_sync(_env : Env, code : String, filepath : String, options : Option \u003C ExpandOptions >) -> Result \u003C ExpandResult >","Synchronously expands macros in TypeScript code.\n\nThis is the standalone macro expansion function that doesn't use caching.\nFor cached expansion, use [`NativePlugin::process_file`] instead.",[9,13,16,19],{"name":10,"type":11,"description":12},"_env","","NAPI environment (unused but required by NAPI)",{"name":14,"type":11,"description":15},"code","The TypeScript source code to expand",{"name":17,"type":11,"description":18},"filepath","The file path (used for TSX detection)",{"name":20,"type":11,"description":21},"options","Optional configuration (e.g., `keep_decorators`)",{"type":11,"description":23},"An [`ExpandResult`] containing the expanded code, diagnostics, and source mapping.",[25],"const result = expand_sync(env, code, \"user.ts\", { keep_decorators: false });\nconsole.log(result.code); // Expanded TypeScript code\nconsole.log(result.diagnostics); // Any warnings or errors",{"name":27,"kind":28,"signature":29,"description":30,"examples":31},"ExpandResult","struct","pub struct ExpandResult","Result of expanding macros in TypeScript source code.\n\nThis is the primary return type for macro expansion operations,\ncontaining the expanded code, diagnostics, and source mapping.",[32],"use macroforge_ts::{ExpandResult, MacroDiagnostic};\n\n// Create an ExpandResult programmatically\nlet result = ExpandResult {\n    code: \"class User {}\".to_string(),\n    types: None,\n    metadata: None,\n    diagnostics: vec![],\n    source_mapping: None,\n};\n\n// Check for errors\nif result.diagnostics.iter().any(|d| d.level == \"error\") {\n    // Handle errors\n}",{"name":34,"kind":28,"signature":35,"description":36,"examples":37},"MacroDiagnostic","pub struct MacroDiagnostic","A diagnostic message produced during macro expansion.\n\nDiagnostics can represent errors, warnings, or informational messages\nthat occurred during the macro expansion process.",[38],"use macroforge_ts::MacroDiagnostic;\n\nlet _diag = MacroDiagnostic {\n    level: \"error\".to_string(),\n    message: \"Unknown macro 'Foo'\".to_string(),\n    start: Some(42),\n    end: Some(45),\n};",{"name":40,"kind":28,"signature":41,"description":42},"SourceMappingResult","pub struct SourceMappingResult","Complete source mapping information for a macro expansion.\n\nContains both preserved segments (original code that wasn't modified)\nand generated regions (new code synthesized by macros)."],"uses":{}}]}
