@matreshka/bff 0.22.0 → 0.22.1

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.
@@ -5,9 +5,9 @@ import { ContextRef, ContextRefValue } from "../context/context-ref";
5
5
  import type { CompatibleContextValueRef } from "../types/context-value-ref";
6
6
  type ContextArrayValue = readonly unknown[] | unknown[];
7
7
  /** Элемент массива по значению `ContextRef`. */
8
- export type ContextRefArrayElement<R extends ContextRef> = Extract<ContextRefValue<R>, ContextArrayValue>[number];
8
+ export type ContextRefArrayElement<R extends ContextRef<any, any>> = Extract<ContextRefValue<R>, ContextArrayValue>[number];
9
9
  /** Ref на массив в контексте (значение по ref — массив или readonly-массив). */
10
- export type CompatibleArrayContextRef<R extends ContextRef> = [
10
+ export type CompatibleArrayContextRef<R extends ContextRef<any, any>> = [
11
11
  Extract<ContextRefValue<R>, ContextArrayValue>
12
12
  ] extends [never] ? never : R;
13
13
  /**
@@ -22,11 +22,11 @@ export type ConditionOperandFor<ValueType> = (ValueType & JsonPrimitive) | Compa
22
22
  * Операнд условия на BFF: JSON-примитив того же типа, что значение по `ref`,
23
23
  * либо другая ссылка с совместимым типом значения (сравнение в рантайме через `===`).
24
24
  */
25
- export type ConditionOperand<R extends ContextRef> = ConditionOperandFor<ContextRefValue<R>>;
25
+ export type ConditionOperand<R extends ContextRef<any, any>> = ConditionOperandFor<ContextRefValue<R>>;
26
26
  /** Значение поля элемента массива по `itemPath` (пустой путь — сам элемент). */
27
27
  export type ArrayIncludesItemValue<Item, P extends string> = P extends "" ? Item : Item extends JsonObject ? PathValue<Item, P & Paths<Item>> : never;
28
28
  /** Операнд {@link ContextArrayIncludes} / {@link ContextArrayNotIncludes}. */
29
- export type ArrayIncludesOperand<R extends ContextRef, P extends string> = ConditionOperandFor<ArrayIncludesItemValue<ContextRefArrayElement<R>, P>>;
29
+ export type ArrayIncludesOperand<R extends ContextRef<any, any>, P extends string> = ConditionOperandFor<ArrayIncludesItemValue<ContextRefArrayElement<R>, P>>;
30
30
  /** Операнд длины массива: число или ссылка на число в контексте. */
31
31
  export type ConditionLengthOperand = ConditionOperandFor<number>;
32
32
  /** Операнд без привязки к конкретному `ref` (сериализация на wire). */
@@ -10,11 +10,11 @@ import { ArrayIncludesOperand, CompatibleArrayContextRef, ContextRefArrayElement
10
10
  *
11
11
  * @internal Используйте {@link contextArrayIncludes} / {@link when.includes}.
12
12
  */
13
- export declare class ContextArrayIncludes<R extends ContextRef, P extends Paths<ContextRefArrayElement<R>> | "" = ""> extends Condition {
13
+ export declare class ContextArrayIncludes<R extends ContextRef<any, any>, P extends Extract<Paths<ContextRefArrayElement<R>>, string> | "" = ""> extends Condition {
14
14
  constructor(ref: CompatibleArrayContextRef<R>, itemPath: P, value: ArrayIncludesOperand<R, P>);
15
15
  }
16
16
  /** Функциональная форма {@link ContextArrayIncludes}. */
17
- export declare function contextArrayIncludes<R extends ContextRef, P extends Paths<ContextRefArrayElement<R>> | "" = "">(ref: CompatibleArrayContextRef<R>, itemPath: P, value: ArrayIncludesOperand<R, P>): ContextArrayIncludes<R, P>;
17
+ export declare function contextArrayIncludes<R extends ContextRef<any, any>, P extends Extract<Paths<ContextRefArrayElement<R>>, string> | "" = "">(ref: CompatibleArrayContextRef<R>, itemPath: P, value: ArrayIncludesOperand<R, P>): ContextArrayIncludes<R, P>;
18
18
  /**
19
19
  * Условие: в массиве из контекста нет элемента, у которого значение по
20
20
  * `itemPath` равно операнду (литерал или `ContextRef`).
@@ -23,8 +23,8 @@ export declare function contextArrayIncludes<R extends ContextRef, P extends Pat
23
23
  *
24
24
  * @internal Используйте {@link contextArrayNotIncludes} / {@link when.excludes}.
25
25
  */
26
- export declare class ContextArrayNotIncludes<R extends ContextRef, P extends Paths<ContextRefArrayElement<R>> | "" = ""> extends Condition {
26
+ export declare class ContextArrayNotIncludes<R extends ContextRef<any, any>, P extends Extract<Paths<ContextRefArrayElement<R>>, string> | "" = ""> extends Condition {
27
27
  constructor(ref: CompatibleArrayContextRef<R>, itemPath: P, value: ArrayIncludesOperand<R, P>);
28
28
  }
29
29
  /** Функциональная форма {@link ContextArrayNotIncludes}. */
30
- export declare function contextArrayNotIncludes<R extends ContextRef, P extends Paths<ContextRefArrayElement<R>> | "" = "">(ref: CompatibleArrayContextRef<R>, itemPath: P, value: ArrayIncludesOperand<R, P>): ContextArrayNotIncludes<R, P>;
30
+ export declare function contextArrayNotIncludes<R extends ContextRef<any, any>, P extends Extract<Paths<ContextRefArrayElement<R>>, string> | "" = "">(ref: CompatibleArrayContextRef<R>, itemPath: P, value: ArrayIncludesOperand<R, P>): ContextArrayNotIncludes<R, P>;
@@ -8,7 +8,7 @@ import { CompatibleArrayContextRef, ConditionLengthOperand } from "./condition-o
8
8
  *
9
9
  * @internal Используйте фабрики длины массива ({@link contextArrayLengthEqual} и др.).
10
10
  */
11
- export declare abstract class ContextArrayLength<R extends ContextRef> extends Condition {
11
+ export declare abstract class ContextArrayLength<R extends ContextRef<any, any>> extends Condition {
12
12
  constructor(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand, operator: ArrayLengthCompare);
13
13
  }
14
14
  /**
@@ -16,68 +16,68 @@ export declare abstract class ContextArrayLength<R extends ContextRef> extends C
16
16
  *
17
17
  * @internal Используйте {@link contextArrayLengthEqual} / {@link when.lengthEquals}.
18
18
  */
19
- export declare class ContextArrayLengthEqual<R extends ContextRef> extends Condition {
19
+ export declare class ContextArrayLengthEqual<R extends ContextRef<any, any>> extends Condition {
20
20
  constructor(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand);
21
21
  }
22
22
  /** Функциональная форма {@link ContextArrayLengthEqual}. */
23
- export declare function contextArrayLengthEqual<R extends ContextRef>(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand): ContextArrayLengthEqual<R>;
23
+ export declare function contextArrayLengthEqual<R extends ContextRef<any, any>>(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand): ContextArrayLengthEqual<R>;
24
24
  /**
25
25
  * Алиас: длина массива в контексте строго меньше операнда (`<`).
26
26
  *
27
27
  * @internal Используйте {@link contextArrayLengthLessThan} / {@link when.lengthLessThan}.
28
28
  */
29
- export declare class ContextArrayLengthLessThan<R extends ContextRef> extends Condition {
29
+ export declare class ContextArrayLengthLessThan<R extends ContextRef<any, any>> extends Condition {
30
30
  constructor(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand);
31
31
  }
32
32
  /** Функциональная форма {@link ContextArrayLengthLessThan}. */
33
- export declare function contextArrayLengthLessThan<R extends ContextRef>(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand): ContextArrayLengthLessThan<R>;
33
+ export declare function contextArrayLengthLessThan<R extends ContextRef<any, any>>(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand): ContextArrayLengthLessThan<R>;
34
34
  /**
35
35
  * Алиас: длина массива в контексте меньше или равна операнду (`<=`).
36
36
  *
37
37
  * @internal Используйте {@link contextArrayLengthLessOrEqual} / {@link when.lengthAtMost}.
38
38
  */
39
- export declare class ContextArrayLengthLessOrEqual<R extends ContextRef> extends Condition {
39
+ export declare class ContextArrayLengthLessOrEqual<R extends ContextRef<any, any>> extends Condition {
40
40
  constructor(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand);
41
41
  }
42
42
  /** Функциональная форма {@link ContextArrayLengthLessOrEqual}. */
43
- export declare function contextArrayLengthLessOrEqual<R extends ContextRef>(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand): ContextArrayLengthLessOrEqual<R>;
43
+ export declare function contextArrayLengthLessOrEqual<R extends ContextRef<any, any>>(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand): ContextArrayLengthLessOrEqual<R>;
44
44
  /**
45
45
  * Алиас: длина массива в контексте строго больше операнда (`>`).
46
46
  *
47
47
  * @internal Используйте {@link contextArrayLengthGreaterThan} / {@link when.lengthGreaterThan}.
48
48
  */
49
- export declare class ContextArrayLengthGreaterThan<R extends ContextRef> extends Condition {
49
+ export declare class ContextArrayLengthGreaterThan<R extends ContextRef<any, any>> extends Condition {
50
50
  constructor(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand);
51
51
  }
52
52
  /** Функциональная форма {@link ContextArrayLengthGreaterThan}. */
53
- export declare function contextArrayLengthGreaterThan<R extends ContextRef>(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand): ContextArrayLengthGreaterThan<R>;
53
+ export declare function contextArrayLengthGreaterThan<R extends ContextRef<any, any>>(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand): ContextArrayLengthGreaterThan<R>;
54
54
  /**
55
55
  * Алиас: длина массива в контексте больше или равна операнду (`>=`).
56
56
  *
57
57
  * @internal Используйте {@link contextArrayLengthGreaterOrEqual} / {@link when.lengthAtLeast}.
58
58
  */
59
- export declare class ContextArrayLengthGreaterOrEqual<R extends ContextRef> extends Condition {
59
+ export declare class ContextArrayLengthGreaterOrEqual<R extends ContextRef<any, any>> extends Condition {
60
60
  constructor(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand);
61
61
  }
62
62
  /** Функциональная форма {@link ContextArrayLengthGreaterOrEqual}. */
63
- export declare function contextArrayLengthGreaterOrEqual<R extends ContextRef>(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand): ContextArrayLengthGreaterOrEqual<R>;
63
+ export declare function contextArrayLengthGreaterOrEqual<R extends ContextRef<any, any>>(ref: CompatibleArrayContextRef<R>, length: ConditionLengthOperand): ContextArrayLengthGreaterOrEqual<R>;
64
64
  /**
65
65
  * Алиас: массив в контексте пуст (длина равна 0).
66
66
  *
67
67
  * @internal Используйте {@link contextValueEmpty} / {@link when.isEmpty}.
68
68
  */
69
- export declare class ContextValueEmpty<R extends ContextRef> extends ContextArrayLengthEqual<R> {
69
+ export declare class ContextValueEmpty<R extends ContextRef<any, any>> extends ContextArrayLengthEqual<R> {
70
70
  constructor(ref: CompatibleArrayContextRef<R>);
71
71
  }
72
72
  /** Функциональная форма {@link ContextValueEmpty}. */
73
- export declare function contextValueEmpty<R extends ContextRef>(ref: CompatibleArrayContextRef<R>): ContextValueEmpty<R>;
73
+ export declare function contextValueEmpty<R extends ContextRef<any, any>>(ref: CompatibleArrayContextRef<R>): ContextValueEmpty<R>;
74
74
  /**
75
75
  * Алиас: массив в контексте непуст (длина строго больше 0).
76
76
  *
77
77
  * @internal Используйте {@link contextValueNotEmpty} / {@link when.notEmpty}.
78
78
  */
79
- export declare class ContextValueNotEmpty<R extends ContextRef> extends ContextArrayLengthGreaterThan<R> {
79
+ export declare class ContextValueNotEmpty<R extends ContextRef<any, any>> extends ContextArrayLengthGreaterThan<R> {
80
80
  constructor(ref: CompatibleArrayContextRef<R>);
81
81
  }
82
82
  /** Функциональная форма {@link ContextValueNotEmpty}. */
83
- export declare function contextValueNotEmpty<R extends ContextRef>(ref: CompatibleArrayContextRef<R>): ContextValueNotEmpty<R>;
83
+ export declare function contextValueNotEmpty<R extends ContextRef<any, any>>(ref: CompatibleArrayContextRef<R>): ContextValueNotEmpty<R>;
@@ -7,8 +7,8 @@ import { ConditionOperand } from "./condition-operand";
7
7
  *
8
8
  * @internal Используйте {@link contextValueEqual} / {@link when.equals}.
9
9
  */
10
- export declare class ContextValueEqual<R extends ContextRef> extends Condition {
10
+ export declare class ContextValueEqual<R extends ContextRef<any, any>> extends Condition {
11
11
  constructor(ref: R, value: ConditionOperand<R>);
12
12
  }
13
13
  /** Функциональная форма {@link ContextValueEqual}. */
14
- export declare function contextValueEqual<R extends ContextRef>(ref: R, value: ConditionOperand<R>): ContextValueEqual<R>;
14
+ export declare function contextValueEqual<R extends ContextRef<any, any>>(ref: R, value: ConditionOperand<R>): ContextValueEqual<R>;
@@ -7,8 +7,8 @@ import { ConditionOperand } from "./condition-operand";
7
7
  *
8
8
  * @internal Используйте {@link contextValueIn} / {@link when.oneOf}.
9
9
  */
10
- export declare class ContextValueIn<R extends ContextRef> extends Condition {
10
+ export declare class ContextValueIn<R extends ContextRef<any, any>> extends Condition {
11
11
  constructor(ref: R, value: ConditionOperand<R>[]);
12
12
  }
13
13
  /** Функциональная форма {@link ContextValueIn}. */
14
- export declare function contextValueIn<R extends ContextRef>(ref: R, value: ConditionOperand<R>[]): ContextValueIn<R>;
14
+ export declare function contextValueIn<R extends ContextRef<any, any>>(ref: R, value: ConditionOperand<R>[]): ContextValueIn<R>;
@@ -7,8 +7,8 @@ import { ConditionOperand } from "./condition-operand";
7
7
  *
8
8
  * @internal Используйте {@link contextValueNotEqual} / {@link when.notEquals}.
9
9
  */
10
- export declare class ContextValueNotEqual<R extends ContextRef> extends Condition {
10
+ export declare class ContextValueNotEqual<R extends ContextRef<any, any>> extends Condition {
11
11
  constructor(ref: R, value: ConditionOperand<R>);
12
12
  }
13
13
  /** Функциональная форма {@link ContextValueNotEqual}. */
14
- export declare function contextValueNotEqual<R extends ContextRef>(ref: R, value: ConditionOperand<R>): ContextValueNotEqual<R>;
14
+ export declare function contextValueNotEqual<R extends ContextRef<any, any>>(ref: R, value: ConditionOperand<R>): ContextValueNotEqual<R>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matreshka/bff",
3
- "version": "0.22.0",
3
+ "version": "0.22.1",
4
4
  "description": "Matreshka BFF: server-driven UI runtime — routing, pages, context, component DSL, and platform APIs",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",