@diagonal-hq/cli 0.0.0-stage → 0.2.0

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.
@@ -0,0 +1,416 @@
1
+ // Generated by `artisan app:generate-custom-typescript` from VariableType. Do not edit.
2
+ // The field builders of defineResource, one for each resource field type, and the data API endpoints.
3
+
4
+ import type { StaticValue } from './index';
5
+
6
+ export type FieldType = "boolean" | "color" | "content" | "date" | "datetime" | "dictionary" | "email" | "event_schedule" | "file_reference" | "liquid" | "list" | "location" | "markdown" | "money" | "number" | "password" | "phone" | "recurrence" | "regular_hours" | "relation" | "resource_reference" | "select" | "text" | "time" | "timezone" | "url" | "uuid" | "wallet_accounting_account" | "wallet_accounting_entity";
7
+
8
+ /** A switch of `dataApi.endpoints` in defineResource. */
9
+ export type DataApiEndpoint = "analytics_distribution" | "analytics_kpi" | "analytics_leaderboard" | "analytics_time_series" | "count" | "create" | "create_many" | "create_many_from_file" | "delete" | "delete_many" | "export" | "index" | "restore" | "search" | "show" | "update" | "update_many" | "upsert" | "upsert_many";
10
+
11
+ /** A declarative resolver tree, for example `{ $type: 'text.slugify', $value: { ... } }`. */
12
+ export type Resolver = { readonly $type: string; readonly $value?: StaticValue };
13
+
14
+ /** One nested field of a list or dictionary schema. */
15
+ export type FieldSchemaDefinition = {
16
+ key: string;
17
+ type: FieldType;
18
+ label?: string;
19
+ description?: string | null;
20
+ guard?: readonly string[];
21
+ value?: StaticValue;
22
+ settings?: { readonly schema?: FieldSchemaSetting; readonly [setting: string]: StaticValue | FieldSchemaSetting | undefined };
23
+ };
24
+
25
+ /** A dictionary schema lists its keys. A list schema is one item definition, or a tuple of definitions. */
26
+ export type FieldSchemaSetting = FieldSchemaDefinition | readonly FieldSchemaDefinition[];
27
+
28
+ export type CommonFieldSettings = {
29
+ "seed_type"?: string | null;
30
+ "faker_method"?: string | null;
31
+ "faker_parameters"?: readonly StaticValue[] | null;
32
+ "seed_data"?: readonly StaticValue[] | null;
33
+ };
34
+
35
+ export type FieldDefinition<TType extends FieldType = FieldType> = {
36
+ readonly $field: TType;
37
+ };
38
+
39
+ type BaseFieldOptions<TSettings> = {
40
+ label?: string;
41
+ description?: string | null;
42
+ /** Adds the `required` guard. Without it the field is nullable. */
43
+ required?: boolean;
44
+ /** Further validation rules, for example `['max:255']`. */
45
+ guard?: readonly string[];
46
+ /** The value of a new record. It does not backfill records. */
47
+ default?: StaticValue;
48
+ /** Writes `settings.unique` and a unique index. */
49
+ unique?: boolean;
50
+ /** Adds a non-unique single-field index. */
51
+ index?: boolean;
52
+ /** A read-time resolver. The field becomes virtual: it is not stored, indexed, or writable. */
53
+ computed?: Resolver;
54
+ /** Transforms the stored value when it is read. */
55
+ getter?: Resolver;
56
+ /** Computes the stored value before each create and update. */
57
+ setter?: Resolver;
58
+ /** Runs the setter only when the value is null or an empty string. */
59
+ setterWhenEmpty?: boolean;
60
+ settings?: TSettings;
61
+ };
62
+
63
+ export type BooleanFieldSettings = CommonFieldSettings & {
64
+ "yes_label"?: string | null;
65
+ "no_label"?: string | null;
66
+ ui?: {
67
+ field_type?: "boolean" | null;
68
+ "show_on_creating"?: boolean | null;
69
+ "show_on_updating"?: boolean | null;
70
+ "placeholder"?: string | null;
71
+ };
72
+ };
73
+
74
+ export type ColorFieldSettings = CommonFieldSettings & {
75
+ ui?: {
76
+ field_type?: "color" | null;
77
+ "show_on_creating"?: boolean | null;
78
+ "show_on_updating"?: boolean | null;
79
+ "placeholder"?: string | null;
80
+ };
81
+ };
82
+
83
+ export type ContentFieldSettings = CommonFieldSettings & {
84
+ "multi_line"?: boolean | null;
85
+ "extensions"?: {
86
+ "bold"?: boolean | null;
87
+ "italic"?: boolean | null;
88
+ "strike"?: boolean | null;
89
+ "underline"?: boolean | null;
90
+ "link"?: boolean | null;
91
+ };
92
+ "allowed_nodes"?: {
93
+ "heading"?: boolean | null;
94
+ "blockquote"?: boolean | null;
95
+ "bulletList"?: boolean | null;
96
+ "orderedList"?: boolean | null;
97
+ "media"?: boolean | null;
98
+ };
99
+ "placeholder"?: string | null;
100
+ ui?: {
101
+ field_type?: "content" | null;
102
+ "show_on_creating"?: boolean | null;
103
+ "show_on_updating"?: boolean | null;
104
+ "placeholder"?: string | null;
105
+ };
106
+ };
107
+
108
+ export type DateFieldSettings = CommonFieldSettings & {
109
+ ui?: {
110
+ field_type?: "date" | null;
111
+ "show_on_creating"?: boolean | null;
112
+ "show_on_updating"?: boolean | null;
113
+ "placeholder"?: string | null;
114
+ "display_format"?: "MMMM d, yyyy" | "MMM d, yyyy" | "MM/dd/yyyy" | "yyyy-MM-dd" | null;
115
+ };
116
+ };
117
+
118
+ export type DatetimeFieldSettings = CommonFieldSettings & {
119
+ ui?: {
120
+ field_type?: "datetime" | null;
121
+ "show_on_creating"?: boolean | null;
122
+ "show_on_updating"?: boolean | null;
123
+ "placeholder"?: string | null;
124
+ "display_format"?: "MMMM d, yyyy h:mm a" | "MMM d, yyyy h:mm a" | "MM/dd/yyyy h:mm a" | "yyyy-MM-dd'T'HH:mm:ss" | null;
125
+ };
126
+ };
127
+
128
+ export type DictionaryFieldSettings = CommonFieldSettings & {
129
+ "schema": FieldSchemaSetting;
130
+ ui?: {
131
+ field_type?: "dictionary" | "json" | null;
132
+ "show_on_creating"?: boolean | null;
133
+ "show_on_updating"?: boolean | null;
134
+ "placeholder"?: string | null;
135
+ };
136
+ };
137
+
138
+ export type EmailFieldSettings = CommonFieldSettings & {
139
+ ui?: {
140
+ field_type?: "text" | null;
141
+ "show_on_creating"?: boolean | null;
142
+ "show_on_updating"?: boolean | null;
143
+ "placeholder"?: string | null;
144
+ };
145
+ };
146
+
147
+ export type EventScheduleFieldSettings = CommonFieldSettings & {
148
+ ui?: {
149
+ field_type?: "event_schedule" | null;
150
+ "show_on_creating"?: boolean | null;
151
+ "show_on_updating"?: boolean | null;
152
+ "placeholder"?: string | null;
153
+ };
154
+ };
155
+
156
+ export type FileReferenceFieldSettings = CommonFieldSettings & {
157
+ "accept"?: unknown[] | null;
158
+ "visibility"?: "private" | "public" | null;
159
+ ui?: {
160
+ field_type?: "file" | null;
161
+ "show_on_creating"?: boolean | null;
162
+ "show_on_updating"?: boolean | null;
163
+ "placeholder"?: string | null;
164
+ };
165
+ };
166
+
167
+ export type LiquidFieldSettings = CommonFieldSettings & {
168
+ ui?: {
169
+ field_type?: "code" | null;
170
+ "show_on_creating"?: boolean | null;
171
+ "show_on_updating"?: boolean | null;
172
+ "placeholder"?: string | null;
173
+ };
174
+ };
175
+
176
+ export type ListFieldSettings = CommonFieldSettings & {
177
+ "schema": FieldSchemaSetting;
178
+ ui?: {
179
+ field_type?: "list" | "combobox" | "resource_field" | null;
180
+ "show_on_creating"?: boolean | null;
181
+ "show_on_updating"?: boolean | null;
182
+ "placeholder"?: string | null;
183
+ };
184
+ };
185
+
186
+ export type LocationFieldSettings = CommonFieldSettings & {
187
+ ui?: {
188
+ field_type?: "location" | null;
189
+ "show_on_creating"?: boolean | null;
190
+ "show_on_updating"?: boolean | null;
191
+ "placeholder"?: string | null;
192
+ "display_format"?: "formatted_address" | "map" | null;
193
+ };
194
+ };
195
+
196
+ export type MarkdownFieldSettings = CommonFieldSettings & {
197
+ "allowed_marks"?: Array<string> | null;
198
+ "allowed_blocks"?: Array<string> | null;
199
+ ui?: {
200
+ field_type?: "markdown" | null;
201
+ "show_on_creating"?: boolean | null;
202
+ "show_on_updating"?: boolean | null;
203
+ "placeholder"?: string | null;
204
+ "show_formatting_toolbar"?: boolean | null;
205
+ "toolbar_placement"?: "floating" | "fixed" | null;
206
+ };
207
+ };
208
+
209
+ export type MoneyFieldSettings = CommonFieldSettings & {
210
+ ui?: {
211
+ field_type?: "money" | null;
212
+ "show_on_creating"?: boolean | null;
213
+ "show_on_updating"?: boolean | null;
214
+ "placeholder"?: string | null;
215
+ };
216
+ };
217
+
218
+ export type NumberFieldSettings = CommonFieldSettings & {
219
+ "integer"?: boolean | null;
220
+ "minimum"?: number | null;
221
+ "maximum"?: number | null;
222
+ ui?: {
223
+ field_type?: "number" | "rating" | null;
224
+ "show_on_creating"?: boolean | null;
225
+ "show_on_updating"?: boolean | null;
226
+ "placeholder"?: string | null;
227
+ };
228
+ };
229
+
230
+ export type PasswordFieldSettings = CommonFieldSettings & {
231
+ ui?: {
232
+ field_type?: "password" | "text" | null;
233
+ "show_on_creating"?: boolean | null;
234
+ "show_on_updating"?: boolean | null;
235
+ "placeholder"?: string | null;
236
+ };
237
+ };
238
+
239
+ export type PhoneFieldSettings = CommonFieldSettings & {
240
+ ui?: {
241
+ field_type?: "phone" | null;
242
+ "show_on_creating"?: boolean | null;
243
+ "show_on_updating"?: boolean | null;
244
+ "placeholder"?: string | null;
245
+ };
246
+ };
247
+
248
+ export type RecurrenceFieldSettings = CommonFieldSettings & {
249
+ ui?: {
250
+ field_type?: "recurrence" | null;
251
+ "show_on_creating"?: boolean | null;
252
+ "show_on_updating"?: boolean | null;
253
+ "placeholder"?: string | null;
254
+ };
255
+ };
256
+
257
+ export type RegularHoursFieldSettings = CommonFieldSettings & {
258
+ ui?: {
259
+ field_type?: "regular_hours" | null;
260
+ "show_on_creating"?: boolean | null;
261
+ "show_on_updating"?: boolean | null;
262
+ "placeholder"?: string | null;
263
+ };
264
+ };
265
+
266
+ export type RelationFieldSettings = CommonFieldSettings & {
267
+ "filters"?: Record<string, unknown> | null;
268
+ "delete_policy"?: "cascade" | "ignore" | "restrict" | "set_null" | null;
269
+ /** The relation field that the build adds to the target resource. */
270
+ inverse?: RelationInverse | null;
271
+ ui?: {
272
+ field_type?: "relation" | null;
273
+ "allow_inline_create_on_creating"?: boolean | null;
274
+ "allow_inline_attach_on_creating"?: boolean | null;
275
+ "allow_inline_create_on_updating"?: boolean | null;
276
+ "allow_inline_attach_on_updating"?: boolean | null;
277
+ "placeholder"?: string | null;
278
+ };
279
+ };
280
+
281
+ export type ResourceReferenceFieldSettings = CommonFieldSettings & {
282
+ ui?: {
283
+ field_type?: "resource" | null;
284
+ "show_on_creating"?: boolean | null;
285
+ "show_on_updating"?: boolean | null;
286
+ "placeholder"?: string | null;
287
+ };
288
+ };
289
+
290
+ export type SelectFieldSettings = CommonFieldSettings & {
291
+ ui?: {
292
+ field_type?: "select" | "inline_select" | null;
293
+ "show_on_creating"?: boolean | null;
294
+ "show_on_updating"?: boolean | null;
295
+ "placeholder"?: string | null;
296
+ };
297
+ };
298
+
299
+ export type TextFieldSettings = CommonFieldSettings & {
300
+ ui?: {
301
+ field_type?: "text" | "textarea" | "code" | "icon" | null;
302
+ "show_on_creating"?: boolean | null;
303
+ "show_on_updating"?: boolean | null;
304
+ "placeholder"?: string | null;
305
+ };
306
+ };
307
+
308
+ export type TimeFieldSettings = CommonFieldSettings & {
309
+ ui?: {
310
+ field_type?: "time" | null;
311
+ "show_on_creating"?: boolean | null;
312
+ "show_on_updating"?: boolean | null;
313
+ "placeholder"?: string | null;
314
+ "display_format"?: "h:mm a" | "HH:mm" | null;
315
+ };
316
+ };
317
+
318
+ export type TimezoneFieldSettings = CommonFieldSettings & {
319
+ ui?: {
320
+ field_type?: "timezone" | null;
321
+ "show_on_creating"?: boolean | null;
322
+ "show_on_updating"?: boolean | null;
323
+ "placeholder"?: string | null;
324
+ };
325
+ };
326
+
327
+ export type UrlFieldSettings = CommonFieldSettings & {
328
+ ui?: {
329
+ field_type?: "url" | null;
330
+ "show_on_creating"?: boolean | null;
331
+ "show_on_updating"?: boolean | null;
332
+ "placeholder"?: string | null;
333
+ };
334
+ };
335
+
336
+ export type UuidFieldSettings = CommonFieldSettings & {
337
+ ui?: {
338
+ field_type?: "text" | null;
339
+ "show_on_creating"?: boolean | null;
340
+ "show_on_updating"?: boolean | null;
341
+ "placeholder"?: string | null;
342
+ };
343
+ };
344
+
345
+ export type WalletAccountingAccountFieldSettings = CommonFieldSettings & {
346
+ ui?: {
347
+ field_type?: "wallet_accounting_account" | null;
348
+ "show_on_creating"?: boolean | null;
349
+ "show_on_updating"?: boolean | null;
350
+ "placeholder"?: string | null;
351
+ };
352
+ };
353
+
354
+ export type WalletAccountingEntityFieldSettings = CommonFieldSettings & {
355
+ ui?: {
356
+ field_type?: "wallet_accounting_entity" | null;
357
+ "show_on_creating"?: boolean | null;
358
+ "show_on_updating"?: boolean | null;
359
+ "placeholder"?: string | null;
360
+ };
361
+ };
362
+
363
+ /**
364
+ * The inverse of a relation. It points back at the resource that declares it,
365
+ * and its relation type is the inverse of the declaring relation type.
366
+ */
367
+ export type RelationInverse = {
368
+ key: string;
369
+ label?: string;
370
+ description?: string | null;
371
+ settings?: Omit<RelationFieldSettings, 'inverse'> & { "max_connections"?: number | null };
372
+ };
373
+
374
+ /** A relation names its target resource by id or slug. The type defaults to `belongs_to`. */
375
+ export type RelationFieldOptions = Omit<BaseFieldOptions<RelationFieldSettings>, 'settings'> & { resource: string } & (
376
+ | { type?: "belongs_to"; settings?: RelationFieldSettings }
377
+ | { type: "belongs_to_many"; settings?: RelationFieldSettings & { "max_connections"?: number | null } }
378
+ | { type: "has_many"; settings?: RelationFieldSettings & { "max_connections"?: number | null } }
379
+ | { type: "has_one"; settings?: RelationFieldSettings }
380
+ );
381
+
382
+ export declare const field: {
383
+ boolean(options?: BaseFieldOptions<BooleanFieldSettings>): FieldDefinition<"boolean">;
384
+ color(options?: BaseFieldOptions<ColorFieldSettings>): FieldDefinition<"color">;
385
+ content(options?: BaseFieldOptions<ContentFieldSettings>): FieldDefinition<"content">;
386
+ date(options?: BaseFieldOptions<DateFieldSettings>): FieldDefinition<"date">;
387
+ datetime(options?: BaseFieldOptions<DatetimeFieldSettings>): FieldDefinition<"datetime">;
388
+ dictionary(options: Omit<BaseFieldOptions<DictionaryFieldSettings>, 'settings'> & { settings: DictionaryFieldSettings }): FieldDefinition<"dictionary">;
389
+ email(options?: BaseFieldOptions<EmailFieldSettings>): FieldDefinition<"email">;
390
+ eventSchedule(options?: BaseFieldOptions<EventScheduleFieldSettings>): FieldDefinition<"event_schedule">;
391
+ /** Stored as a `file_reference` field. */
392
+ file(options?: BaseFieldOptions<FileReferenceFieldSettings>): FieldDefinition<"file_reference">;
393
+ fileReference(options?: BaseFieldOptions<FileReferenceFieldSettings>): FieldDefinition<"file_reference">;
394
+ liquid(options?: BaseFieldOptions<LiquidFieldSettings>): FieldDefinition<"liquid">;
395
+ list(options: Omit<BaseFieldOptions<ListFieldSettings>, 'settings'> & { settings: ListFieldSettings }): FieldDefinition<"list">;
396
+ location(options?: BaseFieldOptions<LocationFieldSettings>): FieldDefinition<"location">;
397
+ /** Stored as a `text` field. */
398
+ longText(options?: BaseFieldOptions<TextFieldSettings>): FieldDefinition<"text">;
399
+ markdown(options?: BaseFieldOptions<MarkdownFieldSettings>): FieldDefinition<"markdown">;
400
+ money(options?: BaseFieldOptions<MoneyFieldSettings>): FieldDefinition<"money">;
401
+ number(options?: BaseFieldOptions<NumberFieldSettings>): FieldDefinition<"number">;
402
+ password(options?: BaseFieldOptions<PasswordFieldSettings>): FieldDefinition<"password">;
403
+ phone(options?: BaseFieldOptions<PhoneFieldSettings>): FieldDefinition<"phone">;
404
+ recurrence(options?: BaseFieldOptions<RecurrenceFieldSettings>): FieldDefinition<"recurrence">;
405
+ regularHours(options?: BaseFieldOptions<RegularHoursFieldSettings>): FieldDefinition<"regular_hours">;
406
+ relation(options: RelationFieldOptions): FieldDefinition<"relation">;
407
+ resourceReference(options?: BaseFieldOptions<ResourceReferenceFieldSettings>): FieldDefinition<"resource_reference">;
408
+ select(options: BaseFieldOptions<SelectFieldSettings> & { options: readonly { label: string; value: string; color?: string | null }[] }): FieldDefinition<"select">;
409
+ text(options?: BaseFieldOptions<TextFieldSettings>): FieldDefinition<"text">;
410
+ time(options?: BaseFieldOptions<TimeFieldSettings>): FieldDefinition<"time">;
411
+ timezone(options?: BaseFieldOptions<TimezoneFieldSettings>): FieldDefinition<"timezone">;
412
+ url(options?: BaseFieldOptions<UrlFieldSettings>): FieldDefinition<"url">;
413
+ uuid(options?: BaseFieldOptions<UuidFieldSettings>): FieldDefinition<"uuid">;
414
+ walletAccountingAccount(options?: BaseFieldOptions<WalletAccountingAccountFieldSettings>): FieldDefinition<"wallet_accounting_account">;
415
+ walletAccountingEntity(options?: BaseFieldOptions<WalletAccountingEntityFieldSettings>): FieldDefinition<"wallet_accounting_entity">;
416
+ };
@@ -0,0 +1,35 @@
1
+ // Generated by `artisan app:generate-custom-typescript` from VariableType. Do not edit.
2
+
3
+ export const field = {
4
+ boolean: (options = {}) => ({ $field: "boolean", ...options }),
5
+ color: (options = {}) => ({ $field: "color", ...options }),
6
+ content: (options = {}) => ({ $field: "content", ...options }),
7
+ date: (options = {}) => ({ $field: "date", ...options }),
8
+ datetime: (options = {}) => ({ $field: "datetime", ...options }),
9
+ dictionary: (options = {}) => ({ $field: "dictionary", ...options }),
10
+ email: (options = {}) => ({ $field: "email", ...options }),
11
+ eventSchedule: (options = {}) => ({ $field: "event_schedule", ...options }),
12
+ file: (options = {}) => ({ $field: "file_reference", ...options }),
13
+ fileReference: (options = {}) => ({ $field: "file_reference", ...options }),
14
+ liquid: (options = {}) => ({ $field: "liquid", ...options }),
15
+ list: (options = {}) => ({ $field: "list", ...options }),
16
+ location: (options = {}) => ({ $field: "location", ...options }),
17
+ longText: (options = {}) => ({ $field: "text", ...options }),
18
+ markdown: (options = {}) => ({ $field: "markdown", ...options }),
19
+ money: (options = {}) => ({ $field: "money", ...options }),
20
+ number: (options = {}) => ({ $field: "number", ...options }),
21
+ password: (options = {}) => ({ $field: "password", ...options }),
22
+ phone: (options = {}) => ({ $field: "phone", ...options }),
23
+ recurrence: (options = {}) => ({ $field: "recurrence", ...options }),
24
+ regularHours: (options = {}) => ({ $field: "regular_hours", ...options }),
25
+ relation: (options = {}) => ({ $field: "relation", ...options }),
26
+ resourceReference: (options = {}) => ({ $field: "resource_reference", ...options }),
27
+ select: (options = {}) => ({ $field: "select", ...options }),
28
+ text: (options = {}) => ({ $field: "text", ...options }),
29
+ time: (options = {}) => ({ $field: "time", ...options }),
30
+ timezone: (options = {}) => ({ $field: "timezone", ...options }),
31
+ url: (options = {}) => ({ $field: "url", ...options }),
32
+ uuid: (options = {}) => ({ $field: "uuid", ...options }),
33
+ walletAccountingAccount: (options = {}) => ({ $field: "wallet_accounting_account", ...options }),
34
+ walletAccountingEntity: (options = {}) => ({ $field: "wallet_accounting_entity", ...options }),
35
+ };
@@ -0,0 +1,72 @@
1
+ // The `Sdk` and `React` globals of page, layout, component, and email files.
2
+ // The same types that the deploy type check uses.
3
+ /// <reference path="./sdk-contract.d.ts" />
4
+ declare namespace React {
5
+ type ReactNode = RenderableChild;
6
+ type ReactElement = any;
7
+ type ComponentType<P = any> = (props: P) => any;
8
+ type FC<P = any> = (props: P & { children?: RenderableChild }) => any;
9
+ type PropsWithChildren<P = unknown> = P & { children?: RenderableChild };
10
+ type CSSProperties = { [property: string]: any };
11
+ type RefObject<T = any> = { current: T };
12
+ type MutableRefObject<T = any> = { current: T };
13
+ type Ref<T = any> = ((instance: T | null) => void) | RefObject<T | null> | null;
14
+ type Dispatch<A = any> = (value: A) => void;
15
+ type SetStateAction<S = any> = S | ((previousState: S) => S);
16
+ type DependencyList = readonly unknown[];
17
+ type ChangeEvent<T = any> = any;
18
+ type FormEvent<T = any> = any;
19
+ type MouseEvent<T = any> = any;
20
+ type KeyboardEvent<T = any> = any;
21
+ type FocusEvent<T = any> = any;
22
+ }
23
+ interface DiagonalReactGlobal {
24
+ useState(initialState: null): [any, React.Dispatch<React.SetStateAction<any>>];
25
+ useState(initialState: never[]): [any[], React.Dispatch<React.SetStateAction<any[]>>];
26
+ useState<S>(initialState: S | (() => S)): [S, React.Dispatch<React.SetStateAction<S>>];
27
+ useState<S = undefined>(): [S | undefined, React.Dispatch<React.SetStateAction<S | undefined>>];
28
+ useEffect(effect: () => any, deps?: React.DependencyList): void;
29
+ useLayoutEffect(effect: () => any, deps?: React.DependencyList): void;
30
+ useMemo<T>(factory: () => T, deps?: React.DependencyList): T;
31
+ useCallback<T extends (...args: any[]) => any>(callback: T, deps?: React.DependencyList): T;
32
+ useRef<T>(initialValue: T): React.RefObject<T>;
33
+ useRef<T>(initialValue: T | null): React.RefObject<T | null>;
34
+ useRef<T>(initialValue: T | undefined): React.RefObject<T | undefined>;
35
+ useReducer<S, A>(reducer: (state: S, action: A) => S, initialState: S): [S, React.Dispatch<A>];
36
+ useReducer<S, A, I>(
37
+ reducer: (state: S, action: A) => S,
38
+ initializerArg: I,
39
+ initializer: (arg: I) => S
40
+ ): [S, React.Dispatch<A>];
41
+ useContext<T = any>(context: unknown): T;
42
+ useId(): string;
43
+ useTransition(): [boolean, (callback: () => void) => void];
44
+ useDeferredValue<T>(value: T): T;
45
+ memo<T>(component: T, arePropsEqual?: (previous: any, next: any) => boolean): T;
46
+ forwardRef<T = any, P = any>(
47
+ render: (props: P, ref: React.Ref<T>) => any
48
+ ): (props: P & { ref?: React.Ref<T> }) => any;
49
+ [member: string]: any;
50
+ }
51
+ declare const React: DiagonalReactGlobal;
52
+ declare namespace JSX {
53
+ type Element = any;
54
+ interface ElementChildrenAttribute { children: {}; }
55
+ interface IntrinsicAttributes { key?: any; }
56
+ interface IntrinsicElements { [name: string]: { [attribute: string]: any; children?: RenderableChild }; }
57
+ }
58
+ type RenderableChild =
59
+ | string
60
+ | number
61
+ | bigint
62
+ | boolean
63
+ | null
64
+ | undefined
65
+ | Iterable<RenderableChild>
66
+ | Promise<RenderableChild>;
67
+
68
+ // The editor does not know the workspace components, so any Sdk.Custom name is allowed.
69
+ declare module "diagonal:sdk-internal" {
70
+ interface CustomComponentRegistry { [key: string]: SdkComponent }
71
+ }
72
+