Implement radio link and regular link.
This commit is contained in:
@@ -4,15 +4,22 @@ use serde::Serialize;
|
||||
use super::ast_node::WasmAstNode;
|
||||
use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use super::AdditionalProperties;
|
||||
use crate::compare::ElispFact;
|
||||
use crate::types::RadioLink;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(tag = "format")]
|
||||
#[serde(rename = "plain")]
|
||||
pub struct WasmRadioLink {
|
||||
#[serde(flatten)]
|
||||
pub(crate) additional_properties: AdditionalProperties,
|
||||
#[serde(rename = "type")]
|
||||
pub(crate) link_type: String,
|
||||
pub(crate) path: String,
|
||||
#[serde(rename = "raw-link")]
|
||||
pub(crate) raw_link: String,
|
||||
pub(crate) application: Option<String>, // Always None
|
||||
#[serde(rename = "search-option")]
|
||||
pub(crate) search_option: Option<String>, // Always None
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
@@ -21,7 +28,7 @@ to_wasm!(
|
||||
original,
|
||||
wasm_context,
|
||||
{ WasmAstNode::RadioLink(original) },
|
||||
{ "TODO".into() },
|
||||
{ "link".into() },
|
||||
{
|
||||
let children = original
|
||||
.children
|
||||
@@ -36,7 +43,11 @@ to_wasm!(
|
||||
Ok((
|
||||
children,
|
||||
WasmRadioLink {
|
||||
additional_properties: AdditionalProperties::default(),
|
||||
link_type: "radio".to_owned(),
|
||||
path: original.path.to_owned(),
|
||||
raw_link: original.get_raw_link().to_owned(),
|
||||
application: None,
|
||||
search_option: None,
|
||||
},
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user