@matreshka/bff 0.9.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 (275) hide show
  1. package/LICENSE +32 -0
  2. package/README.md +35 -0
  3. package/dist/components/actions/server-action.d.ts +30 -0
  4. package/dist/components/actions/server-action.js +23 -0
  5. package/dist/components/aliases/button.d.ts +17 -0
  6. package/dist/components/aliases/button.js +54 -0
  7. package/dist/components/aliases/column.d.ts +11 -0
  8. package/dist/components/aliases/column.js +31 -0
  9. package/dist/components/aliases/row.d.ts +11 -0
  10. package/dist/components/aliases/row.js +31 -0
  11. package/dist/components/aliases/surface.d.ts +11 -0
  12. package/dist/components/aliases/surface.js +30 -0
  13. package/dist/components/app.d.ts +5 -0
  14. package/dist/components/app.js +12 -0
  15. package/dist/components/board.d.ts +58 -0
  16. package/dist/components/board.js +152 -0
  17. package/dist/components/boot.d.ts +2 -0
  18. package/dist/components/boot.js +39 -0
  19. package/dist/components/camera.d.ts +77 -0
  20. package/dist/components/camera.js +116 -0
  21. package/dist/components/charts/bar-chart.d.ts +14 -0
  22. package/dist/components/charts/bar-chart.js +27 -0
  23. package/dist/components/charts/chart.d.ts +69 -0
  24. package/dist/components/charts/chart.js +42 -0
  25. package/dist/components/charts/doughnut-chart.d.ts +14 -0
  26. package/dist/components/charts/doughnut-chart.js +27 -0
  27. package/dist/components/charts/line-chart.d.ts +14 -0
  28. package/dist/components/charts/line-chart.js +27 -0
  29. package/dist/components/charts/pie-chart.d.ts +14 -0
  30. package/dist/components/charts/pie-chart.js +27 -0
  31. package/dist/components/charts/polar-area-chart.d.ts +14 -0
  32. package/dist/components/charts/polar-area-chart.js +27 -0
  33. package/dist/components/charts/radar-chart.d.ts +14 -0
  34. package/dist/components/charts/radar-chart.js +27 -0
  35. package/dist/components/component.d.ts +159 -0
  36. package/dist/components/component.js +380 -0
  37. package/dist/components/container.d.ts +48 -0
  38. package/dist/components/container.js +80 -0
  39. package/dist/components/dialog.d.ts +83 -0
  40. package/dist/components/dialog.js +120 -0
  41. package/dist/components/entry-component.d.ts +34 -0
  42. package/dist/components/entry-component.js +74 -0
  43. package/dist/components/enum/password-input-kind.d.ts +1 -0
  44. package/dist/components/enum/password-input-kind.js +5 -0
  45. package/dist/components/enum/popover-position-area.d.ts +1 -0
  46. package/dist/components/enum/popover-position-area.js +5 -0
  47. package/dist/components/enum/text-input-kind.d.ts +1 -0
  48. package/dist/components/enum/text-input-kind.js +5 -0
  49. package/dist/components/enum/textarea-resize.d.ts +1 -0
  50. package/dist/components/enum/textarea-resize.js +5 -0
  51. package/dist/components/file-upload-area.d.ts +79 -0
  52. package/dist/components/file-upload-area.js +138 -0
  53. package/dist/components/for-each.d.ts +188 -0
  54. package/dist/components/for-each.js +362 -0
  55. package/dist/components/form.d.ts +62 -0
  56. package/dist/components/form.js +92 -0
  57. package/dist/components/grid.d.ts +80 -0
  58. package/dist/components/grid.js +79 -0
  59. package/dist/components/index.d.ts +55 -0
  60. package/dist/components/index.js +76 -0
  61. package/dist/components/inputs/input-component.d.ts +37 -0
  62. package/dist/components/inputs/input-component.js +30 -0
  63. package/dist/components/inputs/number-input.d.ts +45 -0
  64. package/dist/components/inputs/number-input.js +43 -0
  65. package/dist/components/inputs/password-input.d.ts +28 -0
  66. package/dist/components/inputs/password-input.js +42 -0
  67. package/dist/components/inputs/text-editor.d.ts +91 -0
  68. package/dist/components/inputs/text-editor.js +282 -0
  69. package/dist/components/inputs/text-input.d.ts +48 -0
  70. package/dist/components/inputs/text-input.js +40 -0
  71. package/dist/components/inputs/textarea.d.ts +36 -0
  72. package/dist/components/inputs/textarea.js +42 -0
  73. package/dist/components/item-list/flatten-nested-items.d.ts +11 -0
  74. package/dist/components/item-list/flatten-nested-items.js +100 -0
  75. package/dist/components/item-list/index.d.ts +5 -0
  76. package/dist/components/item-list/index.js +21 -0
  77. package/dist/components/item-list/item-list-host.d.ts +10 -0
  78. package/dist/components/item-list/item-list-host.js +2 -0
  79. package/dist/components/item-list/item-list.d.ts +68 -0
  80. package/dist/components/item-list/item-list.js +206 -0
  81. package/dist/components/item-list/list-from-ref-context.d.ts +11 -0
  82. package/dist/components/item-list/list-from-ref-context.js +27 -0
  83. package/dist/components/item-list/nested-items-host-support.d.ts +36 -0
  84. package/dist/components/item-list/nested-items-host-support.js +109 -0
  85. package/dist/components/item-list/types.d.ts +40 -0
  86. package/dist/components/item-list/types.js +13 -0
  87. package/dist/components/line.d.ts +43 -0
  88. package/dist/components/line.js +35 -0
  89. package/dist/components/map.d.ts +83 -0
  90. package/dist/components/map.js +146 -0
  91. package/dist/components/outputs/currency.d.ts +63 -0
  92. package/dist/components/outputs/currency.js +42 -0
  93. package/dist/components/outputs/datetime.d.ts +69 -0
  94. package/dist/components/outputs/datetime.js +49 -0
  95. package/dist/components/outputs/icon.d.ts +43 -0
  96. package/dist/components/outputs/icon.js +38 -0
  97. package/dist/components/outputs/iframe.d.ts +48 -0
  98. package/dist/components/outputs/iframe.js +44 -0
  99. package/dist/components/outputs/image.d.ts +73 -0
  100. package/dist/components/outputs/image.js +63 -0
  101. package/dist/components/outputs/number.d.ts +39 -0
  102. package/dist/components/outputs/number.js +47 -0
  103. package/dist/components/outputs/output-component.d.ts +58 -0
  104. package/dist/components/outputs/output-component.js +50 -0
  105. package/dist/components/outputs/progress-bar.d.ts +33 -0
  106. package/dist/components/outputs/progress-bar.js +42 -0
  107. package/dist/components/outputs/progress-spinner.d.ts +37 -0
  108. package/dist/components/outputs/progress-spinner.js +43 -0
  109. package/dist/components/outputs/qr-code.d.ts +28 -0
  110. package/dist/components/outputs/qr-code.js +40 -0
  111. package/dist/components/outputs/text.d.ts +57 -0
  112. package/dist/components/outputs/text.js +78 -0
  113. package/dist/components/outputs/vector.d.ts +47 -0
  114. package/dist/components/outputs/vector.js +53 -0
  115. package/dist/components/page.d.ts +96 -0
  116. package/dist/components/page.js +127 -0
  117. package/dist/components/popover.d.ts +63 -0
  118. package/dist/components/popover.js +96 -0
  119. package/dist/components/stack.d.ts +158 -0
  120. package/dist/components/stack.js +146 -0
  121. package/dist/components/types/component-sequence.d.ts +3 -0
  122. package/dist/components/types/component-sequence.js +2 -0
  123. package/dist/components/types/container-overlay.d.ts +3 -0
  124. package/dist/components/types/container-overlay.js +2 -0
  125. package/dist/components/utils/component-factory-shared.d.ts +4 -0
  126. package/dist/components/utils/component-factory-shared.js +12 -0
  127. package/dist/core/actions/action.d.ts +35 -0
  128. package/dist/core/actions/action.js +45 -0
  129. package/dist/core/actions/animate-component.d.ts +58 -0
  130. package/dist/core/actions/animate-component.js +57 -0
  131. package/dist/core/actions/local-action.d.ts +8 -0
  132. package/dist/core/actions/local-action.js +12 -0
  133. package/dist/core/actions/set-context-value.d.ts +18 -0
  134. package/dist/core/actions/set-context-value.js +32 -0
  135. package/dist/core/actions/set-context-values.d.ts +34 -0
  136. package/dist/core/actions/set-context-values.js +30 -0
  137. package/dist/core/actions/toggle-context-value.d.ts +21 -0
  138. package/dist/core/actions/toggle-context-value.js +30 -0
  139. package/dist/core/actions/write-text-to-clipboard.d.ts +30 -0
  140. package/dist/core/actions/write-text-to-clipboard.js +44 -0
  141. package/dist/core/boot.d.ts +2 -0
  142. package/dist/core/boot.js +8 -0
  143. package/dist/core/client-context.d.ts +7 -0
  144. package/dist/core/client-context.js +20 -0
  145. package/dist/core/client.d.ts +133 -0
  146. package/dist/core/client.js +292 -0
  147. package/dist/core/conditions/condition-group.d.ts +14 -0
  148. package/dist/core/conditions/condition-group.js +30 -0
  149. package/dist/core/conditions/condition-operand.d.ts +27 -0
  150. package/dist/core/conditions/condition-operand.js +15 -0
  151. package/dist/core/conditions/condition.d.ts +27 -0
  152. package/dist/core/conditions/condition.js +35 -0
  153. package/dist/core/conditions/context-array-includes.d.ts +32 -0
  154. package/dist/core/conditions/context-array-includes.js +52 -0
  155. package/dist/core/conditions/context-array-length.d.ts +86 -0
  156. package/dist/core/conditions/context-array-length.js +155 -0
  157. package/dist/core/conditions/context-value-defined.d.ts +12 -0
  158. package/dist/core/conditions/context-value-defined.js +21 -0
  159. package/dist/core/conditions/context-value-equal.d.ts +14 -0
  160. package/dist/core/conditions/context-value-equal.js +26 -0
  161. package/dist/core/conditions/context-value-in.d.ts +17 -0
  162. package/dist/core/conditions/context-value-in.js +26 -0
  163. package/dist/core/conditions/context-value-not-equal.d.ts +14 -0
  164. package/dist/core/conditions/context-value-not-equal.js +26 -0
  165. package/dist/core/conditions/context-value-undefined.d.ts +12 -0
  166. package/dist/core/conditions/context-value-undefined.js +21 -0
  167. package/dist/core/conditions/desktop-device.d.ts +11 -0
  168. package/dist/core/conditions/desktop-device.js +21 -0
  169. package/dist/core/conditions/groups.d.ts +71 -0
  170. package/dist/core/conditions/groups.js +74 -0
  171. package/dist/core/conditions/index.d.ts +17 -0
  172. package/dist/core/conditions/index.js +33 -0
  173. package/dist/core/conditions/mobile-device.d.ts +11 -0
  174. package/dist/core/conditions/mobile-device.js +21 -0
  175. package/dist/core/conditions/not-desktop-device.d.ts +11 -0
  176. package/dist/core/conditions/not-desktop-device.js +21 -0
  177. package/dist/core/conditions/not-mobile-device.d.ts +11 -0
  178. package/dist/core/conditions/not-mobile-device.js +21 -0
  179. package/dist/core/conditions/not-tablet-device.d.ts +11 -0
  180. package/dist/core/conditions/not-tablet-device.js +21 -0
  181. package/dist/core/conditions/tablet-device.d.ts +11 -0
  182. package/dist/core/conditions/tablet-device.js +21 -0
  183. package/dist/core/context/context-ref.d.ts +48 -0
  184. package/dist/core/context/context-ref.js +58 -0
  185. package/dist/core/context/context.d.ts +121 -0
  186. package/dist/core/context/context.js +353 -0
  187. package/dist/core/entry-context.d.ts +14 -0
  188. package/dist/core/entry-context.js +31 -0
  189. package/dist/core/gateway-connection.d.ts +29 -0
  190. package/dist/core/gateway-connection.js +146 -0
  191. package/dist/core/index.d.ts +30 -0
  192. package/dist/core/index.js +46 -0
  193. package/dist/core/matreshka.d.ts +61 -0
  194. package/dist/core/matreshka.js +186 -0
  195. package/dist/core/router.d.ts +38 -0
  196. package/dist/core/router.js +116 -0
  197. package/dist/core/types/client-settings.d.ts +31 -0
  198. package/dist/core/types/client-settings.js +2 -0
  199. package/dist/core/types/component-instance.d.ts +25 -0
  200. package/dist/core/types/component-instance.js +42 -0
  201. package/dist/core/types/component-tree-node.d.ts +11 -0
  202. package/dist/core/types/component-tree-node.js +18 -0
  203. package/dist/core/types/componentable.d.ts +21 -0
  204. package/dist/core/types/componentable.js +2 -0
  205. package/dist/core/types/context-ref-primitive-value.d.ts +5 -0
  206. package/dist/core/types/context-ref-primitive-value.js +2 -0
  207. package/dist/core/types/message.d.ts +15 -0
  208. package/dist/core/types/message.js +2 -0
  209. package/dist/core/types/mixed-with-callbacks-array.d.ts +9 -0
  210. package/dist/core/types/mixed-with-callbacks-array.js +2 -0
  211. package/dist/core/types/native-picker-context-ref.d.ts +7 -0
  212. package/dist/core/types/native-picker-context-ref.js +2 -0
  213. package/dist/core/types/pageable.d.ts +15 -0
  214. package/dist/core/types/pageable.js +2 -0
  215. package/dist/core/types/standalone-component.d.ts +9 -0
  216. package/dist/core/types/standalone-component.js +2 -0
  217. package/dist/core/types/status-code.d.ts +319 -0
  218. package/dist/core/types/status-code.js +322 -0
  219. package/dist/core/utils/calculate-components.d.ts +13 -0
  220. package/dist/core/utils/calculate-components.js +40 -0
  221. package/dist/core/utils/color-token-id.d.ts +11 -0
  222. package/dist/core/utils/color-token-id.js +24 -0
  223. package/dist/core/utils/deep-pick.d.ts +2 -0
  224. package/dist/core/utils/deep-pick.js +54 -0
  225. package/dist/core/utils/hex-to-hsl.d.ts +14 -0
  226. package/dist/core/utils/hex-to-hsl.js +49 -0
  227. package/dist/core/utils/incoming-message-observer.d.ts +9 -0
  228. package/dist/core/utils/incoming-message-observer.js +23 -0
  229. package/dist/core/utils/merge-deep.d.ts +8 -0
  230. package/dist/core/utils/merge-deep.js +39 -0
  231. package/dist/core/utils/objects-diff.d.ts +13 -0
  232. package/dist/core/utils/objects-diff.js +56 -0
  233. package/dist/core/utils/parse-context-path.d.ts +4 -0
  234. package/dist/core/utils/parse-context-path.js +16 -0
  235. package/dist/core/utils/replace-context-keys.d.ts +12 -0
  236. package/dist/core/utils/replace-context-keys.js +90 -0
  237. package/dist/core/utils/serialize-component-tree.d.ts +9 -0
  238. package/dist/core/utils/serialize-component-tree.js +24 -0
  239. package/dist/core/utils/set-object-property.d.ts +2 -0
  240. package/dist/core/utils/set-object-property.js +29 -0
  241. package/dist/core/utils/track-created-instances.d.ts +10 -0
  242. package/dist/core/utils/track-created-instances.js +18 -0
  243. package/dist/core/version.d.ts +1 -0
  244. package/dist/core/version.js +21 -0
  245. package/dist/index.d.ts +3 -0
  246. package/dist/index.js +19 -0
  247. package/dist/platforms/android-platform.d.ts +6 -0
  248. package/dist/platforms/android-platform.js +10 -0
  249. package/dist/platforms/browser-platform.d.ts +79 -0
  250. package/dist/platforms/browser-platform.js +143 -0
  251. package/dist/platforms/client-platform.d.ts +6 -0
  252. package/dist/platforms/client-platform.js +10 -0
  253. package/dist/platforms/index.d.ts +12 -0
  254. package/dist/platforms/index.js +28 -0
  255. package/dist/platforms/ios-platform.d.ts +6 -0
  256. package/dist/platforms/ios-platform.js +10 -0
  257. package/dist/platforms/max-mini-app-platform.d.ts +45 -0
  258. package/dist/platforms/max-mini-app-platform.js +87 -0
  259. package/dist/platforms/mobile-platform.d.ts +117 -0
  260. package/dist/platforms/mobile-platform.js +316 -0
  261. package/dist/platforms/platform.d.ts +109 -0
  262. package/dist/platforms/platform.js +224 -0
  263. package/dist/platforms/pwa-platform.d.ts +6 -0
  264. package/dist/platforms/pwa-platform.js +10 -0
  265. package/dist/platforms/server-platform.d.ts +6 -0
  266. package/dist/platforms/server-platform.js +10 -0
  267. package/dist/platforms/telegram-mini-app-platform.d.ts +87 -0
  268. package/dist/platforms/telegram-mini-app-platform.js +166 -0
  269. package/dist/platforms/utils/client-platform.d.ts +4 -0
  270. package/dist/platforms/utils/client-platform.js +38 -0
  271. package/dist/platforms/utils/mobile-ble-services.d.ts +3 -0
  272. package/dist/platforms/utils/mobile-ble-services.js +31 -0
  273. package/dist/platforms/web-platform.d.ts +9 -0
  274. package/dist/platforms/web-platform.js +13 -0
  275. package/package.json +109 -0
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConditionGroup = void 0;
4
+ exports.conditionAny = conditionAny;
5
+ exports.conditionAll = conditionAll;
6
+ const condition_group_operator_1 = require("@matreshka/shared/enums/condition-group-operator");
7
+ const condition_type_1 = require("@matreshka/shared/enums/condition-type");
8
+ const condition_1 = require("./condition");
9
+ /**
10
+ * Составное условие: все (`and`) или хотя бы одно (`or`) из вложенных условий.
11
+ *
12
+ * @internal Используйте {@link conditionAny} / {@link conditionAll} или {@link when.any} / {@link when.all}.
13
+ */
14
+ class ConditionGroup extends condition_1.Condition {
15
+ constructor(operator, conditions) {
16
+ super(condition_type_1.ConditionType.Group, {
17
+ operator,
18
+ conditions: conditions.map((condition) => condition.toJSON()),
19
+ });
20
+ }
21
+ }
22
+ exports.ConditionGroup = ConditionGroup;
23
+ /** Хотя бы одно из условий (OR). */
24
+ function conditionAny(conditions) {
25
+ return new ConditionGroup(condition_group_operator_1.ConditionGroupOperator.Or, conditions);
26
+ }
27
+ /** Все условия (AND) — явная группа, удобна внутри {@link conditionAny}. */
28
+ function conditionAll(conditions) {
29
+ return new ConditionGroup(condition_group_operator_1.ConditionGroupOperator.And, conditions);
30
+ }
@@ -0,0 +1,27 @@
1
+ import type { JsonPrimitive } from "@matreshka/shared/types/json";
2
+ import type { SerializedOperand } from "@matreshka/shared/types/serialized-operand";
3
+ import { ContextRef } from "../context/context-ref";
4
+ import type { ContextRefPrimitiveValue } from "../types/context-ref-primitive-value";
5
+ /**
6
+ * Операнд условия на BFF: литерал того же примитивного типа, что значение по `ref`,
7
+ * либо другая `ContextRef` (сравнение в рантайме через `===`).
8
+ */
9
+ export type ConditionOperand<R extends ContextRef<any, any>> = ContextRefPrimitiveValue<R> | ContextRef<any, any>;
10
+ /** Операнд без привязки к конкретному `ref` (например, поле элемента массива). */
11
+ export type UntypedConditionOperand = JsonPrimitive | ContextRef<any, any>;
12
+ /** Операнд длины массива: число или ссылка на число в контексте. */
13
+ export type ConditionLengthOperand = number | ContextRef<any, any>;
14
+ /**
15
+ * До JSON-сериализации в `kind: "ref"` лежит `ContextRef`;
16
+ * после stringify `ref` становится строкой `contextId.path`.
17
+ */
18
+ export type BffSerializedOperand = {
19
+ kind: "literal";
20
+ value: JsonPrimitive;
21
+ } | {
22
+ kind: "ref";
23
+ ref: ContextRef<any, any>;
24
+ };
25
+ export declare function toSerializedOperand(value: UntypedConditionOperand): BffSerializedOperand;
26
+ /** Для payload, который уходит в `Condition` и затем кастится к wire-типу. */
27
+ export declare function toWireOperand(value: UntypedConditionOperand): SerializedOperand;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toSerializedOperand = toSerializedOperand;
4
+ exports.toWireOperand = toWireOperand;
5
+ const context_ref_1 = require("../context/context-ref");
6
+ function toSerializedOperand(value) {
7
+ if (value instanceof context_ref_1.ContextRef) {
8
+ return { kind: "ref", ref: value };
9
+ }
10
+ return { kind: "literal", value };
11
+ }
12
+ /** Для payload, который уходит в `Condition` и затем кастится к wire-типу. */
13
+ function toWireOperand(value) {
14
+ return toSerializedOperand(value);
15
+ }
@@ -0,0 +1,27 @@
1
+ import { ConditionType } from "@matreshka/shared/enums/condition-type";
2
+ import type { Condition as SerializedCondition } from "@matreshka/shared/types/condition";
3
+ /**
4
+ * Абстрактный класс, представляющий условие с типом и дополнительными данными.
5
+ *
6
+ * Используется для описания условий, которые могут быть сериализованы в JSON-формате и
7
+ * применяться к компонентам или другим сущностям.
8
+ *
9
+ * @internal Используйте фабрики ({@link when}, {@link device} и др.).
10
+ */
11
+ export declare abstract class Condition {
12
+ private type;
13
+ private payload;
14
+ /**
15
+ * Создает экземпляр условия.
16
+ *
17
+ * @param type Тип условия.
18
+ * @param payload Дополнительные данные, связанные с условием.
19
+ */
20
+ constructor(type: ConditionType, payload?: object);
21
+ /**
22
+ * Сериализует условие в объект JSON-формата.
23
+ *
24
+ * @returns Объект с полями type и payload.
25
+ */
26
+ toJSON(): SerializedCondition;
27
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Condition = void 0;
4
+ /**
5
+ * Абстрактный класс, представляющий условие с типом и дополнительными данными.
6
+ *
7
+ * Используется для описания условий, которые могут быть сериализованы в JSON-формате и
8
+ * применяться к компонентам или другим сущностям.
9
+ *
10
+ * @internal Используйте фабрики ({@link when}, {@link device} и др.).
11
+ */
12
+ class Condition {
13
+ /**
14
+ * Создает экземпляр условия.
15
+ *
16
+ * @param type Тип условия.
17
+ * @param payload Дополнительные данные, связанные с условием.
18
+ */
19
+ constructor(type, payload = {}) {
20
+ this.type = type;
21
+ this.payload = payload;
22
+ }
23
+ /**
24
+ * Сериализует условие в объект JSON-формата.
25
+ *
26
+ * @returns Объект с полями type и payload.
27
+ */
28
+ toJSON() {
29
+ return {
30
+ type: this.type,
31
+ payload: this.payload,
32
+ };
33
+ }
34
+ }
35
+ exports.Condition = Condition;
@@ -0,0 +1,32 @@
1
+ import { ContextRef, ContextRefValue } from "../context/context-ref";
2
+ import { UntypedConditionOperand } from "./condition-operand";
3
+ import { Condition } from "./condition";
4
+ type ContextArrayValue = readonly unknown[] | unknown[];
5
+ type CompatibleArrayContextRef<R extends ContextRef<any, any>> = Extract<ContextRefValue<R>, ContextArrayValue> extends never ? never : R;
6
+ /**
7
+ * Условие: в массиве из контекста есть элемент, у которого значение по
8
+ * `itemPath` равно операнду (литерал или `ContextRef`).
9
+ *
10
+ * Пустой `itemPath` сравнивает сам элемент массива (для массивов примитивов).
11
+ *
12
+ * @internal Используйте {@link contextArrayIncludes} / {@link when.includes}.
13
+ */
14
+ export declare class ContextArrayIncludes<R extends ContextRef<any, any>> extends Condition {
15
+ constructor(ref: CompatibleArrayContextRef<R>, itemPath: string, value: UntypedConditionOperand);
16
+ }
17
+ /** Функциональная форма {@link ContextArrayIncludes}. */
18
+ export declare function contextArrayIncludes<R extends ContextRef<any, any>>(ref: CompatibleArrayContextRef<R>, itemPath: string, value: UntypedConditionOperand): ContextArrayIncludes<R>;
19
+ /**
20
+ * Условие: в массиве из контекста нет элемента, у которого значение по
21
+ * `itemPath` равно операнду (литерал или `ContextRef`).
22
+ *
23
+ * Пустой `itemPath` сравнивает сам элемент массива (для массивов примитивов).
24
+ *
25
+ * @internal Используйте {@link contextArrayNotIncludes} / {@link when.excludes}.
26
+ */
27
+ export declare class ContextArrayNotIncludes<R extends ContextRef<any, any>> extends Condition {
28
+ constructor(ref: CompatibleArrayContextRef<R>, itemPath: string, value: UntypedConditionOperand);
29
+ }
30
+ /** Функциональная форма {@link ContextArrayNotIncludes}. */
31
+ export declare function contextArrayNotIncludes<R extends ContextRef<any, any>>(ref: CompatibleArrayContextRef<R>, itemPath: string, value: UntypedConditionOperand): ContextArrayNotIncludes<R>;
32
+ export {};
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContextArrayNotIncludes = exports.ContextArrayIncludes = void 0;
4
+ exports.contextArrayIncludes = contextArrayIncludes;
5
+ exports.contextArrayNotIncludes = contextArrayNotIncludes;
6
+ const condition_type_1 = require("@matreshka/shared/enums/condition-type");
7
+ const condition_operand_1 = require("./condition-operand");
8
+ const condition_1 = require("./condition");
9
+ /**
10
+ * Условие: в массиве из контекста есть элемент, у которого значение по
11
+ * `itemPath` равно операнду (литерал или `ContextRef`).
12
+ *
13
+ * Пустой `itemPath` сравнивает сам элемент массива (для массивов примитивов).
14
+ *
15
+ * @internal Используйте {@link contextArrayIncludes} / {@link when.includes}.
16
+ */
17
+ class ContextArrayIncludes extends condition_1.Condition {
18
+ constructor(ref, itemPath, value) {
19
+ super(condition_type_1.ConditionType.ContextArrayIncludes, {
20
+ ref,
21
+ itemPath,
22
+ value: (0, condition_operand_1.toWireOperand)(value),
23
+ });
24
+ }
25
+ }
26
+ exports.ContextArrayIncludes = ContextArrayIncludes;
27
+ /** Функциональная форма {@link ContextArrayIncludes}. */
28
+ function contextArrayIncludes(ref, itemPath, value) {
29
+ return new ContextArrayIncludes(ref, itemPath, value);
30
+ }
31
+ /**
32
+ * Условие: в массиве из контекста нет элемента, у которого значение по
33
+ * `itemPath` равно операнду (литерал или `ContextRef`).
34
+ *
35
+ * Пустой `itemPath` сравнивает сам элемент массива (для массивов примитивов).
36
+ *
37
+ * @internal Используйте {@link contextArrayNotIncludes} / {@link when.excludes}.
38
+ */
39
+ class ContextArrayNotIncludes extends condition_1.Condition {
40
+ constructor(ref, itemPath, value) {
41
+ super(condition_type_1.ConditionType.ContextArrayNotIncludes, {
42
+ ref,
43
+ itemPath,
44
+ value: (0, condition_operand_1.toWireOperand)(value),
45
+ });
46
+ }
47
+ }
48
+ exports.ContextArrayNotIncludes = ContextArrayNotIncludes;
49
+ /** Функциональная форма {@link ContextArrayNotIncludes}. */
50
+ function contextArrayNotIncludes(ref, itemPath, value) {
51
+ return new ContextArrayNotIncludes(ref, itemPath, value);
52
+ }
@@ -0,0 +1,86 @@
1
+ import { ArrayLengthCompare } from "@matreshka/shared/enums/array-length-compare";
2
+ import { ContextRef, ContextRefValue } from "../context/context-ref";
3
+ import { ConditionLengthOperand } from "./condition-operand";
4
+ import { Condition } from "./condition";
5
+ type ContextArrayValue = readonly unknown[] | unknown[];
6
+ type CompatibleArrayContextRef<R extends ContextRef<any, any>> = Extract<ContextRefValue<R>, ContextArrayValue> extends never ? never : R;
7
+ /**
8
+ * Условие сравнения длины массива в контексте с операндом
9
+ * (число или значение по `ContextRef`).
10
+ *
11
+ * @internal Используйте фабрики длины массива ({@link contextArrayLengthEqual} и др.).
12
+ */
13
+ export declare abstract class ContextArrayLength<R extends ContextRef<any, any>> extends Condition {
14
+ constructor(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand, operator: ArrayLengthCompare);
15
+ }
16
+ /**
17
+ * Алиас: длина массива в контексте равна операнду (`===`).
18
+ *
19
+ * @internal Используйте {@link contextArrayLengthEqual} / {@link when.lengthEquals}.
20
+ */
21
+ export declare class ContextArrayLengthEqual<R extends ContextRef<any, any>> extends Condition {
22
+ constructor(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand);
23
+ }
24
+ /** Функциональная форма {@link ContextArrayLengthEqual}. */
25
+ export declare function contextArrayLengthEqual<R extends ContextRef<any, any>>(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand): ContextArrayLengthEqual<R>;
26
+ /**
27
+ * Алиас: длина массива в контексте строго меньше операнда (`<`).
28
+ *
29
+ * @internal Используйте {@link contextArrayLengthLessThan} / {@link when.lengthLessThan}.
30
+ */
31
+ export declare class ContextArrayLengthLessThan<R extends ContextRef<any, any>> extends Condition {
32
+ constructor(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand);
33
+ }
34
+ /** Функциональная форма {@link ContextArrayLengthLessThan}. */
35
+ export declare function contextArrayLengthLessThan<R extends ContextRef<any, any>>(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand): ContextArrayLengthLessThan<R>;
36
+ /**
37
+ * Алиас: длина массива в контексте меньше или равна операнду (`<=`).
38
+ *
39
+ * @internal Используйте {@link contextArrayLengthLessOrEqual} / {@link when.lengthAtMost}.
40
+ */
41
+ export declare class ContextArrayLengthLessOrEqual<R extends ContextRef<any, any>> extends Condition {
42
+ constructor(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand);
43
+ }
44
+ /** Функциональная форма {@link ContextArrayLengthLessOrEqual}. */
45
+ export declare function contextArrayLengthLessOrEqual<R extends ContextRef<any, any>>(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand): ContextArrayLengthLessOrEqual<R>;
46
+ /**
47
+ * Алиас: длина массива в контексте строго больше операнда (`>`).
48
+ *
49
+ * @internal Используйте {@link contextArrayLengthGreaterThan} / {@link when.lengthGreaterThan}.
50
+ */
51
+ export declare class ContextArrayLengthGreaterThan<R extends ContextRef<any, any>> extends Condition {
52
+ constructor(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand);
53
+ }
54
+ /** Функциональная форма {@link ContextArrayLengthGreaterThan}. */
55
+ export declare function contextArrayLengthGreaterThan<R extends ContextRef<any, any>>(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand): ContextArrayLengthGreaterThan<R>;
56
+ /**
57
+ * Алиас: длина массива в контексте больше или равна операнду (`>=`).
58
+ *
59
+ * @internal Используйте {@link contextArrayLengthGreaterOrEqual} / {@link when.lengthAtLeast}.
60
+ */
61
+ export declare class ContextArrayLengthGreaterOrEqual<R extends ContextRef<any, any>> extends Condition {
62
+ constructor(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand);
63
+ }
64
+ /** Функциональная форма {@link ContextArrayLengthGreaterOrEqual}. */
65
+ export declare function contextArrayLengthGreaterOrEqual<R extends ContextRef<any, any>>(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand): ContextArrayLengthGreaterOrEqual<R>;
66
+ /**
67
+ * Алиас: массив в контексте пуст (длина равна 0).
68
+ *
69
+ * @internal Используйте {@link contextValueEmpty} / {@link when.isEmpty}.
70
+ */
71
+ export declare class ContextValueEmpty<R extends ContextRef<any, any>> extends ContextArrayLengthEqual<R> {
72
+ constructor(ref: CompatibleArrayContextRef<R>);
73
+ }
74
+ /** Функциональная форма {@link ContextValueEmpty}. */
75
+ export declare function contextValueEmpty<R extends ContextRef<any, any>>(ref: CompatibleArrayContextRef<R>): ContextValueEmpty<R>;
76
+ /**
77
+ * Алиас: массив в контексте непуст (длина строго больше 0).
78
+ *
79
+ * @internal Используйте {@link contextValueNotEmpty} / {@link when.notEmpty}.
80
+ */
81
+ export declare class ContextValueNotEmpty<R extends ContextRef<any, any>> extends ContextArrayLengthGreaterThan<R> {
82
+ constructor(ref: CompatibleArrayContextRef<R>);
83
+ }
84
+ /** Функциональная форма {@link ContextValueNotEmpty}. */
85
+ export declare function contextValueNotEmpty<R extends ContextRef<any, any>>(ref: CompatibleArrayContextRef<R>): ContextValueNotEmpty<R>;
86
+ export {};
@@ -0,0 +1,155 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContextValueNotEmpty = exports.ContextValueEmpty = exports.ContextArrayLengthGreaterOrEqual = exports.ContextArrayLengthGreaterThan = exports.ContextArrayLengthLessOrEqual = exports.ContextArrayLengthLessThan = exports.ContextArrayLengthEqual = exports.ContextArrayLength = void 0;
4
+ exports.contextArrayLengthEqual = contextArrayLengthEqual;
5
+ exports.contextArrayLengthLessThan = contextArrayLengthLessThan;
6
+ exports.contextArrayLengthLessOrEqual = contextArrayLengthLessOrEqual;
7
+ exports.contextArrayLengthGreaterThan = contextArrayLengthGreaterThan;
8
+ exports.contextArrayLengthGreaterOrEqual = contextArrayLengthGreaterOrEqual;
9
+ exports.contextValueEmpty = contextValueEmpty;
10
+ exports.contextValueNotEmpty = contextValueNotEmpty;
11
+ const array_length_compare_1 = require("@matreshka/shared/enums/array-length-compare");
12
+ const condition_type_1 = require("@matreshka/shared/enums/condition-type");
13
+ const condition_operand_1 = require("./condition-operand");
14
+ const condition_1 = require("./condition");
15
+ /**
16
+ * Условие сравнения длины массива в контексте с операндом
17
+ * (число или значение по `ContextRef`).
18
+ *
19
+ * @internal Используйте фабрики длины массива ({@link contextArrayLengthEqual} и др.).
20
+ */
21
+ class ContextArrayLength extends condition_1.Condition {
22
+ constructor(ref, length, operator) {
23
+ super(condition_type_1.ConditionType.ContextArrayLength, {
24
+ ref,
25
+ length: (0, condition_operand_1.toWireOperand)(length),
26
+ operator,
27
+ });
28
+ }
29
+ }
30
+ exports.ContextArrayLength = ContextArrayLength;
31
+ /**
32
+ * Алиас: длина массива в контексте равна операнду (`===`).
33
+ *
34
+ * @internal Используйте {@link contextArrayLengthEqual} / {@link when.lengthEquals}.
35
+ */
36
+ class ContextArrayLengthEqual extends condition_1.Condition {
37
+ constructor(ref, length) {
38
+ super(condition_type_1.ConditionType.ContextArrayLength, {
39
+ ref,
40
+ length: (0, condition_operand_1.toWireOperand)(length),
41
+ operator: array_length_compare_1.ArrayLengthCompare.Equal,
42
+ });
43
+ }
44
+ }
45
+ exports.ContextArrayLengthEqual = ContextArrayLengthEqual;
46
+ /** Функциональная форма {@link ContextArrayLengthEqual}. */
47
+ function contextArrayLengthEqual(ref, length) {
48
+ return new ContextArrayLengthEqual(ref, length);
49
+ }
50
+ /**
51
+ * Алиас: длина массива в контексте строго меньше операнда (`<`).
52
+ *
53
+ * @internal Используйте {@link contextArrayLengthLessThan} / {@link when.lengthLessThan}.
54
+ */
55
+ class ContextArrayLengthLessThan extends condition_1.Condition {
56
+ constructor(ref, length) {
57
+ super(condition_type_1.ConditionType.ContextArrayLength, {
58
+ ref,
59
+ length: (0, condition_operand_1.toWireOperand)(length),
60
+ operator: array_length_compare_1.ArrayLengthCompare.LessThan,
61
+ });
62
+ }
63
+ }
64
+ exports.ContextArrayLengthLessThan = ContextArrayLengthLessThan;
65
+ /** Функциональная форма {@link ContextArrayLengthLessThan}. */
66
+ function contextArrayLengthLessThan(ref, length) {
67
+ return new ContextArrayLengthLessThan(ref, length);
68
+ }
69
+ /**
70
+ * Алиас: длина массива в контексте меньше или равна операнду (`<=`).
71
+ *
72
+ * @internal Используйте {@link contextArrayLengthLessOrEqual} / {@link when.lengthAtMost}.
73
+ */
74
+ class ContextArrayLengthLessOrEqual extends condition_1.Condition {
75
+ constructor(ref, length) {
76
+ super(condition_type_1.ConditionType.ContextArrayLength, {
77
+ ref,
78
+ length: (0, condition_operand_1.toWireOperand)(length),
79
+ operator: array_length_compare_1.ArrayLengthCompare.LessOrEqual,
80
+ });
81
+ }
82
+ }
83
+ exports.ContextArrayLengthLessOrEqual = ContextArrayLengthLessOrEqual;
84
+ /** Функциональная форма {@link ContextArrayLengthLessOrEqual}. */
85
+ function contextArrayLengthLessOrEqual(ref, length) {
86
+ return new ContextArrayLengthLessOrEqual(ref, length);
87
+ }
88
+ /**
89
+ * Алиас: длина массива в контексте строго больше операнда (`>`).
90
+ *
91
+ * @internal Используйте {@link contextArrayLengthGreaterThan} / {@link when.lengthGreaterThan}.
92
+ */
93
+ class ContextArrayLengthGreaterThan extends condition_1.Condition {
94
+ constructor(ref, length) {
95
+ super(condition_type_1.ConditionType.ContextArrayLength, {
96
+ ref,
97
+ length: (0, condition_operand_1.toWireOperand)(length),
98
+ operator: array_length_compare_1.ArrayLengthCompare.GreaterThan,
99
+ });
100
+ }
101
+ }
102
+ exports.ContextArrayLengthGreaterThan = ContextArrayLengthGreaterThan;
103
+ /** Функциональная форма {@link ContextArrayLengthGreaterThan}. */
104
+ function contextArrayLengthGreaterThan(ref, length) {
105
+ return new ContextArrayLengthGreaterThan(ref, length);
106
+ }
107
+ /**
108
+ * Алиас: длина массива в контексте больше или равна операнду (`>=`).
109
+ *
110
+ * @internal Используйте {@link contextArrayLengthGreaterOrEqual} / {@link when.lengthAtLeast}.
111
+ */
112
+ class ContextArrayLengthGreaterOrEqual extends condition_1.Condition {
113
+ constructor(ref, length) {
114
+ super(condition_type_1.ConditionType.ContextArrayLength, {
115
+ ref,
116
+ length: (0, condition_operand_1.toWireOperand)(length),
117
+ operator: array_length_compare_1.ArrayLengthCompare.GreaterOrEqual,
118
+ });
119
+ }
120
+ }
121
+ exports.ContextArrayLengthGreaterOrEqual = ContextArrayLengthGreaterOrEqual;
122
+ /** Функциональная форма {@link ContextArrayLengthGreaterOrEqual}. */
123
+ function contextArrayLengthGreaterOrEqual(ref, length) {
124
+ return new ContextArrayLengthGreaterOrEqual(ref, length);
125
+ }
126
+ /**
127
+ * Алиас: массив в контексте пуст (длина равна 0).
128
+ *
129
+ * @internal Используйте {@link contextValueEmpty} / {@link when.isEmpty}.
130
+ */
131
+ class ContextValueEmpty extends ContextArrayLengthEqual {
132
+ constructor(ref) {
133
+ super(ref, 0);
134
+ }
135
+ }
136
+ exports.ContextValueEmpty = ContextValueEmpty;
137
+ /** Функциональная форма {@link ContextValueEmpty}. */
138
+ function contextValueEmpty(ref) {
139
+ return new ContextValueEmpty(ref);
140
+ }
141
+ /**
142
+ * Алиас: массив в контексте непуст (длина строго больше 0).
143
+ *
144
+ * @internal Используйте {@link contextValueNotEmpty} / {@link when.notEmpty}.
145
+ */
146
+ class ContextValueNotEmpty extends ContextArrayLengthGreaterThan {
147
+ constructor(ref) {
148
+ super(ref, 0);
149
+ }
150
+ }
151
+ exports.ContextValueNotEmpty = ContextValueNotEmpty;
152
+ /** Функциональная форма {@link ContextValueNotEmpty}. */
153
+ function contextValueNotEmpty(ref) {
154
+ return new ContextValueNotEmpty(ref);
155
+ }
@@ -0,0 +1,12 @@
1
+ import { ContextRef } from "../context/context-ref";
2
+ import { Condition } from "./condition";
3
+ /**
4
+ * Условие, означающее, что в контексте определено значение по заданному ключу.
5
+ *
6
+ * @internal Используйте {@link contextValueDefined} / {@link when.defined}.
7
+ */
8
+ export declare class ContextValueDefined extends Condition {
9
+ constructor(ref: ContextRef);
10
+ }
11
+ /** Функциональная форма {@link ContextValueDefined}. */
12
+ export declare function contextValueDefined(ref: ContextRef): ContextValueDefined;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContextValueDefined = void 0;
4
+ exports.contextValueDefined = contextValueDefined;
5
+ const condition_type_1 = require("@matreshka/shared/enums/condition-type");
6
+ const condition_1 = require("./condition");
7
+ /**
8
+ * Условие, означающее, что в контексте определено значение по заданному ключу.
9
+ *
10
+ * @internal Используйте {@link contextValueDefined} / {@link when.defined}.
11
+ */
12
+ class ContextValueDefined extends condition_1.Condition {
13
+ constructor(ref) {
14
+ super(condition_type_1.ConditionType.ContextValueDefined, { ref });
15
+ }
16
+ }
17
+ exports.ContextValueDefined = ContextValueDefined;
18
+ /** Функциональная форма {@link ContextValueDefined}. */
19
+ function contextValueDefined(ref) {
20
+ return new ContextValueDefined(ref);
21
+ }
@@ -0,0 +1,14 @@
1
+ import { ContextRef } from "../context/context-ref";
2
+ import { ConditionOperand } from "./condition-operand";
3
+ import { Condition } from "./condition";
4
+ /**
5
+ * Условие: значение по `ref` строго равно операнду
6
+ * (литерал того же примитивного типа или значение по другой `ContextRef`).
7
+ *
8
+ * @internal Используйте {@link contextValueEqual} / {@link when.equals}.
9
+ */
10
+ export declare class ContextValueEqual<R extends ContextRef<any, any>> extends Condition {
11
+ constructor(ref: R, value: ConditionOperand<R>);
12
+ }
13
+ /** Функциональная форма {@link ContextValueEqual}. */
14
+ export declare function contextValueEqual<R extends ContextRef<any, any>>(ref: R, value: ConditionOperand<R>): ContextValueEqual<R>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContextValueEqual = void 0;
4
+ exports.contextValueEqual = contextValueEqual;
5
+ const condition_type_1 = require("@matreshka/shared/enums/condition-type");
6
+ const condition_operand_1 = require("./condition-operand");
7
+ const condition_1 = require("./condition");
8
+ /**
9
+ * Условие: значение по `ref` строго равно операнду
10
+ * (литерал того же примитивного типа или значение по другой `ContextRef`).
11
+ *
12
+ * @internal Используйте {@link contextValueEqual} / {@link when.equals}.
13
+ */
14
+ class ContextValueEqual extends condition_1.Condition {
15
+ constructor(ref, value) {
16
+ super(condition_type_1.ConditionType.ContextValueEqual, {
17
+ ref,
18
+ value: (0, condition_operand_1.toWireOperand)(value),
19
+ });
20
+ }
21
+ }
22
+ exports.ContextValueEqual = ContextValueEqual;
23
+ /** Функциональная форма {@link ContextValueEqual}. */
24
+ function contextValueEqual(ref, value) {
25
+ return new ContextValueEqual(ref, value);
26
+ }
@@ -0,0 +1,17 @@
1
+ import { ContextRef } from "../context/context-ref";
2
+ import { ConditionOperand } from "./condition-operand";
3
+ import { ContextRefPrimitiveValue } from "../types/context-ref-primitive-value";
4
+ import { Condition } from "./condition";
5
+ type CompatiblePrimitiveContextRef<R extends ContextRef<any, any>> = ContextRefPrimitiveValue<R> extends never ? never : R;
6
+ /**
7
+ * Условие: значение по `ref` входит в список операндов
8
+ * (каждый элемент — литерал или `ContextRef`).
9
+ *
10
+ * @internal Используйте {@link contextValueIn} / {@link when.oneOf}.
11
+ */
12
+ export declare class ContextValueIn<R extends ContextRef<any, any>> extends Condition {
13
+ constructor(ref: CompatiblePrimitiveContextRef<R>, value: ConditionOperand<R>[]);
14
+ }
15
+ /** Функциональная форма {@link ContextValueIn}. */
16
+ export declare function contextValueIn<R extends ContextRef<any, any>>(ref: CompatiblePrimitiveContextRef<R>, value: ConditionOperand<R>[]): ContextValueIn<R>;
17
+ export {};
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContextValueIn = void 0;
4
+ exports.contextValueIn = contextValueIn;
5
+ const condition_type_1 = require("@matreshka/shared/enums/condition-type");
6
+ const condition_operand_1 = require("./condition-operand");
7
+ const condition_1 = require("./condition");
8
+ /**
9
+ * Условие: значение по `ref` входит в список операндов
10
+ * (каждый элемент — литерал или `ContextRef`).
11
+ *
12
+ * @internal Используйте {@link contextValueIn} / {@link when.oneOf}.
13
+ */
14
+ class ContextValueIn extends condition_1.Condition {
15
+ constructor(ref, value) {
16
+ super(condition_type_1.ConditionType.ContextValueIn, {
17
+ ref,
18
+ value: value.map(condition_operand_1.toWireOperand),
19
+ });
20
+ }
21
+ }
22
+ exports.ContextValueIn = ContextValueIn;
23
+ /** Функциональная форма {@link ContextValueIn}. */
24
+ function contextValueIn(ref, value) {
25
+ return new ContextValueIn(ref, value);
26
+ }
@@ -0,0 +1,14 @@
1
+ import { ContextRef } from "../context/context-ref";
2
+ import { ConditionOperand } from "./condition-operand";
3
+ import { Condition } from "./condition";
4
+ /**
5
+ * Условие: значение по `ref` не равно операнду
6
+ * (литерал того же примитивного типа или значение по другой `ContextRef`).
7
+ *
8
+ * @internal Используйте {@link contextValueNotEqual} / {@link when.notEquals}.
9
+ */
10
+ export declare class ContextValueNotEqual<R extends ContextRef<any, any>> extends Condition {
11
+ constructor(ref: R, value: ConditionOperand<R>);
12
+ }
13
+ /** Функциональная форма {@link ContextValueNotEqual}. */
14
+ export declare function contextValueNotEqual<R extends ContextRef<any, any>>(ref: R, value: ConditionOperand<R>): ContextValueNotEqual<R>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContextValueNotEqual = void 0;
4
+ exports.contextValueNotEqual = contextValueNotEqual;
5
+ const condition_type_1 = require("@matreshka/shared/enums/condition-type");
6
+ const condition_operand_1 = require("./condition-operand");
7
+ const condition_1 = require("./condition");
8
+ /**
9
+ * Условие: значение по `ref` не равно операнду
10
+ * (литерал того же примитивного типа или значение по другой `ContextRef`).
11
+ *
12
+ * @internal Используйте {@link contextValueNotEqual} / {@link when.notEquals}.
13
+ */
14
+ class ContextValueNotEqual extends condition_1.Condition {
15
+ constructor(ref, value) {
16
+ super(condition_type_1.ConditionType.ContextValueNotEqual, {
17
+ ref,
18
+ value: (0, condition_operand_1.toWireOperand)(value),
19
+ });
20
+ }
21
+ }
22
+ exports.ContextValueNotEqual = ContextValueNotEqual;
23
+ /** Функциональная форма {@link ContextValueNotEqual}. */
24
+ function contextValueNotEqual(ref, value) {
25
+ return new ContextValueNotEqual(ref, value);
26
+ }
@@ -0,0 +1,12 @@
1
+ import { ContextRef } from "../context/context-ref";
2
+ import { Condition } from "./condition";
3
+ /**
4
+ * Условие, означающее, что значение в контексте по заданному ключу не определено.
5
+ *
6
+ * @internal Используйте {@link contextValueUndefined} / {@link when.notDefined}.
7
+ */
8
+ export declare class ContextValueUndefined extends Condition {
9
+ constructor(ref: ContextRef);
10
+ }
11
+ /** Функциональная форма {@link ContextValueUndefined}. */
12
+ export declare function contextValueUndefined(ref: ContextRef): ContextValueUndefined;