|
6 | 6 | * LICENSE file in the root directory of this source tree. |
7 | 7 | */ |
8 | 8 |
|
9 | | -// Note: Types from @objectstack/spec would be imported here when available |
10 | | -// import type { FieldType as ProtocolFieldType, Field, SelectOption as SpecSelectOption } from '@objectstack/spec'; |
| 9 | +// Import protocol types from @objectstack/spec |
| 10 | +import type { |
| 11 | + FieldType as ProtocolFieldType, |
| 12 | + Field, |
| 13 | + SelectOption as SpecSelectOption |
| 14 | +} from '@objectstack/spec'; |
11 | 15 |
|
12 | 16 | /** |
13 | 17 | * Re-export Protocol Types from the Constitution |
14 | 18 | * These are the wire-protocol standard types defined in @objectstack/spec |
15 | | - * TODO: Re-enable when @objectstack/spec is available |
16 | | - */ |
17 | | -// export type { Field as SpecField, SpecSelectOption, ProtocolFieldType }; |
18 | | - |
19 | | -/** |
20 | | - * Protocol Field Types (stub definitions until @objectstack/spec is available) |
21 | | - * These match the core field types from the ObjectStack specification |
22 | | - */ |
23 | | -type ProtocolFieldType = |
24 | | - | 'text' |
25 | | - | 'textarea' |
26 | | - | 'number' |
27 | | - | 'boolean' |
28 | | - | 'date' |
29 | | - | 'datetime' |
30 | | - | 'time' |
31 | | - | 'select' |
32 | | - | 'lookup' |
33 | | - | 'master_detail' |
34 | | - | 'formula' |
35 | | - | 'summary' |
36 | | - | 'autonumber' |
37 | | - | 'url' |
38 | | - | 'email' |
39 | | - | 'phone' |
40 | | - | 'currency' |
41 | | - | 'percent' |
42 | | - | 'markdown' |
43 | | - | 'html' |
44 | | - | 'password' |
45 | | - | 'file' |
46 | | - | 'image'; |
47 | | - |
48 | | -/** |
49 | | - * Base Field interface (stub definition until @objectstack/spec is available) |
| 19 | + * |
| 20 | + * @deprecated Import directly from @objectstack/spec instead |
50 | 21 | */ |
51 | | -interface Field { |
52 | | - name: string; |
53 | | - label: string; |
54 | | - type: string; |
55 | | - description?: string; |
56 | | - options?: Array<{label: string; value: string}>; |
57 | | - required?: boolean; |
58 | | - multiple?: boolean; |
59 | | - unique?: boolean; |
60 | | - deleteBehavior?: string; |
61 | | - hidden?: boolean; |
62 | | - readonly?: boolean; |
63 | | - encryption?: boolean; |
64 | | - index?: boolean; |
65 | | - externalId?: boolean; |
66 | | - searchable?: boolean; |
67 | | - defaultValue?: any; |
68 | | - maxLength?: number; |
69 | | - minLength?: number; |
70 | | - min?: number; |
71 | | - max?: number; |
72 | | - precision?: number; |
73 | | - scale?: number; |
74 | | - formula?: string; |
75 | | - reference?: string; |
76 | | - referenceFilters?: any; |
77 | | - writeRequiresMasterRead?: boolean; |
78 | | - expression?: string; |
79 | | - summaryOperations?: string[]; |
80 | | -} |
| 22 | +export type { Field as SpecField, SpecSelectOption, ProtocolFieldType }; |
81 | 23 |
|
82 | 24 | /** |
83 | 25 | * RUNTIME-SPECIFIC TYPES |
|
0 commit comments