1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: pub.leaflet.richtext.facet
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8/// Facet feature for bold text
9#[jacquard_derive::lexicon]
10#[derive(
11 serde::Serialize,
12 serde::Deserialize,
13 Debug,
14 Clone,
15 PartialEq,
16 Eq,
17 jacquard_derive::IntoStatic,
18 Default
19)]
20#[serde(rename_all = "camelCase")]
21pub struct Bold<'a> {}
22/// Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets.
23#[jacquard_derive::lexicon]
24#[derive(
25 serde::Serialize,
26 serde::Deserialize,
27 Debug,
28 Clone,
29 PartialEq,
30 Eq,
31 jacquard_derive::IntoStatic,
32 bon::Builder
33)]
34#[serde(rename_all = "camelCase")]
35pub struct ByteSlice<'a> {
36 pub byte_end: i64,
37 pub byte_start: i64,
38}
39
40/// Facet feature for inline code.
41#[jacquard_derive::lexicon]
42#[derive(
43 serde::Serialize,
44 serde::Deserialize,
45 Debug,
46 Clone,
47 PartialEq,
48 Eq,
49 jacquard_derive::IntoStatic,
50 Default
51)]
52#[serde(rename_all = "camelCase")]
53pub struct Code<'a> {}
54/// Facet feature for highlighted text.
55#[jacquard_derive::lexicon]
56#[derive(
57 serde::Serialize,
58 serde::Deserialize,
59 Debug,
60 Clone,
61 PartialEq,
62 Eq,
63 jacquard_derive::IntoStatic,
64 Default
65)]
66#[serde(rename_all = "camelCase")]
67pub struct Highlight<'a> {}
68/// Facet feature for an identifier. Used for linking to a segment
69#[jacquard_derive::lexicon]
70#[derive(
71 serde::Serialize,
72 serde::Deserialize,
73 Debug,
74 Clone,
75 PartialEq,
76 Eq,
77 jacquard_derive::IntoStatic,
78 Default
79)]
80#[serde(rename_all = "camelCase")]
81pub struct Id<'a> {
82 #[serde(skip_serializing_if = "std::option::Option::is_none")]
83 #[serde(borrow)]
84 pub id: std::option::Option<jacquard_common::CowStr<'a>>,
85}
86
87/// Facet feature for italic text
88#[jacquard_derive::lexicon]
89#[derive(
90 serde::Serialize,
91 serde::Deserialize,
92 Debug,
93 Clone,
94 PartialEq,
95 Eq,
96 jacquard_derive::IntoStatic,
97 Default
98)]
99#[serde(rename_all = "camelCase")]
100pub struct Italic<'a> {}
101/// Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.
102#[jacquard_derive::lexicon]
103#[derive(
104 serde::Serialize,
105 serde::Deserialize,
106 Debug,
107 Clone,
108 PartialEq,
109 Eq,
110 jacquard_derive::IntoStatic,
111 bon::Builder
112)]
113#[serde(rename_all = "camelCase")]
114pub struct Link<'a> {
115 #[serde(borrow)]
116 pub uri: jacquard_common::types::string::Uri<'a>,
117}
118
119/// Annotation of a sub-string within rich text.
120#[jacquard_derive::lexicon]
121#[derive(
122 serde::Serialize,
123 serde::Deserialize,
124 Debug,
125 Clone,
126 PartialEq,
127 Eq,
128 jacquard_derive::IntoStatic,
129 bon::Builder
130)]
131#[serde(rename_all = "camelCase")]
132pub struct Facet<'a> {
133 #[serde(borrow)]
134 pub features: Vec<FacetFeaturesItem<'a>>,
135 #[serde(borrow)]
136 pub index: crate::pub_leaflet::richtext::facet::ByteSlice<'a>,
137}
138
139#[jacquard_derive::open_union]
140#[derive(
141 serde::Serialize,
142 serde::Deserialize,
143 Debug,
144 Clone,
145 PartialEq,
146 Eq,
147 jacquard_derive::IntoStatic
148)]
149#[serde(tag = "$type")]
150#[serde(bound(deserialize = "'de: 'a"))]
151pub enum FacetFeaturesItem<'a> {
152 #[serde(rename = "pub.leaflet.richtext.facet#link")]
153 Link(Box<crate::pub_leaflet::richtext::facet::Link<'a>>),
154 #[serde(rename = "pub.leaflet.richtext.facet#code")]
155 Code(Box<crate::pub_leaflet::richtext::facet::Code<'a>>),
156 #[serde(rename = "pub.leaflet.richtext.facet#highlight")]
157 Highlight(Box<crate::pub_leaflet::richtext::facet::Highlight<'a>>),
158 #[serde(rename = "pub.leaflet.richtext.facet#underline")]
159 Underline(Box<crate::pub_leaflet::richtext::facet::Underline<'a>>),
160 #[serde(rename = "pub.leaflet.richtext.facet#strikethrough")]
161 Strikethrough(Box<crate::pub_leaflet::richtext::facet::Strikethrough<'a>>),
162 #[serde(rename = "pub.leaflet.richtext.facet#id")]
163 Id(Box<crate::pub_leaflet::richtext::facet::Id<'a>>),
164 #[serde(rename = "pub.leaflet.richtext.facet#bold")]
165 Bold(Box<crate::pub_leaflet::richtext::facet::Bold<'a>>),
166 #[serde(rename = "pub.leaflet.richtext.facet#italic")]
167 Italic(Box<crate::pub_leaflet::richtext::facet::Italic<'a>>),
168}
169
170/// Facet feature for strikethrough markup
171#[jacquard_derive::lexicon]
172#[derive(
173 serde::Serialize,
174 serde::Deserialize,
175 Debug,
176 Clone,
177 PartialEq,
178 Eq,
179 jacquard_derive::IntoStatic,
180 Default
181)]
182#[serde(rename_all = "camelCase")]
183pub struct Strikethrough<'a> {}
184/// Facet feature for underline markup
185#[jacquard_derive::lexicon]
186#[derive(
187 serde::Serialize,
188 serde::Deserialize,
189 Debug,
190 Clone,
191 PartialEq,
192 Eq,
193 jacquard_derive::IntoStatic,
194 Default
195)]
196#[serde(rename_all = "camelCase")]
197pub struct Underline<'a> {}