@react-typed-forms/schemas 1.0.0-dev.17 → 1.0.0-dev.18

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.
@@ -1,87 +1,87 @@
1
- import { CompoundField, FieldOption, FieldType, SchemaField } from "./types";
2
- type AllowedSchema<T> = T extends string ? SchemaField & {
3
- type: FieldType.String | FieldType.Date | FieldType.DateTime;
4
- } : T extends number ? SchemaField & {
5
- type: FieldType.Int | FieldType.Double;
6
- } : T extends boolean ? SchemaField & {
7
- type: FieldType.Bool;
8
- } : T extends Array<infer E> ? AllowedSchema<E> & {
9
- collection: true;
10
- } : T extends {
11
- [key: string]: any;
12
- } ? CompoundField & {
13
- type: FieldType.Compound;
14
- } : SchemaField & {
15
- type: FieldType.Any;
16
- };
17
- type AllowedField<T, K> = (name: string) => (SchemaField & {
18
- type: K;
19
- }) | AllowedSchema<T>;
20
- export declare function buildSchema<T, Custom = "">(def: {
21
- [K in keyof T]-?: AllowedField<T[K], Custom>;
22
- }): SchemaField[];
23
- export declare function stringField(displayName: string, options?: Partial<Omit<SchemaField, "type">>): (name: string) => SchemaField & {
24
- field?: string | undefined;
25
- displayName: string | null;
26
- tags?: string[] | null | undefined;
27
- system?: boolean | null | undefined;
28
- collection?: boolean | null | undefined;
29
- onlyForTypes?: string[] | null | undefined;
30
- required?: boolean | null | undefined;
31
- defaultValue?: any;
32
- isTypeField?: boolean | null | undefined;
33
- searchable?: boolean | null | undefined;
34
- options?: FieldOption[] | null | undefined;
35
- restrictions?: import("./types").SchemaRestrictions | null | undefined;
36
- type: FieldType.String;
37
- };
38
- export declare function stringOptionsField(displayName: string, ...options: FieldOption[]): (name: string) => SchemaField & {
39
- type: FieldType.String;
40
- displayName: string;
41
- options: FieldOption[];
42
- };
43
- export declare function withScalarOptions<S extends SchemaField>(options: Partial<SchemaField>, v: (name: string) => S): (name: string) => S;
44
- export declare function makeScalarField<S extends Partial<SchemaField>>(options: S): (name: string) => SchemaField & S;
45
- export declare function makeCompoundField<S extends Partial<CompoundField>>(options: S): (name: string) => CompoundField & {
46
- type: FieldType.Compound;
47
- } & S;
48
- export declare function intField(displayName: string, options?: Partial<Omit<SchemaField, "type">>): (name: string) => SchemaField & {
49
- field?: string | undefined;
50
- displayName: string | null;
51
- tags?: string[] | null | undefined;
52
- system?: boolean | null | undefined;
53
- collection?: boolean | null | undefined;
54
- onlyForTypes?: string[] | null | undefined;
55
- required?: boolean | null | undefined;
56
- defaultValue?: any;
57
- isTypeField?: boolean | null | undefined;
58
- searchable?: boolean | null | undefined;
59
- options?: FieldOption[] | null | undefined;
60
- restrictions?: import("./types").SchemaRestrictions | null | undefined;
61
- type: FieldType.Int;
62
- };
63
- export declare function boolField(displayName: string, options?: Partial<Omit<SchemaField, "type">>): (name: string) => SchemaField & {
64
- field?: string | undefined;
65
- displayName: string | null;
66
- tags?: string[] | null | undefined;
67
- system?: boolean | null | undefined;
68
- collection?: boolean | null | undefined;
69
- onlyForTypes?: string[] | null | undefined;
70
- required?: boolean | null | undefined;
71
- defaultValue?: any;
72
- isTypeField?: boolean | null | undefined;
73
- searchable?: boolean | null | undefined;
74
- options?: FieldOption[] | null | undefined;
75
- restrictions?: import("./types").SchemaRestrictions | null | undefined;
76
- type: FieldType.Bool;
77
- };
78
- export declare function compoundField<Other extends Partial<Omit<CompoundField, "type" | "schemaType">>>(displayName: string, fields: SchemaField[], other: Other): (name: string) => CompoundField & {
79
- collection: Other["collection"];
80
- };
81
- export declare function defaultScalarField(field: string, displayName: string): Omit<SchemaField, "type"> & {
82
- type: FieldType.String;
83
- };
84
- export declare function defaultCompoundField(field: string, displayName: string, collection: boolean): CompoundField & {
85
- type: FieldType.Compound;
86
- };
87
- export {};
1
+ import { CompoundField, FieldOption, FieldType, SchemaField } from "./types";
2
+ type AllowedSchema<T> = T extends string ? SchemaField & {
3
+ type: FieldType.String | FieldType.Date | FieldType.DateTime;
4
+ } : T extends number ? SchemaField & {
5
+ type: FieldType.Int | FieldType.Double;
6
+ } : T extends boolean ? SchemaField & {
7
+ type: FieldType.Bool;
8
+ } : T extends Array<infer E> ? AllowedSchema<E> & {
9
+ collection: true;
10
+ } : T extends {
11
+ [key: string]: any;
12
+ } ? CompoundField & {
13
+ type: FieldType.Compound;
14
+ } : SchemaField & {
15
+ type: FieldType.Any;
16
+ };
17
+ type AllowedField<T, K> = (name: string) => (SchemaField & {
18
+ type: K;
19
+ }) | AllowedSchema<T>;
20
+ export declare function buildSchema<T, Custom = "">(def: {
21
+ [K in keyof T]-?: AllowedField<T[K], Custom>;
22
+ }): SchemaField[];
23
+ export declare function stringField(displayName: string, options?: Partial<Omit<SchemaField, "type">>): (name: string) => SchemaField & {
24
+ field?: string | undefined;
25
+ displayName: string | null;
26
+ tags?: string[] | null | undefined;
27
+ system?: boolean | null | undefined;
28
+ collection?: boolean | null | undefined;
29
+ onlyForTypes?: string[] | null | undefined;
30
+ required?: boolean | null | undefined;
31
+ defaultValue?: any;
32
+ isTypeField?: boolean | null | undefined;
33
+ searchable?: boolean | null | undefined;
34
+ options?: FieldOption[] | null | undefined;
35
+ restrictions?: import("./types").SchemaRestrictions | null | undefined;
36
+ type: FieldType.String;
37
+ };
38
+ export declare function stringOptionsField(displayName: string, ...options: FieldOption[]): (name: string) => SchemaField & {
39
+ type: FieldType.String;
40
+ displayName: string;
41
+ options: FieldOption[];
42
+ };
43
+ export declare function withScalarOptions<S extends SchemaField>(options: Partial<SchemaField>, v: (name: string) => S): (name: string) => S;
44
+ export declare function makeScalarField<S extends Partial<SchemaField>>(options: S): (name: string) => SchemaField & S;
45
+ export declare function makeCompoundField<S extends Partial<CompoundField>>(options: S): (name: string) => CompoundField & {
46
+ type: FieldType.Compound;
47
+ } & S;
48
+ export declare function intField(displayName: string, options?: Partial<Omit<SchemaField, "type">>): (name: string) => SchemaField & {
49
+ field?: string | undefined;
50
+ displayName: string | null;
51
+ tags?: string[] | null | undefined;
52
+ system?: boolean | null | undefined;
53
+ collection?: boolean | null | undefined;
54
+ onlyForTypes?: string[] | null | undefined;
55
+ required?: boolean | null | undefined;
56
+ defaultValue?: any;
57
+ isTypeField?: boolean | null | undefined;
58
+ searchable?: boolean | null | undefined;
59
+ options?: FieldOption[] | null | undefined;
60
+ restrictions?: import("./types").SchemaRestrictions | null | undefined;
61
+ type: FieldType.Int;
62
+ };
63
+ export declare function boolField(displayName: string, options?: Partial<Omit<SchemaField, "type">>): (name: string) => SchemaField & {
64
+ field?: string | undefined;
65
+ displayName: string | null;
66
+ tags?: string[] | null | undefined;
67
+ system?: boolean | null | undefined;
68
+ collection?: boolean | null | undefined;
69
+ onlyForTypes?: string[] | null | undefined;
70
+ required?: boolean | null | undefined;
71
+ defaultValue?: any;
72
+ isTypeField?: boolean | null | undefined;
73
+ searchable?: boolean | null | undefined;
74
+ options?: FieldOption[] | null | undefined;
75
+ restrictions?: import("./types").SchemaRestrictions | null | undefined;
76
+ type: FieldType.Bool;
77
+ };
78
+ export declare function compoundField<Other extends Partial<Omit<CompoundField, "type" | "schemaType">>>(displayName: string, fields: SchemaField[], other: Other): (name: string) => CompoundField & {
79
+ collection: Other["collection"];
80
+ };
81
+ export declare function defaultScalarField(field: string, displayName: string): Omit<SchemaField, "type"> & {
82
+ type: FieldType.String;
83
+ };
84
+ export declare function defaultCompoundField(field: string, displayName: string, collection: boolean): CompoundField & {
85
+ type: FieldType.Compound;
86
+ };
87
+ export {};
@@ -0,0 +1,2 @@
1
+ import { DefaultRendererOptions } from "./renderers";
2
+ export declare const defaultTailwindTheme: DefaultRendererOptions;