@picteus/extension-sdk 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/dist/featureViewGrammar.d.ts +2814 -0
  2. package/dist/featureViewGrammar.js +2612 -0
  3. package/dist/generated/featureViewGrammar.d.ts +3913 -0
  4. package/dist/generated/featureViewGrammar.js +4099 -0
  5. package/dist/generated/viewKit.d.ts +3853 -0
  6. package/dist/generated/viewKit.js +4022 -0
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.js +1 -0
  9. package/dist/picteus-ws-client/apis/AdministrationApi.d.ts +1 -1
  10. package/dist/picteus-ws-client/apis/AdministrationApi.js +1 -1
  11. package/dist/picteus-ws-client/apis/ApiSecretApi.d.ts +1 -1
  12. package/dist/picteus-ws-client/apis/ApiSecretApi.js +1 -1
  13. package/dist/picteus-ws-client/apis/CollectionApi.d.ts +1 -1
  14. package/dist/picteus-ws-client/apis/CollectionApi.js +1 -1
  15. package/dist/picteus-ws-client/apis/ExtensionApi.d.ts +69 -34
  16. package/dist/picteus-ws-client/apis/ExtensionApi.js +83 -38
  17. package/dist/picteus-ws-client/apis/ImageApi.d.ts +36 -5
  18. package/dist/picteus-ws-client/apis/ImageApi.js +44 -3
  19. package/dist/picteus-ws-client/apis/ImageAttachmentApi.d.ts +1 -1
  20. package/dist/picteus-ws-client/apis/ImageAttachmentApi.js +1 -1
  21. package/dist/picteus-ws-client/apis/MiscellaneousApi.d.ts +1 -1
  22. package/dist/picteus-ws-client/apis/MiscellaneousApi.js +1 -1
  23. package/dist/picteus-ws-client/apis/RepositoryApi.d.ts +5 -5
  24. package/dist/picteus-ws-client/apis/RepositoryApi.js +3 -3
  25. package/dist/picteus-ws-client/apis/SettingsApi.d.ts +1 -1
  26. package/dist/picteus-ws-client/apis/SettingsApi.js +1 -1
  27. package/dist/picteus-ws-client/models/ApiSecret.d.ts +1 -1
  28. package/dist/picteus-ws-client/models/ApiSecret.js +1 -1
  29. package/dist/picteus-ws-client/models/ApiSecretSummary.d.ts +1 -1
  30. package/dist/picteus-ws-client/models/ApiSecretSummary.js +1 -1
  31. package/dist/picteus-ws-client/models/ApiSecretType.d.ts +1 -1
  32. package/dist/picteus-ws-client/models/ApiSecretType.js +1 -1
  33. package/dist/picteus-ws-client/models/ApplicationConfiguration.d.ts +1 -1
  34. package/dist/picteus-ws-client/models/ApplicationConfiguration.js +1 -1
  35. package/dist/picteus-ws-client/models/ApplicationMetadata.d.ts +1 -1
  36. package/dist/picteus-ws-client/models/ApplicationMetadata.js +1 -1
  37. package/dist/picteus-ws-client/models/ApplicationMetadataItem.d.ts +1 -1
  38. package/dist/picteus-ws-client/models/ApplicationMetadataItem.js +1 -1
  39. package/dist/picteus-ws-client/models/ApplicationMetadataItemValue.d.ts +4 -2
  40. package/dist/picteus-ws-client/models/ApplicationMetadataItemValue.js +1 -1
  41. package/dist/picteus-ws-client/models/ApplicationSettings.d.ts +1 -1
  42. package/dist/picteus-ws-client/models/ApplicationSettings.js +1 -1
  43. package/dist/picteus-ws-client/models/Collection.d.ts +1 -1
  44. package/dist/picteus-ws-client/models/Collection.js +1 -1
  45. package/dist/picteus-ws-client/models/CommandEntity.d.ts +1 -1
  46. package/dist/picteus-ws-client/models/CommandEntity.js +1 -1
  47. package/dist/picteus-ws-client/models/ComputedImageFormat.d.ts +1 -1
  48. package/dist/picteus-ws-client/models/ComputedImageFormat.js +1 -1
  49. package/dist/picteus-ws-client/models/ConfigurationCapability.d.ts +1 -1
  50. package/dist/picteus-ws-client/models/ConfigurationCapability.js +1 -1
  51. package/dist/picteus-ws-client/models/ConfigurationExtensionCommand.d.ts +1 -1
  52. package/dist/picteus-ws-client/models/ConfigurationExtensionCommand.js +1 -1
  53. package/dist/picteus-ws-client/models/ConstantsRegistry.d.ts +1 -1
  54. package/dist/picteus-ws-client/models/ConstantsRegistry.js +1 -1
  55. package/dist/picteus-ws-client/models/Dates.d.ts +1 -1
  56. package/dist/picteus-ws-client/models/Dates.js +1 -1
  57. package/dist/picteus-ws-client/models/Extension.d.ts +5 -5
  58. package/dist/picteus-ws-client/models/Extension.js +5 -5
  59. package/dist/picteus-ws-client/models/ExtensionActivity.d.ts +23 -5
  60. package/dist/picteus-ws-client/models/ExtensionActivity.js +17 -5
  61. package/dist/picteus-ws-client/models/ExtensionActivityKind.d.ts +1 -1
  62. package/dist/picteus-ws-client/models/ExtensionActivityKind.js +1 -1
  63. package/dist/picteus-ws-client/models/ExtensionActivityState.d.ts +25 -0
  64. package/dist/picteus-ws-client/models/ExtensionActivityState.js +43 -0
  65. package/dist/picteus-ws-client/models/ExtensionAndManual.d.ts +5 -5
  66. package/dist/picteus-ws-client/models/ExtensionAndManual.js +5 -5
  67. package/dist/picteus-ws-client/models/ExtensionCategory.d.ts +1 -1
  68. package/dist/picteus-ws-client/models/ExtensionCategory.js +1 -1
  69. package/dist/picteus-ws-client/models/ExtensionGenerationOptions.d.ts +1 -1
  70. package/dist/picteus-ws-client/models/ExtensionGenerationOptions.js +1 -1
  71. package/dist/picteus-ws-client/models/ExtensionIdImageEmbeddingName.d.ts +1 -1
  72. package/dist/picteus-ws-client/models/ExtensionIdImageEmbeddingName.js +1 -1
  73. package/dist/picteus-ws-client/models/ExtensionImageEmbeddings.d.ts +1 -1
  74. package/dist/picteus-ws-client/models/ExtensionImageEmbeddings.js +1 -1
  75. package/dist/picteus-ws-client/models/ExtensionImageFeature.d.ts +1 -1
  76. package/dist/picteus-ws-client/models/ExtensionImageFeature.js +1 -1
  77. package/dist/picteus-ws-client/models/ExtensionImageFeatureName.d.ts +1 -1
  78. package/dist/picteus-ws-client/models/ExtensionImageFeatureName.js +1 -1
  79. package/dist/picteus-ws-client/models/ExtensionImageFeaturesAttribute.d.ts +1 -1
  80. package/dist/picteus-ws-client/models/ExtensionImageFeaturesAttribute.js +1 -1
  81. package/dist/picteus-ws-client/models/ExtensionImageTag.d.ts +1 -1
  82. package/dist/picteus-ws-client/models/ExtensionImageTag.js +1 -1
  83. package/dist/picteus-ws-client/models/ExtensionImageTagsAttribute.d.ts +1 -1
  84. package/dist/picteus-ws-client/models/ExtensionImageTagsAttribute.js +1 -1
  85. package/dist/picteus-ws-client/models/ExtensionManual.d.ts +1 -1
  86. package/dist/picteus-ws-client/models/ExtensionManual.js +1 -1
  87. package/dist/picteus-ws-client/models/ExtensionSettings.d.ts +5 -3
  88. package/dist/picteus-ws-client/models/ExtensionSettings.js +1 -1
  89. package/dist/picteus-ws-client/models/ExtensionState.d.ts +25 -0
  90. package/dist/picteus-ws-client/models/ExtensionState.js +43 -0
  91. package/dist/picteus-ws-client/models/ExtensionsConfiguration.d.ts +1 -1
  92. package/dist/picteus-ws-client/models/ExtensionsConfiguration.js +1 -1
  93. package/dist/picteus-ws-client/models/GenerationRecipe.d.ts +13 -1
  94. package/dist/picteus-ws-client/models/GenerationRecipe.js +5 -1
  95. package/dist/picteus-ws-client/models/GenerationRecipePrompt.d.ts +1 -1
  96. package/dist/picteus-ws-client/models/GenerationRecipePrompt.js +1 -1
  97. package/dist/picteus-ws-client/models/Image.d.ts +1 -1
  98. package/dist/picteus-ws-client/models/Image.js +1 -1
  99. package/dist/picteus-ws-client/models/ImageDimensions.d.ts +1 -1
  100. package/dist/picteus-ws-client/models/ImageDimensions.js +1 -1
  101. package/dist/picteus-ws-client/models/ImageDistance.d.ts +1 -1
  102. package/dist/picteus-ws-client/models/ImageDistance.js +1 -1
  103. package/dist/picteus-ws-client/models/ImageEmbedding.d.ts +1 -1
  104. package/dist/picteus-ws-client/models/ImageEmbedding.js +1 -1
  105. package/dist/picteus-ws-client/models/ImageFeature.d.ts +1 -1
  106. package/dist/picteus-ws-client/models/ImageFeature.js +1 -1
  107. package/dist/picteus-ws-client/models/ImageFeatureFormat.d.ts +3 -1
  108. package/dist/picteus-ws-client/models/ImageFeatureFormat.js +4 -2
  109. package/dist/picteus-ws-client/models/ImageFeatureNullValue.d.ts +1 -1
  110. package/dist/picteus-ws-client/models/ImageFeatureNullValue.js +1 -1
  111. package/dist/picteus-ws-client/models/ImageFeatureType.d.ts +2 -1
  112. package/dist/picteus-ws-client/models/ImageFeatureType.js +2 -1
  113. package/dist/picteus-ws-client/models/ImageFeatureValue.d.ts +1 -1
  114. package/dist/picteus-ws-client/models/ImageFeatureValue.js +1 -1
  115. package/dist/picteus-ws-client/models/ImageFormat.d.ts +1 -1
  116. package/dist/picteus-ws-client/models/ImageFormat.js +1 -1
  117. package/dist/picteus-ws-client/models/ImageMediaUrl.d.ts +1 -1
  118. package/dist/picteus-ws-client/models/ImageMediaUrl.js +1 -1
  119. package/dist/picteus-ws-client/models/ImageMetadata.d.ts +1 -1
  120. package/dist/picteus-ws-client/models/ImageMetadata.js +1 -1
  121. package/dist/picteus-ws-client/models/ImageResizeRender.d.ts +1 -1
  122. package/dist/picteus-ws-client/models/ImageResizeRender.js +1 -1
  123. package/dist/picteus-ws-client/models/ImageSummary.d.ts +1 -1
  124. package/dist/picteus-ws-client/models/ImageSummary.js +1 -1
  125. package/dist/picteus-ws-client/models/InstructionsPrompt.d.ts +5 -3
  126. package/dist/picteus-ws-client/models/InstructionsPrompt.js +1 -1
  127. package/dist/picteus-ws-client/models/Manifest.d.ts +5 -3
  128. package/dist/picteus-ws-client/models/Manifest.js +1 -1
  129. package/dist/picteus-ws-client/models/ManifestCapability.d.ts +1 -1
  130. package/dist/picteus-ws-client/models/ManifestCapability.js +1 -1
  131. package/dist/picteus-ws-client/models/ManifestCapabilityId.d.ts +1 -1
  132. package/dist/picteus-ws-client/models/ManifestCapabilityId.js +1 -1
  133. package/dist/picteus-ws-client/models/ManifestEvent.d.ts +1 -3
  134. package/dist/picteus-ws-client/models/ManifestEvent.js +1 -3
  135. package/dist/picteus-ws-client/models/ManifestExecution.d.ts +1 -1
  136. package/dist/picteus-ws-client/models/ManifestExecution.js +1 -1
  137. package/dist/picteus-ws-client/models/ManifestExtensionCommand.d.ts +5 -3
  138. package/dist/picteus-ws-client/models/ManifestExtensionCommand.js +1 -1
  139. package/dist/picteus-ws-client/models/ManifestExtensionCommandOn.d.ts +1 -1
  140. package/dist/picteus-ws-client/models/ManifestExtensionCommandOn.js +1 -1
  141. package/dist/picteus-ws-client/models/ManifestExtensionCommandSpecification.d.ts +1 -1
  142. package/dist/picteus-ws-client/models/ManifestExtensionCommandSpecification.js +1 -1
  143. package/dist/picteus-ws-client/models/ManifestExtensionCommandUi.d.ts +1 -1
  144. package/dist/picteus-ws-client/models/ManifestExtensionCommandUi.js +1 -1
  145. package/dist/picteus-ws-client/models/ManifestInstructions.d.ts +1 -1
  146. package/dist/picteus-ws-client/models/ManifestInstructions.js +1 -1
  147. package/dist/picteus-ws-client/models/ManifestInterfaceElement.d.ts +1 -1
  148. package/dist/picteus-ws-client/models/ManifestInterfaceElement.js +1 -1
  149. package/dist/picteus-ws-client/models/ManifestInterfaceElementIntegration.d.ts +1 -1
  150. package/dist/picteus-ws-client/models/ManifestInterfaceElementIntegration.js +1 -1
  151. package/dist/picteus-ws-client/models/ManifestRuntime.d.ts +1 -1
  152. package/dist/picteus-ws-client/models/ManifestRuntime.js +1 -1
  153. package/dist/picteus-ws-client/models/ManifestRuntimeEnvironment.d.ts +1 -1
  154. package/dist/picteus-ws-client/models/ManifestRuntimeEnvironment.js +1 -1
  155. package/dist/picteus-ws-client/models/ManifestThrottlingPolicy.d.ts +1 -1
  156. package/dist/picteus-ws-client/models/ManifestThrottlingPolicy.js +1 -1
  157. package/dist/picteus-ws-client/models/ManifestUserInterface.d.ts +1 -1
  158. package/dist/picteus-ws-client/models/ManifestUserInterface.js +1 -1
  159. package/dist/picteus-ws-client/models/PromptKind.d.ts +1 -1
  160. package/dist/picteus-ws-client/models/PromptKind.js +1 -1
  161. package/dist/picteus-ws-client/models/Repository.d.ts +5 -5
  162. package/dist/picteus-ws-client/models/Repository.js +5 -5
  163. package/dist/picteus-ws-client/models/RepositoryActivity.d.ts +1 -1
  164. package/dist/picteus-ws-client/models/RepositoryActivity.js +1 -1
  165. package/dist/picteus-ws-client/models/RepositoryActivityKind.d.ts +1 -1
  166. package/dist/picteus-ws-client/models/RepositoryActivityKind.js +1 -1
  167. package/dist/picteus-ws-client/models/RepositoryLocationType.d.ts +1 -1
  168. package/dist/picteus-ws-client/models/RepositoryLocationType.js +1 -1
  169. package/dist/picteus-ws-client/models/RepositoryState.d.ts +27 -0
  170. package/dist/picteus-ws-client/models/RepositoryState.js +45 -0
  171. package/dist/picteus-ws-client/models/RunCommandParameters.d.ts +5 -3
  172. package/dist/picteus-ws-client/models/RunCommandParameters.js +1 -1
  173. package/dist/picteus-ws-client/models/SearchCriteria.d.ts +1 -1
  174. package/dist/picteus-ws-client/models/SearchCriteria.js +1 -1
  175. package/dist/picteus-ws-client/models/SearchFeatureComparisonOperator.d.ts +1 -1
  176. package/dist/picteus-ws-client/models/SearchFeatureComparisonOperator.js +1 -1
  177. package/dist/picteus-ws-client/models/SearchFeatureCondition.d.ts +1 -1
  178. package/dist/picteus-ws-client/models/SearchFeatureCondition.js +1 -1
  179. package/dist/picteus-ws-client/models/SearchFeatureConditionValue.d.ts +1 -1
  180. package/dist/picteus-ws-client/models/SearchFeatureConditionValue.js +1 -1
  181. package/dist/picteus-ws-client/models/SearchFeatureLogicalOperator.d.ts +1 -1
  182. package/dist/picteus-ws-client/models/SearchFeatureLogicalOperator.js +1 -1
  183. package/dist/picteus-ws-client/models/SearchFeatures.d.ts +1 -1
  184. package/dist/picteus-ws-client/models/SearchFeatures.js +1 -1
  185. package/dist/picteus-ws-client/models/SearchFeaturesResult.d.ts +1 -1
  186. package/dist/picteus-ws-client/models/SearchFeaturesResult.js +1 -1
  187. package/dist/picteus-ws-client/models/SearchFilter.d.ts +1 -1
  188. package/dist/picteus-ws-client/models/SearchFilter.js +1 -1
  189. package/dist/picteus-ws-client/models/SearchFilterOrigin.d.ts +1 -1
  190. package/dist/picteus-ws-client/models/SearchFilterOrigin.js +1 -1
  191. package/dist/picteus-ws-client/models/SearchImageIdResult.d.ts +1 -1
  192. package/dist/picteus-ws-client/models/SearchImageIdResult.js +1 -1
  193. package/dist/picteus-ws-client/models/SearchImageResult.d.ts +1 -1
  194. package/dist/picteus-ws-client/models/SearchImageResult.js +1 -1
  195. package/dist/picteus-ws-client/models/SearchImageSummaryResult.d.ts +1 -1
  196. package/dist/picteus-ws-client/models/SearchImageSummaryResult.js +1 -1
  197. package/dist/picteus-ws-client/models/SearchImagesOrigin.d.ts +1 -1
  198. package/dist/picteus-ws-client/models/SearchImagesOrigin.js +1 -1
  199. package/dist/picteus-ws-client/models/SearchKeyword.d.ts +1 -1
  200. package/dist/picteus-ws-client/models/SearchKeyword.js +1 -1
  201. package/dist/picteus-ws-client/models/SearchMediaUrlResult.d.ts +1 -1
  202. package/dist/picteus-ws-client/models/SearchMediaUrlResult.js +1 -1
  203. package/dist/picteus-ws-client/models/SearchOriginNature.d.ts +1 -1
  204. package/dist/picteus-ws-client/models/SearchOriginNature.js +1 -1
  205. package/dist/picteus-ws-client/models/SearchParameters.d.ts +1 -1
  206. package/dist/picteus-ws-client/models/SearchParameters.js +1 -1
  207. package/dist/picteus-ws-client/models/SearchProperties.d.ts +1 -1
  208. package/dist/picteus-ws-client/models/SearchProperties.js +1 -1
  209. package/dist/picteus-ws-client/models/SearchPropertyRange.d.ts +1 -1
  210. package/dist/picteus-ws-client/models/SearchPropertyRange.js +1 -1
  211. package/dist/picteus-ws-client/models/SearchRange.d.ts +1 -1
  212. package/dist/picteus-ws-client/models/SearchRange.js +1 -1
  213. package/dist/picteus-ws-client/models/SearchRepositoriesOrigin.d.ts +1 -1
  214. package/dist/picteus-ws-client/models/SearchRepositoriesOrigin.js +1 -1
  215. package/dist/picteus-ws-client/models/SearchSorting.d.ts +1 -1
  216. package/dist/picteus-ws-client/models/SearchSorting.js +1 -1
  217. package/dist/picteus-ws-client/models/SearchSortingProperty.d.ts +1 -1
  218. package/dist/picteus-ws-client/models/SearchSortingProperty.js +1 -1
  219. package/dist/picteus-ws-client/models/SearchTags.d.ts +1 -1
  220. package/dist/picteus-ws-client/models/SearchTags.js +1 -1
  221. package/dist/picteus-ws-client/models/SearchTagsResult.d.ts +1 -1
  222. package/dist/picteus-ws-client/models/SearchTagsResult.js +1 -1
  223. package/dist/picteus-ws-client/models/Software.d.ts +1 -1
  224. package/dist/picteus-ws-client/models/Software.js +1 -1
  225. package/dist/picteus-ws-client/models/TextualPrompt.d.ts +1 -1
  226. package/dist/picteus-ws-client/models/TextualPrompt.js +1 -1
  227. package/dist/picteus-ws-client/models/UserInterfaceAnchor.d.ts +1 -1
  228. package/dist/picteus-ws-client/models/UserInterfaceAnchor.js +1 -1
  229. package/dist/picteus-ws-client/models/UserInterfaceSidebarIntegration.d.ts +1 -1
  230. package/dist/picteus-ws-client/models/UserInterfaceSidebarIntegration.js +1 -1
  231. package/dist/picteus-ws-client/models/UserInterfaceWindowIntegration.d.ts +1 -1
  232. package/dist/picteus-ws-client/models/UserInterfaceWindowIntegration.js +1 -1
  233. package/dist/picteus-ws-client/models/index.d.ts +3 -3
  234. package/dist/picteus-ws-client/models/index.js +3 -3
  235. package/dist/picteus-ws-client/runtime.d.ts +1 -1
  236. package/dist/picteus-ws-client/runtime.js +1 -1
  237. package/dist/picteusExtension.d.ts +1 -1
  238. package/dist/picteusExtension.js +18 -15
  239. package/package.json +1 -1
@@ -0,0 +1,4022 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Auto-generated by @picteus/specification-factory emitter. Do not edit directly.
3
+ // ---------------------------------------------------------------------------
4
+ /** Generic base class providing recursive JSON serialization for all model instances. */
5
+ export class ViewKitNode {
6
+ /**
7
+ * Serializes this model instance into a strongly-typed, JSON-compatible plain object.
8
+ *
9
+ * @returns The plain object representation conforming to interface `T`.
10
+ */
11
+ toJSON() {
12
+ const result = {};
13
+ for (const [key, value] of Object.entries(this)) {
14
+ if (value !== undefined) {
15
+ if (Array.isArray(value)) {
16
+ result[key] = value.map((item) => {
17
+ return item && typeof item === "object" && typeof item.toJSON === "function"
18
+ ? item.toJSON()
19
+ : item;
20
+ });
21
+ }
22
+ else if (value && typeof value === "object" && typeof value.toJSON === "function") {
23
+ result[key] = value.toJSON();
24
+ }
25
+ else {
26
+ result[key] = value;
27
+ }
28
+ }
29
+ }
30
+ return result;
31
+ }
32
+ /**
33
+ * Returns the compact JSON string representation of this model instance with no indentation.
34
+ *
35
+ * @returns Compact JSON string without indentation.
36
+ */
37
+ toString() {
38
+ return JSON.stringify(this.toJSON());
39
+ }
40
+ }
41
+ /** Typographic stroke weight styling. */
42
+ export var TextWeight;
43
+ (function (TextWeight) {
44
+ // Thin / light text weight
45
+ TextWeight["thin"] = "thin";
46
+ // Standard text weight
47
+ TextWeight["normal"] = "normal";
48
+ // Heavy / bold text weight
49
+ TextWeight["heavy"] = "heavy";
50
+ })(TextWeight || (TextWeight = {}));
51
+ /** Visual text color intensity and contrast. */
52
+ export var TextIntensity;
53
+ (function (TextIntensity) {
54
+ // Low visual contrast / subdued text color
55
+ TextIntensity["low"] = "low";
56
+ // Standard text color
57
+ TextIntensity["medium"] = "medium";
58
+ // High visual contrast / intense text color
59
+ TextIntensity["high"] = "high";
60
+ })(TextIntensity || (TextIntensity = {}));
61
+ /** Geometric shape representation for visual containers and indicators. */
62
+ export var Shape;
63
+ (function (Shape) {
64
+ // Circular container shape
65
+ Shape["circle"] = "circle";
66
+ // Square container shape
67
+ Shape["square"] = "square";
68
+ })(Shape || (Shape = {}));
69
+ /** Relative sizing scale for visual elements and indicators. */
70
+ export var Size;
71
+ (function (Size) {
72
+ // Compact small size
73
+ Size["small"] = "small";
74
+ // Standard medium size
75
+ Size["medium"] = "medium";
76
+ // Prominent large size
77
+ Size["large"] = "large";
78
+ })(Size || (Size = {}));
79
+ /** Representation style for short string values. */
80
+ export var StringShortRepresentation;
81
+ (function (StringShortRepresentation) {
82
+ // Standard plain text rendering
83
+ StringShortRepresentation["plain"] = "plain";
84
+ // Visual chip / tag pill representation
85
+ StringShortRepresentation["chip"] = "chip";
86
+ })(StringShortRepresentation || (StringShortRepresentation = {}));
87
+ /** Supported syntax highlighting languages for formatted code blocks. */
88
+ export var CodeLanguage;
89
+ (function (CodeLanguage) {
90
+ // XML markup syntax
91
+ CodeLanguage["xml"] = "xml";
92
+ // JSON format syntax
93
+ CodeLanguage["json"] = "json";
94
+ // YAML format syntax
95
+ CodeLanguage["yaml"] = "yaml";
96
+ })(CodeLanguage || (CodeLanguage = {}));
97
+ /** Visual color tone variants for badge pill representations. */
98
+ export var BadgeVariant;
99
+ (function (BadgeVariant) {
100
+ // Neutral gray tone
101
+ BadgeVariant["neutral"] = "neutral";
102
+ // Success green tone
103
+ BadgeVariant["success"] = "success";
104
+ // Warning yellow/orange tone
105
+ BadgeVariant["warning"] = "warning";
106
+ // Danger red tone
107
+ BadgeVariant["danger"] = "danger";
108
+ })(BadgeVariant || (BadgeVariant = {}));
109
+ /** Presentation format styles for timestamp elements. */
110
+ export var TimestampFormat;
111
+ (function (TimestampFormat) {
112
+ // Complete date and time display
113
+ TimestampFormat["datetime"] = "datetime";
114
+ // Date-only display
115
+ TimestampFormat["date"] = "date";
116
+ // Time-only display
117
+ TimestampFormat["time"] = "time";
118
+ // Relative time expression (e.g. "5 minutes ago")
119
+ TimestampFormat["relative"] = "relative";
120
+ })(TimestampFormat || (TimestampFormat = {}));
121
+ /** Visual style variants for interactive button actions. */
122
+ export var ButtonVariant;
123
+ (function (ButtonVariant) {
124
+ // Primary emphasis button style for default/recommended actions
125
+ ButtonVariant["primary"] = "primary";
126
+ // Secondary standard button style
127
+ ButtonVariant["secondary"] = "secondary";
128
+ // Subtle low-contrast button style
129
+ ButtonVariant["subtle"] = "subtle";
130
+ // Destructive / dangerous action button style
131
+ ButtonVariant["danger"] = "danger";
132
+ })(ButtonVariant || (ButtonVariant = {}));
133
+ /** Text horizontal alignment options for table columns. */
134
+ export var TableColumnAlign;
135
+ (function (TableColumnAlign) {
136
+ // Left-aligned text
137
+ TableColumnAlign["left"] = "left";
138
+ // Center-aligned text
139
+ TableColumnAlign["center"] = "center";
140
+ // Right-aligned text
141
+ TableColumnAlign["right"] = "right";
142
+ })(TableColumnAlign || (TableColumnAlign = {}));
143
+ /** Visual styling variants for hairline dividers. */
144
+ export var DividerStyle;
145
+ (function (DividerStyle) {
146
+ // Subtle thin hairline border
147
+ DividerStyle["hairline"] = "hairline";
148
+ // Solid standard divider line
149
+ DividerStyle["solid"] = "solid";
150
+ // Dashed separator line
151
+ DividerStyle["dashed"] = "dashed";
152
+ })(DividerStyle || (DividerStyle = {}));
153
+ /** Abstract base class for all `UiElement` models. */
154
+ export class BaseUiElement extends ViewKitNode {
155
+ }
156
+ /** Abstract base class for all `UiAction` models. */
157
+ export class BaseUiAction extends ViewKitNode {
158
+ }
159
+ // --- Concrete Model Classes Implementing Interfaces ---
160
+ /**
161
+ * Class implementation of the `TruncateOptions` interface.
162
+ *
163
+ * @remarks
164
+ * Truncation configuration for long textual content with optional expand affordance.
165
+ */
166
+ export class TruncateOptionsClass extends ViewKitNode {
167
+ /** Maximum number of characters to display before truncating */
168
+ characterLimit;
169
+ /**
170
+ * Whether to render a "Show more" / "Show less" toggle affordance
171
+ *
172
+ * @defaultValue true
173
+ */
174
+ showMore;
175
+ /**
176
+ * Constructs a new `TruncateOptionsClass` instance.
177
+ *
178
+ * @param characterLimit - Maximum number of characters to display before truncating
179
+ * @param options - Optional component settings. (showMore (defaults to `true`)).
180
+ */
181
+ constructor(characterLimit, options) {
182
+ super();
183
+ this.characterLimit = characterLimit;
184
+ this.showMore = options?.showMore ?? true;
185
+ }
186
+ }
187
+ /**
188
+ * Class implementation of the `BaseModifiers` interface.
189
+ *
190
+ * @remarks
191
+ * Base modifier traits for elements that support copy affordance.
192
+ */
193
+ export class BaseModifiersClass extends ViewKitNode {
194
+ /** Adds an interactive copy button/action next to the rendered value */
195
+ copyable;
196
+ /**
197
+ * Constructs a new `BaseModifiersClass` instance.
198
+ *
199
+ * @param options - Optional component settings. (copyable).
200
+ */
201
+ constructor(options) {
202
+ super();
203
+ this.copyable = options?.copyable;
204
+ }
205
+ }
206
+ /**
207
+ * Class implementation of the `PrimitiveModifiers` interface.
208
+ *
209
+ * @remarks
210
+ * Common modifier traits that can be attached to primitive elements.
211
+ */
212
+ export class PrimitiveModifiersClass extends ViewKitNode {
213
+ /** Configures character truncation threshold with show-more affordance */
214
+ truncate;
215
+ /**
216
+ * Typographic text weight
217
+ *
218
+ * @defaultValue TextWeight.normal
219
+ */
220
+ weight;
221
+ /**
222
+ * Visual text color intensity
223
+ *
224
+ * @defaultValue TextIntensity.medium
225
+ */
226
+ intensity;
227
+ /**
228
+ * Whether to use monospace font rendering (for hashes, IDs, codes)
229
+ *
230
+ * @defaultValue false
231
+ */
232
+ monospace;
233
+ /** Adds an interactive copy button/action next to the rendered value */
234
+ copyable;
235
+ /**
236
+ * Constructs a new `PrimitiveModifiersClass` instance.
237
+ *
238
+ * @param options - Optional component settings. (truncate, weight (defaults to `normal`), intensity (defaults to `medium`), monospace (defaults to `false`), copyable).
239
+ */
240
+ constructor(options) {
241
+ super();
242
+ this.truncate = options?.truncate;
243
+ this.weight = options?.weight ?? TextWeight.normal;
244
+ this.intensity = options?.intensity ?? TextIntensity.medium;
245
+ this.monospace = options?.monospace ?? false;
246
+ this.copyable = options?.copyable;
247
+ }
248
+ }
249
+ /**
250
+ * Class implementation of the `StringShortElement` interface.
251
+ *
252
+ * @remarks
253
+ * Short string primitive element.
254
+ * Supports plain text or compact chip pill presentation.
255
+ */
256
+ export class StringShortElementClass extends BaseUiElement {
257
+ /**
258
+ * Discriminator identifier for `StringShortElement`.
259
+ *
260
+ * @defaultValue "string-short"
261
+ */
262
+ type = "string-short";
263
+ /** Text value */
264
+ value;
265
+ /**
266
+ * Display representation mode
267
+ *
268
+ * @defaultValue StringShortRepresentation.plain
269
+ */
270
+ representation;
271
+ /** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
272
+ modifiers;
273
+ /**
274
+ * Constructs a new `StringShortElementClass` instance.
275
+ *
276
+ * @param value - Text value
277
+ * @param options - Optional component settings. (representation (defaults to `plain`), modifiers).
278
+ */
279
+ constructor(value, options) {
280
+ super();
281
+ this.value = value;
282
+ this.representation = options?.representation ?? StringShortRepresentation.plain;
283
+ this.modifiers = options?.modifiers;
284
+ }
285
+ }
286
+ /**
287
+ * Class implementation of the `StringLongElement` interface.
288
+ *
289
+ * @remarks
290
+ * Multiline text block primitive element for descriptions, comments, or prose.
291
+ */
292
+ export class StringLongElementClass extends BaseUiElement {
293
+ /**
294
+ * Discriminator identifier for `StringLongElement`.
295
+ *
296
+ * @defaultValue "string-long"
297
+ */
298
+ type = "string-long";
299
+ /** Text value */
300
+ value;
301
+ /** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
302
+ modifiers;
303
+ /**
304
+ * Constructs a new `StringLongElementClass` instance.
305
+ *
306
+ * @param value - Text value
307
+ * @param options - Optional component settings. (modifiers).
308
+ */
309
+ constructor(value, options) {
310
+ super();
311
+ this.value = value;
312
+ this.modifiers = options?.modifiers;
313
+ }
314
+ }
315
+ /**
316
+ * Class implementation of the `StringCodeElement` interface.
317
+ *
318
+ * @remarks
319
+ * Monospace code block or formatted code snippet representation.
320
+ */
321
+ export class StringCodeElementClass extends BaseUiElement {
322
+ /**
323
+ * Discriminator identifier for `StringCodeElement`.
324
+ *
325
+ * @defaultValue "string-code"
326
+ */
327
+ type = "string-code";
328
+ /** Text value */
329
+ value;
330
+ /** Optional syntax highlighting language identifier */
331
+ language;
332
+ /** Optional visual modifiers (copyable) */
333
+ modifiers;
334
+ /**
335
+ * Constructs a new `StringCodeElementClass` instance.
336
+ *
337
+ * @param value - Text value
338
+ * @param options - Optional component settings. (language, modifiers).
339
+ */
340
+ constructor(value, options) {
341
+ super();
342
+ this.value = value;
343
+ this.language = options?.language;
344
+ this.modifiers = options?.modifiers;
345
+ }
346
+ }
347
+ /**
348
+ * Class implementation of the `XmlElement` interface.
349
+ *
350
+ * @remarks
351
+ * XML markup code block element.
352
+ */
353
+ export class XmlElementClass extends BaseUiElement {
354
+ /**
355
+ * Discriminator identifier for `XmlElement`.
356
+ *
357
+ * @defaultValue "xml"
358
+ */
359
+ type = "xml";
360
+ /** XML content value */
361
+ value;
362
+ /** Optional visual modifiers (copyable) */
363
+ modifiers;
364
+ /**
365
+ * Constructs a new `XmlElementClass` instance.
366
+ *
367
+ * @param value - XML content value
368
+ * @param options - Optional component settings. (modifiers).
369
+ */
370
+ constructor(value, options) {
371
+ super();
372
+ this.value = value;
373
+ this.modifiers = options?.modifiers;
374
+ }
375
+ }
376
+ /**
377
+ * Class implementation of the `JsonElement` interface.
378
+ *
379
+ * @remarks
380
+ * JSON data or structure representation element.
381
+ */
382
+ export class JsonElementClass extends BaseUiElement {
383
+ /**
384
+ * Discriminator identifier for `JsonElement`.
385
+ *
386
+ * @defaultValue "json"
387
+ */
388
+ type = "json";
389
+ /** JSON content value */
390
+ value;
391
+ /** Optional visual modifiers (copyable) */
392
+ modifiers;
393
+ /**
394
+ * Constructs a new `JsonElementClass` instance.
395
+ *
396
+ * @param value - JSON content value
397
+ * @param options - Optional component settings. (modifiers).
398
+ */
399
+ constructor(value, options) {
400
+ super();
401
+ this.value = value;
402
+ this.modifiers = options?.modifiers;
403
+ }
404
+ }
405
+ /**
406
+ * Class implementation of the `StringUrlElement` interface.
407
+ *
408
+ * @remarks
409
+ * Hyperlink representation for external or internal URL navigation.
410
+ */
411
+ export class StringUrlElementClass extends BaseUiElement {
412
+ /**
413
+ * Discriminator identifier for `StringUrlElement`.
414
+ *
415
+ * @defaultValue "string-url"
416
+ */
417
+ type = "string-url";
418
+ /** Target URL or navigation destination */
419
+ value;
420
+ /** Optional custom anchor text label */
421
+ label;
422
+ /** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
423
+ modifiers;
424
+ /**
425
+ * Constructs a new `StringUrlElementClass` instance.
426
+ *
427
+ * @param value - Target URL or navigation destination
428
+ * @param options - Optional component settings. (label, modifiers).
429
+ */
430
+ constructor(value, options) {
431
+ super();
432
+ this.value = value;
433
+ this.label = options?.label;
434
+ this.modifiers = options?.modifiers;
435
+ }
436
+ }
437
+ /**
438
+ * Class implementation of the `IdentifierElement` interface.
439
+ *
440
+ * @remarks
441
+ * Monospace semantic identifier representation.
442
+ */
443
+ export class IdentifierElementClass extends BaseUiElement {
444
+ /**
445
+ * Discriminator identifier for `IdentifierElement`.
446
+ *
447
+ * @defaultValue "identifier"
448
+ */
449
+ type = "identifier";
450
+ /** Identifier string value */
451
+ value;
452
+ /** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
453
+ modifiers;
454
+ /**
455
+ * Constructs a new `IdentifierElementClass` instance.
456
+ *
457
+ * @param value - Identifier string value
458
+ * @param options - Optional component settings. (modifiers).
459
+ */
460
+ constructor(value, options) {
461
+ super();
462
+ this.value = value;
463
+ this.modifiers = options?.modifiers;
464
+ }
465
+ }
466
+ /**
467
+ * Class implementation of the `RatioElement` interface.
468
+ *
469
+ * @remarks
470
+ * Aspect ratio representation (e.g. "16:9", "4:3", "1:1").
471
+ */
472
+ export class RatioElementClass extends BaseUiElement {
473
+ /**
474
+ * Discriminator identifier for `RatioElement`.
475
+ *
476
+ * @defaultValue "ratio"
477
+ */
478
+ type = "ratio";
479
+ /** Aspect ratio numerical expression */
480
+ value;
481
+ /** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
482
+ modifiers;
483
+ /**
484
+ * Constructs a new `RatioElementClass` instance.
485
+ *
486
+ * @param value - Aspect ratio numerical expression
487
+ * @param options - Optional component settings. (modifiers).
488
+ */
489
+ constructor(value, options) {
490
+ super();
491
+ this.value = value;
492
+ this.modifiers = options?.modifiers;
493
+ }
494
+ }
495
+ /**
496
+ * Class implementation of the `ColourElement` interface.
497
+ *
498
+ * @remarks
499
+ * Single color representation with hex value, shape/size styling, text display toggle, and copy affordance.
500
+ */
501
+ export class ColourElementClass extends BaseUiElement {
502
+ /**
503
+ * Discriminator identifier for `ColourElement`.
504
+ *
505
+ * @defaultValue "color"
506
+ */
507
+ type = "color";
508
+ /** Hexadecimal color code */
509
+ value;
510
+ /** Optional descriptive color name label */
511
+ label;
512
+ /**
513
+ * Whether to display the textual color code or label next to the swatch
514
+ *
515
+ * @defaultValue true
516
+ */
517
+ showText;
518
+ /**
519
+ * Visual shape of the color indicator
520
+ *
521
+ * @defaultValue Shape.circle
522
+ */
523
+ shape;
524
+ /**
525
+ * Visual size of the color indicator
526
+ *
527
+ * @defaultValue Size.medium
528
+ */
529
+ size;
530
+ /** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
531
+ modifiers;
532
+ /**
533
+ * Constructs a new `ColourElementClass` instance.
534
+ *
535
+ * @param value - Hexadecimal color code
536
+ * @param options - Optional component settings. (label, showText (defaults to `true`), shape (defaults to `circle`), size (defaults to `medium`), modifiers).
537
+ */
538
+ constructor(value, options) {
539
+ super();
540
+ this.value = value;
541
+ this.label = options?.label;
542
+ this.showText = options?.showText ?? true;
543
+ this.shape = options?.shape ?? Shape.circle;
544
+ this.size = options?.size ?? Size.medium;
545
+ this.modifiers = options?.modifiers;
546
+ }
547
+ }
548
+ /**
549
+ * Class implementation of the `NumberUnboundedElement` interface.
550
+ *
551
+ * @remarks
552
+ * Plain unbounded numeric value primitive element.
553
+ */
554
+ export class NumberUnboundedElementClass extends BaseUiElement {
555
+ /**
556
+ * Discriminator identifier for `NumberUnboundedElement`.
557
+ *
558
+ * @defaultValue "number-unbounded"
559
+ */
560
+ type = "number-unbounded";
561
+ /** Numeric value */
562
+ value;
563
+ /** Optional unit suffix (e.g. "px", "ms", "MB") */
564
+ unit;
565
+ /** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
566
+ modifiers;
567
+ /**
568
+ * Constructs a new `NumberUnboundedElementClass` instance.
569
+ *
570
+ * @param value - Numeric value
571
+ * @param options - Optional component settings. (unit, modifiers).
572
+ */
573
+ constructor(value, options) {
574
+ super();
575
+ this.value = value;
576
+ this.unit = options?.unit;
577
+ this.modifiers = options?.modifiers;
578
+ }
579
+ }
580
+ /**
581
+ * Class implementation of the `NumberBoundedStarsElement` interface.
582
+ *
583
+ * @remarks
584
+ * Bounded numeric rating represented as visual stars.
585
+ */
586
+ export class NumberBoundedStarsElementClass extends BaseUiElement {
587
+ /**
588
+ * Discriminator identifier for `NumberBoundedStarsElement`.
589
+ *
590
+ * @defaultValue "number-stars"
591
+ */
592
+ type = "number-stars";
593
+ /** Numeric rating score */
594
+ value;
595
+ /** Maximum rating scale (defaults to 5) */
596
+ maximum;
597
+ /** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
598
+ modifiers;
599
+ /**
600
+ * Constructs a new `NumberBoundedStarsElementClass` instance.
601
+ *
602
+ * @param value - Numeric rating score
603
+ * @param options - Optional component settings. (maximum, modifiers).
604
+ */
605
+ constructor(value, options) {
606
+ super();
607
+ this.value = value;
608
+ this.maximum = options?.maximum;
609
+ this.modifiers = options?.modifiers;
610
+ }
611
+ }
612
+ /**
613
+ * Class implementation of the `NumberBoundedMeterElement` interface.
614
+ *
615
+ * @remarks
616
+ * Bounded numeric meter representation (read-only progress / score bar).
617
+ */
618
+ export class NumberBoundedMeterElementClass extends BaseUiElement {
619
+ /**
620
+ * Discriminator identifier for `NumberBoundedMeterElement`.
621
+ *
622
+ * @defaultValue "number-meter"
623
+ */
624
+ type = "number-meter";
625
+ /** Numeric value */
626
+ value;
627
+ /** Minimum scale bound (defaults to 0) */
628
+ minimum;
629
+ /** Maximum scale bound (e.g. 100) */
630
+ maximum;
631
+ /** Optional custom text label override (e.g. "68 / 100") */
632
+ label;
633
+ /** Optional unit suffix (e.g. "%") */
634
+ unit;
635
+ /** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
636
+ modifiers;
637
+ /**
638
+ * Constructs a new `NumberBoundedMeterElementClass` instance.
639
+ *
640
+ * @param value - Numeric value
641
+ * @param options - Optional component settings. (minimum, maximum, label, unit, modifiers).
642
+ */
643
+ constructor(value, options) {
644
+ super();
645
+ this.value = value;
646
+ this.minimum = options?.minimum;
647
+ this.maximum = options?.maximum;
648
+ this.label = options?.label;
649
+ this.unit = options?.unit;
650
+ this.modifiers = options?.modifiers;
651
+ }
652
+ }
653
+ /**
654
+ * Class implementation of the `BooleanPlainElement` interface.
655
+ *
656
+ * @remarks
657
+ * Plain boolean value representation (textual "true" / "false").
658
+ */
659
+ export class BooleanPlainElementClass extends BaseUiElement {
660
+ /**
661
+ * Discriminator identifier for `BooleanPlainElement`.
662
+ *
663
+ * @defaultValue "boolean-plain"
664
+ */
665
+ type = "boolean-plain";
666
+ /** Boolean state value */
667
+ value;
668
+ /** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
669
+ modifiers;
670
+ /**
671
+ * Constructs a new `BooleanPlainElementClass` instance.
672
+ *
673
+ * @param value - Boolean state value
674
+ * @param options - Optional component settings. (modifiers).
675
+ */
676
+ constructor(value, options) {
677
+ super();
678
+ this.value = value;
679
+ this.modifiers = options?.modifiers;
680
+ }
681
+ }
682
+ /**
683
+ * Class implementation of the `BooleanBadgeElement` interface.
684
+ *
685
+ * @remarks
686
+ * Visual badge pill representation of a boolean state.
687
+ */
688
+ export class BooleanBadgeElementClass extends BaseUiElement {
689
+ /**
690
+ * Discriminator identifier for `BooleanBadgeElement`.
691
+ *
692
+ * @defaultValue "boolean-badge"
693
+ */
694
+ type = "boolean-badge";
695
+ /** Boolean state value */
696
+ value;
697
+ /**
698
+ * Custom display label when true (defaults to "true")
699
+ *
700
+ * @defaultValue "true"
701
+ */
702
+ trueLabel;
703
+ /**
704
+ * Custom display label when false (defaults to "false")
705
+ *
706
+ * @defaultValue "false"
707
+ */
708
+ falseLabel;
709
+ /**
710
+ * Badge color tone
711
+ *
712
+ * @defaultValue BadgeVariant.neutral
713
+ */
714
+ variant;
715
+ /** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
716
+ modifiers;
717
+ /**
718
+ * Constructs a new `BooleanBadgeElementClass` instance.
719
+ *
720
+ * @param value - Boolean state value
721
+ * @param options - Optional component settings. (trueLabel (defaults to `true`), falseLabel (defaults to `false`), variant (defaults to `neutral`), modifiers).
722
+ */
723
+ constructor(value, options) {
724
+ super();
725
+ this.value = value;
726
+ this.trueLabel = options?.trueLabel ?? "true";
727
+ this.falseLabel = options?.falseLabel ?? "false";
728
+ this.variant = options?.variant ?? BadgeVariant.neutral;
729
+ this.modifiers = options?.modifiers;
730
+ }
731
+ }
732
+ /**
733
+ * Class implementation of the `TimestampElement` interface.
734
+ *
735
+ * @remarks
736
+ * Formatted date and time representation.
737
+ */
738
+ export class TimestampElementClass extends BaseUiElement {
739
+ /**
740
+ * Discriminator identifier for `TimestampElement`.
741
+ *
742
+ * @defaultValue "timestamp"
743
+ */
744
+ type = "timestamp";
745
+ /** The timestamp in milliseconds */
746
+ value;
747
+ /**
748
+ * Presentation date/time format
749
+ *
750
+ * @defaultValue TimestampFormat.datetime
751
+ */
752
+ format;
753
+ /** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
754
+ modifiers;
755
+ /**
756
+ * Constructs a new `TimestampElementClass` instance.
757
+ *
758
+ * @param value - The timestamp in milliseconds
759
+ * @param options - Optional component settings. (format (defaults to `datetime`), modifiers).
760
+ */
761
+ constructor(value, options) {
762
+ super();
763
+ this.value = value;
764
+ this.format = options?.format ?? TimestampFormat.datetime;
765
+ this.modifiers = options?.modifiers;
766
+ }
767
+ }
768
+ /**
769
+ * Class implementation of the `ImageReferenceElement` interface.
770
+ *
771
+ * @remarks
772
+ * Thumbnail image reference with placeholder fallback handling.
773
+ */
774
+ export class ImageReferenceElementClass extends BaseUiElement {
775
+ /**
776
+ * Discriminator identifier for `ImageReferenceElement`.
777
+ *
778
+ * @defaultValue "image-ref"
779
+ */
780
+ type = "image-ref";
781
+ /** Image source URI (HTTPS URL, base64 data URI, or asset path) */
782
+ src;
783
+ /** Accessible alternative description */
784
+ alt;
785
+ /**
786
+ * Aspect ratio of the thumbnail container
787
+ *
788
+ * @defaultValue "1:1"
789
+ */
790
+ aspectRatio;
791
+ /** Fallback placeholder image URI */
792
+ placeholder;
793
+ /**
794
+ * Constructs a new `ImageReferenceElementClass` instance.
795
+ *
796
+ * @param src - Image source URI (HTTPS URL, base64 data URI, or asset path)
797
+ * @param options - Optional component settings. (alt, aspectRatio (defaults to `1:1`), placeholder).
798
+ */
799
+ constructor(src, options) {
800
+ super();
801
+ this.src = src;
802
+ this.alt = options?.alt;
803
+ this.aspectRatio = options?.aspectRatio ?? "1:1";
804
+ this.placeholder = options?.placeholder;
805
+ }
806
+ }
807
+ /**
808
+ * Class implementation of the `ButtonActionElement` interface.
809
+ *
810
+ * @remarks
811
+ * Interactive button action triggering an extension command.
812
+ */
813
+ export class ButtonActionElementClass extends BaseUiAction {
814
+ /**
815
+ * Discriminator identifier for `ButtonActionElement`.
816
+ *
817
+ * @defaultValue "button"
818
+ */
819
+ type = "button";
820
+ /** Command identifier to invoke */
821
+ commandId;
822
+ /** Display label for the action */
823
+ label;
824
+ /** Extension identifier owning the target command */
825
+ extensionId;
826
+ /** Target entity or context identifier */
827
+ target;
828
+ /** Optional arbitrary parameters payload forwarded to the command handler */
829
+ parameters;
830
+ /**
831
+ * Whether the button is disabled / unavailable
832
+ *
833
+ * @defaultValue false
834
+ */
835
+ disabled;
836
+ /**
837
+ * Button visual style variant
838
+ *
839
+ * @defaultValue ButtonVariant.secondary
840
+ */
841
+ variant;
842
+ /**
843
+ * Constructs a new `ButtonActionElementClass` instance.
844
+ *
845
+ * @param commandId - Command identifier to invoke
846
+ * @param label - Display label for the action
847
+ * @param options - Optional component settings. (extensionId, target, parameters, disabled (defaults to `false`), variant (defaults to `secondary`)).
848
+ */
849
+ constructor(commandId, label, options) {
850
+ super();
851
+ this.commandId = commandId;
852
+ this.label = label;
853
+ this.extensionId = options?.extensionId;
854
+ this.target = options?.target;
855
+ this.parameters = options?.parameters;
856
+ this.disabled = options?.disabled ?? false;
857
+ this.variant = options?.variant ?? ButtonVariant.secondary;
858
+ }
859
+ }
860
+ /**
861
+ * Class implementation of the `ExternalLinkActionElement` interface.
862
+ *
863
+ * @remarks
864
+ * External link action distinct from inline URL text values.
865
+ */
866
+ export class ExternalLinkActionElementClass extends BaseUiAction {
867
+ /**
868
+ * Discriminator identifier for `ExternalLinkActionElement`.
869
+ *
870
+ * @defaultValue "external-link"
871
+ */
872
+ type = "external-link";
873
+ /** Target URL destination */
874
+ url;
875
+ /** Display label for the action */
876
+ label;
877
+ /**
878
+ * Constructs a new `ExternalLinkActionElementClass` instance.
879
+ *
880
+ * @param url - Target URL destination
881
+ * @param label - Display label for the action
882
+ */
883
+ constructor(url, label) {
884
+ super();
885
+ this.url = url;
886
+ this.label = label;
887
+ }
888
+ }
889
+ /**
890
+ * Class implementation of the `MarkdownBlockElement` interface.
891
+ *
892
+ * @remarks
893
+ * Full Markdown fallback block rendered with core typographic hierarchy, spacing, and styling.
894
+ */
895
+ export class MarkdownBlockElementClass extends BaseUiElement {
896
+ /**
897
+ * Discriminator identifier for `MarkdownBlockElement`.
898
+ *
899
+ * @defaultValue "markdown"
900
+ */
901
+ type = "markdown";
902
+ /** Raw Markdown markup content */
903
+ content;
904
+ /** Optional visual modifiers (copyable) */
905
+ modifiers;
906
+ /**
907
+ * Constructs a new `MarkdownBlockElementClass` instance.
908
+ *
909
+ * @param content - Raw Markdown markup content
910
+ * @param options - Optional component settings. (modifiers).
911
+ */
912
+ constructor(content, options) {
913
+ super();
914
+ this.content = content;
915
+ this.modifiers = options?.modifiers;
916
+ }
917
+ }
918
+ /**
919
+ * Class implementation of the `HtmlBlockElement` interface.
920
+ *
921
+ * @remarks
922
+ * Sandboxed HTML rendering escape hatch.
923
+ */
924
+ export class HtmlBlockElementClass extends BaseUiElement {
925
+ /**
926
+ * Discriminator identifier for `HtmlBlockElement`.
927
+ *
928
+ * @defaultValue "html"
929
+ */
930
+ type = "html";
931
+ /** Raw HTML markup content */
932
+ content;
933
+ /** Optional visual modifiers (copyable) */
934
+ modifiers;
935
+ /**
936
+ * Constructs a new `HtmlBlockElementClass` instance.
937
+ *
938
+ * @param content - Raw HTML markup content
939
+ * @param options - Optional component settings. (modifiers).
940
+ */
941
+ constructor(content, options) {
942
+ super();
943
+ this.content = content;
944
+ this.modifiers = options?.modifiers;
945
+ }
946
+ }
947
+ /**
948
+ * Class implementation of the `Slot` interface.
949
+ *
950
+ * @remarks
951
+ * Single slot within a multi-slot horizontal row layout.
952
+ */
953
+ export class SlotClass extends ViewKitNode {
954
+ /** Rendered content inside the slot */
955
+ content;
956
+ /** Optional slot label (e.g. "Slot A") */
957
+ label;
958
+ /** Relative or fractional width proportion (e.g. "1/3", "2/3", "100px", "auto") */
959
+ width;
960
+ /**
961
+ * Constructs a new `SlotClass` instance.
962
+ *
963
+ * @param content - Rendered content inside the slot
964
+ * @param options - Optional component settings. (label, width).
965
+ */
966
+ constructor(content, options) {
967
+ super();
968
+ this.content = content;
969
+ this.label = options?.label;
970
+ this.width = options?.width;
971
+ }
972
+ }
973
+ /**
974
+ * Class implementation of the `MultiSlotElement` interface.
975
+ *
976
+ * @remarks
977
+ * Multi-slot horizontal row with declared column width proportions.
978
+ * Examples: "1/3 + 2/3", "equal thirds", "1/4 + 3/4".
979
+ */
980
+ export class MultiSlotElementClass extends BaseUiElement {
981
+ /**
982
+ * Discriminator identifier for `MultiSlotElement`.
983
+ *
984
+ * @defaultValue "multi-slot"
985
+ */
986
+ type = "multi-slot";
987
+ /** List of slots comprising the row */
988
+ slots;
989
+ /** Proportions descriptor (e.g. "1/3 + 2/3", "equal", "1/4 + 3/4") */
990
+ proportions;
991
+ /**
992
+ * Constructs a new `MultiSlotElementClass` instance.
993
+ *
994
+ * @param slots - List of slots comprising the row
995
+ * @param options - Optional component settings. (proportions).
996
+ */
997
+ constructor(slots, options) {
998
+ super();
999
+ this.slots = slots ? [...slots] : [];
1000
+ this.proportions = options?.proportions;
1001
+ }
1002
+ }
1003
+ /**
1004
+ * Class implementation of the `FlowingElement` interface.
1005
+ *
1006
+ * @remarks
1007
+ * Flowing inline layout container with automatic line wrapping.
1008
+ * Renders child elements horizontally in sequence, automatically wrapping to the next line when space runs out.
1009
+ */
1010
+ export class FlowingElementClass extends BaseUiElement {
1011
+ /**
1012
+ * Discriminator identifier for `FlowingElement`.
1013
+ *
1014
+ * @defaultValue "flowing"
1015
+ */
1016
+ type = "flowing";
1017
+ /** List of child elements rendered sequentially with line wrapping */
1018
+ elements;
1019
+ /**
1020
+ * Constructs a new `FlowingElementClass` instance.
1021
+ *
1022
+ * @param elements - List of child elements rendered sequentially with line wrapping
1023
+ */
1024
+ constructor(elements) {
1025
+ super();
1026
+ this.elements = elements ? [...elements] : [];
1027
+ }
1028
+ }
1029
+ /**
1030
+ * Class implementation of the `LabelValueElement` interface.
1031
+ *
1032
+ * @remarks
1033
+ * Standard label and value row.
1034
+ * Displays a muted label on the left and value representation on the right with a vertical dividing line.
1035
+ */
1036
+ export class LabelValueElementClass extends BaseUiElement {
1037
+ /**
1038
+ * Discriminator identifier for `LabelValueElement`.
1039
+ *
1040
+ * @defaultValue "label-value"
1041
+ */
1042
+ type = "label-value";
1043
+ /** Key or descriptive label displayed muted on the left */
1044
+ label;
1045
+ /** Rendered value element on the right */
1046
+ value;
1047
+ /**
1048
+ * Whether to render a bottom border/hairline divider
1049
+ *
1050
+ * @defaultValue false
1051
+ */
1052
+ withDivider;
1053
+ /**
1054
+ * Constructs a new `LabelValueElementClass` instance.
1055
+ *
1056
+ * @param label - Key or descriptive label displayed muted on the left
1057
+ * @param value - Rendered value element on the right
1058
+ * @param options - Optional component settings. (withDivider (defaults to `false`)).
1059
+ */
1060
+ constructor(label, value, options) {
1061
+ super();
1062
+ this.label = label;
1063
+ this.value = value;
1064
+ this.withDivider = options?.withDivider ?? false;
1065
+ }
1066
+ }
1067
+ /**
1068
+ * Class implementation of the `TableColumn` interface.
1069
+ *
1070
+ * @remarks
1071
+ * Column definition for structured tables.
1072
+ */
1073
+ export class TableColumnClass extends ViewKitNode {
1074
+ /** Display header text */
1075
+ header;
1076
+ /**
1077
+ * Text horizontal alignment
1078
+ *
1079
+ * @defaultValue TableColumnAlign.left
1080
+ */
1081
+ align;
1082
+ /** Optional width constraint */
1083
+ width;
1084
+ /**
1085
+ * Constructs a new `TableColumnClass` instance.
1086
+ *
1087
+ * @param options - Optional component settings. (header, align (defaults to `left`), width).
1088
+ */
1089
+ constructor(options) {
1090
+ super();
1091
+ this.header = options?.header;
1092
+ this.align = options?.align ?? TableColumnAlign.left;
1093
+ this.width = options?.width;
1094
+ }
1095
+ }
1096
+ /**
1097
+ * Class implementation of the `TableRow` interface.
1098
+ *
1099
+ * @remarks
1100
+ * Single table row containing an array of cell values.
1101
+ */
1102
+ export class TableRowClass extends ViewKitNode {
1103
+ /** Array of cell values corresponding to table columns */
1104
+ cells;
1105
+ /**
1106
+ * Constructs a new `TableRowClass` instance.
1107
+ *
1108
+ * @param cells - Array of cell values corresponding to table columns
1109
+ */
1110
+ constructor(cells) {
1111
+ super();
1112
+ this.cells = cells ? [...cells] : [];
1113
+ }
1114
+ }
1115
+ /**
1116
+ * Class implementation of the `TableElement` interface.
1117
+ *
1118
+ * @remarks
1119
+ * Structured tabular data representation.
1120
+ * Supports header/borderless modes, 2-column key-value tables, and 3-column data tables.
1121
+ */
1122
+ export class TableElementClass extends BaseUiElement {
1123
+ /**
1124
+ * Discriminator identifier for `TableElement`.
1125
+ *
1126
+ * @defaultValue "table"
1127
+ */
1128
+ type = "table";
1129
+ /** Tabular data rows */
1130
+ rows;
1131
+ /**
1132
+ * Whether to render a column header row
1133
+ *
1134
+ * @defaultValue true
1135
+ */
1136
+ hasHeader;
1137
+ /**
1138
+ * Whether to render alternating row background colors
1139
+ *
1140
+ * @defaultValue false
1141
+ */
1142
+ isStriped;
1143
+ /**
1144
+ * Whether to render vertical column separators
1145
+ *
1146
+ * @defaultValue false
1147
+ */
1148
+ withColumnSeparators;
1149
+ /**
1150
+ * Whether to render horizontal row separators
1151
+ *
1152
+ * @defaultValue false
1153
+ */
1154
+ withRowSeparators;
1155
+ /** Optional explicit column definitions */
1156
+ columns;
1157
+ /**
1158
+ * Constructs a new `TableElementClass` instance.
1159
+ *
1160
+ * @param rows - Tabular data rows
1161
+ * @param options - Optional component settings. (hasHeader (defaults to `true`), isStriped (defaults to `false`), withColumnSeparators (defaults to `false`), withRowSeparators (defaults to `false`), columns).
1162
+ */
1163
+ constructor(rows, options) {
1164
+ super();
1165
+ this.rows = rows ? [...rows] : [];
1166
+ this.hasHeader = options?.hasHeader ?? true;
1167
+ this.isStriped = options?.isStriped ?? false;
1168
+ this.withColumnSeparators = options?.withColumnSeparators ?? false;
1169
+ this.withRowSeparators = options?.withRowSeparators ?? false;
1170
+ this.columns = options?.columns ? [...options.columns] : undefined;
1171
+ }
1172
+ }
1173
+ /**
1174
+ * Class implementation of the `RepeatingGroupEntry` interface.
1175
+ *
1176
+ * @remarks
1177
+ * Single entry within a repeating group.
1178
+ */
1179
+ export class RepeatingGroupEntryClass extends ViewKitNode {
1180
+ /** Entry label */
1181
+ label;
1182
+ /** Primary entry value or nested elements */
1183
+ value;
1184
+ /** Nested elements for structured entries */
1185
+ elements;
1186
+ /**
1187
+ * Constructs a new `RepeatingGroupEntryClass` instance.
1188
+ *
1189
+ * @param label - Entry label
1190
+ * @param options - Optional component settings. (value, elements).
1191
+ */
1192
+ constructor(label, options) {
1193
+ super();
1194
+ this.label = label;
1195
+ this.value = options?.value;
1196
+ this.elements = options?.elements ? [...options.elements] : undefined;
1197
+ }
1198
+ }
1199
+ /**
1200
+ * Class implementation of the `RepeatingGroupElement` interface.
1201
+ *
1202
+ * @remarks
1203
+ * Repeating group container where entries share uniform structure and retain per-entry labels.
1204
+ */
1205
+ export class RepeatingGroupElementClass extends BaseUiElement {
1206
+ /**
1207
+ * Discriminator identifier for `RepeatingGroupElement`.
1208
+ *
1209
+ * @defaultValue "repeating-group"
1210
+ */
1211
+ type = "repeating-group";
1212
+ /** List of repeated entry records */
1213
+ entries;
1214
+ /** Optional section header for the group */
1215
+ title;
1216
+ /**
1217
+ * Constructs a new `RepeatingGroupElementClass` instance.
1218
+ *
1219
+ * @param entries - List of repeated entry records
1220
+ * @param options - Optional component settings. (title).
1221
+ */
1222
+ constructor(entries, options) {
1223
+ super();
1224
+ this.entries = entries ? [...entries] : [];
1225
+ this.title = options?.title;
1226
+ }
1227
+ }
1228
+ /**
1229
+ * Class implementation of the `CollapsibleGroupElement` interface.
1230
+ *
1231
+ * @remarks
1232
+ * Collapsible disclosure container (accordion) with summary badge.
1233
+ */
1234
+ export class CollapsibleGroupElementClass extends BaseUiElement {
1235
+ /**
1236
+ * Discriminator identifier for `CollapsibleGroupElement`.
1237
+ *
1238
+ * @defaultValue "collapsible-group"
1239
+ */
1240
+ type = "collapsible-group";
1241
+ /** Group title (e.g. "Show specimen details") */
1242
+ title;
1243
+ /** Nested content elements revealed when expanded */
1244
+ elements;
1245
+ /** Secondary summary indicator (e.g. "2 neutral values") */
1246
+ summary;
1247
+ /**
1248
+ * Whether the disclosure is open/expanded by default
1249
+ *
1250
+ * @defaultValue false
1251
+ */
1252
+ defaultExpanded;
1253
+ /**
1254
+ * Constructs a new `CollapsibleGroupElementClass` instance.
1255
+ *
1256
+ * @param title - Group title (e.g. "Show specimen details")
1257
+ * @param elements - Nested content elements revealed when expanded
1258
+ * @param options - Optional component settings. (summary, defaultExpanded (defaults to `false`)).
1259
+ */
1260
+ constructor(title, elements, options) {
1261
+ super();
1262
+ this.title = title;
1263
+ this.elements = elements ? [...elements] : [];
1264
+ this.summary = options?.summary;
1265
+ this.defaultExpanded = options?.defaultExpanded ?? false;
1266
+ }
1267
+ }
1268
+ /**
1269
+ * Class implementation of the `DividerElement` interface.
1270
+ *
1271
+ * @remarks
1272
+ * Visual hairline separator separating sections or element groups.
1273
+ */
1274
+ export class DividerElementClass extends BaseUiElement {
1275
+ /**
1276
+ * Discriminator identifier for `DividerElement`.
1277
+ *
1278
+ * @defaultValue "divider"
1279
+ */
1280
+ type = "divider";
1281
+ /**
1282
+ * Line styling
1283
+ *
1284
+ * @defaultValue DividerStyle.hairline
1285
+ */
1286
+ style;
1287
+ /**
1288
+ * Constructs a new `DividerElementClass` instance.
1289
+ *
1290
+ * @param options - Optional component settings. (style (defaults to `hairline`)).
1291
+ */
1292
+ constructor(options) {
1293
+ super();
1294
+ this.style = options?.style ?? DividerStyle.hairline;
1295
+ }
1296
+ }
1297
+ /**
1298
+ * Class implementation of the `Envelop` interface.
1299
+ *
1300
+ * @remarks
1301
+ * Base envelope container model holding the schema version attribute.
1302
+ */
1303
+ export class EnvelopClass extends ViewKitNode {
1304
+ /**
1305
+ * Schema specification version
1306
+ *
1307
+ * @defaultValue "1.0"
1308
+ */
1309
+ schemaVersion;
1310
+ /**
1311
+ * Constructs a new `EnvelopClass` instance.
1312
+ *
1313
+ * @param options - Optional component settings. (schemaVersion (defaults to `1.0`)).
1314
+ */
1315
+ constructor(options) {
1316
+ super();
1317
+ this.schemaVersion = options?.schemaVersion ?? "1.0";
1318
+ }
1319
+ }
1320
+ /**
1321
+ * Class implementation of the `UiContainer` interface.
1322
+ *
1323
+ * @remarks
1324
+ * Container model representing an ordered list of visual elements.
1325
+ */
1326
+ export class UiContainerClass extends ViewKitNode {
1327
+ /** Ordered list of visual elements, structures, and content */
1328
+ elements;
1329
+ /**
1330
+ * Schema specification version
1331
+ *
1332
+ * @defaultValue "1.0"
1333
+ */
1334
+ schemaVersion;
1335
+ /**
1336
+ * Constructs a new `UiContainerClass` instance.
1337
+ *
1338
+ * @param elements - Ordered list of visual elements, structures, and content
1339
+ * @param options - Optional component settings. (schemaVersion (defaults to `1.0`)).
1340
+ */
1341
+ constructor(elements, options) {
1342
+ super();
1343
+ this.elements = elements ? [...elements] : [];
1344
+ this.schemaVersion = options?.schemaVersion ?? "1.0";
1345
+ }
1346
+ }
1347
+ /**
1348
+ * Class implementation of the `UiCard` interface.
1349
+ *
1350
+ * @remarks
1351
+ * Root Card container model.
1352
+ * Represents a complete feature card rendered inside the 360px panel.
1353
+ */
1354
+ export class UiCardClass extends ViewKitNode {
1355
+ /** Human-readable feature title displayed in the card header */
1356
+ title;
1357
+ /** Ordered list of visual elements, structures, and content */
1358
+ elements;
1359
+ /** Optional neutral subtitle / description for the feature */
1360
+ description;
1361
+ /** Optional card action buttons rendered at the base of the feature card */
1362
+ actions;
1363
+ /**
1364
+ * Schema specification version
1365
+ *
1366
+ * @defaultValue "1.0"
1367
+ */
1368
+ schemaVersion;
1369
+ /**
1370
+ * Constructs a new `UiCardClass` instance.
1371
+ *
1372
+ * @param title - Human-readable feature title displayed in the card header
1373
+ * @param elements - Ordered list of visual elements, structures, and content
1374
+ * @param options - Optional component settings. (description, actions, schemaVersion (defaults to `1.0`)).
1375
+ */
1376
+ constructor(title, elements, options) {
1377
+ super();
1378
+ this.title = title;
1379
+ this.elements = elements ? [...elements] : [];
1380
+ this.description = options?.description;
1381
+ this.actions = options?.actions ? [...options.actions] : undefined;
1382
+ this.schemaVersion = options?.schemaVersion ?? "1.0";
1383
+ }
1384
+ }
1385
+ /**
1386
+ * Fluent builder for constructing strongly-typed `UiContainer` instances.
1387
+ *
1388
+ * @remarks
1389
+ * Container model representing an ordered list of visual elements.
1390
+ */
1391
+ export class UiContainerBuilder {
1392
+ _elements = [];
1393
+ /** Initializes a new `UiContainerBuilder`. */
1394
+ constructor() {
1395
+ }
1396
+ /**
1397
+ * Appends a visual element.
1398
+ *
1399
+ * @param element - The visual UI element component to add.
1400
+ * @returns This builder instance for method chaining.
1401
+ */
1402
+ add(element) {
1403
+ this._elements.push(element);
1404
+ return this;
1405
+ }
1406
+ /**
1407
+ * Appends multiple elements items.
1408
+ *
1409
+ * @param items - The `UiElement` items to add.
1410
+ * @returns This builder instance for method chaining.
1411
+ */
1412
+ addElements(...items) {
1413
+ this._elements.push(...items);
1414
+ return this;
1415
+ }
1416
+ /**
1417
+ * Appends a `StringShortElement` component.
1418
+ *
1419
+ * @remarks
1420
+ * Short string primitive element.
1421
+ * Supports plain text or compact chip pill presentation.
1422
+ *
1423
+ * @param value - Text value
1424
+ * @param options - Optional component settings (representation (defaults to `plain`), modifiers).
1425
+ * @returns This builder instance for method chaining.
1426
+ */
1427
+ addStringShort(value, options) {
1428
+ return this.add(stringShort(value, options));
1429
+ }
1430
+ /**
1431
+ * Appends a `StringLongElement` component.
1432
+ *
1433
+ * @remarks
1434
+ * Multiline text block primitive element for descriptions, comments, or prose.
1435
+ *
1436
+ * @param value - Text value
1437
+ * @param options - Optional component settings (modifiers).
1438
+ * @returns This builder instance for method chaining.
1439
+ */
1440
+ addStringLong(value, options) {
1441
+ return this.add(stringLong(value, options));
1442
+ }
1443
+ /**
1444
+ * Appends a `StringCodeElement` component.
1445
+ *
1446
+ * @remarks
1447
+ * Monospace code block or formatted code snippet representation.
1448
+ *
1449
+ * @param value - Text value
1450
+ * @param options - Optional component settings (language, modifiers).
1451
+ * @returns This builder instance for method chaining.
1452
+ */
1453
+ addStringCode(value, options) {
1454
+ return this.add(stringCode(value, options));
1455
+ }
1456
+ /**
1457
+ * Appends a `XmlElement` component.
1458
+ *
1459
+ * @remarks
1460
+ * XML markup code block element.
1461
+ *
1462
+ * @param value - XML content value
1463
+ * @param options - Optional component settings (modifiers).
1464
+ * @returns This builder instance for method chaining.
1465
+ */
1466
+ addXml(value, options) {
1467
+ return this.add(xml(value, options));
1468
+ }
1469
+ /**
1470
+ * Appends a `JsonElement` component.
1471
+ *
1472
+ * @remarks
1473
+ * JSON data or structure representation element.
1474
+ *
1475
+ * @param value - JSON content value
1476
+ * @param options - Optional component settings (modifiers).
1477
+ * @returns This builder instance for method chaining.
1478
+ */
1479
+ addJson(value, options) {
1480
+ return this.add(json(value, options));
1481
+ }
1482
+ /**
1483
+ * Appends a `StringUrlElement` component.
1484
+ *
1485
+ * @remarks
1486
+ * Hyperlink representation for external or internal URL navigation.
1487
+ *
1488
+ * @param value - Target URL or navigation destination
1489
+ * @param options - Optional component settings (label, modifiers).
1490
+ * @returns This builder instance for method chaining.
1491
+ */
1492
+ addStringUrl(value, options) {
1493
+ return this.add(stringUrl(value, options));
1494
+ }
1495
+ /**
1496
+ * Appends a `IdentifierElement` component.
1497
+ *
1498
+ * @remarks
1499
+ * Monospace semantic identifier representation.
1500
+ *
1501
+ * @param value - Identifier string value
1502
+ * @param options - Optional component settings (modifiers).
1503
+ * @returns This builder instance for method chaining.
1504
+ */
1505
+ addIdentifier(value, options) {
1506
+ return this.add(identifier(value, options));
1507
+ }
1508
+ /**
1509
+ * Appends a `RatioElement` component.
1510
+ *
1511
+ * @remarks
1512
+ * Aspect ratio representation (e.g. "16:9", "4:3", "1:1").
1513
+ *
1514
+ * @param value - Aspect ratio numerical expression
1515
+ * @param options - Optional component settings (modifiers).
1516
+ * @returns This builder instance for method chaining.
1517
+ */
1518
+ addRatio(value, options) {
1519
+ return this.add(ratio(value, options));
1520
+ }
1521
+ /**
1522
+ * Appends a `ColourElement` component.
1523
+ *
1524
+ * @remarks
1525
+ * Single color representation with hex value, shape/size styling, text display toggle, and copy affordance.
1526
+ *
1527
+ * @param value - Hexadecimal color code
1528
+ * @param options - Optional component settings (label, showText (defaults to `true`), shape (defaults to `circle`), size (defaults to `medium`), modifiers).
1529
+ * @returns This builder instance for method chaining.
1530
+ */
1531
+ addColour(value, options) {
1532
+ return this.add(colour(value, options));
1533
+ }
1534
+ /**
1535
+ * Appends a `ColourElement` component.
1536
+ *
1537
+ * @remarks
1538
+ * Single color representation with hex value, shape/size styling, text display toggle, and copy affordance.
1539
+ *
1540
+ * @param value - Hexadecimal color code
1541
+ * @param options - Optional component settings (label, showText (defaults to `true`), shape (defaults to `circle`), size (defaults to `medium`), modifiers).
1542
+ * @returns This builder instance for method chaining.
1543
+ */
1544
+ addColor(value, options) {
1545
+ return this.add(color(value, options));
1546
+ }
1547
+ /**
1548
+ * Appends a `NumberUnboundedElement` component.
1549
+ *
1550
+ * @remarks
1551
+ * Plain unbounded numeric value primitive element.
1552
+ *
1553
+ * @param value - Numeric value
1554
+ * @param options - Optional component settings (unit, modifiers).
1555
+ * @returns This builder instance for method chaining.
1556
+ */
1557
+ addNumberUnbounded(value, options) {
1558
+ return this.add(numberUnbounded(value, options));
1559
+ }
1560
+ /**
1561
+ * Appends a `NumberBoundedStarsElement` component.
1562
+ *
1563
+ * @remarks
1564
+ * Bounded numeric rating represented as visual stars.
1565
+ *
1566
+ * @param value - Numeric rating score
1567
+ * @param options - Optional component settings (maximum, modifiers).
1568
+ * @returns This builder instance for method chaining.
1569
+ */
1570
+ addNumberBoundedStars(value, options) {
1571
+ return this.add(numberBoundedStars(value, options));
1572
+ }
1573
+ /**
1574
+ * Appends a `NumberBoundedStarsElement` component.
1575
+ *
1576
+ * @remarks
1577
+ * Bounded numeric rating represented as visual stars.
1578
+ *
1579
+ * @param value - Numeric rating score
1580
+ * @param options - Optional component settings (maximum, modifiers).
1581
+ * @returns This builder instance for method chaining.
1582
+ */
1583
+ addNumberStars(value, options) {
1584
+ return this.add(numberStars(value, options));
1585
+ }
1586
+ /**
1587
+ * Appends a `NumberBoundedMeterElement` component.
1588
+ *
1589
+ * @remarks
1590
+ * Bounded numeric meter representation (read-only progress / score bar).
1591
+ *
1592
+ * @param value - Numeric value
1593
+ * @param options - Optional component settings (minimum, maximum, label, unit, modifiers).
1594
+ * @returns This builder instance for method chaining.
1595
+ */
1596
+ addNumberBoundedMeter(value, options) {
1597
+ return this.add(numberBoundedMeter(value, options));
1598
+ }
1599
+ /**
1600
+ * Appends a `NumberBoundedMeterElement` component.
1601
+ *
1602
+ * @remarks
1603
+ * Bounded numeric meter representation (read-only progress / score bar).
1604
+ *
1605
+ * @param value - Numeric value
1606
+ * @param options - Optional component settings (minimum, maximum, label, unit, modifiers).
1607
+ * @returns This builder instance for method chaining.
1608
+ */
1609
+ addNumberMeter(value, options) {
1610
+ return this.add(numberMeter(value, options));
1611
+ }
1612
+ /**
1613
+ * Appends a `BooleanPlainElement` component.
1614
+ *
1615
+ * @remarks
1616
+ * Plain boolean value representation (textual "true" / "false").
1617
+ *
1618
+ * @param value - Boolean state value
1619
+ * @param options - Optional component settings (modifiers).
1620
+ * @returns This builder instance for method chaining.
1621
+ */
1622
+ addBooleanPlain(value, options) {
1623
+ return this.add(booleanPlain(value, options));
1624
+ }
1625
+ /**
1626
+ * Appends a `BooleanBadgeElement` component.
1627
+ *
1628
+ * @remarks
1629
+ * Visual badge pill representation of a boolean state.
1630
+ *
1631
+ * @param value - Boolean state value
1632
+ * @param options - Optional component settings (trueLabel (defaults to `true`), falseLabel (defaults to `false`), variant (defaults to `neutral`), modifiers).
1633
+ * @returns This builder instance for method chaining.
1634
+ */
1635
+ addBooleanBadge(value, options) {
1636
+ return this.add(booleanBadge(value, options));
1637
+ }
1638
+ /**
1639
+ * Appends a `TimestampElement` component.
1640
+ *
1641
+ * @remarks
1642
+ * Formatted date and time representation.
1643
+ *
1644
+ * @param value - The timestamp in milliseconds
1645
+ * @param options - Optional component settings (format (defaults to `datetime`), modifiers).
1646
+ * @returns This builder instance for method chaining.
1647
+ */
1648
+ addTimestamp(value, options) {
1649
+ return this.add(timestamp(value, options));
1650
+ }
1651
+ /**
1652
+ * Appends a `ImageReferenceElement` component.
1653
+ *
1654
+ * @remarks
1655
+ * Thumbnail image reference with placeholder fallback handling.
1656
+ *
1657
+ * @param src - Image source URI (HTTPS URL, base64 data URI, or asset path)
1658
+ * @param options - Optional component settings (alt, aspectRatio (defaults to `1:1`), placeholder).
1659
+ * @returns This builder instance for method chaining.
1660
+ */
1661
+ addImageReference(src, options) {
1662
+ return this.add(imageReference(src, options));
1663
+ }
1664
+ /**
1665
+ * Appends a `ImageReferenceElement` component.
1666
+ *
1667
+ * @remarks
1668
+ * Thumbnail image reference with placeholder fallback handling.
1669
+ *
1670
+ * @param src - Image source URI (HTTPS URL, base64 data URI, or asset path)
1671
+ * @param options - Optional component settings (alt, aspectRatio (defaults to `1:1`), placeholder).
1672
+ * @returns This builder instance for method chaining.
1673
+ */
1674
+ addImageRef(src, options) {
1675
+ return this.add(imageRef(src, options));
1676
+ }
1677
+ /**
1678
+ * Appends a `MarkdownBlockElement` component.
1679
+ *
1680
+ * @remarks
1681
+ * Full Markdown fallback block rendered with core typographic hierarchy, spacing, and styling.
1682
+ *
1683
+ * @param content - Raw Markdown markup content
1684
+ * @param options - Optional component settings (modifiers).
1685
+ * @returns This builder instance for method chaining.
1686
+ */
1687
+ addMarkdownBlock(content, options) {
1688
+ return this.add(markdownBlock(content, options));
1689
+ }
1690
+ /**
1691
+ * Appends a `MarkdownBlockElement` component.
1692
+ *
1693
+ * @remarks
1694
+ * Full Markdown fallback block rendered with core typographic hierarchy, spacing, and styling.
1695
+ *
1696
+ * @param content - Raw Markdown markup content
1697
+ * @param options - Optional component settings (modifiers).
1698
+ * @returns This builder instance for method chaining.
1699
+ */
1700
+ addMarkdown(content, options) {
1701
+ return this.add(markdown(content, options));
1702
+ }
1703
+ /**
1704
+ * Appends a `HtmlBlockElement` component.
1705
+ *
1706
+ * @remarks
1707
+ * Sandboxed HTML rendering escape hatch.
1708
+ *
1709
+ * @param content - Raw HTML markup content
1710
+ * @param options - Optional component settings (modifiers).
1711
+ * @returns This builder instance for method chaining.
1712
+ */
1713
+ addHtmlBlock(content, options) {
1714
+ return this.add(htmlBlock(content, options));
1715
+ }
1716
+ /**
1717
+ * Appends a `HtmlBlockElement` component.
1718
+ *
1719
+ * @remarks
1720
+ * Sandboxed HTML rendering escape hatch.
1721
+ *
1722
+ * @param content - Raw HTML markup content
1723
+ * @param options - Optional component settings (modifiers).
1724
+ * @returns This builder instance for method chaining.
1725
+ */
1726
+ addHtml(content, options) {
1727
+ return this.add(html(content, options));
1728
+ }
1729
+ /**
1730
+ * Appends a `MultiSlotElement` component.
1731
+ *
1732
+ * @remarks
1733
+ * Multi-slot horizontal row with declared column width proportions.
1734
+ * Examples: "1/3 + 2/3", "equal thirds", "1/4 + 3/4".
1735
+ *
1736
+ * @param slots - List of slots comprising the row
1737
+ * @param options - Optional component settings (proportions).
1738
+ * @returns This builder instance for method chaining.
1739
+ */
1740
+ addMultiSlot(slots, options) {
1741
+ return this.add(multiSlot(slots, options));
1742
+ }
1743
+ /**
1744
+ * Appends a `FlowingElement` component.
1745
+ *
1746
+ * @remarks
1747
+ * Flowing inline layout container with automatic line wrapping.
1748
+ * Renders child elements horizontally in sequence, automatically wrapping to the next line when space runs out.
1749
+ *
1750
+ * @param elements - List of child elements rendered sequentially with line wrapping
1751
+ * @returns This builder instance for method chaining.
1752
+ */
1753
+ addFlowing(elements) {
1754
+ return this.add(flowing(elements));
1755
+ }
1756
+ /**
1757
+ * Appends a `LabelValueElement` component.
1758
+ *
1759
+ * @remarks
1760
+ * Standard label and value row.
1761
+ * Displays a muted label on the left and value representation on the right with a vertical dividing line.
1762
+ *
1763
+ * @param label - Key or descriptive label displayed muted on the left
1764
+ * @param value - Rendered value element on the right
1765
+ * @param options - Optional component settings (withDivider (defaults to `false`)).
1766
+ * @returns This builder instance for method chaining.
1767
+ */
1768
+ addLabelValue(label, value, options) {
1769
+ return this.add(labelValue(label, value, options));
1770
+ }
1771
+ /**
1772
+ * Appends a `TableElement` component.
1773
+ *
1774
+ * @remarks
1775
+ * Structured tabular data representation.
1776
+ * Supports header/borderless modes, 2-column key-value tables, and 3-column data tables.
1777
+ *
1778
+ * @param rows - Tabular data rows
1779
+ * @param options - Optional component settings (hasHeader (defaults to `true`), isStriped (defaults to `false`), withColumnSeparators (defaults to `false`), withRowSeparators (defaults to `false`), columns).
1780
+ * @returns This builder instance for method chaining.
1781
+ */
1782
+ addTable(rows, options) {
1783
+ return this.add(table(rows, options));
1784
+ }
1785
+ /**
1786
+ * Appends a `RepeatingGroupElement` component.
1787
+ *
1788
+ * @remarks
1789
+ * Repeating group container where entries share uniform structure and retain per-entry labels.
1790
+ *
1791
+ * @param entries - List of repeated entry records
1792
+ * @param options - Optional component settings (title).
1793
+ * @returns This builder instance for method chaining.
1794
+ */
1795
+ addRepeatingGroup(entries, options) {
1796
+ return this.add(repeatingGroup(entries, options));
1797
+ }
1798
+ /**
1799
+ * Appends a `CollapsibleGroupElement` component.
1800
+ *
1801
+ * @remarks
1802
+ * Collapsible disclosure container (accordion) with summary badge.
1803
+ *
1804
+ * @param title - Group title (e.g. "Show specimen details")
1805
+ * @param elements - Nested content elements revealed when expanded
1806
+ * @param options - Optional component settings (summary, defaultExpanded (defaults to `false`)).
1807
+ * @returns This builder instance for method chaining.
1808
+ */
1809
+ addCollapsibleGroup(title, elements, options) {
1810
+ return this.add(collapsibleGroup(title, elements, options));
1811
+ }
1812
+ /**
1813
+ * Appends a `DividerElement` component.
1814
+ *
1815
+ * @remarks
1816
+ * Visual hairline separator separating sections or element groups.
1817
+ *
1818
+ * @param options - Optional component settings (style (defaults to `hairline`)).
1819
+ * @returns This builder instance for method chaining.
1820
+ */
1821
+ addDivider(options) {
1822
+ return this.add(divider(options));
1823
+ }
1824
+ /**
1825
+ * Finalizes and returns the complete strongly-typed `UiContainerClass` instance.
1826
+ *
1827
+ * @returns The constructed `UiContainerClass` instance.
1828
+ */
1829
+ build() {
1830
+ return new UiContainerClass(this._elements);
1831
+ }
1832
+ /**
1833
+ * Serializes this builder into a strongly-typed, JSON-compatible plain object conforming to interface `UiContainer`.
1834
+ *
1835
+ * @returns The plain object representation conforming to interface `UiContainer`.
1836
+ */
1837
+ toJSON() {
1838
+ return this.build().toJSON();
1839
+ }
1840
+ /**
1841
+ * Returns the compact JSON string representation of the built `UiContainerClass` instance with no indentation.
1842
+ *
1843
+ * @returns Compact JSON string without indentation.
1844
+ */
1845
+ toString() {
1846
+ return this.build().toString();
1847
+ }
1848
+ }
1849
+ /** Static helper factory object for `UiContainer`. */
1850
+ export const UiContainer = {
1851
+ /**
1852
+ * Creates a new fluent builder for constructing a `UiContainer`.
1853
+ *
1854
+ * @returns A new `UiContainerBuilder` instance.
1855
+ */
1856
+ builder() {
1857
+ return new UiContainerBuilder();
1858
+ },
1859
+ /**
1860
+ * Creates a `UiContainerClass` directly from a properties object.
1861
+ *
1862
+ * @param params - Configuration properties.
1863
+ * @returns A completed `UiContainerClass` instance.
1864
+ */
1865
+ create(params) {
1866
+ return new UiContainerClass(params.elements);
1867
+ },
1868
+ /**
1869
+ * Parses a JSON string or raw object into a validated `UiContainerClass` instance.
1870
+ *
1871
+ * @remarks
1872
+ * Throws an `Error` if the input does not conform to the `UiContainer` schema.
1873
+ *
1874
+ * @param json - JSON string or parsed JavaScript object to validate and hydrate.
1875
+ * @param withDeepValidation - Whether to recursively validate all nested child entities.
1876
+ * @returns A strongly-typed `UiContainerClass` instance.
1877
+ */
1878
+ parse(json, withDeepValidation = true) {
1879
+ const data = typeof json === "string" ? JSON.parse(json) : json;
1880
+ if (!isUiContainer(data, withDeepValidation)) {
1881
+ throw new Error("Invalid JSON: value does not match the `UiContainer` schema.");
1882
+ }
1883
+ return UiContainer.create(data);
1884
+ }
1885
+ };
1886
+ /**
1887
+ * Functional helper to create a `UiContainerClass` instance directly.
1888
+ *
1889
+ * @remarks
1890
+ * Container model representing an ordered list of visual elements.
1891
+ *
1892
+ * @param options - Optional configuration properties.
1893
+ * @returns A strongly-typed `UiContainerClass` instance.
1894
+ */
1895
+ export function createUiContainer(options) {
1896
+ return new UiContainerClass(options?.elements ?? []);
1897
+ }
1898
+ /**
1899
+ * Parses a JSON string or raw object into a validated `UiContainerClass` instance.
1900
+ *
1901
+ * @remarks
1902
+ * Container model representing an ordered list of visual elements.
1903
+ *
1904
+ * @param json - JSON string or parsed JavaScript object to validate and hydrate.
1905
+ * @param withDeepValidation - Whether to recursively validate all nested child entities.
1906
+ * @returns A strongly-typed `UiContainerClass` instance.
1907
+ */
1908
+ export function parseUiContainer(json, withDeepValidation = true) {
1909
+ return UiContainer.parse(json, withDeepValidation);
1910
+ }
1911
+ /**
1912
+ * Fluent builder for constructing strongly-typed `UiCard` instances.
1913
+ *
1914
+ * @remarks
1915
+ * Root Card container model.
1916
+ * Represents a complete feature card rendered inside the 360px panel.
1917
+ */
1918
+ export class UiCardBuilder {
1919
+ _title;
1920
+ _description;
1921
+ _actions = [];
1922
+ _elements = [];
1923
+ /**
1924
+ * Initializes a new `UiCardBuilder`.
1925
+ *
1926
+ * @param title - Human-readable feature title displayed in the card header
1927
+ */
1928
+ constructor(title) {
1929
+ this._title = title;
1930
+ }
1931
+ /**
1932
+ * Sets the `description` property on this builder.
1933
+ *
1934
+ * @param description - Optional neutral subtitle / description for the feature
1935
+ * @returns This builder instance for method chaining.
1936
+ */
1937
+ description(description) {
1938
+ this._description = description;
1939
+ return this;
1940
+ }
1941
+ /**
1942
+ * Appends multiple actions items.
1943
+ *
1944
+ * @param items - The `UiAction` items to add.
1945
+ * @returns This builder instance for method chaining.
1946
+ */
1947
+ addActions(...items) {
1948
+ this._actions.push(...items);
1949
+ return this;
1950
+ }
1951
+ /**
1952
+ * Appends a single action.
1953
+ *
1954
+ * @param item - The `UiAction` item to add.
1955
+ * @returns This builder instance for method chaining.
1956
+ */
1957
+ addAction(item) {
1958
+ this._actions.push(item);
1959
+ return this;
1960
+ }
1961
+ /**
1962
+ * Appends a visual element.
1963
+ *
1964
+ * @param element - The visual UI element component to add.
1965
+ * @returns This builder instance for method chaining.
1966
+ */
1967
+ add(element) {
1968
+ this._elements.push(element);
1969
+ return this;
1970
+ }
1971
+ /**
1972
+ * Appends multiple elements items.
1973
+ *
1974
+ * @param items - The `UiElement` items to add.
1975
+ * @returns This builder instance for method chaining.
1976
+ */
1977
+ addElements(...items) {
1978
+ this._elements.push(...items);
1979
+ return this;
1980
+ }
1981
+ /**
1982
+ * Appends a `StringShortElement` component.
1983
+ *
1984
+ * @remarks
1985
+ * Short string primitive element.
1986
+ * Supports plain text or compact chip pill presentation.
1987
+ *
1988
+ * @param value - Text value
1989
+ * @param options - Optional component settings (representation (defaults to `plain`), modifiers).
1990
+ * @returns This builder instance for method chaining.
1991
+ */
1992
+ addStringShort(value, options) {
1993
+ return this.add(stringShort(value, options));
1994
+ }
1995
+ /**
1996
+ * Appends a `StringLongElement` component.
1997
+ *
1998
+ * @remarks
1999
+ * Multiline text block primitive element for descriptions, comments, or prose.
2000
+ *
2001
+ * @param value - Text value
2002
+ * @param options - Optional component settings (modifiers).
2003
+ * @returns This builder instance for method chaining.
2004
+ */
2005
+ addStringLong(value, options) {
2006
+ return this.add(stringLong(value, options));
2007
+ }
2008
+ /**
2009
+ * Appends a `StringCodeElement` component.
2010
+ *
2011
+ * @remarks
2012
+ * Monospace code block or formatted code snippet representation.
2013
+ *
2014
+ * @param value - Text value
2015
+ * @param options - Optional component settings (language, modifiers).
2016
+ * @returns This builder instance for method chaining.
2017
+ */
2018
+ addStringCode(value, options) {
2019
+ return this.add(stringCode(value, options));
2020
+ }
2021
+ /**
2022
+ * Appends a `XmlElement` component.
2023
+ *
2024
+ * @remarks
2025
+ * XML markup code block element.
2026
+ *
2027
+ * @param value - XML content value
2028
+ * @param options - Optional component settings (modifiers).
2029
+ * @returns This builder instance for method chaining.
2030
+ */
2031
+ addXml(value, options) {
2032
+ return this.add(xml(value, options));
2033
+ }
2034
+ /**
2035
+ * Appends a `JsonElement` component.
2036
+ *
2037
+ * @remarks
2038
+ * JSON data or structure representation element.
2039
+ *
2040
+ * @param value - JSON content value
2041
+ * @param options - Optional component settings (modifiers).
2042
+ * @returns This builder instance for method chaining.
2043
+ */
2044
+ addJson(value, options) {
2045
+ return this.add(json(value, options));
2046
+ }
2047
+ /**
2048
+ * Appends a `StringUrlElement` component.
2049
+ *
2050
+ * @remarks
2051
+ * Hyperlink representation for external or internal URL navigation.
2052
+ *
2053
+ * @param value - Target URL or navigation destination
2054
+ * @param options - Optional component settings (label, modifiers).
2055
+ * @returns This builder instance for method chaining.
2056
+ */
2057
+ addStringUrl(value, options) {
2058
+ return this.add(stringUrl(value, options));
2059
+ }
2060
+ /**
2061
+ * Appends a `IdentifierElement` component.
2062
+ *
2063
+ * @remarks
2064
+ * Monospace semantic identifier representation.
2065
+ *
2066
+ * @param value - Identifier string value
2067
+ * @param options - Optional component settings (modifiers).
2068
+ * @returns This builder instance for method chaining.
2069
+ */
2070
+ addIdentifier(value, options) {
2071
+ return this.add(identifier(value, options));
2072
+ }
2073
+ /**
2074
+ * Appends a `RatioElement` component.
2075
+ *
2076
+ * @remarks
2077
+ * Aspect ratio representation (e.g. "16:9", "4:3", "1:1").
2078
+ *
2079
+ * @param value - Aspect ratio numerical expression
2080
+ * @param options - Optional component settings (modifiers).
2081
+ * @returns This builder instance for method chaining.
2082
+ */
2083
+ addRatio(value, options) {
2084
+ return this.add(ratio(value, options));
2085
+ }
2086
+ /**
2087
+ * Appends a `ColourElement` component.
2088
+ *
2089
+ * @remarks
2090
+ * Single color representation with hex value, shape/size styling, text display toggle, and copy affordance.
2091
+ *
2092
+ * @param value - Hexadecimal color code
2093
+ * @param options - Optional component settings (label, showText (defaults to `true`), shape (defaults to `circle`), size (defaults to `medium`), modifiers).
2094
+ * @returns This builder instance for method chaining.
2095
+ */
2096
+ addColour(value, options) {
2097
+ return this.add(colour(value, options));
2098
+ }
2099
+ /**
2100
+ * Appends a `ColourElement` component.
2101
+ *
2102
+ * @remarks
2103
+ * Single color representation with hex value, shape/size styling, text display toggle, and copy affordance.
2104
+ *
2105
+ * @param value - Hexadecimal color code
2106
+ * @param options - Optional component settings (label, showText (defaults to `true`), shape (defaults to `circle`), size (defaults to `medium`), modifiers).
2107
+ * @returns This builder instance for method chaining.
2108
+ */
2109
+ addColor(value, options) {
2110
+ return this.add(color(value, options));
2111
+ }
2112
+ /**
2113
+ * Appends a `NumberUnboundedElement` component.
2114
+ *
2115
+ * @remarks
2116
+ * Plain unbounded numeric value primitive element.
2117
+ *
2118
+ * @param value - Numeric value
2119
+ * @param options - Optional component settings (unit, modifiers).
2120
+ * @returns This builder instance for method chaining.
2121
+ */
2122
+ addNumberUnbounded(value, options) {
2123
+ return this.add(numberUnbounded(value, options));
2124
+ }
2125
+ /**
2126
+ * Appends a `NumberBoundedStarsElement` component.
2127
+ *
2128
+ * @remarks
2129
+ * Bounded numeric rating represented as visual stars.
2130
+ *
2131
+ * @param value - Numeric rating score
2132
+ * @param options - Optional component settings (maximum, modifiers).
2133
+ * @returns This builder instance for method chaining.
2134
+ */
2135
+ addNumberBoundedStars(value, options) {
2136
+ return this.add(numberBoundedStars(value, options));
2137
+ }
2138
+ /**
2139
+ * Appends a `NumberBoundedStarsElement` component.
2140
+ *
2141
+ * @remarks
2142
+ * Bounded numeric rating represented as visual stars.
2143
+ *
2144
+ * @param value - Numeric rating score
2145
+ * @param options - Optional component settings (maximum, modifiers).
2146
+ * @returns This builder instance for method chaining.
2147
+ */
2148
+ addNumberStars(value, options) {
2149
+ return this.add(numberStars(value, options));
2150
+ }
2151
+ /**
2152
+ * Appends a `NumberBoundedMeterElement` component.
2153
+ *
2154
+ * @remarks
2155
+ * Bounded numeric meter representation (read-only progress / score bar).
2156
+ *
2157
+ * @param value - Numeric value
2158
+ * @param options - Optional component settings (minimum, maximum, label, unit, modifiers).
2159
+ * @returns This builder instance for method chaining.
2160
+ */
2161
+ addNumberBoundedMeter(value, options) {
2162
+ return this.add(numberBoundedMeter(value, options));
2163
+ }
2164
+ /**
2165
+ * Appends a `NumberBoundedMeterElement` component.
2166
+ *
2167
+ * @remarks
2168
+ * Bounded numeric meter representation (read-only progress / score bar).
2169
+ *
2170
+ * @param value - Numeric value
2171
+ * @param options - Optional component settings (minimum, maximum, label, unit, modifiers).
2172
+ * @returns This builder instance for method chaining.
2173
+ */
2174
+ addNumberMeter(value, options) {
2175
+ return this.add(numberMeter(value, options));
2176
+ }
2177
+ /**
2178
+ * Appends a `BooleanPlainElement` component.
2179
+ *
2180
+ * @remarks
2181
+ * Plain boolean value representation (textual "true" / "false").
2182
+ *
2183
+ * @param value - Boolean state value
2184
+ * @param options - Optional component settings (modifiers).
2185
+ * @returns This builder instance for method chaining.
2186
+ */
2187
+ addBooleanPlain(value, options) {
2188
+ return this.add(booleanPlain(value, options));
2189
+ }
2190
+ /**
2191
+ * Appends a `BooleanBadgeElement` component.
2192
+ *
2193
+ * @remarks
2194
+ * Visual badge pill representation of a boolean state.
2195
+ *
2196
+ * @param value - Boolean state value
2197
+ * @param options - Optional component settings (trueLabel (defaults to `true`), falseLabel (defaults to `false`), variant (defaults to `neutral`), modifiers).
2198
+ * @returns This builder instance for method chaining.
2199
+ */
2200
+ addBooleanBadge(value, options) {
2201
+ return this.add(booleanBadge(value, options));
2202
+ }
2203
+ /**
2204
+ * Appends a `TimestampElement` component.
2205
+ *
2206
+ * @remarks
2207
+ * Formatted date and time representation.
2208
+ *
2209
+ * @param value - The timestamp in milliseconds
2210
+ * @param options - Optional component settings (format (defaults to `datetime`), modifiers).
2211
+ * @returns This builder instance for method chaining.
2212
+ */
2213
+ addTimestamp(value, options) {
2214
+ return this.add(timestamp(value, options));
2215
+ }
2216
+ /**
2217
+ * Appends a `ImageReferenceElement` component.
2218
+ *
2219
+ * @remarks
2220
+ * Thumbnail image reference with placeholder fallback handling.
2221
+ *
2222
+ * @param src - Image source URI (HTTPS URL, base64 data URI, or asset path)
2223
+ * @param options - Optional component settings (alt, aspectRatio (defaults to `1:1`), placeholder).
2224
+ * @returns This builder instance for method chaining.
2225
+ */
2226
+ addImageReference(src, options) {
2227
+ return this.add(imageReference(src, options));
2228
+ }
2229
+ /**
2230
+ * Appends a `ImageReferenceElement` component.
2231
+ *
2232
+ * @remarks
2233
+ * Thumbnail image reference with placeholder fallback handling.
2234
+ *
2235
+ * @param src - Image source URI (HTTPS URL, base64 data URI, or asset path)
2236
+ * @param options - Optional component settings (alt, aspectRatio (defaults to `1:1`), placeholder).
2237
+ * @returns This builder instance for method chaining.
2238
+ */
2239
+ addImageRef(src, options) {
2240
+ return this.add(imageRef(src, options));
2241
+ }
2242
+ /**
2243
+ * Appends a `MarkdownBlockElement` component.
2244
+ *
2245
+ * @remarks
2246
+ * Full Markdown fallback block rendered with core typographic hierarchy, spacing, and styling.
2247
+ *
2248
+ * @param content - Raw Markdown markup content
2249
+ * @param options - Optional component settings (modifiers).
2250
+ * @returns This builder instance for method chaining.
2251
+ */
2252
+ addMarkdownBlock(content, options) {
2253
+ return this.add(markdownBlock(content, options));
2254
+ }
2255
+ /**
2256
+ * Appends a `MarkdownBlockElement` component.
2257
+ *
2258
+ * @remarks
2259
+ * Full Markdown fallback block rendered with core typographic hierarchy, spacing, and styling.
2260
+ *
2261
+ * @param content - Raw Markdown markup content
2262
+ * @param options - Optional component settings (modifiers).
2263
+ * @returns This builder instance for method chaining.
2264
+ */
2265
+ addMarkdown(content, options) {
2266
+ return this.add(markdown(content, options));
2267
+ }
2268
+ /**
2269
+ * Appends a `HtmlBlockElement` component.
2270
+ *
2271
+ * @remarks
2272
+ * Sandboxed HTML rendering escape hatch.
2273
+ *
2274
+ * @param content - Raw HTML markup content
2275
+ * @param options - Optional component settings (modifiers).
2276
+ * @returns This builder instance for method chaining.
2277
+ */
2278
+ addHtmlBlock(content, options) {
2279
+ return this.add(htmlBlock(content, options));
2280
+ }
2281
+ /**
2282
+ * Appends a `HtmlBlockElement` component.
2283
+ *
2284
+ * @remarks
2285
+ * Sandboxed HTML rendering escape hatch.
2286
+ *
2287
+ * @param content - Raw HTML markup content
2288
+ * @param options - Optional component settings (modifiers).
2289
+ * @returns This builder instance for method chaining.
2290
+ */
2291
+ addHtml(content, options) {
2292
+ return this.add(html(content, options));
2293
+ }
2294
+ /**
2295
+ * Appends a `MultiSlotElement` component.
2296
+ *
2297
+ * @remarks
2298
+ * Multi-slot horizontal row with declared column width proportions.
2299
+ * Examples: "1/3 + 2/3", "equal thirds", "1/4 + 3/4".
2300
+ *
2301
+ * @param slots - List of slots comprising the row
2302
+ * @param options - Optional component settings (proportions).
2303
+ * @returns This builder instance for method chaining.
2304
+ */
2305
+ addMultiSlot(slots, options) {
2306
+ return this.add(multiSlot(slots, options));
2307
+ }
2308
+ /**
2309
+ * Appends a `FlowingElement` component.
2310
+ *
2311
+ * @remarks
2312
+ * Flowing inline layout container with automatic line wrapping.
2313
+ * Renders child elements horizontally in sequence, automatically wrapping to the next line when space runs out.
2314
+ *
2315
+ * @param elements - List of child elements rendered sequentially with line wrapping
2316
+ * @returns This builder instance for method chaining.
2317
+ */
2318
+ addFlowing(elements) {
2319
+ return this.add(flowing(elements));
2320
+ }
2321
+ /**
2322
+ * Appends a `LabelValueElement` component.
2323
+ *
2324
+ * @remarks
2325
+ * Standard label and value row.
2326
+ * Displays a muted label on the left and value representation on the right with a vertical dividing line.
2327
+ *
2328
+ * @param label - Key or descriptive label displayed muted on the left
2329
+ * @param value - Rendered value element on the right
2330
+ * @param options - Optional component settings (withDivider (defaults to `false`)).
2331
+ * @returns This builder instance for method chaining.
2332
+ */
2333
+ addLabelValue(label, value, options) {
2334
+ return this.add(labelValue(label, value, options));
2335
+ }
2336
+ /**
2337
+ * Appends a `TableElement` component.
2338
+ *
2339
+ * @remarks
2340
+ * Structured tabular data representation.
2341
+ * Supports header/borderless modes, 2-column key-value tables, and 3-column data tables.
2342
+ *
2343
+ * @param rows - Tabular data rows
2344
+ * @param options - Optional component settings (hasHeader (defaults to `true`), isStriped (defaults to `false`), withColumnSeparators (defaults to `false`), withRowSeparators (defaults to `false`), columns).
2345
+ * @returns This builder instance for method chaining.
2346
+ */
2347
+ addTable(rows, options) {
2348
+ return this.add(table(rows, options));
2349
+ }
2350
+ /**
2351
+ * Appends a `RepeatingGroupElement` component.
2352
+ *
2353
+ * @remarks
2354
+ * Repeating group container where entries share uniform structure and retain per-entry labels.
2355
+ *
2356
+ * @param entries - List of repeated entry records
2357
+ * @param options - Optional component settings (title).
2358
+ * @returns This builder instance for method chaining.
2359
+ */
2360
+ addRepeatingGroup(entries, options) {
2361
+ return this.add(repeatingGroup(entries, options));
2362
+ }
2363
+ /**
2364
+ * Appends a `CollapsibleGroupElement` component.
2365
+ *
2366
+ * @remarks
2367
+ * Collapsible disclosure container (accordion) with summary badge.
2368
+ *
2369
+ * @param title - Group title (e.g. "Show specimen details")
2370
+ * @param elements - Nested content elements revealed when expanded
2371
+ * @param options - Optional component settings (summary, defaultExpanded (defaults to `false`)).
2372
+ * @returns This builder instance for method chaining.
2373
+ */
2374
+ addCollapsibleGroup(title, elements, options) {
2375
+ return this.add(collapsibleGroup(title, elements, options));
2376
+ }
2377
+ /**
2378
+ * Appends a `DividerElement` component.
2379
+ *
2380
+ * @remarks
2381
+ * Visual hairline separator separating sections or element groups.
2382
+ *
2383
+ * @param options - Optional component settings (style (defaults to `hairline`)).
2384
+ * @returns This builder instance for method chaining.
2385
+ */
2386
+ addDivider(options) {
2387
+ return this.add(divider(options));
2388
+ }
2389
+ /**
2390
+ * Finalizes and returns the complete strongly-typed `UiCardClass` instance.
2391
+ *
2392
+ * @returns The constructed `UiCardClass` instance.
2393
+ */
2394
+ build() {
2395
+ return new UiCardClass(this._title, this._elements, {
2396
+ description: this._description,
2397
+ actions: this._actions.length > 0 ? this._actions : undefined
2398
+ });
2399
+ }
2400
+ /**
2401
+ * Serializes this builder into a strongly-typed, JSON-compatible plain object conforming to interface `UiCard`.
2402
+ *
2403
+ * @returns The plain object representation conforming to interface `UiCard`.
2404
+ */
2405
+ toJSON() {
2406
+ return this.build().toJSON();
2407
+ }
2408
+ /**
2409
+ * Returns the compact JSON string representation of the built `UiCardClass` instance with no indentation.
2410
+ *
2411
+ * @returns Compact JSON string without indentation.
2412
+ */
2413
+ toString() {
2414
+ return this.build().toString();
2415
+ }
2416
+ }
2417
+ /** Static helper factory object for `UiCard`. */
2418
+ export const UiCard = {
2419
+ /**
2420
+ * Creates a new fluent builder for constructing a `UiCard`.
2421
+ *
2422
+ * @param title - Human-readable feature title displayed in the card header
2423
+ * @returns A new `UiCardBuilder` instance.
2424
+ */
2425
+ builder(title) {
2426
+ return new UiCardBuilder(title);
2427
+ },
2428
+ /**
2429
+ * Creates a `UiCardClass` directly from a properties object.
2430
+ *
2431
+ * @param params - Configuration properties.
2432
+ * @returns A completed `UiCardClass` instance.
2433
+ */
2434
+ create(params) {
2435
+ return new UiCardClass(params.title, params.elements, {
2436
+ description: params.description,
2437
+ actions: params.actions
2438
+ });
2439
+ },
2440
+ /**
2441
+ * Parses a JSON string or raw object into a validated `UiCardClass` instance.
2442
+ *
2443
+ * @remarks
2444
+ * Throws an `Error` if the input does not conform to the `UiCard` schema.
2445
+ *
2446
+ * @param json - JSON string or parsed JavaScript object to validate and hydrate.
2447
+ * @param withDeepValidation - Whether to recursively validate all nested child entities.
2448
+ * @returns A strongly-typed `UiCardClass` instance.
2449
+ */
2450
+ parse(json, withDeepValidation = true) {
2451
+ const data = typeof json === "string" ? JSON.parse(json) : json;
2452
+ if (!isUiCard(data, withDeepValidation)) {
2453
+ throw new Error("Invalid JSON: value does not match the `UiCard` schema.");
2454
+ }
2455
+ return UiCard.create(data);
2456
+ }
2457
+ };
2458
+ /**
2459
+ * Functional helper to create a `UiCardClass` instance directly.
2460
+ *
2461
+ * @remarks
2462
+ * Root Card container model.
2463
+ * Represents a complete feature card rendered inside the 360px panel.
2464
+ *
2465
+ * @param title - Human-readable feature title displayed in the card header
2466
+ * @param options - Optional configuration properties.
2467
+ * @returns A strongly-typed `UiCardClass` instance.
2468
+ */
2469
+ export function createUiCard(title, options) {
2470
+ return new UiCardClass(title, options?.elements ?? [], {
2471
+ description: options?.description,
2472
+ actions: options?.actions
2473
+ });
2474
+ }
2475
+ /**
2476
+ * Parses a JSON string or raw object into a validated `UiCardClass` instance.
2477
+ *
2478
+ * @remarks
2479
+ * Root Card container model.
2480
+ * Represents a complete feature card rendered inside the 360px panel.
2481
+ *
2482
+ * @param json - JSON string or parsed JavaScript object to validate and hydrate.
2483
+ * @param withDeepValidation - Whether to recursively validate all nested child entities.
2484
+ * @returns A strongly-typed `UiCardClass` instance.
2485
+ */
2486
+ export function parseUiCard(json, withDeepValidation = true) {
2487
+ return UiCard.parse(json, withDeepValidation);
2488
+ }
2489
+ // --- Functional DSL Factory Helpers ---
2490
+ /**
2491
+ * Creates a `TruncateOptions` component instance.
2492
+ *
2493
+ * @remarks
2494
+ * Truncation configuration for long textual content with optional expand affordance.
2495
+ *
2496
+ * @param characterLimit - Maximum number of characters to display before truncating
2497
+ * @param options - Optional settings (showMore (defaults to `true`)).
2498
+ * @returns A strongly-typed `TruncateOptions` object.
2499
+ */
2500
+ export function truncateOptions(characterLimit, options) {
2501
+ return {
2502
+ characterLimit,
2503
+ showMore: options?.showMore ?? true
2504
+ };
2505
+ }
2506
+ /**
2507
+ * Creates a `BaseModifiers` component instance.
2508
+ *
2509
+ * @remarks
2510
+ * Base modifier traits for elements that support copy affordance.
2511
+ *
2512
+ * @param options - Optional settings (copyable).
2513
+ * @returns A strongly-typed `BaseModifiers` object.
2514
+ */
2515
+ export function baseModifiers(options) {
2516
+ return {
2517
+ copyable: options?.copyable
2518
+ };
2519
+ }
2520
+ /**
2521
+ * Creates a `PrimitiveModifiers` component instance.
2522
+ *
2523
+ * @remarks
2524
+ * Common modifier traits that can be attached to primitive elements.
2525
+ *
2526
+ * @param options - Optional settings (truncate, weight (defaults to `normal`), intensity (defaults to `medium`), monospace (defaults to `false`), copyable).
2527
+ * @returns A strongly-typed `PrimitiveModifiers` object.
2528
+ */
2529
+ export function primitiveModifiers(options) {
2530
+ return {
2531
+ truncate: options?.truncate,
2532
+ weight: options?.weight ?? TextWeight.normal,
2533
+ intensity: options?.intensity ?? TextIntensity.medium,
2534
+ monospace: options?.monospace ?? false,
2535
+ copyable: options?.copyable
2536
+ };
2537
+ }
2538
+ /**
2539
+ * Creates a `StringShortElement` component instance.
2540
+ *
2541
+ * @remarks
2542
+ * Short string primitive element.
2543
+ * Supports plain text or compact chip pill presentation.
2544
+ *
2545
+ * @param value - Text value
2546
+ * @param options - Optional settings (representation (defaults to `plain`), modifiers).
2547
+ * @returns A strongly-typed `StringShortElement` object.
2548
+ */
2549
+ export function stringShort(value, options) {
2550
+ return {
2551
+ type: "string-short",
2552
+ value,
2553
+ representation: options?.representation ?? StringShortRepresentation.plain,
2554
+ modifiers: options?.modifiers
2555
+ };
2556
+ }
2557
+ /**
2558
+ * Creates a `StringLongElement` component instance.
2559
+ *
2560
+ * @remarks
2561
+ * Multiline text block primitive element for descriptions, comments, or prose.
2562
+ *
2563
+ * @param value - Text value
2564
+ * @param options - Optional settings (modifiers).
2565
+ * @returns A strongly-typed `StringLongElement` object.
2566
+ */
2567
+ export function stringLong(value, options) {
2568
+ return {
2569
+ type: "string-long",
2570
+ value,
2571
+ modifiers: options?.modifiers
2572
+ };
2573
+ }
2574
+ /**
2575
+ * Creates a `StringCodeElement` component instance.
2576
+ *
2577
+ * @remarks
2578
+ * Monospace code block or formatted code snippet representation.
2579
+ *
2580
+ * @param value - Text value
2581
+ * @param options - Optional settings (language, modifiers).
2582
+ * @returns A strongly-typed `StringCodeElement` object.
2583
+ */
2584
+ export function stringCode(value, options) {
2585
+ return {
2586
+ type: "string-code",
2587
+ value,
2588
+ language: options?.language,
2589
+ modifiers: options?.modifiers
2590
+ };
2591
+ }
2592
+ /**
2593
+ * Creates a `XmlElement` component instance.
2594
+ *
2595
+ * @remarks
2596
+ * XML markup code block element.
2597
+ *
2598
+ * @param value - XML content value
2599
+ * @param options - Optional settings (modifiers).
2600
+ * @returns A strongly-typed `XmlElement` object.
2601
+ */
2602
+ export function xml(value, options) {
2603
+ return {
2604
+ type: "xml",
2605
+ value,
2606
+ modifiers: options?.modifiers
2607
+ };
2608
+ }
2609
+ /**
2610
+ * Creates a `JsonElement` component instance.
2611
+ *
2612
+ * @remarks
2613
+ * JSON data or structure representation element.
2614
+ *
2615
+ * @param value - JSON content value
2616
+ * @param options - Optional settings (modifiers).
2617
+ * @returns A strongly-typed `JsonElement` object.
2618
+ */
2619
+ export function json(value, options) {
2620
+ return {
2621
+ type: "json",
2622
+ value,
2623
+ modifiers: options?.modifiers
2624
+ };
2625
+ }
2626
+ /**
2627
+ * Creates a `StringUrlElement` component instance.
2628
+ *
2629
+ * @remarks
2630
+ * Hyperlink representation for external or internal URL navigation.
2631
+ *
2632
+ * @param value - Target URL or navigation destination
2633
+ * @param options - Optional settings (label, modifiers).
2634
+ * @returns A strongly-typed `StringUrlElement` object.
2635
+ */
2636
+ export function stringUrl(value, options) {
2637
+ return {
2638
+ type: "string-url",
2639
+ value,
2640
+ label: options?.label,
2641
+ modifiers: options?.modifiers
2642
+ };
2643
+ }
2644
+ /**
2645
+ * Creates a `IdentifierElement` component instance.
2646
+ *
2647
+ * @remarks
2648
+ * Monospace semantic identifier representation.
2649
+ *
2650
+ * @param value - Identifier string value
2651
+ * @param options - Optional settings (modifiers).
2652
+ * @returns A strongly-typed `IdentifierElement` object.
2653
+ */
2654
+ export function identifier(value, options) {
2655
+ return {
2656
+ type: "identifier",
2657
+ value,
2658
+ modifiers: options?.modifiers
2659
+ };
2660
+ }
2661
+ /**
2662
+ * Creates a `RatioElement` component instance.
2663
+ *
2664
+ * @remarks
2665
+ * Aspect ratio representation (e.g. "16:9", "4:3", "1:1").
2666
+ *
2667
+ * @param value - Aspect ratio numerical expression
2668
+ * @param options - Optional settings (modifiers).
2669
+ * @returns A strongly-typed `RatioElement` object.
2670
+ */
2671
+ export function ratio(value, options) {
2672
+ return {
2673
+ type: "ratio",
2674
+ value,
2675
+ modifiers: options?.modifiers
2676
+ };
2677
+ }
2678
+ /**
2679
+ * Creates a `ColourElement` component instance.
2680
+ *
2681
+ * @remarks
2682
+ * Single color representation with hex value, shape/size styling, text display toggle, and copy affordance.
2683
+ *
2684
+ * @param value - Hexadecimal color code
2685
+ * @param options - Optional settings (label, showText (defaults to `true`), shape (defaults to `circle`), size (defaults to `medium`), modifiers).
2686
+ * @returns A strongly-typed `ColourElement` object.
2687
+ */
2688
+ export function colour(value, options) {
2689
+ return {
2690
+ type: "color",
2691
+ value,
2692
+ label: options?.label,
2693
+ showText: options?.showText ?? true,
2694
+ shape: options?.shape ?? Shape.circle,
2695
+ size: options?.size ?? Size.medium,
2696
+ modifiers: options?.modifiers
2697
+ };
2698
+ }
2699
+ /**
2700
+ * Creates a `ColourElement` component instance.
2701
+ *
2702
+ * @remarks
2703
+ * Single color representation with hex value, shape/size styling, text display toggle, and copy affordance.
2704
+ *
2705
+ * @param value - Hexadecimal color code
2706
+ * @param options - Optional settings (label, showText (defaults to `true`), shape (defaults to `circle`), size (defaults to `medium`), modifiers).
2707
+ * @returns A strongly-typed `ColourElement` object.
2708
+ */
2709
+ export function color(value, options) {
2710
+ return {
2711
+ type: "color",
2712
+ value,
2713
+ label: options?.label,
2714
+ showText: options?.showText ?? true,
2715
+ shape: options?.shape ?? Shape.circle,
2716
+ size: options?.size ?? Size.medium,
2717
+ modifiers: options?.modifiers
2718
+ };
2719
+ }
2720
+ /**
2721
+ * Creates a `NumberUnboundedElement` component instance.
2722
+ *
2723
+ * @remarks
2724
+ * Plain unbounded numeric value primitive element.
2725
+ *
2726
+ * @param value - Numeric value
2727
+ * @param options - Optional settings (unit, modifiers).
2728
+ * @returns A strongly-typed `NumberUnboundedElement` object.
2729
+ */
2730
+ export function numberUnbounded(value, options) {
2731
+ return {
2732
+ type: "number-unbounded",
2733
+ value,
2734
+ unit: options?.unit,
2735
+ modifiers: options?.modifiers
2736
+ };
2737
+ }
2738
+ /**
2739
+ * Creates a `NumberBoundedStarsElement` component instance.
2740
+ *
2741
+ * @remarks
2742
+ * Bounded numeric rating represented as visual stars.
2743
+ *
2744
+ * @param value - Numeric rating score
2745
+ * @param options - Optional settings (maximum, modifiers).
2746
+ * @returns A strongly-typed `NumberBoundedStarsElement` object.
2747
+ */
2748
+ export function numberBoundedStars(value, options) {
2749
+ return {
2750
+ type: "number-stars",
2751
+ value,
2752
+ maximum: options?.maximum,
2753
+ modifiers: options?.modifiers
2754
+ };
2755
+ }
2756
+ /**
2757
+ * Creates a `NumberBoundedStarsElement` component instance.
2758
+ *
2759
+ * @remarks
2760
+ * Bounded numeric rating represented as visual stars.
2761
+ *
2762
+ * @param value - Numeric rating score
2763
+ * @param options - Optional settings (maximum, modifiers).
2764
+ * @returns A strongly-typed `NumberBoundedStarsElement` object.
2765
+ */
2766
+ export function numberStars(value, options) {
2767
+ return {
2768
+ type: "number-stars",
2769
+ value,
2770
+ maximum: options?.maximum,
2771
+ modifiers: options?.modifiers
2772
+ };
2773
+ }
2774
+ /**
2775
+ * Creates a `NumberBoundedMeterElement` component instance.
2776
+ *
2777
+ * @remarks
2778
+ * Bounded numeric meter representation (read-only progress / score bar).
2779
+ *
2780
+ * @param value - Numeric value
2781
+ * @param options - Optional settings (minimum, maximum, label, unit, modifiers).
2782
+ * @returns A strongly-typed `NumberBoundedMeterElement` object.
2783
+ */
2784
+ export function numberBoundedMeter(value, options) {
2785
+ return {
2786
+ type: "number-meter",
2787
+ value,
2788
+ minimum: options?.minimum,
2789
+ maximum: options?.maximum,
2790
+ label: options?.label,
2791
+ unit: options?.unit,
2792
+ modifiers: options?.modifiers
2793
+ };
2794
+ }
2795
+ /**
2796
+ * Creates a `NumberBoundedMeterElement` component instance.
2797
+ *
2798
+ * @remarks
2799
+ * Bounded numeric meter representation (read-only progress / score bar).
2800
+ *
2801
+ * @param value - Numeric value
2802
+ * @param options - Optional settings (minimum, maximum, label, unit, modifiers).
2803
+ * @returns A strongly-typed `NumberBoundedMeterElement` object.
2804
+ */
2805
+ export function numberMeter(value, options) {
2806
+ return {
2807
+ type: "number-meter",
2808
+ value,
2809
+ minimum: options?.minimum,
2810
+ maximum: options?.maximum,
2811
+ label: options?.label,
2812
+ unit: options?.unit,
2813
+ modifiers: options?.modifiers
2814
+ };
2815
+ }
2816
+ /**
2817
+ * Creates a `BooleanPlainElement` component instance.
2818
+ *
2819
+ * @remarks
2820
+ * Plain boolean value representation (textual "true" / "false").
2821
+ *
2822
+ * @param value - Boolean state value
2823
+ * @param options - Optional settings (modifiers).
2824
+ * @returns A strongly-typed `BooleanPlainElement` object.
2825
+ */
2826
+ export function booleanPlain(value, options) {
2827
+ return {
2828
+ type: "boolean-plain",
2829
+ value,
2830
+ modifiers: options?.modifiers
2831
+ };
2832
+ }
2833
+ /**
2834
+ * Creates a `BooleanBadgeElement` component instance.
2835
+ *
2836
+ * @remarks
2837
+ * Visual badge pill representation of a boolean state.
2838
+ *
2839
+ * @param value - Boolean state value
2840
+ * @param options - Optional settings (trueLabel (defaults to `true`), falseLabel (defaults to `false`), variant (defaults to `neutral`), modifiers).
2841
+ * @returns A strongly-typed `BooleanBadgeElement` object.
2842
+ */
2843
+ export function booleanBadge(value, options) {
2844
+ return {
2845
+ type: "boolean-badge",
2846
+ value,
2847
+ trueLabel: options?.trueLabel ?? "true",
2848
+ falseLabel: options?.falseLabel ?? "false",
2849
+ variant: options?.variant ?? BadgeVariant.neutral,
2850
+ modifiers: options?.modifiers
2851
+ };
2852
+ }
2853
+ /**
2854
+ * Creates a `TimestampElement` component instance.
2855
+ *
2856
+ * @remarks
2857
+ * Formatted date and time representation.
2858
+ *
2859
+ * @param value - The timestamp in milliseconds
2860
+ * @param options - Optional settings (format (defaults to `datetime`), modifiers).
2861
+ * @returns A strongly-typed `TimestampElement` object.
2862
+ */
2863
+ export function timestamp(value, options) {
2864
+ return {
2865
+ type: "timestamp",
2866
+ value,
2867
+ format: options?.format ?? TimestampFormat.datetime,
2868
+ modifiers: options?.modifiers
2869
+ };
2870
+ }
2871
+ /**
2872
+ * Creates a `ImageReferenceElement` component instance.
2873
+ *
2874
+ * @remarks
2875
+ * Thumbnail image reference with placeholder fallback handling.
2876
+ *
2877
+ * @param src - Image source URI (HTTPS URL, base64 data URI, or asset path)
2878
+ * @param options - Optional settings (alt, aspectRatio (defaults to `1:1`), placeholder).
2879
+ * @returns A strongly-typed `ImageReferenceElement` object.
2880
+ */
2881
+ export function imageReference(src, options) {
2882
+ return {
2883
+ type: "image-ref",
2884
+ src,
2885
+ alt: options?.alt,
2886
+ aspectRatio: options?.aspectRatio ?? "1:1",
2887
+ placeholder: options?.placeholder
2888
+ };
2889
+ }
2890
+ /**
2891
+ * Creates a `ImageReferenceElement` component instance.
2892
+ *
2893
+ * @remarks
2894
+ * Thumbnail image reference with placeholder fallback handling.
2895
+ *
2896
+ * @param src - Image source URI (HTTPS URL, base64 data URI, or asset path)
2897
+ * @param options - Optional settings (alt, aspectRatio (defaults to `1:1`), placeholder).
2898
+ * @returns A strongly-typed `ImageReferenceElement` object.
2899
+ */
2900
+ export function imageRef(src, options) {
2901
+ return {
2902
+ type: "image-ref",
2903
+ src,
2904
+ alt: options?.alt,
2905
+ aspectRatio: options?.aspectRatio ?? "1:1",
2906
+ placeholder: options?.placeholder
2907
+ };
2908
+ }
2909
+ /**
2910
+ * Creates a `ButtonActionElement` component instance.
2911
+ *
2912
+ * @remarks
2913
+ * Interactive button action triggering an extension command.
2914
+ *
2915
+ * @param commandId - Command identifier to invoke
2916
+ * @param label - Display label for the action
2917
+ * @param options - Optional settings (extensionId, target, parameters, disabled (defaults to `false`), variant (defaults to `secondary`)).
2918
+ * @returns A strongly-typed `ButtonActionElement` object.
2919
+ */
2920
+ export function buttonAction(commandId, label, options) {
2921
+ return {
2922
+ type: "button",
2923
+ commandId,
2924
+ label,
2925
+ extensionId: options?.extensionId,
2926
+ target: options?.target,
2927
+ parameters: options?.parameters,
2928
+ disabled: options?.disabled ?? false,
2929
+ variant: options?.variant ?? ButtonVariant.secondary
2930
+ };
2931
+ }
2932
+ /**
2933
+ * Creates a `ExternalLinkActionElement` component instance.
2934
+ *
2935
+ * @remarks
2936
+ * External link action distinct from inline URL text values.
2937
+ *
2938
+ * @param url - Target URL destination
2939
+ * @param label - Display label for the action
2940
+ * @returns A strongly-typed `ExternalLinkActionElement` object.
2941
+ */
2942
+ export function externalLinkAction(url, label) {
2943
+ return {
2944
+ type: "external-link",
2945
+ url,
2946
+ label
2947
+ };
2948
+ }
2949
+ /**
2950
+ * Creates a `MarkdownBlockElement` component instance.
2951
+ *
2952
+ * @remarks
2953
+ * Full Markdown fallback block rendered with core typographic hierarchy, spacing, and styling.
2954
+ *
2955
+ * @param content - Raw Markdown markup content
2956
+ * @param options - Optional settings (modifiers).
2957
+ * @returns A strongly-typed `MarkdownBlockElement` object.
2958
+ */
2959
+ export function markdownBlock(content, options) {
2960
+ return {
2961
+ type: "markdown",
2962
+ content,
2963
+ modifiers: options?.modifiers
2964
+ };
2965
+ }
2966
+ /**
2967
+ * Creates a `MarkdownBlockElement` component instance.
2968
+ *
2969
+ * @remarks
2970
+ * Full Markdown fallback block rendered with core typographic hierarchy, spacing, and styling.
2971
+ *
2972
+ * @param content - Raw Markdown markup content
2973
+ * @param options - Optional settings (modifiers).
2974
+ * @returns A strongly-typed `MarkdownBlockElement` object.
2975
+ */
2976
+ export function markdown(content, options) {
2977
+ return {
2978
+ type: "markdown",
2979
+ content,
2980
+ modifiers: options?.modifiers
2981
+ };
2982
+ }
2983
+ /**
2984
+ * Creates a `HtmlBlockElement` component instance.
2985
+ *
2986
+ * @remarks
2987
+ * Sandboxed HTML rendering escape hatch.
2988
+ *
2989
+ * @param content - Raw HTML markup content
2990
+ * @param options - Optional settings (modifiers).
2991
+ * @returns A strongly-typed `HtmlBlockElement` object.
2992
+ */
2993
+ export function htmlBlock(content, options) {
2994
+ return {
2995
+ type: "html",
2996
+ content,
2997
+ modifiers: options?.modifiers
2998
+ };
2999
+ }
3000
+ /**
3001
+ * Creates a `HtmlBlockElement` component instance.
3002
+ *
3003
+ * @remarks
3004
+ * Sandboxed HTML rendering escape hatch.
3005
+ *
3006
+ * @param content - Raw HTML markup content
3007
+ * @param options - Optional settings (modifiers).
3008
+ * @returns A strongly-typed `HtmlBlockElement` object.
3009
+ */
3010
+ export function html(content, options) {
3011
+ return {
3012
+ type: "html",
3013
+ content,
3014
+ modifiers: options?.modifiers
3015
+ };
3016
+ }
3017
+ /**
3018
+ * Creates a `Slot` component instance.
3019
+ *
3020
+ * @remarks
3021
+ * Single slot within a multi-slot horizontal row layout.
3022
+ *
3023
+ * @param content - Rendered content inside the slot
3024
+ * @param options - Optional settings (label, width).
3025
+ * @returns A strongly-typed `Slot` object.
3026
+ */
3027
+ export function slot(content, options) {
3028
+ return {
3029
+ content,
3030
+ label: options?.label,
3031
+ width: options?.width
3032
+ };
3033
+ }
3034
+ /**
3035
+ * Creates a `MultiSlotElement` component instance.
3036
+ *
3037
+ * @remarks
3038
+ * Multi-slot horizontal row with declared column width proportions.
3039
+ * Examples: "1/3 + 2/3", "equal thirds", "1/4 + 3/4".
3040
+ *
3041
+ * @param slots - List of slots comprising the row
3042
+ * @param options - Optional settings (proportions).
3043
+ * @returns A strongly-typed `MultiSlotElement` object.
3044
+ */
3045
+ export function multiSlot(slots, options) {
3046
+ return {
3047
+ type: "multi-slot",
3048
+ slots: [...slots],
3049
+ proportions: options?.proportions
3050
+ };
3051
+ }
3052
+ /**
3053
+ * Creates a `FlowingElement` component instance.
3054
+ *
3055
+ * @remarks
3056
+ * Flowing inline layout container with automatic line wrapping.
3057
+ * Renders child elements horizontally in sequence, automatically wrapping to the next line when space runs out.
3058
+ *
3059
+ * @param elements - List of child elements rendered sequentially with line wrapping
3060
+ * @returns A strongly-typed `FlowingElement` object.
3061
+ */
3062
+ export function flowing(elements) {
3063
+ return {
3064
+ type: "flowing",
3065
+ elements: [...elements]
3066
+ };
3067
+ }
3068
+ /**
3069
+ * Creates a `LabelValueElement` component instance.
3070
+ *
3071
+ * @remarks
3072
+ * Standard label and value row.
3073
+ * Displays a muted label on the left and value representation on the right with a vertical dividing line.
3074
+ *
3075
+ * @param label - Key or descriptive label displayed muted on the left
3076
+ * @param value - Rendered value element on the right
3077
+ * @param options - Optional settings (withDivider (defaults to `false`)).
3078
+ * @returns A strongly-typed `LabelValueElement` object.
3079
+ */
3080
+ export function labelValue(label, value, options) {
3081
+ return {
3082
+ type: "label-value",
3083
+ label,
3084
+ value,
3085
+ withDivider: options?.withDivider ?? false
3086
+ };
3087
+ }
3088
+ /**
3089
+ * Creates a `TableColumn` component instance.
3090
+ *
3091
+ * @remarks
3092
+ * Column definition for structured tables.
3093
+ *
3094
+ * @param options - Optional settings (header, align (defaults to `left`), width).
3095
+ * @returns A strongly-typed `TableColumn` object.
3096
+ */
3097
+ export function tableColumn(options) {
3098
+ return {
3099
+ header: options?.header,
3100
+ align: options?.align ?? TableColumnAlign.left,
3101
+ width: options?.width
3102
+ };
3103
+ }
3104
+ /**
3105
+ * Creates a `TableRow` component instance.
3106
+ *
3107
+ * @remarks
3108
+ * Single table row containing an array of cell values.
3109
+ *
3110
+ * @param cells - Array of cell values corresponding to table columns
3111
+ * @returns A strongly-typed `TableRow` object.
3112
+ */
3113
+ export function tableRow(cells) {
3114
+ return {
3115
+ cells: [...cells]
3116
+ };
3117
+ }
3118
+ /**
3119
+ * Creates a `TableElement` component instance.
3120
+ *
3121
+ * @remarks
3122
+ * Structured tabular data representation.
3123
+ * Supports header/borderless modes, 2-column key-value tables, and 3-column data tables.
3124
+ *
3125
+ * @param rows - Tabular data rows
3126
+ * @param options - Optional settings (hasHeader (defaults to `true`), isStriped (defaults to `false`), withColumnSeparators (defaults to `false`), withRowSeparators (defaults to `false`), columns).
3127
+ * @returns A strongly-typed `TableElement` object.
3128
+ */
3129
+ export function table(rows, options) {
3130
+ return {
3131
+ type: "table",
3132
+ rows: [...rows],
3133
+ hasHeader: options?.hasHeader ?? true,
3134
+ isStriped: options?.isStriped ?? false,
3135
+ withColumnSeparators: options?.withColumnSeparators ?? false,
3136
+ withRowSeparators: options?.withRowSeparators ?? false,
3137
+ columns: options?.columns ? [...options.columns] : undefined
3138
+ };
3139
+ }
3140
+ /**
3141
+ * Creates a `RepeatingGroupEntry` component instance.
3142
+ *
3143
+ * @remarks
3144
+ * Single entry within a repeating group.
3145
+ *
3146
+ * @param label - Entry label
3147
+ * @param options - Optional settings (value, elements).
3148
+ * @returns A strongly-typed `RepeatingGroupEntry` object.
3149
+ */
3150
+ export function repeatingGroupEntry(label, options) {
3151
+ return {
3152
+ label,
3153
+ value: options?.value,
3154
+ elements: options?.elements ? [...options.elements] : undefined
3155
+ };
3156
+ }
3157
+ /**
3158
+ * Creates a `RepeatingGroupElement` component instance.
3159
+ *
3160
+ * @remarks
3161
+ * Repeating group container where entries share uniform structure and retain per-entry labels.
3162
+ *
3163
+ * @param entries - List of repeated entry records
3164
+ * @param options - Optional settings (title).
3165
+ * @returns A strongly-typed `RepeatingGroupElement` object.
3166
+ */
3167
+ export function repeatingGroup(entries, options) {
3168
+ return {
3169
+ type: "repeating-group",
3170
+ entries: [...entries],
3171
+ title: options?.title
3172
+ };
3173
+ }
3174
+ /**
3175
+ * Creates a `CollapsibleGroupElement` component instance.
3176
+ *
3177
+ * @remarks
3178
+ * Collapsible disclosure container (accordion) with summary badge.
3179
+ *
3180
+ * @param title - Group title (e.g. "Show specimen details")
3181
+ * @param elements - Nested content elements revealed when expanded
3182
+ * @param options - Optional settings (summary, defaultExpanded (defaults to `false`)).
3183
+ * @returns A strongly-typed `CollapsibleGroupElement` object.
3184
+ */
3185
+ export function collapsibleGroup(title, elements, options) {
3186
+ return {
3187
+ type: "collapsible-group",
3188
+ title,
3189
+ elements: [...elements],
3190
+ summary: options?.summary,
3191
+ defaultExpanded: options?.defaultExpanded ?? false
3192
+ };
3193
+ }
3194
+ /**
3195
+ * Creates a `DividerElement` component instance.
3196
+ *
3197
+ * @remarks
3198
+ * Visual hairline separator separating sections or element groups.
3199
+ *
3200
+ * @param options - Optional settings (style (defaults to `hairline`)).
3201
+ * @returns A strongly-typed `DividerElement` object.
3202
+ */
3203
+ export function divider(options) {
3204
+ return {
3205
+ type: "divider",
3206
+ style: options?.style ?? DividerStyle.hairline
3207
+ };
3208
+ }
3209
+ /**
3210
+ * Creates a `Envelop` component instance.
3211
+ *
3212
+ * @remarks
3213
+ * Base envelope container model holding the schema version attribute.
3214
+ *
3215
+ * @param options - Optional settings (schemaVersion (defaults to `1.0`)).
3216
+ * @returns A strongly-typed `Envelop` object.
3217
+ */
3218
+ export function envelop(options) {
3219
+ return {
3220
+ schemaVersion: options?.schemaVersion ?? "1.0"
3221
+ };
3222
+ }
3223
+ // --- Type Guards ---
3224
+ /**
3225
+ * Type guard predicate verifying whether an unknown value conforms to `TruncateOptions`.
3226
+ *
3227
+ * @param value - The value to inspect.
3228
+ * @param withDeepValidation - Whether to recursively validate all properties.
3229
+ * @returns `true` if the value conforms to `TruncateOptions`, otherwise `false`.
3230
+ */
3231
+ export function isTruncateOptions(value, withDeepValidation = false) {
3232
+ if (typeof value !== "object" || value === null) {
3233
+ return false;
3234
+ }
3235
+ if (!withDeepValidation) {
3236
+ return true;
3237
+ }
3238
+ const element = value;
3239
+ return ("characterLimit" in value && typeof element.characterLimit === "number") &&
3240
+ (element.showMore === undefined || typeof element.showMore === "boolean");
3241
+ }
3242
+ /**
3243
+ * Type guard predicate verifying whether an unknown value conforms to `BaseModifiers`.
3244
+ *
3245
+ * @param value - The value to inspect.
3246
+ * @param withDeepValidation - Whether to recursively validate all properties.
3247
+ * @returns `true` if the value conforms to `BaseModifiers`, otherwise `false`.
3248
+ */
3249
+ export function isBaseModifiers(value, withDeepValidation = false) {
3250
+ if (typeof value !== "object" || value === null) {
3251
+ return false;
3252
+ }
3253
+ if (!withDeepValidation) {
3254
+ return true;
3255
+ }
3256
+ const element = value;
3257
+ return (element.copyable === undefined || typeof element.copyable === "boolean");
3258
+ }
3259
+ /**
3260
+ * Type guard predicate verifying whether an unknown value conforms to `PrimitiveModifiers`.
3261
+ *
3262
+ * @param value - The value to inspect.
3263
+ * @param withDeepValidation - Whether to recursively validate all properties.
3264
+ * @returns `true` if the value conforms to `PrimitiveModifiers`, otherwise `false`.
3265
+ */
3266
+ export function isPrimitiveModifiers(value, withDeepValidation = false) {
3267
+ if (typeof value !== "object" || value === null) {
3268
+ return false;
3269
+ }
3270
+ if (!withDeepValidation) {
3271
+ return true;
3272
+ }
3273
+ const element = value;
3274
+ return (element.truncate === undefined || isTruncateOptions(element.truncate, true)) &&
3275
+ (element.weight === undefined || Object.values(TextWeight).includes(element.weight)) &&
3276
+ (element.intensity === undefined || Object.values(TextIntensity).includes(element.intensity)) &&
3277
+ (element.monospace === undefined || typeof element.monospace === "boolean") &&
3278
+ (element.copyable === undefined || typeof element.copyable === "boolean");
3279
+ }
3280
+ /**
3281
+ * Type guard predicate verifying whether an unknown value conforms to `Slot`.
3282
+ *
3283
+ * @param value - The value to inspect.
3284
+ * @param withDeepValidation - Whether to recursively validate all properties.
3285
+ * @returns `true` if the value conforms to `Slot`, otherwise `false`.
3286
+ */
3287
+ export function isSlot(value, withDeepValidation = false) {
3288
+ if (typeof value !== "object" || value === null) {
3289
+ return false;
3290
+ }
3291
+ if (!withDeepValidation) {
3292
+ return true;
3293
+ }
3294
+ const element = value;
3295
+ return (element.label === undefined || typeof element.label === "string") &&
3296
+ (element.width === undefined || typeof element.width === "string") &&
3297
+ ("content" in value && isUiElement(element.content, true));
3298
+ }
3299
+ /**
3300
+ * Type guard predicate verifying whether an unknown value conforms to `TableColumn`.
3301
+ *
3302
+ * @param value - The value to inspect.
3303
+ * @param withDeepValidation - Whether to recursively validate all properties.
3304
+ * @returns `true` if the value conforms to `TableColumn`, otherwise `false`.
3305
+ */
3306
+ export function isTableColumn(value, withDeepValidation = false) {
3307
+ if (typeof value !== "object" || value === null) {
3308
+ return false;
3309
+ }
3310
+ if (!withDeepValidation) {
3311
+ return true;
3312
+ }
3313
+ const element = value;
3314
+ return (element.header === undefined || typeof element.header === "string") &&
3315
+ (element.align === undefined || Object.values(TableColumnAlign).includes(element.align)) &&
3316
+ (element.width === undefined || typeof element.width === "string");
3317
+ }
3318
+ /**
3319
+ * Type guard predicate verifying whether an unknown value conforms to `TableRow`.
3320
+ *
3321
+ * @param value - The value to inspect.
3322
+ * @param withDeepValidation - Whether to recursively validate all properties.
3323
+ * @returns `true` if the value conforms to `TableRow`, otherwise `false`.
3324
+ */
3325
+ export function isTableRow(value, withDeepValidation = false) {
3326
+ if (typeof value !== "object" || value === null) {
3327
+ return false;
3328
+ }
3329
+ if (!withDeepValidation) {
3330
+ return true;
3331
+ }
3332
+ const element = value;
3333
+ return ("cells" in value && (Array.isArray(element.cells) && element.cells.every((item) => isUiElement(item, true))));
3334
+ }
3335
+ /**
3336
+ * Type guard predicate verifying whether an unknown value conforms to `RepeatingGroupEntry`.
3337
+ *
3338
+ * @param value - The value to inspect.
3339
+ * @param withDeepValidation - Whether to recursively validate all properties.
3340
+ * @returns `true` if the value conforms to `RepeatingGroupEntry`, otherwise `false`.
3341
+ */
3342
+ export function isRepeatingGroupEntry(value, withDeepValidation = false) {
3343
+ if (typeof value !== "object" || value === null) {
3344
+ return false;
3345
+ }
3346
+ if (!withDeepValidation) {
3347
+ return true;
3348
+ }
3349
+ const element = value;
3350
+ return ("label" in value && typeof element.label === "string") &&
3351
+ (element.value === undefined || isUiElement(element.value, true)) &&
3352
+ (element.elements === undefined || (Array.isArray(element.elements) && element.elements.every((item) => isUiElement(item, true))));
3353
+ }
3354
+ /**
3355
+ * Type guard predicate verifying whether an unknown value conforms to `Envelop`.
3356
+ *
3357
+ * @param value - The value to inspect.
3358
+ * @param withDeepValidation - Whether to recursively validate all properties.
3359
+ * @returns `true` if the value conforms to `Envelop`, otherwise `false`.
3360
+ */
3361
+ export function isEnvelop(value, withDeepValidation = false) {
3362
+ if (typeof value !== "object" || value === null) {
3363
+ return false;
3364
+ }
3365
+ if (!withDeepValidation) {
3366
+ return true;
3367
+ }
3368
+ const element = value;
3369
+ return true;
3370
+ }
3371
+ /**
3372
+ * Type guard predicate verifying whether an unknown value conforms to `UiElement`.
3373
+ *
3374
+ * @param value - The value to inspect.
3375
+ * @param withDeepValidation - Whether to recursively validate all properties.
3376
+ * @returns `true` if the value is a valid `UiElement`, otherwise `false`.
3377
+ */
3378
+ export function isUiElement(value, withDeepValidation = false) {
3379
+ if (typeof value !== "object" || value === null || !("type" in value) || typeof value.type !== "string") {
3380
+ return false;
3381
+ }
3382
+ if (!withDeepValidation) {
3383
+ return true;
3384
+ }
3385
+ const element = value;
3386
+ switch (element.type) {
3387
+ case "string-short":
3388
+ return isStringShortElement(element, true);
3389
+ case "string-long":
3390
+ return isStringLongElement(element, true);
3391
+ case "string-code":
3392
+ return isStringCodeElement(element, true);
3393
+ case "xml":
3394
+ return isXmlElement(element, true);
3395
+ case "json":
3396
+ return isJsonElement(element, true);
3397
+ case "string-url":
3398
+ return isStringUrlElement(element, true);
3399
+ case "identifier":
3400
+ return isIdentifierElement(element, true);
3401
+ case "ratio":
3402
+ return isRatioElement(element, true);
3403
+ case "color":
3404
+ return isColourElement(element, true);
3405
+ case "number-unbounded":
3406
+ return isNumberUnboundedElement(element, true);
3407
+ case "number-stars":
3408
+ return isNumberBoundedStarsElement(element, true);
3409
+ case "number-meter":
3410
+ return isNumberBoundedMeterElement(element, true);
3411
+ case "boolean-plain":
3412
+ return isBooleanPlainElement(element, true);
3413
+ case "boolean-badge":
3414
+ return isBooleanBadgeElement(element, true);
3415
+ case "timestamp":
3416
+ return isTimestampElement(element, true);
3417
+ case "image-ref":
3418
+ return isImageReferenceElement(element, true);
3419
+ case "markdown":
3420
+ return isMarkdownBlockElement(element, true);
3421
+ case "html":
3422
+ return isHtmlBlockElement(element, true);
3423
+ case "multi-slot":
3424
+ return isMultiSlotElement(element, true);
3425
+ case "flowing":
3426
+ return isFlowingElement(element, true);
3427
+ case "label-value":
3428
+ return isLabelValueElement(element, true);
3429
+ case "table":
3430
+ return isTableElement(element, true);
3431
+ case "repeating-group":
3432
+ return isRepeatingGroupElement(element, true);
3433
+ case "collapsible-group":
3434
+ return isCollapsibleGroupElement(element, true);
3435
+ case "divider":
3436
+ return isDividerElement(element, true);
3437
+ default:
3438
+ return false;
3439
+ }
3440
+ }
3441
+ /**
3442
+ * Type guard predicate narrowing a value to `StringShortElement`.
3443
+ *
3444
+ * @param value - The value to inspect.
3445
+ * @param withDeepValidation - Whether to recursively validate all properties.
3446
+ * @returns `true` if the value is a `StringShortElement` (type = "string-short"), otherwise `false`.
3447
+ */
3448
+ export function isStringShortElement(value, withDeepValidation = false) {
3449
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "string-short") {
3450
+ return false;
3451
+ }
3452
+ if (!withDeepValidation) {
3453
+ return true;
3454
+ }
3455
+ const element = value;
3456
+ return ("value" in value && typeof element.value === "string") &&
3457
+ (element.representation === undefined || Object.values(StringShortRepresentation).includes(element.representation)) &&
3458
+ (element.modifiers === undefined || isPrimitiveModifiers(element.modifiers, true));
3459
+ }
3460
+ /**
3461
+ * Type guard predicate narrowing a value to `StringLongElement`.
3462
+ *
3463
+ * @param value - The value to inspect.
3464
+ * @param withDeepValidation - Whether to recursively validate all properties.
3465
+ * @returns `true` if the value is a `StringLongElement` (type = "string-long"), otherwise `false`.
3466
+ */
3467
+ export function isStringLongElement(value, withDeepValidation = false) {
3468
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "string-long") {
3469
+ return false;
3470
+ }
3471
+ if (!withDeepValidation) {
3472
+ return true;
3473
+ }
3474
+ const element = value;
3475
+ return ("value" in value && typeof element.value === "string") &&
3476
+ (element.modifiers === undefined || isPrimitiveModifiers(element.modifiers, true));
3477
+ }
3478
+ /**
3479
+ * Type guard predicate narrowing a value to `StringCodeElement`.
3480
+ *
3481
+ * @param value - The value to inspect.
3482
+ * @param withDeepValidation - Whether to recursively validate all properties.
3483
+ * @returns `true` if the value is a `StringCodeElement` (type = "string-code"), otherwise `false`.
3484
+ */
3485
+ export function isStringCodeElement(value, withDeepValidation = false) {
3486
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "string-code") {
3487
+ return false;
3488
+ }
3489
+ if (!withDeepValidation) {
3490
+ return true;
3491
+ }
3492
+ const element = value;
3493
+ return ("value" in value && typeof element.value === "string") &&
3494
+ (element.language === undefined || Object.values(CodeLanguage).includes(element.language)) &&
3495
+ (element.modifiers === undefined || isBaseModifiers(element.modifiers, true));
3496
+ }
3497
+ /**
3498
+ * Type guard predicate narrowing a value to `XmlElement`.
3499
+ *
3500
+ * @param value - The value to inspect.
3501
+ * @param withDeepValidation - Whether to recursively validate all properties.
3502
+ * @returns `true` if the value is a `XmlElement` (type = "xml"), otherwise `false`.
3503
+ */
3504
+ export function isXmlElement(value, withDeepValidation = false) {
3505
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "xml") {
3506
+ return false;
3507
+ }
3508
+ if (!withDeepValidation) {
3509
+ return true;
3510
+ }
3511
+ const element = value;
3512
+ return ("value" in value && typeof element.value === "string") &&
3513
+ (element.modifiers === undefined || isBaseModifiers(element.modifiers, true));
3514
+ }
3515
+ /**
3516
+ * Type guard predicate narrowing a value to `JsonElement`.
3517
+ *
3518
+ * @param value - The value to inspect.
3519
+ * @param withDeepValidation - Whether to recursively validate all properties.
3520
+ * @returns `true` if the value is a `JsonElement` (type = "json"), otherwise `false`.
3521
+ */
3522
+ export function isJsonElement(value, withDeepValidation = false) {
3523
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "json") {
3524
+ return false;
3525
+ }
3526
+ if (!withDeepValidation) {
3527
+ return true;
3528
+ }
3529
+ const element = value;
3530
+ return ("value" in value && typeof element.value === "string") &&
3531
+ (element.modifiers === undefined || isBaseModifiers(element.modifiers, true));
3532
+ }
3533
+ /**
3534
+ * Type guard predicate narrowing a value to `StringUrlElement`.
3535
+ *
3536
+ * @param value - The value to inspect.
3537
+ * @param withDeepValidation - Whether to recursively validate all properties.
3538
+ * @returns `true` if the value is a `StringUrlElement` (type = "string-url"), otherwise `false`.
3539
+ */
3540
+ export function isStringUrlElement(value, withDeepValidation = false) {
3541
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "string-url") {
3542
+ return false;
3543
+ }
3544
+ if (!withDeepValidation) {
3545
+ return true;
3546
+ }
3547
+ const element = value;
3548
+ return ("value" in value && typeof element.value === "string") &&
3549
+ (element.label === undefined || typeof element.label === "string") &&
3550
+ (element.modifiers === undefined || isPrimitiveModifiers(element.modifiers, true));
3551
+ }
3552
+ /**
3553
+ * Type guard predicate narrowing a value to `IdentifierElement`.
3554
+ *
3555
+ * @param value - The value to inspect.
3556
+ * @param withDeepValidation - Whether to recursively validate all properties.
3557
+ * @returns `true` if the value is a `IdentifierElement` (type = "identifier"), otherwise `false`.
3558
+ */
3559
+ export function isIdentifierElement(value, withDeepValidation = false) {
3560
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "identifier") {
3561
+ return false;
3562
+ }
3563
+ if (!withDeepValidation) {
3564
+ return true;
3565
+ }
3566
+ const element = value;
3567
+ return ("value" in value && typeof element.value === "string") &&
3568
+ (element.modifiers === undefined || isPrimitiveModifiers(element.modifiers, true));
3569
+ }
3570
+ /**
3571
+ * Type guard predicate narrowing a value to `RatioElement`.
3572
+ *
3573
+ * @param value - The value to inspect.
3574
+ * @param withDeepValidation - Whether to recursively validate all properties.
3575
+ * @returns `true` if the value is a `RatioElement` (type = "ratio"), otherwise `false`.
3576
+ */
3577
+ export function isRatioElement(value, withDeepValidation = false) {
3578
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "ratio") {
3579
+ return false;
3580
+ }
3581
+ if (!withDeepValidation) {
3582
+ return true;
3583
+ }
3584
+ const element = value;
3585
+ return ("value" in value && typeof element.value === "number") &&
3586
+ (element.modifiers === undefined || isPrimitiveModifiers(element.modifiers, true));
3587
+ }
3588
+ /**
3589
+ * Type guard predicate narrowing a value to `ColourElement`.
3590
+ *
3591
+ * @param value - The value to inspect.
3592
+ * @param withDeepValidation - Whether to recursively validate all properties.
3593
+ * @returns `true` if the value is a `ColourElement` (type = "color"), otherwise `false`.
3594
+ */
3595
+ export function isColourElement(value, withDeepValidation = false) {
3596
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "color") {
3597
+ return false;
3598
+ }
3599
+ if (!withDeepValidation) {
3600
+ return true;
3601
+ }
3602
+ const element = value;
3603
+ return ("value" in value && typeof element.value === "string") &&
3604
+ (element.label === undefined || typeof element.label === "string") &&
3605
+ (element.showText === undefined || typeof element.showText === "boolean") &&
3606
+ (element.shape === undefined || Object.values(Shape).includes(element.shape)) &&
3607
+ (element.size === undefined || Object.values(Size).includes(element.size)) &&
3608
+ (element.modifiers === undefined || isPrimitiveModifiers(element.modifiers, true));
3609
+ }
3610
+ /**
3611
+ * Type guard predicate narrowing a value to `NumberUnboundedElement`.
3612
+ *
3613
+ * @param value - The value to inspect.
3614
+ * @param withDeepValidation - Whether to recursively validate all properties.
3615
+ * @returns `true` if the value is a `NumberUnboundedElement` (type = "number-unbounded"), otherwise `false`.
3616
+ */
3617
+ export function isNumberUnboundedElement(value, withDeepValidation = false) {
3618
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "number-unbounded") {
3619
+ return false;
3620
+ }
3621
+ if (!withDeepValidation) {
3622
+ return true;
3623
+ }
3624
+ const element = value;
3625
+ return ("value" in value && typeof element.value === "number") &&
3626
+ (element.unit === undefined || typeof element.unit === "string") &&
3627
+ (element.modifiers === undefined || isPrimitiveModifiers(element.modifiers, true));
3628
+ }
3629
+ /**
3630
+ * Type guard predicate narrowing a value to `NumberBoundedStarsElement`.
3631
+ *
3632
+ * @param value - The value to inspect.
3633
+ * @param withDeepValidation - Whether to recursively validate all properties.
3634
+ * @returns `true` if the value is a `NumberBoundedStarsElement` (type = "number-stars"), otherwise `false`.
3635
+ */
3636
+ export function isNumberBoundedStarsElement(value, withDeepValidation = false) {
3637
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "number-stars") {
3638
+ return false;
3639
+ }
3640
+ if (!withDeepValidation) {
3641
+ return true;
3642
+ }
3643
+ const element = value;
3644
+ return ("value" in value && typeof element.value === "number") &&
3645
+ (element.maximum === undefined || typeof element.maximum === "number") &&
3646
+ (element.modifiers === undefined || isPrimitiveModifiers(element.modifiers, true));
3647
+ }
3648
+ /**
3649
+ * Type guard predicate narrowing a value to `NumberBoundedMeterElement`.
3650
+ *
3651
+ * @param value - The value to inspect.
3652
+ * @param withDeepValidation - Whether to recursively validate all properties.
3653
+ * @returns `true` if the value is a `NumberBoundedMeterElement` (type = "number-meter"), otherwise `false`.
3654
+ */
3655
+ export function isNumberBoundedMeterElement(value, withDeepValidation = false) {
3656
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "number-meter") {
3657
+ return false;
3658
+ }
3659
+ if (!withDeepValidation) {
3660
+ return true;
3661
+ }
3662
+ const element = value;
3663
+ return ("value" in value && typeof element.value === "number") &&
3664
+ (element.minimum === undefined || typeof element.minimum === "number") &&
3665
+ (element.maximum === undefined || typeof element.maximum === "number") &&
3666
+ (element.label === undefined || typeof element.label === "string") &&
3667
+ (element.unit === undefined || typeof element.unit === "string") &&
3668
+ (element.modifiers === undefined || isPrimitiveModifiers(element.modifiers, true));
3669
+ }
3670
+ /**
3671
+ * Type guard predicate narrowing a value to `BooleanPlainElement`.
3672
+ *
3673
+ * @param value - The value to inspect.
3674
+ * @param withDeepValidation - Whether to recursively validate all properties.
3675
+ * @returns `true` if the value is a `BooleanPlainElement` (type = "boolean-plain"), otherwise `false`.
3676
+ */
3677
+ export function isBooleanPlainElement(value, withDeepValidation = false) {
3678
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "boolean-plain") {
3679
+ return false;
3680
+ }
3681
+ if (!withDeepValidation) {
3682
+ return true;
3683
+ }
3684
+ const element = value;
3685
+ return ("value" in value && typeof element.value === "boolean") &&
3686
+ (element.modifiers === undefined || isPrimitiveModifiers(element.modifiers, true));
3687
+ }
3688
+ /**
3689
+ * Type guard predicate narrowing a value to `BooleanBadgeElement`.
3690
+ *
3691
+ * @param value - The value to inspect.
3692
+ * @param withDeepValidation - Whether to recursively validate all properties.
3693
+ * @returns `true` if the value is a `BooleanBadgeElement` (type = "boolean-badge"), otherwise `false`.
3694
+ */
3695
+ export function isBooleanBadgeElement(value, withDeepValidation = false) {
3696
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "boolean-badge") {
3697
+ return false;
3698
+ }
3699
+ if (!withDeepValidation) {
3700
+ return true;
3701
+ }
3702
+ const element = value;
3703
+ return ("value" in value && typeof element.value === "boolean") &&
3704
+ (element.trueLabel === undefined || typeof element.trueLabel === "string") &&
3705
+ (element.falseLabel === undefined || typeof element.falseLabel === "string") &&
3706
+ (element.variant === undefined || Object.values(BadgeVariant).includes(element.variant)) &&
3707
+ (element.modifiers === undefined || isPrimitiveModifiers(element.modifiers, true));
3708
+ }
3709
+ /**
3710
+ * Type guard predicate narrowing a value to `TimestampElement`.
3711
+ *
3712
+ * @param value - The value to inspect.
3713
+ * @param withDeepValidation - Whether to recursively validate all properties.
3714
+ * @returns `true` if the value is a `TimestampElement` (type = "timestamp"), otherwise `false`.
3715
+ */
3716
+ export function isTimestampElement(value, withDeepValidation = false) {
3717
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "timestamp") {
3718
+ return false;
3719
+ }
3720
+ if (!withDeepValidation) {
3721
+ return true;
3722
+ }
3723
+ const element = value;
3724
+ return ("value" in value && typeof element.value === "number") &&
3725
+ (element.format === undefined || Object.values(TimestampFormat).includes(element.format)) &&
3726
+ (element.modifiers === undefined || isPrimitiveModifiers(element.modifiers, true));
3727
+ }
3728
+ /**
3729
+ * Type guard predicate narrowing a value to `ImageReferenceElement`.
3730
+ *
3731
+ * @param value - The value to inspect.
3732
+ * @param withDeepValidation - Whether to recursively validate all properties.
3733
+ * @returns `true` if the value is a `ImageReferenceElement` (type = "image-ref"), otherwise `false`.
3734
+ */
3735
+ export function isImageReferenceElement(value, withDeepValidation = false) {
3736
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "image-ref") {
3737
+ return false;
3738
+ }
3739
+ if (!withDeepValidation) {
3740
+ return true;
3741
+ }
3742
+ const element = value;
3743
+ return ("src" in value && typeof element.src === "string") &&
3744
+ (element.alt === undefined || typeof element.alt === "string") &&
3745
+ (element.aspectRatio === undefined || typeof element.aspectRatio === "string") &&
3746
+ (element.placeholder === undefined || typeof element.placeholder === "string");
3747
+ }
3748
+ /**
3749
+ * Type guard predicate narrowing a value to `MarkdownBlockElement`.
3750
+ *
3751
+ * @param value - The value to inspect.
3752
+ * @param withDeepValidation - Whether to recursively validate all properties.
3753
+ * @returns `true` if the value is a `MarkdownBlockElement` (type = "markdown"), otherwise `false`.
3754
+ */
3755
+ export function isMarkdownBlockElement(value, withDeepValidation = false) {
3756
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "markdown") {
3757
+ return false;
3758
+ }
3759
+ if (!withDeepValidation) {
3760
+ return true;
3761
+ }
3762
+ const element = value;
3763
+ return ("content" in value && typeof element.content === "string") &&
3764
+ (element.modifiers === undefined || isBaseModifiers(element.modifiers, true));
3765
+ }
3766
+ /**
3767
+ * Type guard predicate narrowing a value to `HtmlBlockElement`.
3768
+ *
3769
+ * @param value - The value to inspect.
3770
+ * @param withDeepValidation - Whether to recursively validate all properties.
3771
+ * @returns `true` if the value is a `HtmlBlockElement` (type = "html"), otherwise `false`.
3772
+ */
3773
+ export function isHtmlBlockElement(value, withDeepValidation = false) {
3774
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "html") {
3775
+ return false;
3776
+ }
3777
+ if (!withDeepValidation) {
3778
+ return true;
3779
+ }
3780
+ const element = value;
3781
+ return ("content" in value && typeof element.content === "string") &&
3782
+ (element.modifiers === undefined || isBaseModifiers(element.modifiers, true));
3783
+ }
3784
+ /**
3785
+ * Type guard predicate narrowing a value to `MultiSlotElement`.
3786
+ *
3787
+ * @param value - The value to inspect.
3788
+ * @param withDeepValidation - Whether to recursively validate all properties.
3789
+ * @returns `true` if the value is a `MultiSlotElement` (type = "multi-slot"), otherwise `false`.
3790
+ */
3791
+ export function isMultiSlotElement(value, withDeepValidation = false) {
3792
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "multi-slot") {
3793
+ return false;
3794
+ }
3795
+ if (!withDeepValidation) {
3796
+ return true;
3797
+ }
3798
+ const element = value;
3799
+ return (element.proportions === undefined || typeof element.proportions === "string") &&
3800
+ ("slots" in value && (Array.isArray(element.slots) && element.slots.every((item) => isSlot(item, true))));
3801
+ }
3802
+ /**
3803
+ * Type guard predicate narrowing a value to `FlowingElement`.
3804
+ *
3805
+ * @param value - The value to inspect.
3806
+ * @param withDeepValidation - Whether to recursively validate all properties.
3807
+ * @returns `true` if the value is a `FlowingElement` (type = "flowing"), otherwise `false`.
3808
+ */
3809
+ export function isFlowingElement(value, withDeepValidation = false) {
3810
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "flowing") {
3811
+ return false;
3812
+ }
3813
+ if (!withDeepValidation) {
3814
+ return true;
3815
+ }
3816
+ const element = value;
3817
+ return ("elements" in value && (Array.isArray(element.elements) && element.elements.every((item) => isUiElement(item, true))));
3818
+ }
3819
+ /**
3820
+ * Type guard predicate narrowing a value to `LabelValueElement`.
3821
+ *
3822
+ * @param value - The value to inspect.
3823
+ * @param withDeepValidation - Whether to recursively validate all properties.
3824
+ * @returns `true` if the value is a `LabelValueElement` (type = "label-value"), otherwise `false`.
3825
+ */
3826
+ export function isLabelValueElement(value, withDeepValidation = false) {
3827
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "label-value") {
3828
+ return false;
3829
+ }
3830
+ if (!withDeepValidation) {
3831
+ return true;
3832
+ }
3833
+ const element = value;
3834
+ return ("label" in value && typeof element.label === "string") &&
3835
+ ("value" in value && isUiElement(element.value, true)) &&
3836
+ (element.withDivider === undefined || typeof element.withDivider === "boolean");
3837
+ }
3838
+ /**
3839
+ * Type guard predicate narrowing a value to `TableElement`.
3840
+ *
3841
+ * @param value - The value to inspect.
3842
+ * @param withDeepValidation - Whether to recursively validate all properties.
3843
+ * @returns `true` if the value is a `TableElement` (type = "table"), otherwise `false`.
3844
+ */
3845
+ export function isTableElement(value, withDeepValidation = false) {
3846
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "table") {
3847
+ return false;
3848
+ }
3849
+ if (!withDeepValidation) {
3850
+ return true;
3851
+ }
3852
+ const element = value;
3853
+ return (element.hasHeader === undefined || typeof element.hasHeader === "boolean") &&
3854
+ (element.isStriped === undefined || typeof element.isStriped === "boolean") &&
3855
+ (element.withColumnSeparators === undefined || typeof element.withColumnSeparators === "boolean") &&
3856
+ (element.withRowSeparators === undefined || typeof element.withRowSeparators === "boolean") &&
3857
+ (element.columns === undefined || (Array.isArray(element.columns) && element.columns.every((item) => isTableColumn(item, true)))) &&
3858
+ ("rows" in value && (Array.isArray(element.rows) && element.rows.every((item) => isTableRow(item, true))));
3859
+ }
3860
+ /**
3861
+ * Type guard predicate narrowing a value to `RepeatingGroupElement`.
3862
+ *
3863
+ * @param value - The value to inspect.
3864
+ * @param withDeepValidation - Whether to recursively validate all properties.
3865
+ * @returns `true` if the value is a `RepeatingGroupElement` (type = "repeating-group"), otherwise `false`.
3866
+ */
3867
+ export function isRepeatingGroupElement(value, withDeepValidation = false) {
3868
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "repeating-group") {
3869
+ return false;
3870
+ }
3871
+ if (!withDeepValidation) {
3872
+ return true;
3873
+ }
3874
+ const element = value;
3875
+ return (element.title === undefined || typeof element.title === "string") &&
3876
+ ("entries" in value && (Array.isArray(element.entries) && element.entries.every((item) => isRepeatingGroupEntry(item, true))));
3877
+ }
3878
+ /**
3879
+ * Type guard predicate narrowing a value to `CollapsibleGroupElement`.
3880
+ *
3881
+ * @param value - The value to inspect.
3882
+ * @param withDeepValidation - Whether to recursively validate all properties.
3883
+ * @returns `true` if the value is a `CollapsibleGroupElement` (type = "collapsible-group"), otherwise `false`.
3884
+ */
3885
+ export function isCollapsibleGroupElement(value, withDeepValidation = false) {
3886
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "collapsible-group") {
3887
+ return false;
3888
+ }
3889
+ if (!withDeepValidation) {
3890
+ return true;
3891
+ }
3892
+ const element = value;
3893
+ return ("title" in value && typeof element.title === "string") &&
3894
+ (element.summary === undefined || typeof element.summary === "string") &&
3895
+ (element.defaultExpanded === undefined || typeof element.defaultExpanded === "boolean") &&
3896
+ ("elements" in value && (Array.isArray(element.elements) && element.elements.every((item) => isUiElement(item, true))));
3897
+ }
3898
+ /**
3899
+ * Type guard predicate narrowing a value to `DividerElement`.
3900
+ *
3901
+ * @param value - The value to inspect.
3902
+ * @param withDeepValidation - Whether to recursively validate all properties.
3903
+ * @returns `true` if the value is a `DividerElement` (type = "divider"), otherwise `false`.
3904
+ */
3905
+ export function isDividerElement(value, withDeepValidation = false) {
3906
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "divider") {
3907
+ return false;
3908
+ }
3909
+ if (!withDeepValidation) {
3910
+ return true;
3911
+ }
3912
+ const element = value;
3913
+ return (element.style === undefined || Object.values(DividerStyle).includes(element.style));
3914
+ }
3915
+ /**
3916
+ * Type guard predicate verifying whether an unknown value conforms to `UiAction`.
3917
+ *
3918
+ * @param value - The value to inspect.
3919
+ * @param withDeepValidation - Whether to recursively validate all properties.
3920
+ * @returns `true` if the value is a valid `UiAction`, otherwise `false`.
3921
+ */
3922
+ export function isUiAction(value, withDeepValidation = false) {
3923
+ if (typeof value !== "object" || value === null || !("type" in value) || typeof value.type !== "string") {
3924
+ return false;
3925
+ }
3926
+ if (!withDeepValidation) {
3927
+ return true;
3928
+ }
3929
+ const element = value;
3930
+ switch (element.type) {
3931
+ case "button":
3932
+ return isButtonActionElement(element, true);
3933
+ case "external-link":
3934
+ return isExternalLinkActionElement(element, true);
3935
+ default:
3936
+ return false;
3937
+ }
3938
+ }
3939
+ /**
3940
+ * Type guard predicate narrowing a value to `ButtonActionElement`.
3941
+ *
3942
+ * @param value - The value to inspect.
3943
+ * @param withDeepValidation - Whether to recursively validate all properties.
3944
+ * @returns `true` if the value is a `ButtonActionElement` (type = "button"), otherwise `false`.
3945
+ */
3946
+ export function isButtonActionElement(value, withDeepValidation = false) {
3947
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "button") {
3948
+ return false;
3949
+ }
3950
+ if (!withDeepValidation) {
3951
+ return true;
3952
+ }
3953
+ const element = value;
3954
+ return (element.extensionId === undefined || typeof element.extensionId === "string") &&
3955
+ ("commandId" in value && typeof element.commandId === "string") &&
3956
+ (element.target === undefined || typeof element.target === "string") &&
3957
+ (element.parameters === undefined || (typeof element.parameters === "object" && element.parameters !== null)) &&
3958
+ (element.disabled === undefined || typeof element.disabled === "boolean") &&
3959
+ (element.variant === undefined || Object.values(ButtonVariant).includes(element.variant)) &&
3960
+ ("label" in value && typeof element.label === "string");
3961
+ }
3962
+ /**
3963
+ * Type guard predicate narrowing a value to `ExternalLinkActionElement`.
3964
+ *
3965
+ * @param value - The value to inspect.
3966
+ * @param withDeepValidation - Whether to recursively validate all properties.
3967
+ * @returns `true` if the value is a `ExternalLinkActionElement` (type = "external-link"), otherwise `false`.
3968
+ */
3969
+ export function isExternalLinkActionElement(value, withDeepValidation = false) {
3970
+ if (typeof value !== "object" || value === null || !("type" in value) || value.type !== "external-link") {
3971
+ return false;
3972
+ }
3973
+ if (!withDeepValidation) {
3974
+ return true;
3975
+ }
3976
+ const element = value;
3977
+ return ("url" in value && typeof element.url === "string") &&
3978
+ ("label" in value && typeof element.label === "string");
3979
+ }
3980
+ /**
3981
+ * Type guard predicate verifying whether an unknown value conforms to `UiContainer`.
3982
+ *
3983
+ * @param value - The value to inspect.
3984
+ * @param withDeepValidation - Whether to recursively validate all properties.
3985
+ * @returns `true` if the value is a valid `UiContainer`, otherwise `false`.
3986
+ */
3987
+ export function isUiContainer(value, withDeepValidation = false) {
3988
+ if (typeof value !== "object" || value === null) {
3989
+ return false;
3990
+ }
3991
+ if (!("schemaVersion" in value) || value.schemaVersion !== "1.0" || !("elements" in value)) {
3992
+ return false;
3993
+ }
3994
+ if (!withDeepValidation) {
3995
+ return true;
3996
+ }
3997
+ const element = value;
3998
+ return ("elements" in value && (Array.isArray(element.elements) && element.elements.every((item) => isUiElement(item, true))));
3999
+ }
4000
+ /**
4001
+ * Type guard predicate verifying whether an unknown value conforms to `UiCard`.
4002
+ *
4003
+ * @param value - The value to inspect.
4004
+ * @param withDeepValidation - Whether to recursively validate all properties.
4005
+ * @returns `true` if the value is a valid `UiCard`, otherwise `false`.
4006
+ */
4007
+ export function isUiCard(value, withDeepValidation = false) {
4008
+ if (typeof value !== "object" || value === null) {
4009
+ return false;
4010
+ }
4011
+ if (!("schemaVersion" in value) || value.schemaVersion !== "1.0" || !("title" in value) || !("elements" in value)) {
4012
+ return false;
4013
+ }
4014
+ if (!withDeepValidation) {
4015
+ return true;
4016
+ }
4017
+ const element = value;
4018
+ return ("title" in value && typeof element.title === "string") &&
4019
+ (element.description === undefined || typeof element.description === "string") &&
4020
+ (element.actions === undefined || (Array.isArray(element.actions) && element.actions.every((item) => isUiAction(item, true)))) &&
4021
+ ("elements" in value && (Array.isArray(element.elements) && element.elements.every((item) => isUiElement(item, true))));
4022
+ }