use serde::Serialize;

use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm;
use crate::types::ExportSnippet;
use crate::wasm::to_wasm::ToWasmStandardProperties;
use crate::wasm::WasmAstNode;

#[derive(Debug, Serialize)]
#[serde(tag = "ast_node")]
#[serde(rename = "org-data")]
pub struct WasmExportSnippet<'s, 'p> {
    standard_properties: WasmStandardProperties,
    children: Vec<WasmAstNode<'s, 'p>>,
}

to_wasm!(
    WasmExportSnippet<'s, 'p>,
    ExportSnippet<'s>,
    original,
    wasm_context,
    standard_properties,
    {
        Ok(WasmExportSnippet {
            standard_properties,
            children: Vec::new(),
        })
    }
);