@raycast/api 1.26.2 → 1.28.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.
Files changed (88) hide show
  1. package/bin/arm64/ray +0 -0
  2. package/bin/x86/ray +0 -0
  3. package/package.json +3 -3
  4. package/types/api/app/app.d.ts +171 -0
  5. package/types/api/app/clipboard.d.ts +47 -0
  6. package/types/api/app/index.d.ts +4 -0
  7. package/types/api/app/keyboard.d.ts +56 -0
  8. package/types/api/app/localStorage.d.ts +117 -0
  9. package/types/api/components/ActionPanel.d.ts +297 -0
  10. package/types/api/components/Detail.d.ts +40 -0
  11. package/types/api/components/Form.d.ts +992 -0
  12. package/types/api/components/List.d.ts +275 -0
  13. package/types/api/components/actions/Action.d.ts +396 -0
  14. package/types/api/components/actions/CopyToClipboardAction.d.ts +39 -0
  15. package/types/api/components/actions/OpenAction.d.ts +47 -0
  16. package/types/api/components/actions/OpenInBrowserAction.d.ts +42 -0
  17. package/types/api/components/actions/OpenWithAction.d.ts +40 -0
  18. package/types/api/components/actions/PasteAction.d.ts +39 -0
  19. package/types/api/components/actions/PushAction.d.ts +38 -0
  20. package/types/api/components/actions/ShowInFinderAction.d.ts +42 -0
  21. package/types/api/components/actions/SubmitFormAction.d.ts +34 -0
  22. package/types/api/components/actions/TrashAction.d.ts +43 -0
  23. package/types/api/components/actions/index.d.ts +1 -0
  24. package/types/api/components/index.d.ts +5 -0
  25. package/types/api/components/propTypes.d.ts +1 -0
  26. package/types/api/components/types.d.ts +30 -0
  27. package/types/api/deprecated.d.ts +410 -0
  28. package/types/api/environment/environment.d.ts +48 -0
  29. package/types/api/environment/index.d.ts +3 -0
  30. package/types/api/environment/preferences.d.ts +31 -0
  31. package/types/api/environment/workspace.d.ts +62 -0
  32. package/types/api/hooks/index.d.ts +1 -0
  33. package/types/api/hooks/useNavigation.d.ts +66 -0
  34. package/types/api/index.d.ts +6 -0
  35. package/types/api/internal/comm/index.d.ts +1 -0
  36. package/types/api/internal/components/ErrorBoundary.d.ts +1 -0
  37. package/types/api/internal/components/Navigation.d.ts +1 -0
  38. package/types/api/internal/components/Root.d.ts +1 -0
  39. package/types/api/internal/components/index.d.ts +4 -0
  40. package/types/api/internal/components/portal/components/portal/Portal.d.ts +4 -0
  41. package/types/api/internal/components/portal/components/portal/index.d.ts +1 -0
  42. package/types/api/internal/components/portal/components/portalHost/PortalHost.d.ts +4 -0
  43. package/types/api/internal/components/portal/components/portalHost/index.d.ts +1 -0
  44. package/types/api/internal/components/portal/components/portalProvider/PortalProvider.d.ts +4 -0
  45. package/types/api/internal/components/portal/components/portalProvider/index.d.ts +1 -0
  46. package/types/api/internal/components/portal/contexts/index.d.ts +1 -0
  47. package/types/api/internal/components/portal/contexts/portal.d.ts +5 -0
  48. package/types/api/internal/components/portal/hooks/index.d.ts +2 -0
  49. package/types/api/internal/components/portal/hooks/usePortal.d.ts +8 -0
  50. package/types/api/internal/components/portal/hooks/usePortalState.d.ts +1 -0
  51. package/types/api/internal/components/portal/index.d.ts +5 -0
  52. package/types/api/internal/components/portal/state/constants.d.ts +9 -0
  53. package/types/api/internal/components/portal/state/index.d.ts +3 -0
  54. package/types/api/internal/components/portal/state/reducer.d.ts +3 -0
  55. package/types/api/internal/components/portal/utilities/logger.d.ts +9 -0
  56. package/types/api/internal/devtools/index.d.ts +1 -0
  57. package/types/api/internal/devtools/react.d.ts +1 -0
  58. package/types/api/internal/hooks/index.d.ts +2 -0
  59. package/types/api/internal/hooks/useActionPanel.d.ts +1 -0
  60. package/types/api/internal/hooks/useId.d.ts +1 -0
  61. package/types/api/internal/index.d.ts +6 -0
  62. package/types/api/internal/rendering/callbacks.d.ts +1 -0
  63. package/types/api/internal/rendering/index.d.ts +5 -0
  64. package/types/api/internal/rendering/node-builders/actions.d.ts +1 -0
  65. package/types/api/internal/rendering/node-builders/detail.d.ts +1 -0
  66. package/types/api/internal/rendering/node-builders/forms.d.ts +1 -0
  67. package/types/api/internal/rendering/node-builders/keyboard.d.ts +1 -0
  68. package/types/api/internal/rendering/node-builders/list.d.ts +1 -0
  69. package/types/api/internal/rendering/node-builders/navigationStack.d.ts +1 -0
  70. package/types/api/internal/rendering/node-builders/root.d.ts +1 -0
  71. package/types/api/internal/rendering/node-builders/types.d.ts +1 -0
  72. package/types/api/internal/rendering/node-builders/utils.d.ts +1 -0
  73. package/types/api/internal/rendering/reconciler.d.ts +1 -0
  74. package/types/api/internal/rendering/renderer.d.ts +1 -0
  75. package/types/api/internal/utils/ids.d.ts +1 -0
  76. package/types/api/internal/utils/index.d.ts +1 -0
  77. package/types/api/ui/color.d.ts +115 -0
  78. package/types/api/ui/errors.d.ts +1 -0
  79. package/types/api/ui/feedback/alert.d.ts +97 -0
  80. package/types/api/ui/feedback/hud.d.ts +16 -0
  81. package/types/api/ui/feedback/index.d.ts +3 -0
  82. package/types/api/ui/feedback/toast.d.ts +171 -0
  83. package/types/api/ui/icon.d.ts +88 -0
  84. package/types/api/ui/image.d.ts +161 -0
  85. package/types/api/ui/index.d.ts +5 -0
  86. package/types/core/message-types.d.ts +17 -0
  87. package/types/core/preferences.d.ts +69 -0
  88. package/types/index.d.ts +2814 -2139
@@ -0,0 +1,992 @@
1
+ import { ReactElement, ReactNode } from "react";
2
+ import { Image } from "../ui";
3
+ import { ActionsInterface, NavigationChildInterface } from "./types";
4
+ import PropTypes from "prop-types";
5
+ /**
6
+ * Shows a list of form items such as {@link Form.TextField}, {@link Form.Checkbox} or {@link Form.Dropdown}.
7
+ */
8
+ export declare function Form(props: Form.Props): ReactElement<Form.Props>;
9
+ export declare namespace Form {
10
+ var propTypes: {
11
+ submitTitle: PropTypes.Requireable<string>;
12
+ navigationTitle: PropTypes.Requireable<string>;
13
+ isLoading: PropTypes.Requireable<boolean>;
14
+ };
15
+ var displayName: string;
16
+ }
17
+ /**
18
+ * See {@link Form.TextField}
19
+ */
20
+ declare function FormTextField(props: Form.TextField.Props): ReactElement<Form.TextField.Props>;
21
+ declare namespace FormTextField {
22
+ var propTypes: {
23
+ id: PropTypes.Validator<string>;
24
+ title: PropTypes.Requireable<string>;
25
+ storeValue: PropTypes.Requireable<boolean>;
26
+ value: PropTypes.Requireable<string>;
27
+ defaultValue: PropTypes.Requireable<string>;
28
+ placeholder: PropTypes.Requireable<string>;
29
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
30
+ };
31
+ var displayName: string;
32
+ }
33
+ /**
34
+ * See {@link Form.PasswordField}
35
+ */
36
+ declare function FormPasswordField(props: Form.PasswordField.Props): ReactElement<Form.PasswordField.Props>;
37
+ declare namespace FormPasswordField {
38
+ var propTypes: {
39
+ id: PropTypes.Validator<string>;
40
+ title: PropTypes.Requireable<string>;
41
+ storeValue: PropTypes.Requireable<boolean>;
42
+ value: PropTypes.Requireable<string>;
43
+ defaultValue: PropTypes.Requireable<string>;
44
+ placeholder: PropTypes.Requireable<string>;
45
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
46
+ };
47
+ var displayName: string;
48
+ }
49
+ /**
50
+ * See {@link Form.TextArea}
51
+ */
52
+ declare function FormTextArea(props: Form.TextArea.Props): ReactElement<Form.TextArea.Props>;
53
+ declare namespace FormTextArea {
54
+ var propTypes: {
55
+ id: PropTypes.Validator<string>;
56
+ title: PropTypes.Requireable<string>;
57
+ storeValue: PropTypes.Requireable<boolean>;
58
+ value: PropTypes.Requireable<string>;
59
+ defaultValue: PropTypes.Requireable<string>;
60
+ placeholder: PropTypes.Requireable<string>;
61
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
62
+ };
63
+ var displayName: string;
64
+ }
65
+ /**
66
+ * See {@link Form.Checkbox}
67
+ */
68
+ declare function FormCheckbox(props: Form.Checkbox.Props): ReactElement<Form.Checkbox.Props>;
69
+ declare namespace FormCheckbox {
70
+ var propTypes: {
71
+ id: PropTypes.Validator<string>;
72
+ title: PropTypes.Requireable<string>;
73
+ storeValue: PropTypes.Requireable<boolean>;
74
+ value: PropTypes.Requireable<boolean>;
75
+ defaultValue: PropTypes.Requireable<boolean>;
76
+ label: PropTypes.Requireable<string>;
77
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
78
+ };
79
+ var displayName: string;
80
+ }
81
+ /**
82
+ * See {@link Form.DatePicker}
83
+ */
84
+ declare function FormDatePicker(props: Form.DatePicker.Props): ReactElement<Form.DatePicker.Props>;
85
+ declare namespace FormDatePicker {
86
+ var propTypes: {
87
+ id: PropTypes.Validator<string>;
88
+ title: PropTypes.Requireable<string>;
89
+ storeValue: PropTypes.Requireable<boolean>;
90
+ value: PropTypes.Requireable<Date>;
91
+ defaultValue: PropTypes.Requireable<Date>;
92
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
93
+ };
94
+ var displayName: string;
95
+ }
96
+ /**
97
+ * See {@link Form.Separator}
98
+ */
99
+ declare function FormSeparator(): ReactElement<Form.Separator.Props>;
100
+ declare namespace FormSeparator {
101
+ var displayName: string;
102
+ }
103
+ /**
104
+ * See {@link Form.Description}
105
+ */
106
+ declare function FormDescription(props: Form.Description.Props): ReactElement<Form.Description.Props>;
107
+ declare namespace FormDescription {
108
+ var propTypes: {
109
+ text: PropTypes.Requireable<string>;
110
+ };
111
+ var displayName: string;
112
+ }
113
+ /**
114
+ * See {@link Form.Dropdown}
115
+ */
116
+ declare function FormDropdown(props: Form.Dropdown.Props): ReactElement<Form.Dropdown.Props>;
117
+ declare namespace FormDropdown {
118
+ var propTypes: {
119
+ id: PropTypes.Validator<string>;
120
+ title: PropTypes.Requireable<string>;
121
+ storeValue: PropTypes.Requireable<boolean>;
122
+ value: PropTypes.Requireable<string>;
123
+ defaultValue: PropTypes.Requireable<string>;
124
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
125
+ };
126
+ var displayName: string;
127
+ }
128
+ /**
129
+ * See {@link Form.Dropdown.Section}
130
+ */
131
+ declare function FormDropdownSection(props: Form.Dropdown.Section.Props): ReactElement<Form.Dropdown.Section.Props>;
132
+ declare namespace FormDropdownSection {
133
+ var propTypes: {
134
+ title: PropTypes.Requireable<string>;
135
+ };
136
+ var displayName: string;
137
+ }
138
+ /**
139
+ * See {@link Form.Dropdown.Item}
140
+ */
141
+ declare function FormDropdownItem(props: Form.Dropdown.Item.Props): ReactElement<Form.Dropdown.Item.Props>;
142
+ declare namespace FormDropdownItem {
143
+ var propTypes: {
144
+ value: PropTypes.Requireable<string>;
145
+ title: PropTypes.Validator<string>;
146
+ icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
147
+ fileIcon: PropTypes.Validator<string>;
148
+ }>> | PropTypes.InferProps<{
149
+ source: PropTypes.Requireable<string | PropTypes.InferProps<{
150
+ light: PropTypes.Validator<string>;
151
+ dark: PropTypes.Validator<string>;
152
+ }>>;
153
+ fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
154
+ light: PropTypes.Validator<string>;
155
+ dark: PropTypes.Validator<string>;
156
+ }>>;
157
+ mask: PropTypes.Requireable<Image.Mask>;
158
+ tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
159
+ light: PropTypes.Validator<string>;
160
+ dark: PropTypes.Validator<string>;
161
+ adjustContrast: PropTypes.Requireable<boolean>;
162
+ }>>;
163
+ }>>;
164
+ };
165
+ var displayName: string;
166
+ }
167
+ /**
168
+ * See {@link Form.TagPicker}
169
+ */
170
+ declare function FormTagPicker(props: Form.TagPicker.Props): ReactElement<Form.TagPicker.Props>;
171
+ declare namespace FormTagPicker {
172
+ var propTypes: {
173
+ id: PropTypes.Validator<string>;
174
+ title: PropTypes.Requireable<string>;
175
+ storeValue: PropTypes.Requireable<boolean>;
176
+ placeholder: PropTypes.Requireable<string>;
177
+ value: PropTypes.Requireable<string[]>;
178
+ defaultValue: PropTypes.Requireable<string[]>;
179
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
180
+ };
181
+ var displayName: string;
182
+ }
183
+ /**
184
+ * See {@link Form.TagPicker.Item}
185
+ */
186
+ declare function FormTagPickerItem(props: Form.TagPicker.Item.Props): ReactElement<Form.TagPicker.Item.Props>;
187
+ declare namespace FormTagPickerItem {
188
+ var propTypes: {
189
+ value: PropTypes.Validator<string>;
190
+ title: PropTypes.Validator<string>;
191
+ icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
192
+ fileIcon: PropTypes.Validator<string>;
193
+ }>> | PropTypes.InferProps<{
194
+ source: PropTypes.Requireable<string | PropTypes.InferProps<{
195
+ light: PropTypes.Validator<string>;
196
+ dark: PropTypes.Validator<string>;
197
+ }>>;
198
+ fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
199
+ light: PropTypes.Validator<string>;
200
+ dark: PropTypes.Validator<string>;
201
+ }>>;
202
+ mask: PropTypes.Requireable<Image.Mask>;
203
+ tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
204
+ light: PropTypes.Validator<string>;
205
+ dark: PropTypes.Validator<string>;
206
+ adjustContrast: PropTypes.Requireable<boolean>;
207
+ }>>;
208
+ }>>;
209
+ };
210
+ var displayName: string;
211
+ }
212
+ declare namespace FormDropdown {
213
+ /**
214
+ * Visually separated group of dropdown items.
215
+ *
216
+ * @remarks
217
+ * Use sections to group related menu items together.
218
+ *
219
+ * @example
220
+ * ```typescript
221
+ * import { ActionPanel, Form, Action } from "@raycast/api";
222
+ *
223
+ * export default function Command() {
224
+ * return (
225
+ * <Form
226
+ * actions={
227
+ * <ActionPanel>
228
+ * <Action.SubmitForm title="Submit Favorite" onSubmit={(values) => console.log(values)} />
229
+ * </ActionPanel>
230
+ * }
231
+ * >
232
+ * <Form.Dropdown id="food" title="Favorite Food">
233
+ * <Form.Dropdown.Section title="Fruits">
234
+ * <Form.Dropdown.Item value="apple" title="Apple" icon="🍎" />
235
+ * <Form.Dropdown.Item value="banana" title="Banana" icon="🍌" />
236
+ * </Form.Dropdown.Section>
237
+ * <Form.Dropdown.Section title="Vegetables">
238
+ * <Form.Dropdown.Item value="broccoli" title="Broccoli" icon="🥦" />
239
+ * <Form.Dropdown.Item value="carrot" title="Carrot" icon="🥕" />
240
+ * </Form.Dropdown.Section>
241
+ * </Form.Dropdown>
242
+ * </Form>
243
+ * );
244
+ * }
245
+ * ```
246
+ */
247
+ const Section: typeof FormDropdownSection;
248
+ /**
249
+ * A dropdown item in a {@link Form.Dropdown}
250
+ *
251
+ * @example
252
+ * ```typescript
253
+ * import { ActionPanel, Form, Action } from "@raycast/api";
254
+ *
255
+ * export default function Command() {
256
+ * return (
257
+ * <Form
258
+ * actions={
259
+ * <ActionPanel>
260
+ * <Action.SubmitForm title="Submit Icon" onSubmit={(values) => console.log(values)} />
261
+ * </ActionPanel>
262
+ * }
263
+ * >
264
+ * <Form.Dropdown id="icon" title="Icon">
265
+ * <Form.Dropdown.Item value="circle" title="Cirlce" icon={Icon.Circle} />
266
+ * </Form.Dropdown>
267
+ * </Form>
268
+ * );
269
+ * }
270
+ * ```
271
+ */
272
+ const Item: typeof FormDropdownItem;
273
+ }
274
+ declare namespace FormTagPicker {
275
+ /**
276
+ * A tag picker item in a {@link Form.TagPicker}.
277
+ *
278
+ * @example
279
+ * ```typescript
280
+ * import { ActionPanel, Color, Form, Icon, Action } from "@raycast/api";
281
+ *
282
+ * export default function Command() {
283
+ * return (
284
+ * <Form
285
+ * actions={
286
+ * <ActionPanel>
287
+ * <Action.SubmitForm title="Submit Color" onSubmit={(values) => console.log(values)} />
288
+ * </ActionPanel>
289
+ * }
290
+ * >
291
+ * <Form.TagPicker id="color" title="Color">
292
+ * <Form.TagPicker.Item value="red" title="Red" icon={{ source: Icon.Circle, tintColor: Color.Red }} />
293
+ * <Form.TagPicker.Item value="green" title="Green" icon={{ source: Icon.Circle, tintColor: Color.Green }} />
294
+ * <Form.TagPicker.Item value="blue" title="Blue" icon={{ source: Icon.Circle, tintColor: Color.Blue }} />
295
+ * </Form.TagPicker>
296
+ * </Form>
297
+ * );
298
+ * }
299
+ * ```
300
+ */
301
+ const Item: typeof FormTagPickerItem;
302
+ }
303
+ export declare namespace Form {
304
+ /**
305
+ * @deprecated Use `Form.Dropdown.Section` instead.
306
+ */
307
+ const DropdownSection: typeof FormDropdownSection;
308
+ /**
309
+ * @deprecated Use `Form.Dropdown.Item` instead.
310
+ */
311
+ const DropdownItem: typeof FormDropdownItem;
312
+ /**
313
+ * @deprecated Use `Form.TagPicker.Item` instead.
314
+ */
315
+ const TagPickerItem: typeof FormTagPickerItem;
316
+ /**
317
+ * A form item with a text field for input.
318
+ *
319
+ * @example
320
+ * Uncontrolled text field
321
+ *
322
+ * ```typescript
323
+ * import { ActionPanel, Form, Action } from "@raycast/api";
324
+ *
325
+ * export default function Command() {
326
+ * return (
327
+ * <Form
328
+ * actions={
329
+ * <ActionPanel>
330
+ * <Action.SubmitForm title="Submit Name" onSubmit={(values) => console.log(values)} />
331
+ * </ActionPanel>
332
+ * }
333
+ * >
334
+ * <Form.TextField id="name" defaultValue="Steve" />
335
+ * </Form>
336
+ * );
337
+ * }
338
+ * ```
339
+ *
340
+ * @example
341
+ * Controlled text field
342
+ *
343
+ * ```typescript
344
+ * import { ActionPanel, Form, Action } from "@raycast/api";
345
+ * import { useState } from "react";
346
+ *
347
+ * export default function Command() {
348
+ * const [name, setName] = useState<string>();
349
+ *
350
+ * return (
351
+ * <Form
352
+ * actions={
353
+ * <ActionPanel>
354
+ * <Action.SubmitForm title="Submit Name" onSubmit={(values) => console.log(values)} />
355
+ * </ActionPanel>
356
+ * }
357
+ * >
358
+ * <Form.TextField id="name" value={name} onChange={setName} />
359
+ * </Form>
360
+ * );
361
+ * }
362
+ * ```
363
+ */
364
+ const TextField: typeof FormTextField;
365
+ /**
366
+ * A form item with a text area for input.
367
+ * The item supports multiline text entry.
368
+ *
369
+ * @example
370
+ * Uncontrolled text area
371
+ *
372
+ * ```typescript
373
+ * import { ActionPanel, Form, Action } from "@raycast/api";
374
+ *
375
+ * const DESCRIPTION =
376
+ * "We spend too much time staring at loading indicators. The Raycast team is dedicated to make everybody interact faster with their computers.";
377
+ *
378
+ * export default function Command() {
379
+ * return (
380
+ * <Form
381
+ * actions={
382
+ * <ActionPanel>
383
+ * <Action.SubmitForm title="Submit Description" onSubmit={(values) => console.log(values)} />
384
+ * </ActionPanel>
385
+ * }
386
+ * >
387
+ * <Form.TextArea id="description" defaultValue={DESCRIPTION} />
388
+ * </Form>
389
+ * );
390
+ * }
391
+ * ```
392
+ *
393
+ * @example
394
+ * Controlled text area
395
+ *
396
+ * ```typescript
397
+ * import { ActionPanel, Form, Action } from "@raycast/api";
398
+ * import { useState } from "react";
399
+ *
400
+ * export default function Command() {
401
+ * const [description, setDescription] = useState<string>();
402
+ *
403
+ * return (
404
+ * <Form
405
+ * actions={
406
+ * <ActionPanel>
407
+ * <Action.SubmitForm title="Submit Description" onSubmit={(values) => console.log(values)} />
408
+ * </ActionPanel>
409
+ * }
410
+ * >
411
+ * <Form.TextArea id="description" value={description} onChange={setDescription} />
412
+ * </Form>
413
+ * );
414
+ * }
415
+ * ```
416
+ */
417
+ const TextArea: typeof FormTextArea;
418
+ /**
419
+ * A form item with a checkbox.
420
+ *
421
+ * @example
422
+ * Uncontrolled checkbox
423
+ *
424
+ * ```typescript
425
+ * import { ActionPanel, Form, Action } from "@raycast/api";
426
+ *
427
+ * export default function Command() {
428
+ * return (
429
+ * <Form
430
+ * actions={
431
+ * <ActionPanel>
432
+ * <Action.SubmitForm title="Submit Answer" onSubmit={(values) => console.log(values)} />
433
+ * </ActionPanel>
434
+ * }
435
+ * >
436
+ * <Form.Checkbox id="answer" label="Are you happy?" defaultValue={true} />
437
+ * </Form>
438
+ * );
439
+ * }
440
+ * ```
441
+ *
442
+ * @example
443
+ * Controlled checkbox
444
+ *
445
+ * ```typescript
446
+ * import { ActionPanel, Form, Action } from "@raycast/api";
447
+ * import { useState } from "react";
448
+ *
449
+ * export default function Command() {
450
+ * const [checked, setChecked] = useState(true);
451
+ *
452
+ * return (
453
+ * <Form
454
+ * actions={
455
+ * <ActionPanel>
456
+ * <Action.SubmitForm title="Submit Answer" onSubmit={(values) => console.log(values)} />
457
+ * </ActionPanel>
458
+ * }
459
+ * >
460
+ * <Form.Checkbox id="answer" label="Do you like orange juice?" value={checked} onChange={setChecked} />
461
+ * </Form>
462
+ * );
463
+ * }
464
+ * ```
465
+ */
466
+ const Checkbox: typeof FormCheckbox;
467
+ /**
468
+ * A form item with a date picker.
469
+ *
470
+ * @example
471
+ * Uncontrolled date picker
472
+ *
473
+ * ```typescript
474
+ * import { ActionPanel, Form, Action } from "@raycast/api";
475
+ *
476
+ * export default function Command() {
477
+ * return (
478
+ * <Form
479
+ * actions={
480
+ * <ActionPanel>
481
+ * <Action.SubmitForm title="Submit Form" onSubmit={(values) => console.log(values)} />
482
+ * </ActionPanel>
483
+ * }
484
+ * >
485
+ * <Form.DatePicker id="dateOfBirth" title="Date of Birth" defaultValue={new Date(1955, 1, 24)} />
486
+ * </Form>
487
+ * );
488
+ * }
489
+ * ```
490
+ *
491
+ * @example
492
+ * Controlled date picker
493
+ *
494
+ * ```typescript
495
+ * import { ActionPanel, Form, Action } from "@raycast/api";
496
+ * import { useState } from "react";
497
+ *
498
+ * export default function Command() {
499
+ * const [date, setDate] = useState<Date>();
500
+ *
501
+ * return (
502
+ * <Form
503
+ * actions={
504
+ * <ActionPanel>
505
+ * <Action.SubmitForm title="Submit Form" onSubmit={(values) => console.log(values)} />
506
+ * </ActionPanel>
507
+ * }
508
+ * >
509
+ * <Form.DatePicker id="launchDate" title="Launch Date" value={date} onChange={setDate} />
510
+ * </Form>
511
+ * );
512
+ * }
513
+ * ```
514
+ */
515
+ const DatePicker: typeof FormDatePicker;
516
+ /**
517
+ * A form item that shows a separator line.
518
+ * Use for grouping and visually separating form items.
519
+ *
520
+ * @example
521
+ * ```typescript
522
+ * import { ActionPanel, Form, Action } from "@raycast/api";
523
+ *
524
+ * export default function Command() {
525
+ * return (
526
+ * <Form
527
+ * actions={
528
+ * <ActionPanel>
529
+ * <Action.SubmitForm title="Submit Form" onSubmit={(values) => console.log(values)} />
530
+ * </ActionPanel>
531
+ * }
532
+ * >
533
+ * <Form.TextField id="textfield" />
534
+ * <Form.Separator />
535
+ * <Form.TextArea id="textarea" />
536
+ * </Form>
537
+ * );
538
+ * }
539
+ * ```
540
+ */
541
+ const Separator: typeof FormSeparator;
542
+ /**
543
+ * A form item with a dropdown menu.
544
+ *
545
+ * @example
546
+ * Uncontrolled dropdown
547
+ *
548
+ * ```typescript
549
+ * import { ActionPanel, Form, Action } from "@raycast/api";
550
+ *
551
+ * export default function Command() {
552
+ * return (
553
+ * <Form
554
+ * actions={
555
+ * <ActionPanel>
556
+ * <Action.SubmitForm title="Submit Favorite" onSubmit={(values) => console.log(values)} />
557
+ * </ActionPanel>
558
+ * }
559
+ * >
560
+ * <Form.Dropdown id="emoji" title="Favorite Emoji" defaultValue="lol">
561
+ * <Form.Dropdown.Item value="poop" title="Pile of poop" icon="💩" />
562
+ * <Form.Dropdown.Item value="rocket" title="Rocket" icon="🚀" />
563
+ * <Form.Dropdown.Item value="lol" title="Rolling on the floor laughing face" icon="🤣" />
564
+ * </Form.Dropdown>
565
+ * </Form>
566
+ * );
567
+ * }
568
+ * ```
569
+ *
570
+ * @example
571
+ * Controlled dropdown
572
+ *
573
+ * ```typescript
574
+ * import { ActionPanel, Form, Action } from "@raycast/api";
575
+ * import { useState } from "react";
576
+ *
577
+ * export default function Command() {
578
+ * const [programmingLanguage, setProgrammingLanguage] = useState<string>("typescript");
579
+ *
580
+ * return (
581
+ * <Form
582
+ * actions={
583
+ * <ActionPanel>
584
+ * <Action.SubmitForm title="Submit Favorite" onSubmit={(values) => console.log(values)} />
585
+ * </ActionPanel>
586
+ * }
587
+ * >
588
+ * <Form.Dropdown
589
+ * id="dropdown"
590
+ * title="Favorite Language"
591
+ * value={programmingLanguage}
592
+ * onChange={setProgrammingLanguage}
593
+ * >
594
+ * <Form.Dropdown.Item value="cpp" title="C++" />
595
+ * <Form.Dropdown.Item value="javascript" title="JavaScript" />
596
+ * <Form.Dropdown.Item value="ruby" title="Ruby" />
597
+ * <Form.Dropdown.Item value="python" title="Python" />
598
+ * <Form.Dropdown.Item value="swift" title="Swift" />
599
+ * <Form.Dropdown.Item value="typescript" title="TypeScript" />
600
+ * </Form.Dropdown>
601
+ * </Form>
602
+ * );
603
+ * }
604
+ * ```
605
+ */
606
+ const Dropdown: typeof FormDropdown;
607
+ /**
608
+ * A form item with a tag picker that allows the user to select multiple items.
609
+ *
610
+ * @example
611
+ * Uncontrolled tag picker
612
+ *
613
+ * ```typescript
614
+ * import { ActionPanel, Form, Action } from "@raycast/api";
615
+ *
616
+ * export default function Command() {
617
+ * return (
618
+ * <Form
619
+ * actions={
620
+ * <ActionPanel>
621
+ * <Action.SubmitForm title="Submit Favorite" onSubmit={(values) => console.log(values)} />
622
+ * </ActionPanel>
623
+ * }
624
+ * >
625
+ * <Form.TagPicker id="sports" title="Favorite Sports" defaultValue={["football"]}>
626
+ * <Form.TagPicker.Item value="basketball" title="Basketball" icon="🏀" />
627
+ * <Form.TagPicker.Item value="football" title="Football" icon="⚽️" />
628
+ * <Form.TagPicker.Item value="tennis" title="Tennis" icon="🎾" />
629
+ * </Form.TagPicker>
630
+ * </Form>
631
+ * );
632
+ * }
633
+ * ```
634
+ *
635
+ * @example
636
+ * Controlled tag picker
637
+ *
638
+ * ```typescript
639
+ * import { ActionPanel, Form, Action } from "@raycast/api";
640
+ * import { useState } from "react";
641
+ *
642
+ * export default function Command() {
643
+ * const [countries, setCountries] = useState<string[]>(["ger", "ned", "pol"]);
644
+ *
645
+ * return (
646
+ * <Form
647
+ * actions={
648
+ * <ActionPanel>
649
+ * <Action.SubmitForm title="Submit Countries" onSubmit={(values) => console.log(values)} />
650
+ * </ActionPanel>
651
+ * }
652
+ * >
653
+ * <Form.TagPicker id="countries" title="Visited Countries" value={countries} onChange={setCountries}>
654
+ * <Form.TagPicker.Item value="ger" title="Germany" icon="🇩🇪" />
655
+ * <Form.TagPicker.Item value="ind" title="India" icon="🇮🇳" />
656
+ * <Form.TagPicker.Item value="ned" title="Netherlands" icon="🇳🇱" />
657
+ * <Form.TagPicker.Item value="nor" title="Norway" icon="🇳🇴" />
658
+ * <Form.TagPicker.Item value="pol" title="Poland" icon="🇵🇱" />
659
+ * <Form.TagPicker.Item value="rus" title="Russia" icon="🇷🇺" />
660
+ * <Form.TagPicker.Item value="sco" title="Scotland" icon="🏴󠁧󠁢󠁳󠁣󠁴󠁿" />
661
+ * </Form.TagPicker>
662
+ * </Form>
663
+ * );
664
+ * }
665
+ * ```
666
+ */
667
+ const TagPicker: typeof FormTagPicker;
668
+ /**
669
+ * A form item with a secure text field for password-entry in which the entered characters must be kept secret.
670
+ *
671
+ * @example
672
+ * Uncontrolled password field
673
+ *
674
+ * ```typescript
675
+ * import { ActionPanel, Form, Action } from "@raycast/api";
676
+ *
677
+ * export default function Command() {
678
+ * return (
679
+ * <Form
680
+ * actions={
681
+ * <ActionPanel>
682
+ * <Action.SubmitFormAction title="Submit Password" onSubmit={(values) => console.log(values)} />
683
+ * </ActionPanel>
684
+ * }
685
+ * >
686
+ * <Form.PasswordField id="password" title="Enter Password" />
687
+ * </Form>
688
+ * );
689
+ * }
690
+ * ```
691
+ *
692
+ * @example
693
+ * Controlled password field
694
+ *
695
+ * ```typescript
696
+ * import { ActionPanel, Form, Action } from "@raycast/api";
697
+ * import { useState } from "react";
698
+ *
699
+ * export default function Command() {
700
+ * const [password, setPassword] = useState<string>();
701
+ *
702
+ * return (
703
+ * <Form
704
+ * actions={
705
+ * <ActionPanel>
706
+ * <Action.SubmitForm title="Submit Password" onSubmit={(values) => console.log(values)} />
707
+ * </ActionPanel>
708
+ * }
709
+ * >
710
+ * <Form.PasswordField id="password" value={password} onChange={setPassword} />
711
+ * </Form>
712
+ * );
713
+ * }
714
+ * ```
715
+ */
716
+ const PasswordField: typeof FormPasswordField;
717
+ /**
718
+ * A form item with a simple text label.
719
+ *
720
+ * @remark Do *not* use this component to show validation messages for other form fields.
721
+ *
722
+ * @example
723
+ * Label
724
+ *
725
+ * ```typescript
726
+ * import { ActionPanel, Form, Action } from "@raycast/api";
727
+ *
728
+ * export default function Command() {
729
+ * return (
730
+ * <Form
731
+ * actions={
732
+ * <ActionPanel>
733
+ * <Action.SubmitForm title="Submit" onSubmit={(values) => console.log(values)} />
734
+ * </ActionPanel>
735
+ * }
736
+ * >
737
+ * <Form.Description title="Import / Export" text="Exporting will back-up your preferences, quicklinks, snippets, floating notes, script-command folder paths, aliases, hotkeys, favorites and other data." />
738
+ * </Form>
739
+ * );
740
+ * }
741
+ * ```
742
+ */
743
+ const Description: typeof FormDescription;
744
+ /**
745
+ * Props of the {@link Form} React component.
746
+ *
747
+ * @category User Interface
748
+ * @subcategory Form
749
+ */
750
+ interface Props extends ActionsInterface, NavigationChildInterface {
751
+ /**
752
+ * The Form.Item elements of the form.
753
+ */
754
+ children?: ReactNode;
755
+ }
756
+ /**
757
+ * A possible form item value that will be used as an input for the submit callback of a form.
758
+ */
759
+ type Value = string | number | boolean | string[] | number[] | Date | null;
760
+ /**
761
+ * Values of items in the form.
762
+ *
763
+ * @remarks
764
+ * For type-safe form values, you can define your own interface. Use the ID's of the form items
765
+ * as the property names. See the example for more details.
766
+ *
767
+ * @example
768
+ * ```typescript
769
+ * import { Form, Action } from "@raycast/api";
770
+ *
771
+ * interface Values {
772
+ * todo: string;
773
+ * due?: Date;
774
+ * }
775
+ *
776
+ * export default function Command() {
777
+ * function handleSubmit(values: Values) {
778
+ * console.log(values);
779
+ * }
780
+ *
781
+ * return (
782
+ * <Form
783
+ * actions={
784
+ * <ActionPanel>
785
+ * <Action.SubmitForm title="Submit" onSubmit={handleSubmit} />
786
+ * </ActionPanel>
787
+ * }
788
+ * >
789
+ * <Form.TextField id="todo" title="Todo" />
790
+ * <Form.DatePicker id="due" title="Due Date" />
791
+ * </Form>
792
+ * );
793
+ * };
794
+ * ```
795
+ */
796
+ interface Values {
797
+ /**
798
+ * The form value of a given item.
799
+ */
800
+ [item: string]: any;
801
+ }
802
+ /**
803
+ * Props of the Form.Item React component.
804
+ */
805
+ interface ItemProps<Value extends Form.Value> {
806
+ /**
807
+ * ID of the form item.
808
+ * Make sure to assign each form item a unique id.
809
+ */
810
+ id: string;
811
+ /**
812
+ * The title displayed on the left side of the item.
813
+ */
814
+ title?: string;
815
+ /**
816
+ * Indicates whether the value of the item should be persisted after submitting, and restored next time the form is rendered.
817
+ */
818
+ storeValue?: boolean;
819
+ /**
820
+ * The current value of the item.
821
+ */
822
+ value?: Value;
823
+ /**
824
+ * The default value of the item.
825
+ * Keep in mind that `defaultValue` will be configured once per component lifecycle. This means that if a user changes the value, `defaultValue` won't be configured on re-rendering.
826
+ * @important If you're using {@link Form.Item.Props.storeValue} and configured it as `true` then the stored value will be set.
827
+ * @important If you configure {@link Form.Item.Props.value} at the same time with {@link Form.Item.Props.defaultValue}, the `value` will be set instead of `defaultValue`.
828
+ */
829
+ defaultValue?: Value;
830
+ /**
831
+ * The callback which will be triggered on the {@link Form.Item.Props.value} change for the item.
832
+ */
833
+ onChange?: (newValue: Value) => void;
834
+ }
835
+ namespace TextField {
836
+ /**
837
+ * Props of the {@link Form.TextField} React component.
838
+ */
839
+ interface Props extends Form.ItemProps<string> {
840
+ /**
841
+ * Placeholder text shown in the text field.
842
+ */
843
+ placeholder?: string;
844
+ }
845
+ }
846
+ namespace TextArea {
847
+ /**
848
+ * Props of the {@link Form.TextArea} React component.
849
+ */
850
+ interface Props extends Form.ItemProps<string> {
851
+ /**
852
+ * Placeholder text shown in the text field.
853
+ */
854
+ placeholder?: string;
855
+ }
856
+ }
857
+ namespace Dropdown {
858
+ /**
859
+ * Props of the {@link Form.Dropdown} React component.
860
+ * The {@link Form.Dropdown.Props.value} here is ID ({@link Form.Dropdown.Item.Props.id}) of the default selected item.
861
+ */
862
+ interface Props extends Form.ItemProps<string> {
863
+ /**
864
+ * Sections or items. If {@link Form.Dropdown.Item} elements are specified, a default section is automatically created.
865
+ */
866
+ children?: ReactNode;
867
+ }
868
+ namespace Section {
869
+ /**
870
+ * Props of the {@link Form.Dropdown.Section} React component.
871
+ */
872
+ interface Props {
873
+ /**
874
+ * The item elements of the section.
875
+ */
876
+ children?: ReactNode;
877
+ /**
878
+ * Title displayed above the section
879
+ */
880
+ title?: string;
881
+ }
882
+ }
883
+ namespace Item {
884
+ /**
885
+ * Props of the {@link Form.Dropdown.Item} React component.
886
+ */
887
+ interface Props {
888
+ /**
889
+ * Value of the dropdown item.
890
+ * Make sure to assign each unique value for each item.
891
+ */
892
+ value: string;
893
+ /**
894
+ * The title displayed for the item.
895
+ */
896
+ title: string;
897
+ /**
898
+ * A optional icon displayed for the item.
899
+ */
900
+ icon?: Image.ImageLike;
901
+ }
902
+ }
903
+ }
904
+ namespace Checkbox {
905
+ /**
906
+ * Props of the {@link Form.Checkbox} React component.
907
+ */
908
+ interface Props extends Form.ItemProps<boolean> {
909
+ /**
910
+ * The label displayed on the right side of the checkbox.
911
+ */
912
+ label: string;
913
+ }
914
+ }
915
+ namespace DatePicker {
916
+ /**
917
+ * Props of the {@link Form.DatePicker} React component.
918
+ */
919
+ interface Props extends Form.ItemProps<Date> {
920
+ }
921
+ }
922
+ namespace Separator {
923
+ /**
924
+ * Props of the {@link Form.Separator} React component.
925
+ */
926
+ interface Props {
927
+ }
928
+ }
929
+ namespace TagPicker {
930
+ /**
931
+ * Props of the {@link Form.TagPicker} React component.
932
+ * The {@link Form.TagPicker.Props.value} here is the IDs ({@link Form.TagPicker.Item.Props.id}) of the default selected items.
933
+ */
934
+ interface Props extends Form.ItemProps<string[]> {
935
+ /**
936
+ * The list of tag picker's items.
937
+ */
938
+ children?: ReactNode;
939
+ /**
940
+ * Placeholder text shown in the token field.
941
+ */
942
+ placeholder?: string;
943
+ }
944
+ namespace Item {
945
+ /**
946
+ * Props of the {@link Form.TagPicker.Item} React component.
947
+ */
948
+ interface Props {
949
+ /**
950
+ * Value of the tag picker item.
951
+ * Make sure to assign unique value for each item.
952
+ */
953
+ value: string;
954
+ /**
955
+ * The display title of the token.
956
+ */
957
+ title: string;
958
+ /**
959
+ * An icon to show in the token.
960
+ */
961
+ icon?: Image.ImageLike;
962
+ }
963
+ }
964
+ }
965
+ namespace PasswordField {
966
+ /**
967
+ * Props of the {@link Form.PasswordField} React component.
968
+ */
969
+ interface Props extends Form.ItemProps<string> {
970
+ /**
971
+ * Placeholder text shown in the password field.
972
+ */
973
+ placeholder?: string;
974
+ }
975
+ }
976
+ namespace Description {
977
+ /**
978
+ * Props of the {@link Form.Description} React component.
979
+ */
980
+ interface Props {
981
+ /**
982
+ * The display title of the left side from the description item.
983
+ */
984
+ title?: string;
985
+ /**
986
+ * Text that will be displayed in the middle.
987
+ */
988
+ text: string;
989
+ }
990
+ }
991
+ }
992
+ export {};