@graphcore/react-kernel 0.2.2 → 0.2.5

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.
@@ -4,6 +4,13 @@
4
4
  * (persistence/ENTITY_REPOSITORY_TECHNICAL_TDD.md, Wire encoding).
5
5
  */
6
6
  export type Scalar = string | number | boolean | null;
7
+ /** Exclusive (`gt`, `lt`) or inclusive (`gte`, `lte`); at most one lower and one upper. */
8
+ export type Bounds = {
9
+ gt?: string | number;
10
+ gte?: string | number;
11
+ lt?: string | number;
12
+ lte?: string | number;
13
+ };
7
14
  export type Predicate = {
8
15
  equal: {
9
16
  field: string;
@@ -24,6 +31,10 @@ export type Predicate = {
24
31
  field: string;
25
32
  values: Scalar[];
26
33
  };
34
+ } | {
35
+ range: {
36
+ field: string;
37
+ } & Bounds;
27
38
  } | {
28
39
  all_of: Predicate[];
29
40
  } | {
@@ -33,5 +44,6 @@ export declare const equal: (field: string, value: Scalar) => Predicate;
33
44
  export declare const inValues: (field: string, values: Scalar[]) => Predicate;
34
45
  export declare const containsValue: (field: string, value: Scalar) => Predicate;
35
46
  export declare const containsAny: (field: string, values: Scalar[]) => Predicate;
47
+ export declare const range: (field: string, bounds: Bounds) => Predicate;
36
48
  export declare const allOf: (...predicates: Predicate[]) => Predicate;
37
49
  export declare const anyOf: (...predicates: Predicate[]) => Predicate;
@@ -24,6 +24,7 @@ export declare function useAccess(entityId: string, sendStrategyRequest: SendStr
24
24
  canManage: boolean;
25
25
  grants: AccessGrant[];
26
26
  shareable: boolean;
27
+ invitable: boolean;
27
28
  roles: AccessRole[];
28
29
  publicPermissions: string[];
29
30
  subjectTypeIds: string[];
@@ -0,0 +1,29 @@
1
+ import { default as React } from 'react';
2
+ type Values = Record<string, unknown>;
3
+ export type StrategyFormProps = {
4
+ /** The strategy's name, as registered on the backend. */
5
+ strategy: string;
6
+ target: string | null;
7
+ /** Shown until the user edits a field; pass live entity values here. */
8
+ initial?: Values;
9
+ /** Controlled: the values to show, with `onChange` receiving each edit (pair with `useEditable`). */
10
+ value?: Values | null;
11
+ onChange?: (patch: Values) => void;
12
+ /** The params to show, in order. Default: every param the form can render. */
13
+ fields?: string[];
14
+ /** Params sent with every submit but never shown, such as `base_version`. */
15
+ hidden?: Values;
16
+ labels?: Record<string, string>;
17
+ submitLabel?: string;
18
+ onDone?: (result: Values) => void;
19
+ };
20
+ /**
21
+ * A form for one strategy, built from its request schema: text, number and
22
+ * true/false fields, enums as a select, and lists of strings. A string whose
23
+ * `maxLength` is over 200 is a text area. Params of any other shape are left
24
+ * out; send them through `hidden`, or write the form by hand. Uncontrolled, it
25
+ * shows `initial` until edited and keeps its own draft; controlled, it shows
26
+ * `value` and reports edits to `onChange`.
27
+ */
28
+ export declare function StrategyForm({ strategy, target, initial, value, onChange, fields, hidden, labels, submitLabel, onDone, }: StrategyFormProps): React.JSX.Element;
29
+ export {};