@react-typed-forms/schemas 12.0.2 → 12.1.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.
@@ -6,11 +6,15 @@ export declare class DefaultSchemaInterface implements SchemaInterface {
6
6
  constructor(boolStrings?: [string, string]);
7
7
  parseToMillis(field: SchemaField, v: string): number;
8
8
  validationMessageText(field: SchemaField, messageType: ValidationMessageType, actual: any, expected: any): string;
9
+ getDataOptions(node: SchemaDataNode): FieldOption[] | null | undefined;
10
+ getNodeOptions(node: SchemaNode): FieldOption[] | null | undefined;
9
11
  getOptions({ options }: SchemaField): FieldOption[] | null | undefined;
10
12
  getFilterOptions(array: SchemaDataNode, field: SchemaNode): FieldOption[] | undefined | null;
11
13
  isEmptyValue(f: SchemaField, value: any): boolean;
14
+ searchText(field: SchemaField, value: any): string;
12
15
  textValue(field: SchemaField, value: any, element?: boolean | undefined): string | undefined;
13
16
  controlLength(f: SchemaField, control: Control<any>): number;
14
17
  valueLength(field: SchemaField, value: any): number;
18
+ compareValue(field: SchemaField, v1: unknown, v2: unknown): number;
15
19
  }
16
20
  export declare const defaultSchemaInterface: SchemaInterface;
@@ -34,6 +34,10 @@ export declare function makeSchemaDataNode(schema: SchemaNode, control?: Control
34
34
  export declare function fieldPathForDefinition(c: ControlDefinition): string[] | undefined;
35
35
  export declare function schemaDataForFieldRef(fieldRef: string | undefined, schema: SchemaDataNode): SchemaDataNode;
36
36
  export declare function schemaForFieldRef(fieldRef: string | undefined, schema: SchemaNode): SchemaNode;
37
+ export declare function traverseSchemaPath<A>(fieldPath: string[], schema: SchemaNode, acc: A, next: (acc: A, node: SchemaNode) => A): A;
38
+ export declare function traverseData(fieldPath: string[], root: SchemaNode, data: {
39
+ [k: string]: any;
40
+ }): unknown;
37
41
  export declare function schemaDataForFieldPath(fieldPath: string[], schema: SchemaDataNode): SchemaDataNode;
38
42
  export declare function schemaForFieldPath(fieldPath: string[], schema: SchemaNode): SchemaNode;
39
43
  export declare function traverseParents<A, B extends {
package/lib/types.d.ts CHANGED
@@ -66,6 +66,8 @@ export interface SchemaInterface {
66
66
  getFilterOptions(array: SchemaDataNode, field: SchemaNode): FieldOption[] | undefined | null;
67
67
  parseToMillis(field: SchemaField, v: string): number;
68
68
  validationMessageText(field: SchemaField, messageType: ValidationMessageType, actual: any, expected: any): string;
69
+ compareValue(field: SchemaField, v1: unknown, v2: unknown): number;
70
+ searchText(field: SchemaField, value: any): string;
69
71
  }
70
72
  export interface ControlDefinition {
71
73
  type: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-typed-forms/schemas",
3
- "version": "12.0.2",
3
+ "version": "12.1.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.cjs",