@raycast/api 1.33.2 → 1.35.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.
package/types/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="react" />
2
3
 
3
4
  import { ForwardRefExoticComponent } from 'react';
4
5
  import { FunctionComponent } from 'react';
5
6
  import { PathLike } from 'fs';
6
- import PropTypes from 'prop-types';
7
7
  import { ReactElement } from 'react';
8
8
  import { ReactNode } from 'react';
9
9
  import { RefAttributes } from 'react';
@@ -37,354 +37,15 @@ import { RefAttributes } from 'react';
37
37
  * }
38
38
  * ```
39
39
  */
40
- export declare function Action(props: Action.Props): ReactElement<Action.Props>;
40
+ export declare const Action: FunctionComponent<ActionProps> & ConvenienceActions;
41
41
 
42
42
  export declare namespace Action {
43
- var propTypes: {
44
- id: PropTypes.Requireable<string>;
45
- title: PropTypes.Validator<string>;
46
- icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
47
- fileIcon: PropTypes.Validator<string>;
48
- }>> | Required<PropTypes.InferProps<{
49
- source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
50
- light: PropTypes.Validator<string>;
51
- dark: PropTypes.Validator<string>;
52
- }>>>;
53
- fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
54
- light: PropTypes.Validator<string>;
55
- dark: PropTypes.Validator<string>;
56
- }>>>;
57
- mask: PropTypes.Requireable<Image.Mask>;
58
- tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
59
- light: PropTypes.Validator<string>;
60
- dark: PropTypes.Validator<string>;
61
- adjustContrast: PropTypes.Requireable<boolean>;
62
- }>>>;
63
- }>>>;
64
- shortcut: PropTypes.Requireable<Required<PropTypes.InferProps<{
65
- modifiers: PropTypes.Validator<string[]>;
66
- key: PropTypes.Validator<string>;
67
- }>>>;
68
- onAction: PropTypes.Requireable<(...args: any[]) => any>;
69
- };
70
- var displayName: string;
71
- }
72
-
73
- export declare namespace Action {
74
- /**
75
- * Action that copies the content to the clipboard.
76
- *
77
- * @remarks
78
- * The main window is closed, and a HUD is shown after the content was copied to the clipboard.
79
- *
80
- * @example
81
- * ```typescript
82
- * import { ActionPanel, Action, Detail } from "@raycast/api";
83
- *
84
- * export default function Command() {
85
- * return (
86
- * <Detail
87
- * markdown="Press `⌘ + .` and share some love."
88
- * actions={
89
- * <ActionPanel>
90
- * <Action.CopyToClipboard content="I ❤️ Raycast" shortcut={{ modifiers: ["cmd"], key: "." }} />
91
- * </ActionPanel>
92
- * }
93
- * />
94
- * );
95
- * }
96
- * ```
97
- */
98
- const CopyToClipboard: typeof CopyToClipboardAction_2;
99
- /**
100
- * An action to open a file or folder with a specific application, just as if you had double-clicked the
101
- * file's icon.
102
- *
103
- * @remarks
104
- * The main window is closed after the file is opened.
105
- *
106
- * @example
107
- * ```typescript
108
- * import { ActionPanel, Detail, Action } from "@raycast/api";
109
- *
110
- * export default function Command() {
111
- * return (
112
- * <Detail
113
- * markdown="Check out your extension code."
114
- * actions={
115
- * <ActionPanel>
116
- * <Action.Open title="Open Folder" target={__dirname} />
117
- * </ActionPanel>
118
- * }
119
- * />
120
- * );
121
- * }
122
- * ```
123
- */
124
- const Open: typeof OpenAction_2;
125
- /**
126
- * Action that opens a URL in the default browser.
127
- *
128
- * @remarks
129
- * The main window is closed after the URL is opened in the browser.
130
- *
131
- * @example
132
- * ```typescript
133
- * import { ActionPanel, Detail, Action } from "@raycast/api";
134
- *
135
- * export default function Command() {
136
- * return (
137
- * <Detail
138
- * markdown="Join the gang!"
139
- * actions={
140
- * <ActionPanel>
141
- * <Action.OpenInBrowser url="https://raycast.com/jobs" />
142
- * </ActionPanel>
143
- * }
144
- * />
145
- * );
146
- * }
147
- * ```
148
- */
149
- const OpenInBrowser: typeof OpenInBrowserAction_2;
150
- /**
151
- * Action that opens a file or folder with a specific application.
152
- *
153
- * @remarks
154
- * The action opens a sub-menu with all applications that can open the file or folder.
155
- * The main window is closed after the file is opened in the specified application.
156
- *
157
- * @example
158
- * ```typescript
159
- * import { ActionPanel, Detail, Action } from "@raycast/api";
160
- * import { homedir } from "os";
161
- *
162
- * const DESKTOP_DIR = `${homedir()}/Desktop`;
163
- *
164
- * export default function Command() {
165
- * return (
166
- * <Detail
167
- * markdown="What do you want to use to open your desktop with?"
168
- * actions={
169
- * <ActionPanel>
170
- * <Action.OpenWith path={DESKTOP_DIR} />
171
- * </ActionPanel>
172
- * }
173
- * />
174
- * );
175
- * }
176
- * ```
177
- */
178
- const OpenWith: typeof OpenWithAction_2;
179
- /**
180
- * Action that pastes the content to the front-most applications.
181
- *
182
- * @remarks
183
- * The main window is closed after the content is pasted to the front-most application.
184
- *
185
- * @example
186
- * ```typescript
187
- * import { ActionPanel, Detail, Action } from "@raycast/api";
188
- *
189
- * export default function Command() {
190
- * return (
191
- * <Detail
192
- * markdown="Let us know what you think about the Raycast API?"
193
- * actions={
194
- * <ActionPanel>
195
- * <Action.Paste content="api@raycast.com" />
196
- * </ActionPanel>
197
- * }
198
- * />
199
- * );
200
- * }
201
- * ```
202
- */
203
- const Paste: typeof PasteAction_2;
204
- /**
205
- * Action that pushes a new view to the navigation stack.
206
- *
207
- * @example
208
- * ```typescript
209
- * import { ActionPanel, Detail, Action } from "@raycast/api";
210
- *
211
- * function Ping() {
212
- * return (
213
- * <Detail
214
- * markdown="Ping"
215
- * actions={
216
- * <ActionPanel>
217
- * <Action.Push title="Push Pong" target={<Pong />} />
218
- * </ActionPanel>
219
- * }
220
- * />
221
- * );
222
- * }
223
- *
224
- * function Pong() {
225
- * return <Detail markdown="Pong" />;
226
- * }
227
- *
228
- * export default function Command() {
229
- * return <Ping />;
230
- * }
231
- * ```
232
- */
233
- const Push: typeof PushAction_2;
234
- /**
235
- * Action that shows a file or folder in the Finder.
236
- *
237
- * @remarks
238
- * The main window is closed after the file or folder is revealed in the Finder.
239
- *
240
- * @example
241
- * ```typescript
242
- * import { ActionPanel, Detail, Action } from "@raycast/api";
243
- * import { homedir } from "os";
244
- *
245
- * const DOWNLOADS_DIR = `${homedir()}/Downloads`;
246
- *
247
- * export default function Command() {
248
- * return (
249
- * <Detail
250
- * markdown="Are your downloads pilling up again?"
251
- * actions={
252
- * <ActionPanel>
253
- * <Action.ShowInFinder path={DOWNLOADS_DIR} />
254
- * </ActionPanel>
255
- * }
256
- * />
257
- * );
258
- * }
259
- * ```
260
- */
261
- const ShowInFinder: typeof ShowInFinderAction_2;
262
- /**
263
- * Action that adds a submit handler for capturing form values.
264
- *
265
- * @example
266
- * ```typescript
267
- * import { ActionPanel, Form, Action } from "@raycast/api";
268
- * import { useState } from "react";
269
- *
270
- * export default function Command() {
271
- * const [name, setName] = useState<string>();
272
- *
273
- * return (
274
- * <Form
275
- * actions={
276
- * <ActionPanel>
277
- * <Action.SubmitForm title="Submit Name" onSubmit={(values) => console.log(values)} />
278
- * </ActionPanel>
279
- * }
280
- * >
281
- * <Form.TextField id="name" value={name} onChange={setName} />
282
- * </Form>
283
- * );
284
- * }
285
- * ```
286
- */
287
- const SubmitForm: typeof SubmitFormAction_2;
288
- /**
289
- * Action that moves a file or folder to the Trash.
290
- *
291
- * @example
292
- * ```typescript
293
- * import { ActionPanel, Detail, Action } from "@raycast/api";
294
- * import { homedir } from "os";
295
- *
296
- * const FILE = `${homedir()}/Downloads/get-rid-of-me.txt`;
297
- *
298
- * export default function Command() {
299
- * return (
300
- * <Detail
301
- * markdown="Some spring cleaning?"
302
- * actions={
303
- * <ActionPanel>
304
- * <Action.Trash paths={FILE} />
305
- * </ActionPanel>
306
- * }
307
- * />
308
- * );
309
- * }
310
- * ```
311
- */
312
- const Trash: typeof TrashAction_2;
313
- /**
314
- * Action that navigates to the the Create Snippet command with some or all of the fields prefilled.
315
- *
316
- * @example
317
- * ```typescript
318
- * import { ActionPanel, Detail, Action } from "@raycast/api";
319
- *
320
- * export default function Command() {
321
- * return (
322
- * <Detail
323
- * markdown="Test out snippet creation"
324
- * actions={
325
- * <ActionPanel>
326
- * <Action.CreateSnippet snippet={{ text: "DE75512108001245126199" }} />
327
- * </ActionPanel>
328
- * }
329
- * />
330
- * );
331
- * }
332
- * ```
333
- */
334
- const CreateSnippet: typeof CreateSnippetAction;
335
- /**
336
- * Action that navigates to the the Create Quicklink command with some or all of the fields prefilled.
337
- *
338
- * @example
339
- * ```typescript
340
- * import { ActionPanel, Detail, Action } from "@raycast/api";
341
- *
342
- * export default function Command() {
343
- * return (
344
- * <Detail
345
- * markdown="Test out quicklink creation"
346
- * actions={
347
- * <ActionPanel>
348
- * <Action.CreateQuicklink quicklink={{ link: "https://duckduckgo.com/?q={Query}" }} />
349
- * </ActionPanel>
350
- * }
351
- * />
352
- * );
353
- * }
354
- * ```
355
- */
356
- const CreateQuicklink: typeof CreateQuicklinkAction;
357
- /**
358
- * Props of the {@link Action} React component.
359
- */
360
- export interface Props {
361
- /**
362
- * ID of the item.
363
- *
364
- * @remarks
365
- * Make sure to assign each section or item a unique ID. If no ID is specified, a memoized auto-generated is used.
366
- */
367
- id?: string;
368
- /**
369
- * The title displayed for the item.
370
- */
371
- title: string;
372
- /**
373
- * The icon displayed for the action.
374
- */
375
- icon?: Image.ImageLike;
376
- /**
377
- * The keyboard shortcut for the item.
378
- *
379
- * @remarks
380
- * The first and second action in an {@link ActionPanel} become the primary and secondary action. They automatically get the default keyboard shortcuts assigned.
381
- * In {@link List} and {@link Detail}, this is `↵` for the primary and `⌘` `↵` for the secondary action. In {@link Form} it's `⌘` `↵` for the primary and `⌘` `⇧` `↵` for the secondary.
382
- */
383
- shortcut?: Keyboard.Shortcut;
43
+ export type Props = ActionProps;
44
+ export namespace CopyToClipboard {
384
45
  /**
385
- * Callback that is triggered when the item is selected.
46
+ * Props of the {@link Action.CopyToClipboard} React component.
386
47
  */
387
- onAction?: () => void;
48
+ export type Props = CopyToClipboardProps;
388
49
  }
389
50
  export namespace CreateQuicklink {
390
51
  /**
@@ -398,59 +59,53 @@ export declare namespace Action {
398
59
  */
399
60
  export type Props = CreateSnippetProps;
400
61
  }
401
- export namespace CopyToClipboard {
402
- /**
403
- * Props of the {@link Action.CopyToClipboard} React component.
404
- */
405
- export type Props = CopyToClipboardActionProps_2;
406
- }
407
62
  export namespace Open {
408
63
  /**
409
64
  * Props of the {@link Action.Open} React component.
410
65
  */
411
- export type Props = OpenActionProps_2;
66
+ export type Props = OpenProps;
412
67
  }
413
68
  export namespace OpenInBrowser {
414
69
  /**
415
70
  * Props of the {@link Action.OpenInBrowser} React component.
416
71
  */
417
- export type Props = OpenInBrowserActionProps_2;
72
+ export type Props = OpenInBrowserProps;
418
73
  }
419
74
  export namespace OpenWith {
420
75
  /**
421
76
  * Props of the {@link Action.OpenWith} React component.
422
77
  */
423
- export type Props = OpenWithActionProps_2;
78
+ export type Props = OpenWithProps;
424
79
  }
425
80
  export namespace Paste {
426
81
  /**
427
82
  * Props of the {@link Action.Paste} React component.
428
83
  */
429
- export type Props = PasteActionProps_2;
84
+ export type Props = PasteProps;
430
85
  }
431
86
  export namespace Push {
432
87
  /**
433
88
  * Props of the {@link Action.Push} React component.
434
89
  */
435
- export type Props = PushActionProps_2;
90
+ export type Props = PushProps;
436
91
  }
437
92
  export namespace ShowInFinder {
438
93
  /**
439
94
  * Props of the {@link Action.ShowInFinder} React component.
440
95
  */
441
- export type Props = ShowInFinderActionProps_2;
96
+ export type Props = ShowInFinderProps;
442
97
  }
443
98
  export namespace SubmitForm {
444
99
  /**
445
100
  * Props of the {@link Action.SubmitForm} React component.
446
101
  */
447
- export type Props<T> = SubmitFormActionProps_2<T>;
102
+ export type Props<T> = SubmitFormProps<T>;
448
103
  }
449
104
  export namespace Trash {
450
105
  /**
451
106
  * Props of the {@link Action.Trash} React component.
452
107
  */
453
- export type Props = TrashActionProps_2;
108
+ export type Props = TrashProps;
454
109
  }
455
110
  }
456
111
 
@@ -490,20 +145,58 @@ export declare namespace Action {
490
145
  * }
491
146
  * ```
492
147
  */
493
- export declare function ActionPanel(props: ActionPanel.Props): ReactElement<ActionPanel.Props>;
494
-
495
- export declare namespace ActionPanel {
496
- var propTypes: {
497
- title: PropTypes.Requireable<string>;
498
- };
499
- var displayName: string;
500
- }
148
+ export declare const ActionPanel: FunctionComponent<ActionPanelProps_2> & DeprecatedActionPanelMembers & ActionPanelMembers;
501
149
 
502
150
  export declare namespace ActionPanel {
503
151
  /**
504
- * @deprecated Use `Action` instead.
152
+ * Props of the {@link ActionPanel} React component.
505
153
  */
506
- const Item: typeof Action;
154
+ export type Props = ActionPanelProps_2;
155
+ /**
156
+ * Supported children for the {@link ActionPanel} components.
157
+ */
158
+ export type Children = ActionPanelChildren_2;
159
+ export namespace Section {
160
+ /**
161
+ * Props of the {@link ActionPanel.Section} React component.
162
+ */
163
+ export type Props = SectionProps;
164
+ /**
165
+ * Supported children for the {@link ActionPanel.Section} component.
166
+ */
167
+ export type Children = SectionChildren;
168
+ }
169
+ export namespace Submenu {
170
+ /**
171
+ * Props of the {@link ActionPanel.Submenu} React component.
172
+ */
173
+ export type Props = SubmenuProps;
174
+ /**
175
+ * Supported children for the {@link ActionPanel.Submenu} components.
176
+ */
177
+ export type Children = SubmenuChildren;
178
+ }
179
+ }
180
+
181
+ /**
182
+ * @deprecated Use {@link ActionPanel.Children} instead.
183
+ */
184
+ export declare type ActionPanelChildren = ActionPanel.Children;
185
+
186
+ declare type ActionPanelChildren_2 = ReactElement<ActionPanel.Section.Props> | ReactElement<ActionPanel.Section.Props>[] | ActionPanel.Section.Children | null;
187
+
188
+ /**
189
+ * @deprecated Use {@link Action} instead.
190
+ */
191
+ export declare const ActionPanelItem: FunctionComponent<ActionProps> & ConvenienceActions;
192
+
193
+ /**
194
+ * @deprecated Use {@link Action.Props} instead.
195
+ */
196
+ export declare interface ActionPanelItemProps extends Action.Props {
197
+ }
198
+
199
+ declare interface ActionPanelMembers {
507
200
  /**
508
201
  * A group of visually separated items.
509
202
  *
@@ -542,7 +235,7 @@ export declare namespace ActionPanel {
542
235
  * }
543
236
  * ```
544
237
  */
545
- const Section: typeof ActionPanelSection_2;
238
+ Section: typeof Section;
546
239
  /**
547
240
  * An action that replaces the current ActionPanel with its children when selected.
548
241
  *
@@ -587,102 +280,7 @@ export declare namespace ActionPanel {
587
280
  * }
588
281
  * ```
589
282
  */
590
- const Submenu: typeof ActionPanelSubmenu_2;
591
- /**
592
- * Props of the {@link ActionPanel} React component.
593
- */
594
- export interface Props {
595
- /**
596
- * Sections or Actions. If {@link Action} elements are specified, a default section is automatically created.
597
- */
598
- children?: ReactNode;
599
- /**
600
- * The title displayed at the top of the panel
601
- */
602
- title?: string;
603
- }
604
- /**
605
- * Supported children for the {@link ActionPanel} components.
606
- */
607
- export type Children = ReactElement<ActionPanel.Section.Props> | ReactElement<ActionPanel.Section.Props>[] | ActionPanel.Section.Children | null;
608
- export namespace Section {
609
- /**
610
- * Props of the {@link ActionPanel.Section} React component.
611
- */
612
- export interface Props {
613
- /**
614
- * The item elements of the section.
615
- */
616
- children?: ReactNode;
617
- /**
618
- * Title displayed above the section
619
- */
620
- title?: string;
621
- }
622
- /**
623
- * Supported children for the {@link ActionPanel.Section} component.
624
- */
625
- export type Children = ReactElement<Action.Props> | ReactElement<Action.Props>[] | ReactElement<ActionPanel.Submenu.Props> | Array<ReactElement<ActionPanel.Submenu.Props>> | Array<ReactElement<ActionPanel.Submenu.Props> | ReactElement<Action.Props>> | null;
626
- }
627
- export namespace Submenu {
628
- /**
629
- * Props of the {@link ActionPanel.Submenu} React component.
630
- */
631
- export interface Props {
632
- /**
633
- * ID of the submenu.
634
- * Make sure to assign each submenu a unique ID or a UUID will be auto-generated.
635
- */
636
- id?: string;
637
- /**
638
- * The title displayed for submenu.
639
- */
640
- title: string;
641
- /**
642
- * The icon displayed for the submenu.
643
- */
644
- icon?: Image.ImageLike;
645
- /**
646
- * The keyboard shortcut for the submenu.
647
- */
648
- shortcut?: Keyboard.Shortcut;
649
- /**
650
- * Items of the submenu.
651
- *
652
- * @example
653
- * ```typescript
654
- * <ActionPanel.Submenu title="Submenu">
655
- * <Action title="Just an action" />
656
- * </ActionPanel.Submenu>
657
- * ```
658
- *
659
- * @remarks
660
- * If {@link Action} elements are specified, a default section is automatically created.
661
- * Use {@link ActionPanel.Submenu} as parent when specifying sub-menu's children to make code is more readable.
662
- */
663
- children?: ReactNode;
664
- }
665
- /**
666
- * Supported children for the {@link ActionPanel.Submenu} components.
667
- */
668
- export type Children = ActionPanel.Children;
669
- }
670
- }
671
-
672
- /**
673
- * @deprecated Use {@link ActionPanel.Children} instead.
674
- */
675
- export declare type ActionPanelChildren = ActionPanel.Children;
676
-
677
- /**
678
- * @deprecated Use {@link Action} instead.
679
- */
680
- export declare const ActionPanelItem: typeof Action;
681
-
682
- /**
683
- * @deprecated Use {@link Action.Props} instead.
684
- */
685
- export declare interface ActionPanelItemProps extends Action.Props {
283
+ Submenu: typeof Submenu;
686
284
  }
687
285
 
688
286
  /**
@@ -691,23 +289,22 @@ export declare interface ActionPanelItemProps extends Action.Props {
691
289
  export declare interface ActionPanelProps extends ActionPanel.Props {
692
290
  }
693
291
 
292
+ declare interface ActionPanelProps_2 {
293
+ /**
294
+ * Sections or Actions. If {@link Action} elements are specified, a default section is automatically created.
295
+ */
296
+ children?: ReactNode;
297
+ /**
298
+ * The title displayed at the top of the panel
299
+ */
300
+ title?: string;
301
+ }
302
+
694
303
  /**
695
304
  * @deprecated Use {@link ActionPanel.Section} instead.
696
305
  */
697
306
  export declare const ActionPanelSection: typeof ActionPanel.Section;
698
307
 
699
- /**
700
- * See {@link ActionPanel.Section}
701
- */
702
- declare function ActionPanelSection_2(props: ActionPanel.Section.Props): ReactElement<ActionPanel.Section.Props>;
703
-
704
- declare namespace ActionPanelSection_2 {
705
- var propTypes: {
706
- title: PropTypes.Requireable<string>;
707
- };
708
- var displayName: string;
709
- }
710
-
711
308
  /**
712
309
  * @deprecated Use {@link ActionPanel.Section.Children} instead.
713
310
  */
@@ -735,44 +332,40 @@ export declare interface ActionPanelState {
735
332
  export declare const ActionPanelSubmenu: typeof ActionPanel.Submenu;
736
333
 
737
334
  /**
738
- * See {@link ActionPanel.Submenu}
335
+ * @deprecated Use {@link ActionPanel.Submenu.Props} instead.
739
336
  */
740
- declare function ActionPanelSubmenu_2(props: ActionPanel.Submenu.Props): ReactElement<Action.Props>;
741
-
742
- declare namespace ActionPanelSubmenu_2 {
743
- var propTypes: {
744
- id: PropTypes.Requireable<string>;
745
- title: PropTypes.Validator<string>;
746
- icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
747
- fileIcon: PropTypes.Validator<string>;
748
- }>> | Required<PropTypes.InferProps<{
749
- source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
750
- light: PropTypes.Validator<string>;
751
- dark: PropTypes.Validator<string>;
752
- }>>>;
753
- fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
754
- light: PropTypes.Validator<string>;
755
- dark: PropTypes.Validator<string>;
756
- }>>>;
757
- mask: PropTypes.Requireable<Image.Mask>;
758
- tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
759
- light: PropTypes.Validator<string>;
760
- dark: PropTypes.Validator<string>;
761
- adjustContrast: PropTypes.Requireable<boolean>;
762
- }>>>;
763
- }>>>;
764
- shortcut: PropTypes.Requireable<Required<PropTypes.InferProps<{
765
- modifiers: PropTypes.Validator<string[]>;
766
- key: PropTypes.Validator<string>;
767
- }>>>;
768
- };
769
- var displayName: string;
337
+ export declare interface ActionPanelSubmenuProps extends ActionPanel.Submenu.Props {
770
338
  }
771
339
 
772
340
  /**
773
- * @deprecated Use {@link ActionPanel.Submenu.Props} instead.
341
+ * Props of the {@link Action} React component.
774
342
  */
775
- export declare interface ActionPanelSubmenuProps extends ActionPanel.Submenu.Props {
343
+ declare interface ActionProps {
344
+ /**
345
+ * ID of the item.
346
+ * @deprecated - This is an internal prop which not not have been exposed. You can safely remove it.
347
+ */
348
+ id?: string;
349
+ /**
350
+ * The title displayed for the item.
351
+ */
352
+ title: string;
353
+ /**
354
+ * The icon displayed for the action.
355
+ */
356
+ icon?: Image.ImageLike | undefined | null;
357
+ /**
358
+ * The keyboard shortcut for the item.
359
+ *
360
+ * @remarks
361
+ * The first and second action in an {@link ActionPanel} become the primary and secondary action. They automatically get the default keyboard shortcuts assigned.
362
+ * In {@link List} and {@link Detail}, this is `↵` for the primary and `⌘` `↵` for the secondary action. In {@link Form} it's `⌘` `↵` for the primary and `⌘` `⇧` `↵` for the secondary.
363
+ */
364
+ shortcut?: Keyboard.Shortcut | undefined | null;
365
+ /**
366
+ * Callback that is triggered when the item is selected.
367
+ */
368
+ onAction?: () => void;
776
369
  }
777
370
 
778
371
  /**
@@ -1137,7 +730,7 @@ export declare namespace Color {
1137
730
  * Raycast user interface. This makes it easy to guarantee a good look and feel when you aren't in control of the
1138
731
  * color, e.g. get it via a network request.
1139
732
  *
1140
- * @defaultValue false
733
+ * @defaultValue `false`
1141
734
  */
1142
735
  adjustContrast?: boolean | undefined | null;
1143
736
  }
@@ -1178,24 +771,306 @@ export declare type ColorLike = Color.ColorLike;
1178
771
  */
1179
772
  export declare function confirmAlert(options: Alert.Options): Promise<boolean>;
1180
773
 
774
+ declare interface ConvenienceActions {
775
+ /**
776
+ * Action that copies the content to the clipboard.
777
+ *
778
+ * @remarks
779
+ * The main window is closed, and a HUD is shown after the content was copied to the clipboard.
780
+ *
781
+ * @example
782
+ * ```typescript
783
+ * import { ActionPanel, Action, Detail } from "@raycast/api";
784
+ *
785
+ * export default function Command() {
786
+ * return (
787
+ * <Detail
788
+ * markdown="Press `⌘ + .` and share some love."
789
+ * actions={
790
+ * <ActionPanel>
791
+ * <Action.CopyToClipboard content="I ❤️ Raycast" shortcut={{ modifiers: ["cmd"], key: "." }} />
792
+ * </ActionPanel>
793
+ * }
794
+ * />
795
+ * );
796
+ * }
797
+ * ```
798
+ */
799
+ CopyToClipboard: typeof CopyToClipboard;
800
+ /**
801
+ * An action to open a file or folder with a specific application, just as if you had double-clicked the
802
+ * file's icon.
803
+ *
804
+ * @remarks
805
+ * The main window is closed after the file is opened.
806
+ *
807
+ * @example
808
+ * ```typescript
809
+ * import { ActionPanel, Detail, Action } from "@raycast/api";
810
+ *
811
+ * export default function Command() {
812
+ * return (
813
+ * <Detail
814
+ * markdown="Check out your extension code."
815
+ * actions={
816
+ * <ActionPanel>
817
+ * <Action.Open title="Open Folder" target={__dirname} />
818
+ * </ActionPanel>
819
+ * }
820
+ * />
821
+ * );
822
+ * }
823
+ * ```
824
+ */
825
+ Open: typeof Open;
826
+ /**
827
+ * Action that opens a URL in the default browser.
828
+ *
829
+ * @remarks
830
+ * The main window is closed after the URL is opened in the browser.
831
+ *
832
+ * @example
833
+ * ```typescript
834
+ * import { ActionPanel, Detail, Action } from "@raycast/api";
835
+ *
836
+ * export default function Command() {
837
+ * return (
838
+ * <Detail
839
+ * markdown="Join the gang!"
840
+ * actions={
841
+ * <ActionPanel>
842
+ * <Action.OpenInBrowser url="https://raycast.com/jobs" />
843
+ * </ActionPanel>
844
+ * }
845
+ * />
846
+ * );
847
+ * }
848
+ * ```
849
+ */
850
+ OpenInBrowser: typeof OpenInBrowser;
851
+ /**
852
+ * Action that opens a file or folder with a specific application.
853
+ *
854
+ * @remarks
855
+ * The action opens a sub-menu with all applications that can open the file or folder.
856
+ * The main window is closed after the file is opened in the specified application.
857
+ *
858
+ * @example
859
+ * ```typescript
860
+ * import { ActionPanel, Detail, Action } from "@raycast/api";
861
+ * import { homedir } from "os";
862
+ *
863
+ * const DESKTOP_DIR = `${homedir()}/Desktop`;
864
+ *
865
+ * export default function Command() {
866
+ * return (
867
+ * <Detail
868
+ * markdown="What do you want to use to open your desktop with?"
869
+ * actions={
870
+ * <ActionPanel>
871
+ * <Action.OpenWith path={DESKTOP_DIR} />
872
+ * </ActionPanel>
873
+ * }
874
+ * />
875
+ * );
876
+ * }
877
+ * ```
878
+ */
879
+ OpenWith: typeof OpenWith;
880
+ /**
881
+ * Action that pastes the content to the front-most applications.
882
+ *
883
+ * @remarks
884
+ * The main window is closed after the content is pasted to the front-most application.
885
+ *
886
+ * @example
887
+ * ```typescript
888
+ * import { ActionPanel, Detail, Action } from "@raycast/api";
889
+ *
890
+ * export default function Command() {
891
+ * return (
892
+ * <Detail
893
+ * markdown="Let us know what you think about the Raycast API?"
894
+ * actions={
895
+ * <ActionPanel>
896
+ * <Action.Paste content="api@raycast.com" />
897
+ * </ActionPanel>
898
+ * }
899
+ * />
900
+ * );
901
+ * }
902
+ * ```
903
+ */
904
+ Paste: typeof Paste;
905
+ /**
906
+ * Action that pushes a new view to the navigation stack.
907
+ *
908
+ * @example
909
+ * ```typescript
910
+ * import { ActionPanel, Detail, Action } from "@raycast/api";
911
+ *
912
+ * function Ping() {
913
+ * return (
914
+ * <Detail
915
+ * markdown="Ping"
916
+ * actions={
917
+ * <ActionPanel>
918
+ * <Action.Push title="Push Pong" target={<Pong />} />
919
+ * </ActionPanel>
920
+ * }
921
+ * />
922
+ * );
923
+ * }
924
+ *
925
+ * function Pong() {
926
+ * return <Detail markdown="Pong" />;
927
+ * }
928
+ *
929
+ * export default function Command() {
930
+ * return <Ping />;
931
+ * }
932
+ * ```
933
+ */
934
+ Push: typeof Push;
935
+ /**
936
+ * Action that shows a file or folder in the Finder.
937
+ *
938
+ * @remarks
939
+ * The main window is closed after the file or folder is revealed in the Finder.
940
+ *
941
+ * @example
942
+ * ```typescript
943
+ * import { ActionPanel, Detail, Action } from "@raycast/api";
944
+ * import { homedir } from "os";
945
+ *
946
+ * const DOWNLOADS_DIR = `${homedir()}/Downloads`;
947
+ *
948
+ * export default function Command() {
949
+ * return (
950
+ * <Detail
951
+ * markdown="Are your downloads pilling up again?"
952
+ * actions={
953
+ * <ActionPanel>
954
+ * <Action.ShowInFinder path={DOWNLOADS_DIR} />
955
+ * </ActionPanel>
956
+ * }
957
+ * />
958
+ * );
959
+ * }
960
+ * ```
961
+ */
962
+ ShowInFinder: typeof ShowInFinder;
963
+ /**
964
+ * Action that adds a submit handler for capturing form values.
965
+ *
966
+ * @example
967
+ * ```typescript
968
+ * import { ActionPanel, Form, Action } from "@raycast/api";
969
+ * import { useState } from "react";
970
+ *
971
+ * export default function Command() {
972
+ * const [name, setName] = useState<string>();
973
+ *
974
+ * return (
975
+ * <Form
976
+ * actions={
977
+ * <ActionPanel>
978
+ * <Action.SubmitForm title="Submit Name" onSubmit={(values) => console.log(values)} />
979
+ * </ActionPanel>
980
+ * }
981
+ * >
982
+ * <Form.TextField id="name" value={name} onChange={setName} />
983
+ * </Form>
984
+ * );
985
+ * }
986
+ * ```
987
+ */
988
+ SubmitForm: typeof SubmitForm;
989
+ /**
990
+ * Action that moves a file or folder to the Trash.
991
+ *
992
+ * @example
993
+ * ```typescript
994
+ * import { ActionPanel, Detail, Action } from "@raycast/api";
995
+ * import { homedir } from "os";
996
+ *
997
+ * const FILE = `${homedir()}/Downloads/get-rid-of-me.txt`;
998
+ *
999
+ * export default function Command() {
1000
+ * return (
1001
+ * <Detail
1002
+ * markdown="Some spring cleaning?"
1003
+ * actions={
1004
+ * <ActionPanel>
1005
+ * <Action.Trash paths={FILE} />
1006
+ * </ActionPanel>
1007
+ * }
1008
+ * />
1009
+ * );
1010
+ * }
1011
+ * ```
1012
+ */
1013
+ Trash: typeof Trash;
1014
+ /**
1015
+ * Action that navigates to the the Create Snippet command with some or all of the fields prefilled.
1016
+ *
1017
+ * @example
1018
+ * ```typescript
1019
+ * import { ActionPanel, Detail, Action } from "@raycast/api";
1020
+ *
1021
+ * export default function Command() {
1022
+ * return (
1023
+ * <Detail
1024
+ * markdown="Test out snippet creation"
1025
+ * actions={
1026
+ * <ActionPanel>
1027
+ * <Action.CreateSnippet snippet={{ text: "DE75512108001245126199" }} />
1028
+ * </ActionPanel>
1029
+ * }
1030
+ * />
1031
+ * );
1032
+ * }
1033
+ * ```
1034
+ */
1035
+ CreateSnippet: typeof CreateSnippet;
1036
+ /**
1037
+ * Action that navigates to the the Create Quicklink command with some or all of the fields prefilled.
1038
+ *
1039
+ * @example
1040
+ * ```typescript
1041
+ * import { ActionPanel, Detail, Action } from "@raycast/api";
1042
+ *
1043
+ * export default function Command() {
1044
+ * return (
1045
+ * <Detail
1046
+ * markdown="Test out quicklink creation"
1047
+ * actions={
1048
+ * <ActionPanel>
1049
+ * <Action.CreateQuicklink quicklink={{ link: "https://duckduckgo.com/?q={Query}" }} />
1050
+ * </ActionPanel>
1051
+ * }
1052
+ * />
1053
+ * );
1054
+ * }
1055
+ * ```
1056
+ */
1057
+ CreateQuicklink: typeof CreateQuicklink;
1058
+ }
1059
+
1181
1060
  /**
1182
1061
  * @deprecated Use {@link Clipboard.copy} instead
1183
1062
  */
1184
1063
  export declare const copyTextToClipboard: typeof Clipboard.copy;
1185
1064
 
1186
1065
  /**
1187
- * @deprecated Use {@link Action.CopyToClipboard} instead.
1066
+ * See {@link Action.CopyToClipboard}
1188
1067
  */
1189
- export declare const CopyToClipboardAction: CopyToClipboardAction_2;
1068
+ declare const CopyToClipboard: FunctionComponent<CopyToClipboardProps>;
1190
1069
 
1191
1070
  /**
1192
- * See {@link Action.CopyToClipboard}
1071
+ * @deprecated Use {@link Action.CopyToClipboard} instead.
1193
1072
  */
1194
- declare function CopyToClipboardAction_2(props: CopyToClipboardActionProps_2): ReactElement<CopyToClipboardActionProps_2>;
1195
-
1196
- declare namespace CopyToClipboardAction_2 {
1197
- var displayName: string;
1198
- }
1073
+ export declare const CopyToClipboardAction: FunctionComponent<CopyToClipboardProps>;
1199
1074
 
1200
1075
  /**
1201
1076
  * @deprecated Use {@link Action.CopyToClipboard.Props} instead.
@@ -1206,14 +1081,14 @@ export declare interface CopyToClipboardActionProps extends Action.CopyToClipboa
1206
1081
  /**
1207
1082
  * See {@link Action.CopyToClipboard.Props}
1208
1083
  */
1209
- declare interface CopyToClipboardActionProps_2 {
1084
+ declare interface CopyToClipboardProps {
1210
1085
  /**
1211
1086
  * The contents that will be written to the clipboard as string.
1212
1087
  */
1213
1088
  content: string | number;
1214
1089
  /**
1215
1090
  * An optional title for the action.
1216
- * @defaultValue Copy to Clipboard
1091
+ * @defaultValue `"Copy to Clipboard"`
1217
1092
  */
1218
1093
  title?: string;
1219
1094
  /**
@@ -1237,11 +1112,7 @@ declare interface CopyToClipboardActionProps_2 {
1237
1112
  /**
1238
1113
  * See {@link Action.CreateQuicklink}
1239
1114
  */
1240
- declare function CreateQuicklinkAction(props: CreateQuicklinkProps): ReactElement<CreateQuicklinkProps>;
1241
-
1242
- declare namespace CreateQuicklinkAction {
1243
- var displayName: string;
1244
- }
1115
+ declare const CreateQuicklink: FunctionComponent<CreateQuicklinkProps>;
1245
1116
 
1246
1117
  declare interface CreateQuicklinkProps {
1247
1118
  /**
@@ -1253,7 +1124,7 @@ declare interface CreateQuicklinkProps {
1253
1124
  */
1254
1125
  title?: string;
1255
1126
  /**
1256
- * A optional icon displayed for the item. See {@link ImageLike} for the supported formats and types.
1127
+ * A optional icon displayed for the item. See {@link Image.ImageLike} for the supported formats and types.
1257
1128
  */
1258
1129
  icon?: Image.ImageLike;
1259
1130
  /**
@@ -1265,11 +1136,7 @@ declare interface CreateQuicklinkProps {
1265
1136
  /**
1266
1137
  * See {@link Action.CreateQuicklink}
1267
1138
  */
1268
- declare function CreateSnippetAction(props: CreateSnippetProps): ReactElement<CreateSnippetProps>;
1269
-
1270
- declare namespace CreateSnippetAction {
1271
- var displayName: string;
1272
- }
1139
+ declare const CreateSnippet: FunctionComponent<CreateSnippetProps>;
1273
1140
 
1274
1141
  declare interface CreateSnippetProps {
1275
1142
  snippet: Snippet;
@@ -1278,7 +1145,7 @@ declare interface CreateSnippetProps {
1278
1145
  */
1279
1146
  title?: string;
1280
1147
  /**
1281
- * A optional icon displayed for the item. See {@link ImageLike} for the supported formats and types.
1148
+ * A optional icon displayed for the item. See {@link Image.ImageLike} for the supported formats and types.
1282
1149
  */
1283
1150
  icon?: Image.ImageLike;
1284
1151
  /**
@@ -1290,22 +1157,24 @@ declare interface CreateSnippetProps {
1290
1157
  /**
1291
1158
  * See {@link Form.DatePicker}
1292
1159
  */
1293
- declare const DatePicker: ForwardRefExoticComponent<DatePickerProps & RefAttributes<FormItemRef>> & {
1160
+ declare const DatePicker: ForwardRefExoticComponent<DatePickerProps & RefAttributes<FormItemRef>> & DatePickerMembers;
1161
+
1162
+ declare interface DatePickerMembers {
1294
1163
  /**
1295
1164
  * The types of date components the user can pick
1296
1165
  * * `Date` - only year, month, and day can be picked
1297
1166
  * * `DateTime` - hour and second can be picked in addition to year, month and day
1298
1167
  */
1299
- Type: typeof FormDatePickerType;
1300
- };
1168
+ Type: typeof DatePickerType;
1169
+ }
1301
1170
 
1302
1171
  declare interface DatePickerProps extends FormItemProps_2<Date> {
1303
1172
  /**
1304
1173
  * Indicates what types of date components can be picked
1305
1174
  *
1306
- * Defaults to {@link FormDatePickerType.DateTime}
1175
+ * Defaults to {@link Form.DatePicker.Type.DateTime}
1307
1176
  */
1308
- type?: FormDatePickerType;
1177
+ type?: DatePickerType;
1309
1178
  }
1310
1179
 
1311
1180
  /**
@@ -1313,7 +1182,28 @@ declare interface DatePickerProps extends FormItemProps_2<Date> {
1313
1182
  */
1314
1183
  declare type DatePickerRef = FormItemRef;
1315
1184
 
1316
- declare interface DeprecatedFormItems {
1185
+ /**
1186
+ * See {@link Form.DatePicker.Type}
1187
+ */
1188
+ declare enum DatePickerType {
1189
+ /**
1190
+ * Only year, month, and day can be picked
1191
+ */
1192
+ Date = "date",
1193
+ /**
1194
+ * hour and second can be picked in addition to year, month and day
1195
+ */
1196
+ DateTime = "date_time"
1197
+ }
1198
+
1199
+ declare interface DeprecatedActionPanelMembers {
1200
+ /**
1201
+ * @deprecated Use {@link Action} instead.
1202
+ */
1203
+ Item: typeof Action;
1204
+ }
1205
+
1206
+ declare interface DeprecatedFormMembers {
1317
1207
  /**
1318
1208
  * @deprecated Use {@link Form.Dropdown.Section} instead.
1319
1209
  */
@@ -1385,276 +1275,245 @@ declare interface DescriptionProps {
1385
1275
  * }
1386
1276
  * ```
1387
1277
  */
1388
- export declare function Detail(props: Detail.Props): ReactElement<Detail.Props>;
1389
-
1390
- export declare namespace Detail {
1391
- var propTypes: {
1392
- navigationTitle: PropTypes.Requireable<string>;
1393
- isLoading: PropTypes.Requireable<boolean>;
1394
- markdown: PropTypes.Requireable<string>;
1395
- metadata: PropTypes.Requireable<PropTypes.ReactNodeLike>;
1396
- };
1397
- var displayName: string;
1398
- }
1278
+ export declare const Detail: FunctionComponent<DetailProps_2> & DetailMembers;
1399
1279
 
1400
1280
  export declare namespace Detail {
1401
1281
  /**
1402
1282
  * Props of the {@link Detail} React component.
1403
1283
  */
1404
- export interface Props extends ActionsInterface, NavigationChildInterface {
1405
- /**
1406
- * The CommonMark string to be rendered.
1407
- */
1408
- markdown?: string | null;
1409
- /**
1410
- * The `Detail.Metadata` to be rendered in the right side area
1411
- */
1412
- metadata?: ReactNode;
1413
- }
1414
- /**
1415
- * A Metadata view that will be shown in the right-hand-side of the `Detail`.
1416
- *
1417
- * Use it to display additional structured data about the main content shown in the `Detail` view.
1418
- */
1419
- const Metadata: typeof DetailMetadata;
1284
+ export type Props = DetailProps_2;
1420
1285
  export namespace Metadata {
1421
1286
  /**
1422
1287
  * Props of the {@link Detail.Metadata} React component.
1423
1288
  */
1424
- export interface Props {
1425
- /**
1426
- * The Detail.Metadata.Item elements of the Metadata view.
1427
- */
1428
- children: ReactNode;
1429
- }
1430
- /**
1431
- * Props of the Detail.Metadata.Item React component.
1432
- */
1433
- export interface ItemProps {
1434
- /**
1435
- * The title shown above the item.
1436
- */
1437
- title: string;
1438
- }
1289
+ export type Props = MetadataProps;
1439
1290
  export namespace Label {
1440
1291
  /**
1441
1292
  * Props of the {@link Detail.Metadata.Label} React component.
1442
1293
  */
1443
- export interface Props extends ItemProps {
1444
- /**
1445
- * An icon to illustrate the value of the item.
1446
- */
1447
- icon?: Image.ImageLike;
1448
- /**
1449
- * The text value of the item.
1450
- */
1451
- text?: string;
1452
- }
1294
+ export type Props = LabelProps;
1453
1295
  }
1454
1296
  export namespace Separator {
1455
1297
  /**
1456
1298
  * Props of the {@link Detail.Metadata.Separator} React component.
1457
1299
  */
1458
- export interface Props {
1459
- }
1300
+ export type Props = SeparatorProps;
1460
1301
  }
1461
1302
  export namespace Link {
1462
1303
  /**
1463
1304
  * Props of the {@link Detail.Metadata.Link} React component.
1464
1305
  */
1465
- export interface Props extends ItemProps {
1466
- /**
1467
- * The target of the link.
1468
- */
1469
- target: string;
1470
- /**
1471
- * The text value of the item.
1472
- */
1473
- text: string;
1474
- }
1306
+ export type Props = LinkProps;
1475
1307
  }
1476
1308
  export namespace TagList {
1477
1309
  /**
1478
1310
  * Props of the {@link Detail.Metadata.TagList} React component.
1479
1311
  */
1480
- export interface Props extends ItemProps {
1481
- /**
1482
- * The tags contained in the TagList.
1483
- */
1484
- children: ReactNode;
1485
- }
1312
+ export type Props = TagListProps;
1486
1313
  export namespace Item {
1487
1314
  /**
1488
1315
  * Props of the {@link Detail.Metadata.TagList.Item} React component.
1489
1316
  */
1490
- export interface Props {
1491
- /**
1492
- * An optional icon in front of the text of the tag.
1493
- */
1494
- icon?: Image.ImageLike;
1495
- /**
1496
- * The text of the tag.
1497
- */
1498
- text: string;
1499
- /**
1500
- * Changes the text color to the provided color and sets a transparent background with the same color.
1501
- */
1502
- color?: Color.ColorLike;
1503
- }
1317
+ export type Props = TagListItemProps;
1504
1318
  }
1505
1319
  }
1506
1320
  }
1507
1321
  }
1508
1322
 
1509
1323
  /**
1510
- * See {@link Detail.Metadata}
1324
+ * See {@link List.Item.Detail}
1511
1325
  */
1512
- declare function DetailMetadata(props: Detail.Metadata.Props): ReactElement<Detail.Metadata.Props>;
1326
+ declare const Detail_2: FunctionComponent<DetailProps_3> & DetailMembers_2;
1513
1327
 
1514
- declare namespace DetailMetadata {
1515
- var propTypes: {};
1516
- var displayName: string;
1328
+ declare interface DetailMembers {
1329
+ /**
1330
+ * A Metadata view that will be shown in the right-hand-side of the `Detail`.
1331
+ *
1332
+ * Use it to display additional structured data about the main content shown in the `Detail` view.
1333
+ */
1334
+ Metadata: typeof Metadata;
1517
1335
  }
1518
1336
 
1519
- declare namespace DetailMetadata {
1337
+ declare interface DetailMembers_2 {
1520
1338
  /**
1521
- * A single value with an optional icon.
1339
+ * A Metadata view that will be shown in the bottom side of the `List.Item.Detail`.
1340
+ *
1341
+ * Use it to display additional structured data about the content of the `List.Item`.
1342
+ *
1343
+ * @example
1344
+ * ```typescript
1345
+ * import { List } from "@raycast/api";
1346
+ *
1347
+ * export default function Metadata() {
1348
+ * const markdown = `
1349
+ * ![Illustration](https://assets.pokemon.com/assets/cms2/img/pokedex/full/001.png)
1350
+ * There is a plant seed on its back right from the day this Pokémon is born. The seed slowly grows larger.
1351
+ * `;
1352
+ * return (
1353
+ * <List isShowingDetail>
1354
+ * <List.Item
1355
+ * title="Bulbasaur"
1356
+ * detail={
1357
+ * <List.Item.Detail
1358
+ * markdown={markdown}
1359
+ * metadata={
1360
+ * <List.Item.Detail.Metadata>
1361
+ * <List.Item.Detail.Metadata.Label title="Types" />
1362
+ * <List.Item.Detail.Metadata.Label title="Grass" icon="pokemon_types/grass.svg" />
1363
+ * <List.Item.Detail.Metadata.Separator />
1364
+ * <List.Item.Detail.Metadata.Label title="Poison" icon="pokemon_types/poison.svg" />
1365
+ * <List.Item.Detail.Metadata.Separator />
1366
+ * <List.Item.Detail.Metadata.Label title="Chracteristics" />
1367
+ * <List.Item.Detail.Metadata.Label title="Height" text="70cm" />
1368
+ * <List.Item.Detail.Metadata.Separator />
1369
+ * <List.Item.Detail.Metadata.Label title="Weight" text="6.9 kg" />
1370
+ * <List.Item.Detail.Metadata.Separator />
1371
+ * <List.Item.Detail.Metadata.Label title="Abilities" />
1372
+ * <List.Item.Detail.Metadata.Label title="Chlorophyll" text="Main Series" />
1373
+ * <List.Item.Detail.Metadata.Separator />
1374
+ * <List.Item.Detail.Metadata.Label title="Overgrow" text="Main Series" />
1375
+ * <List.Item.Detail.Metadata.Separator />
1376
+ * </List.Item.Detail.Metadata>
1377
+ * }
1378
+ * />
1379
+ * }
1380
+ * />
1381
+ * </List>
1382
+ * );
1383
+ * }
1384
+ * ```
1385
+ *
1386
+ * @example
1387
+ * ```typescript
1388
+ * import { List } from "@raycast/api";
1389
+ *
1390
+ * export default function Metadata() {
1391
+ * return (
1392
+ * <List isShowingDetail>
1393
+ * <List.Item
1394
+ * title="Bulbasaur"
1395
+ * detail={
1396
+ * <List.Item.Detail
1397
+ * metadata={
1398
+ * <List.Item.Detail.Metadata>
1399
+ * <List.Item.Detail.Metadata.Label title="Types" />
1400
+ * <List.Item.Detail.Metadata.Label title="Grass" icon="pokemon_types/grass.svg" />
1401
+ * <List.Item.Detail.Metadata.Separator />
1402
+ * <List.Item.Detail.Metadata.Label title="Poison" icon="pokemon_types/poison.svg" />
1403
+ * <List.Item.Detail.Metadata.Separator />
1404
+ * <List.Item.Detail.Metadata.Label title="Chracteristics" />
1405
+ * <List.Item.Detail.Metadata.Label title="Height" text="70cm" />
1406
+ * <List.Item.Detail.Metadata.Separator />
1407
+ * <List.Item.Detail.Metadata.Label title="Weight" text="6.9 kg" />
1408
+ * <List.Item.Detail.Metadata.Separator />
1409
+ * <List.Item.Detail.Metadata.Label title="Abilities" />
1410
+ * <List.Item.Detail.Metadata.Label title="Chlorophyll" text="Main Series" />
1411
+ * <List.Item.Detail.Metadata.Separator />
1412
+ * <List.Item.Detail.Metadata.Label title="Overgrow" text="Main Series" />
1413
+ * <List.Item.Detail.Metadata.Separator />
1414
+ * </List.Item.Detail.Metadata>
1415
+ * }
1416
+ * />
1417
+ * }
1418
+ * />
1419
+ * </List>
1420
+ * );
1421
+ * }
1422
+ * ```
1423
+ */
1424
+ Metadata: typeof Metadata_2;
1425
+ }
1426
+
1427
+ /**
1428
+ * @deprecated Use {@link Detail.Props} instead.
1429
+ */
1430
+ export declare interface DetailProps extends Detail.Props {
1431
+ }
1432
+
1433
+ declare interface DetailProps_2 extends ActionsInterface, NavigationChildInterface {
1434
+ /**
1435
+ * The CommonMark string to be rendered.
1522
1436
  */
1523
- const Label: typeof DetailMetadataLabel;
1437
+ markdown?: string | null;
1524
1438
  /**
1525
- * A metadata item that shows a separator line. Use it for grouping and visually separating metadata items.
1439
+ * The `Detail.Metadata` to be rendered in the right side area
1526
1440
  */
1527
- const Separator: typeof DetailMetadataSeparator;
1441
+ metadata?: ReactNode;
1442
+ }
1443
+
1444
+ declare interface DetailProps_3 {
1528
1445
  /**
1529
- * An item to display a link.
1446
+ * Indicates whether a loading bar should be shown or hidden above the detail
1447
+ *
1448
+ * @defaultValue `false`
1530
1449
  */
1531
- const Link: typeof DetailMetadataLink;
1450
+ isLoading?: boolean;
1532
1451
  /**
1533
- * A list of {@link Detail.Metadata.TagList.Item} displayed in a row.
1452
+ * The CommonMark string to be rendered in the right side area when the parent List is showing details and the item is selected.
1453
+ */
1454
+ markdown?: string | null;
1455
+ /**
1456
+ * The `List.Item.Detail.Metadata` to be rendered in the bottom side of the `List.Item.Detail`
1534
1457
  */
1535
- const TagList: typeof DetailMetadataTagList;
1458
+ metadata?: ReactNode;
1536
1459
  }
1537
1460
 
1538
1461
  /**
1539
- * See {@link Detail.Metadata.Label}
1462
+ * See {@link Form.Dropdown}
1540
1463
  */
1541
- declare function DetailMetadataLabel(props: Detail.Metadata.Label.Props): ReactElement<Detail.Metadata.Label.Props> | null;
1542
-
1543
- declare namespace DetailMetadataLabel {
1544
- var propTypes: {
1545
- title: PropTypes.Validator<string>;
1546
- icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
1547
- fileIcon: PropTypes.Validator<string>;
1548
- }>> | Required<PropTypes.InferProps<{
1549
- source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
1550
- light: PropTypes.Validator<string>;
1551
- dark: PropTypes.Validator<string>;
1552
- }>>>;
1553
- fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
1554
- light: PropTypes.Validator<string>;
1555
- dark: PropTypes.Validator<string>;
1556
- }>>>;
1557
- mask: PropTypes.Requireable<Image.Mask>;
1558
- tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
1559
- light: PropTypes.Validator<string>;
1560
- dark: PropTypes.Validator<string>;
1561
- adjustContrast: PropTypes.Requireable<boolean>;
1562
- }>>>;
1563
- }>>>;
1564
- text: PropTypes.Requireable<string>;
1565
- };
1566
- var displayName: string;
1567
- }
1464
+ declare const Dropdown: ForwardRefExoticComponent<DropdownProps & RefAttributes<FormItemRef>> & DropdownMembers;
1568
1465
 
1569
1466
  /**
1570
- * See {@link Detail.Metadata.Link}
1467
+ * See {@link List.Dropdown}
1571
1468
  */
1572
- declare function DetailMetadataLink(props: Detail.Metadata.Link.Props): ReactElement<Detail.Metadata.Link.Props>;
1573
-
1574
- declare namespace DetailMetadataLink {
1575
- var propTypes: {
1576
- title: PropTypes.Validator<string>;
1577
- target: PropTypes.Validator<string>;
1578
- text: PropTypes.Validator<string>;
1579
- };
1580
- var displayName: string;
1581
- }
1469
+ declare const Dropdown_2: FunctionComponent<DropdownProps_2> & DropdownMembers_2;
1582
1470
 
1583
1471
  /**
1584
- * See {@link Detail.Metadata.Separator}
1472
+ * See {@link Form.Dropdown.Item}
1585
1473
  */
1586
- declare function DetailMetadataSeparator(props: Detail.Metadata.Separator.Props): ReactElement<Detail.Metadata.Separator.Props>;
1587
-
1588
- declare namespace DetailMetadataSeparator {
1589
- var propTypes: {};
1590
- var displayName: string;
1591
- }
1474
+ declare const DropdownItem: FunctionComponent<DropdownItemProps>;
1592
1475
 
1593
1476
  /**
1594
- * See {@link Detail.Metadata.TagList}
1477
+ * See {@link List.Dropdown.Item}
1595
1478
  */
1596
- declare function DetailMetadataTagList(props: Detail.Metadata.TagList.Props): ReactElement<Detail.Metadata.TagList.Props>;
1597
-
1598
- declare namespace DetailMetadataTagList {
1599
- var propTypes: {
1600
- title: PropTypes.Validator<string>;
1601
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
1602
- };
1603
- var displayName: string;
1604
- }
1605
-
1606
- declare namespace DetailMetadataTagList {
1607
- /**
1608
- * A Tag in a {@link Detail.Metadata.TagList}.
1609
- */
1610
- const Item: typeof DetailMetadataTagListItem;
1611
- }
1479
+ declare const DropdownItem_2: FunctionComponent<DropdownItemProps_2>;
1612
1480
 
1613
1481
  /**
1614
- * See {@link Detail.Metadata.TagList.Item}
1482
+ * See {@link Form.Dropdown.Item.Props}
1615
1483
  */
1616
- declare function DetailMetadataTagListItem(props: Detail.Metadata.TagList.Item.Props): ReactElement<Detail.Metadata.TagList.Item.Props>;
1617
-
1618
- declare namespace DetailMetadataTagListItem {
1619
- var propTypes: {
1620
- text: PropTypes.Validator<string>;
1621
- icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
1622
- fileIcon: PropTypes.Validator<string>;
1623
- }>> | Required<PropTypes.InferProps<{
1624
- source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
1625
- light: PropTypes.Validator<string>;
1626
- dark: PropTypes.Validator<string>;
1627
- }>>>;
1628
- fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
1629
- light: PropTypes.Validator<string>;
1630
- dark: PropTypes.Validator<string>;
1631
- }>>>;
1632
- mask: PropTypes.Requireable<Image.Mask>;
1633
- tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
1634
- light: PropTypes.Validator<string>;
1635
- dark: PropTypes.Validator<string>;
1636
- adjustContrast: PropTypes.Requireable<boolean>;
1637
- }>>>;
1638
- }>>>;
1639
- color: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
1640
- light: PropTypes.Validator<string>;
1641
- dark: PropTypes.Validator<string>;
1642
- adjustContrast: PropTypes.Requireable<boolean>;
1643
- }>>>;
1644
- };
1645
- var displayName: string;
1484
+ declare interface DropdownItemProps {
1485
+ /**
1486
+ * Value of the dropdown item.
1487
+ * Make sure to assign each unique value for each item.
1488
+ */
1489
+ value: string;
1490
+ /**
1491
+ * The title displayed for the item.
1492
+ */
1493
+ title: string;
1494
+ /**
1495
+ * A optional icon displayed for the item.
1496
+ */
1497
+ icon?: Image.ImageLike;
1646
1498
  }
1647
1499
 
1648
- /**
1649
- * @deprecated Use {@link Detail.Props} instead.
1650
- */
1651
- export declare interface DetailProps extends Detail.Props {
1500
+ declare interface DropdownItemProps_2 {
1501
+ /**
1502
+ * Value of the dropdown item.
1503
+ * Make sure to assign each unique value for each item.
1504
+ */
1505
+ value: string;
1506
+ /**
1507
+ * The title displayed for the item.
1508
+ */
1509
+ title: string;
1510
+ /**
1511
+ * An optional icon displayed for the item.
1512
+ */
1513
+ icon?: Image.ImageLike | undefined | null;
1652
1514
  }
1653
1515
 
1654
- /**
1655
- * See {@link Form.Dropdown}
1656
- */
1657
- declare const Dropdown: ForwardRefExoticComponent<DropdownProps & RefAttributes<FormItemRef>> & {
1516
+ declare interface DropdownMembers {
1658
1517
  /**
1659
1518
  * Visually separated group of dropdown items.
1660
1519
  *
@@ -1714,41 +1573,114 @@ declare const Dropdown: ForwardRefExoticComponent<DropdownProps & RefAttributes<
1714
1573
  * }
1715
1574
  * ```
1716
1575
  */
1717
- Item: typeof DropdownItem;
1718
- };
1576
+ Item: typeof DropdownItem;
1577
+ }
1578
+
1579
+ declare interface DropdownMembers_2 {
1580
+ /**
1581
+ * Visually separated group of dropdown items in a {@link List.Dropdown}.
1582
+ *
1583
+ * @remarks
1584
+ * Use sections to group related dropdown items together.
1585
+ *
1586
+ * @example
1587
+ * ```typescript
1588
+ * import { List } from "@raycast/api";
1589
+ *
1590
+ * export default function Command() {
1591
+ * return (
1592
+ * <List searchBarAccessory={
1593
+ * <List.Dropdown tooltip="Dropdown With Sections">
1594
+ * <List.Dropdown.Section title="First Section">
1595
+ * <List.Dropdown.Item title="One" value="one" />
1596
+ * </List.Dropdown.Section>
1597
+ * <List.Dropdown.Section title="Second Section">
1598
+ * <List.Dropdown.Item title="Two" value="two" />
1599
+ * </List.Dropdown.Section>
1600
+ * </List.Dropdown>
1601
+ * }>
1602
+ * <List.Item title="Item in the Main List">
1603
+ * </List>
1604
+ * );
1605
+ * }
1606
+ * ```
1607
+ */
1608
+ Section: typeof DropdownSection_2;
1609
+ /**
1610
+ * A dropdown item in a {@link List.Dropdown}
1611
+ *
1612
+ * @example
1613
+ * ```typescript
1614
+ * import { List } from "@raycast/api";
1615
+ *
1616
+ * export default function Command() {
1617
+ * return (
1618
+ * <List searchBarAccessory={
1619
+ * <List.Dropdown tooltip="Dropdown With Items">
1620
+ * <List.Dropdown.Item title="One" value="one" />
1621
+ * <List.Dropdown.Item title="Two" value="two" />
1622
+ * <List.Dropdown.Item title="Three" value="three" />
1623
+ * </List.Dropdown>
1624
+ * }>
1625
+ * <List.Item title="Item in the Main List">
1626
+ * </List>
1627
+ * );
1628
+ * }
1629
+ * ```
1630
+ */
1631
+ Item: typeof DropdownItem_2;
1632
+ }
1719
1633
 
1720
1634
  /**
1721
- * See {@link Form.Dropdown.Item}
1635
+ * See {@link Form.Dropdown.Props}
1722
1636
  */
1723
- declare const DropdownItem: FunctionComponent<DropdownItemProps>;
1637
+ declare interface DropdownProps extends FormItemProps_2<string> {
1638
+ /**
1639
+ * Sections or items. If {@link Form.Dropdown.Item} elements are specified, a default section is automatically created.
1640
+ */
1641
+ children?: ReactNode;
1642
+ }
1724
1643
 
1725
- /**
1726
- * See {@link Form.Dropdown.Item.Props}
1727
- */
1728
- declare interface DropdownItemProps {
1644
+ declare interface DropdownProps_2 {
1729
1645
  /**
1730
- * Value of the dropdown item.
1731
- * Make sure to assign each unique value for each item.
1646
+ * ID of the dropdown.
1732
1647
  */
1733
- value: string;
1648
+ id?: string;
1734
1649
  /**
1735
- * The title displayed for the item.
1650
+ * Tooltip displayed when hovering the dropdown.
1736
1651
  */
1737
- title: string;
1652
+ tooltip: string;
1738
1653
  /**
1739
- * A optional icon displayed for the item.
1654
+ * Placeholder text that will be shown in the dropdown search field.
1655
+ *
1656
+ * @defaultValue `"Search..."`
1740
1657
  */
1741
- icon?: Image.ImageLike;
1742
- }
1743
-
1744
- /**
1745
- * See {@link Form.Dropdown.Props}
1746
- */
1747
- declare interface DropdownProps extends FormItemProps_2<string> {
1658
+ placeholder?: string;
1659
+ /**
1660
+ * Indicates whether the value of the dropdown should be persisted after selection, and restored next time the dropdown is rendered.
1661
+ */
1662
+ storeValue?: boolean | undefined;
1748
1663
  /**
1749
- * Sections or items. If {@link DropdownItem} elements are specified, a default section is automatically created.
1664
+ * The currently value of the dropdown.
1665
+ */
1666
+ value?: string;
1667
+ /**
1668
+ * The default value of the dropdown.
1669
+ * 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.
1670
+ *
1671
+ * **If you're using `storeValue` and configured it as `true` _and_ a {@link List.Dropdown.Item} with the same value exists, then it will be selected.**
1672
+ *
1673
+ * **If you configure `value` at the same time as `defaultValue`, the `value` will have precedence over `defaultValue`.**
1674
+ */
1675
+ defaultValue?: string;
1676
+ /**
1677
+ * List sections or items. If {@link List.Dropdown.Item} elements are specified, a default section is automatically created.
1750
1678
  */
1751
1679
  children?: ReactNode;
1680
+ /**
1681
+ * Callback triggered when the list item selection changes.
1682
+ */
1683
+ onChange?: (newValue: string) => void;
1752
1684
  }
1753
1685
 
1754
1686
  /**
@@ -1761,6 +1693,11 @@ declare type DropdownRef = FormItemRef;
1761
1693
  */
1762
1694
  declare const DropdownSection: FunctionComponent<DropdownSectionProps>;
1763
1695
 
1696
+ /**
1697
+ * See {@link List.Dropdown.Section}
1698
+ */
1699
+ declare const DropdownSection_2: FunctionComponent<DropdownSectionProps_2>;
1700
+
1764
1701
  /**
1765
1702
  * See {@link Form.Dropdown.Section.Props}
1766
1703
  */
@@ -1775,11 +1712,43 @@ declare interface DropdownSectionProps {
1775
1712
  title?: string;
1776
1713
  }
1777
1714
 
1715
+ declare interface DropdownSectionProps_2 {
1716
+ /**
1717
+ * The item elements of the section.
1718
+ */
1719
+ children?: ReactNode;
1720
+ /**
1721
+ * Title displayed above the section
1722
+ */
1723
+ title?: string;
1724
+ }
1725
+
1778
1726
  /**
1779
1727
  * @deprecated Use {@link Color.Dynamic} instead
1780
1728
  */
1781
1729
  export declare type DynamicColor = Color.Dynamic;
1782
1730
 
1731
+ declare const EmptyView: FunctionComponent<EmptyViewProps>;
1732
+
1733
+ declare interface EmptyViewProps extends ActionsInterface {
1734
+ /**
1735
+ * An icon displayed in the center of the EmptyView.
1736
+ *
1737
+ * @remarks
1738
+ * If an SVG is used, its longest side will be 128 pixels. Other images will be up/downscaled proportionally so that the longest side is between 64 and 256 pixels.
1739
+ * If not specified, Raycast's default `EmptyView` icon will be used.
1740
+ */
1741
+ icon?: Image.ImageLike | undefined | null;
1742
+ /**
1743
+ * The main title displayed for the Empty View.
1744
+ */
1745
+ title?: string;
1746
+ /**
1747
+ * An optional description for why the empty view is shown.
1748
+ */
1749
+ description?: string;
1750
+ }
1751
+
1783
1752
  /**
1784
1753
  * Holds data about the environment the command is running in. Use the global {@link environment} object to retrieve values.
1785
1754
  */
@@ -1871,7 +1840,7 @@ export declare interface FileSystemItem {
1871
1840
  /**
1872
1841
  * Shows a list of form items such as {@link Form.TextField}, {@link Form.Checkbox} or {@link Form.Dropdown}.
1873
1842
  */
1874
- export declare const Form: FunctionComponent<FormProps_2> & FormItems & DeprecatedFormItems;
1843
+ export declare const Form: FunctionComponent<FormProps_2> & FormMembers & DeprecatedFormMembers;
1875
1844
 
1876
1845
  export declare namespace Form {
1877
1846
  export type ItemProps<T extends FormValue_2> = FormItemProps_2<T>;
@@ -2258,6 +2227,12 @@ export declare namespace Form {
2258
2227
  * Props of the {@link Form.DatePicker} React component.
2259
2228
  */
2260
2229
  export type Props = DatePickerProps;
2230
+ /**
2231
+ * The types of date components the user can pick
2232
+ * * `Date` - only year, month, and day can be picked
2233
+ * * `DateTime` - hour and second can be picked in addition to year, month and day
2234
+ */
2235
+ export type Type = DatePickerType;
2261
2236
  }
2262
2237
  /**
2263
2238
  * A Ref Type for the {@link Form.Dropdown}.
@@ -2467,20 +2442,6 @@ export declare const FormDatePicker: typeof Form.DatePicker;
2467
2442
  export declare interface FormDatePickerProps extends Form.DatePicker.Props {
2468
2443
  }
2469
2444
 
2470
- /**
2471
- * See {@link Form.DatePicker.Type}
2472
- */
2473
- declare enum FormDatePickerType {
2474
- /**
2475
- * Only year, month, and day can be picked
2476
- */
2477
- Date = "date",
2478
- /**
2479
- * hour and second can be picked in addition to year, month and day
2480
- */
2481
- DateTime = "date_time"
2482
- }
2483
-
2484
2445
  /**
2485
2446
  * @deprecated Use {@link Form.Dropdown} instead.
2486
2447
  */
@@ -2548,23 +2509,98 @@ declare interface FormItemProps_2<T extends FormValue_2> {
2548
2509
  /**
2549
2510
  * The current value of the item.
2550
2511
  */
2551
- value?: T & FormValue_2;
2512
+ value?: T;
2552
2513
  /**
2553
2514
  * The default value of the item.
2554
2515
  * 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.
2555
2516
  *
2556
- * If you're using {@link FormItemProps.storeValue} and configured it as `true` then the stored value will be set.
2517
+ * If you're using `storeValue` and configured it as `true` then the stored value will be set.
2518
+ *
2519
+ * If you configure `value` at the same time with `defaultValue`, the `value` will be set instead of `defaultValue`.
2520
+ */
2521
+ defaultValue?: T;
2522
+ /**
2523
+ * The callback which will be triggered when the `value` of the item changes.
2524
+ */
2525
+ onChange?: (newValue: T) => void;
2526
+ }
2527
+
2528
+ /**
2529
+ * Interface describing common functions and props that Form.Item Refs has.
2530
+ */
2531
+ declare interface FormItemRef {
2532
+ /**
2533
+ * Focuses the item.
2534
+ *
2535
+ * @example
2536
+ * ```typescript
2537
+ * import { Form, ActionPanel, Action } from "@raycast/api";
2538
+ * import { useRef } from "react";
2539
+ *
2540
+ * export default function Command() {
2541
+ * const textFieldRef = useRef<Form.TextField>(null);
2557
2542
  *
2558
- * If you configure {@link FormItemProps.value} at the same time with {@link FormItemProps.defaultValue}, the `value` will be set instead of `defaultValue`.
2543
+ * return (
2544
+ * <Form
2545
+ * actions={
2546
+ * <ActionPanel>
2547
+ * <Action.SubmitForm
2548
+ * title="Submit"
2549
+ * onSubmit={(values) => {
2550
+ * textFieldRef.current?.focus();
2551
+ * console.log("Values", values);
2552
+ * }}
2553
+ * />
2554
+ * </ActionPanel>
2555
+ * }
2556
+ * >
2557
+ * <Form.TextField id="textField" title="Your Name" placeholder="César" ref={textFieldRef} />
2558
+ * <Form.TextArea id="textArea" title="About" placeholder="Enter something about you" />
2559
+ * </Form>
2560
+ * );
2561
+ * }
2562
+ * ```
2559
2563
  */
2560
- defaultValue?: T & FormValue_2;
2564
+ focus: () => void;
2561
2565
  /**
2562
- * The callback which will be triggered on the {@link Form.Item.Props.value} change for the item.
2566
+ * Resets value of the item
2567
+ *
2568
+ * @remarks
2569
+ * If `defaultValue` is defined, calling the `.reset()` function will set `value` to the `defaultValue`.
2570
+ *
2571
+ * @example
2572
+ * ```typescript
2573
+ * import { Form, ActionPanel, Action } from "@raycast/api";
2574
+ * import { useRef } from "react";
2575
+ *
2576
+ * export default function Command() {
2577
+ * const textFieldRef = useRef<Form.TextField>(null);
2578
+ *
2579
+ * return (
2580
+ * <Form
2581
+ * actions={
2582
+ * <ActionPanel>
2583
+ * <Action.SubmitForm
2584
+ * title="Submit"
2585
+ * onSubmit={(values) => {
2586
+ * textFieldRef.current?.focus();
2587
+ * console.log("Values", values);
2588
+ * }}
2589
+ * />
2590
+ * </ActionPanel>
2591
+ * }
2592
+ * >
2593
+ * <Form.TextField id="textField" title="Your Name" placeholder="César" ref={textFieldRef} />
2594
+ * <Form.TextArea id="textArea" title="About" placeholder="Enter something about you" />
2595
+ * </Form>
2596
+ * );
2597
+ * }
2598
+ * ```
2563
2599
  */
2564
- onChange?: (newValue: T & FormValue_2) => void;
2600
+ reset: () => void;
2565
2601
  }
2566
2602
 
2567
- declare interface FormItems {
2603
+ declare interface FormMembers {
2568
2604
  /**
2569
2605
  * A form item with a checkbox.
2570
2606
  *
@@ -3447,56 +3483,156 @@ export declare namespace Image {
3447
3483
  dark: Asset;
3448
3484
  };
3449
3485
  /**
3450
- * Available masks that can be used to change the shape of an image.
3451
- *
3452
- * @remarks
3453
- * Can be handy to shape avatars or other items in a list.
3454
- *
3455
- * @example
3456
- * ```typescript
3457
- * import { Image, List } from "@raycast/api";
3458
- *
3459
- * export default function Command() {
3460
- * return (
3461
- * <List>
3462
- * <List.Item title="Icon" icon={{ source: "https://raycast.com/uploads/avatar.png", mask: Image.Mask.Circle }} />
3463
- * </List>
3464
- * );
3465
- * };
3466
- * ```
3486
+ * Available masks that can be used to change the shape of an image.
3487
+ *
3488
+ * @remarks
3489
+ * Can be handy to shape avatars or other items in a list.
3490
+ *
3491
+ * @example
3492
+ * ```typescript
3493
+ * import { Image, List } from "@raycast/api";
3494
+ *
3495
+ * export default function Command() {
3496
+ * return (
3497
+ * <List>
3498
+ * <List.Item title="Icon" icon={{ source: "https://raycast.com/uploads/avatar.png", mask: Image.Mask.Circle }} />
3499
+ * </List>
3500
+ * );
3501
+ * };
3502
+ * ```
3503
+ */
3504
+ export enum Mask {
3505
+ /**
3506
+ * Masks an image with a circle. Good to use for avatars.
3507
+ */
3508
+ Circle = "circle",
3509
+ /**
3510
+ * Masks an image with a rounded rectangle.
3511
+ */
3512
+ RoundedRectangle = "roundedRectangle"
3513
+ }
3514
+ }
3515
+
3516
+ /**
3517
+ * @deprecated Use {@link Image.ImageLike} instead
3518
+ */
3519
+ export declare type ImageLike = Image.ImageLike;
3520
+
3521
+ /**
3522
+ * @deprecated Use {@link Image.Mask} instead
3523
+ */
3524
+ export declare type ImageMask = Image.Mask;
3525
+
3526
+ /**
3527
+ * @deprecated Use {@link Image.Mask} instead
3528
+ */
3529
+ export declare const ImageMask: typeof Image.Mask;
3530
+
3531
+ /**
3532
+ * @deprecated Use {@link Image.Source} instead
3533
+ */
3534
+ export declare type ImageSource = Image.Source;
3535
+
3536
+ /**
3537
+ * See {@link List.Item}
3538
+ */
3539
+ declare const Item: FunctionComponent<ItemProps> & ItemMembers;
3540
+
3541
+ declare interface ItemAccessory {
3542
+ /**
3543
+ * An optional text that will be used as the label.
3544
+ */
3545
+ text?: string | undefined | null;
3546
+ /**
3547
+ * An optional {@link Image.ImageLike} that will be used as the icon.
3548
+ * @remarks
3549
+ * An image will be shown in front of the text if {@link List.Item.Accessory.text} is specified.
3550
+ */
3551
+ icon?: Image.ImageLike | undefined | null;
3552
+ /**
3553
+ * An optional tooltip shown when the accessory is hovered.
3554
+ */
3555
+ tooltip?: string | undefined | null;
3556
+ }
3557
+
3558
+ declare interface ItemMembers {
3559
+ /**
3560
+ * A Detail view that will be shown in the right-hand-side of the List.
3561
+ *
3562
+ * @example
3563
+ * ```typescript
3564
+ * import { List } from "@raycast/api";
3565
+ *
3566
+ * export default function Command() {
3567
+ * return (
3568
+ * <List isShowingDetail>
3569
+ * <List.Item
3570
+ * title="Pikachu"
3571
+ * subtitle="Electric"
3572
+ * detail={<List.Item.Detail markdown="![Illustration](https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/25.png)" />}
3573
+ * />
3574
+ * </List>
3575
+ * );
3576
+ * }
3577
+ * ```
3578
+ */
3579
+ Detail: typeof Detail_2;
3580
+ }
3581
+
3582
+ declare interface ItemProps extends ActionsInterface {
3583
+ /**
3584
+ * ID of the item. This string is passed to the `onSelectionChange` handler of the {@link List} when the item is selected.
3585
+ * Make sure to assign each item a unique ID or a UUID will be auto generated.
3586
+ */
3587
+ id?: string;
3588
+ /**
3589
+ * The main title displayed for that item, optionally with a tooltip.
3590
+ */
3591
+ title: string | {
3592
+ value: string;
3593
+ tooltip: string;
3594
+ };
3595
+ /**
3596
+ * An optional subtitle displayed next to the main title, optionally with a tooltip.
3597
+ */
3598
+ subtitle?: string | {
3599
+ value: string;
3600
+ tooltip: string;
3601
+ };
3602
+ /**
3603
+ * An optional property used for providing additional indexable strings for search.
3604
+ * When filtering the list in Raycast through the search bar, the keywords will be searched in addition to the title.
3605
+ */
3606
+ keywords?: string[];
3607
+ /**
3608
+ * An optional icon displayed for the list item.
3609
+ */
3610
+ icon?: Image.ImageLike | {
3611
+ value: Image.ImageLike;
3612
+ tooltip: string;
3613
+ };
3614
+ /**
3615
+ * @deprecated Use `accessories={[ { icon: ... } ]}` instead.
3616
+ */
3617
+ accessoryIcon?: Image.ImageLike;
3618
+ /**
3619
+ * @deprecated Use `accessories={[ { text: ... } ]}` instead.
3620
+ */
3621
+ accessoryTitle?: string;
3622
+ /**
3623
+ * An optional array of {@link List.Item.Accessory} items displayed on the right side in a List.Item.
3624
+ */
3625
+ accessories?: ItemAccessory[] | undefined | null;
3626
+ /**
3627
+ * An {@link ActionPanel} that will be updated for the selected list item.
3628
+ */
3629
+ actions?: ReactNode | null;
3630
+ /**
3631
+ * The `List.Item.Detail` to be rendered in the right side area when the parent List is showing details and the item is selected.
3467
3632
  */
3468
- export enum Mask {
3469
- /**
3470
- * Masks an image with a circle. Good to use for avatars.
3471
- */
3472
- Circle = "circle",
3473
- /**
3474
- * Masks an image with a rounded rectangle.
3475
- */
3476
- RoundedRectangle = "roundedRectangle"
3477
- }
3633
+ detail?: ReactNode;
3478
3634
  }
3479
3635
 
3480
- /**
3481
- * @deprecated Use {@link Image.ImageLike} instead
3482
- */
3483
- export declare type ImageLike = Image.ImageLike;
3484
-
3485
- /**
3486
- * @deprecated Use {@link Image.Mask} instead
3487
- */
3488
- export declare type ImageMask = Image.Mask;
3489
-
3490
- /**
3491
- * @deprecated Use {@link Image.Mask} instead
3492
- */
3493
- export declare const ImageMask: typeof Image.Mask;
3494
-
3495
- /**
3496
- * @deprecated Use {@link Image.Source} instead
3497
- */
3498
- export declare type ImageSource = Image.Source;
3499
-
3500
3636
  export declare namespace Keyboard {
3501
3637
  /**
3502
3638
  * A keyboard shortcut is defined by one or more modifier keys (command, control, etc.) and a single key equivalent (a character or special key).
@@ -3573,291 +3709,142 @@ export declare type KeyEquivalent = Keyboard.KeyEquivalent;
3573
3709
  export declare type KeyModifier = Keyboard.KeyModifier;
3574
3710
 
3575
3711
  /**
3576
- * Displays {@link List.Section} or {@link List.Item}, optionally {@link List.Dropdown}.
3577
- *
3578
- * @remarks
3579
- * The list uses built-in filtering by indexing the title of list items and additionally keywords.
3580
- *
3581
- * @example
3582
- * ```typescript
3583
- * import { List } from "@raycast/api";
3584
- *
3585
- * function DrinkDropdown(props: DrinkDropdownProps) {
3586
- * const { isLoading = false, drinkTypes, onDrinkTypeChange } = props;
3587
- * return (
3588
- * <List.Dropdown
3589
- * tooltip="Select Drink Type"
3590
- * storeValue={true}
3591
- * onChange={(newValue) => {
3592
- * onDrinkTypeChange(newValue);
3593
- * }}
3594
- * >
3595
- * <List.Dropdown.Section title="Alcoholic Beverages">
3596
- * {drinkTypes.map((drinkType) => (
3597
- * <List.Dropdown.Item key={drinkType.id} title={{ value: drinkType.name, tooltip: drinkType.definition }} value={drinkType.id} />
3598
- * ))}
3599
- * </List.Dropdown.Section>
3600
- * </List.Dropdown>
3601
- * );
3602
- * }
3603
- *
3604
- * export default function Command() {
3605
- * const drinkTypes = [
3606
- * { id: 1, name: 'Beer', definition: "an alcoholic drink made from yeast-fermented malt flavoured with hops" },
3607
- * { id: 2, name: 'Wine', definition: "an alcoholic drink made from fermented grape juice" }];
3608
- * const onDrinkTypeChange = (newValue) => {
3609
- * console.log(newValue);
3610
- * }
3611
- * return (
3612
- * <List
3613
- * navigationTitle="Search Beers"
3614
- * searchBarPlaceholder="Search your favorite drink"
3615
- * searchBarAccessory={<DrinkDropdown drinkTypes={drinkTypes} onDrinkTypeChange={onDrinkTypeChange} />}
3616
- * >
3617
- * <List.Item title="Augustiner Helles" />
3618
- * <List.Item title="Camden Hells" />
3619
- * <List.Item title="Leffe Blonde" />
3620
- * <List.Item title="Sierra Nevada IPA" />
3621
- * </List>
3622
- * );
3623
- * }
3624
- * ```
3712
+ * See {@link Detail.Metadata.Label}
3625
3713
  */
3626
- export declare function List(props: List.Props): ReactElement<List.Props>;
3714
+ declare const Label: FunctionComponent<LabelProps>;
3627
3715
 
3628
- export declare namespace List {
3629
- var propTypes: {
3630
- onSelectionChange: PropTypes.Requireable<(...args: any[]) => any>;
3631
- searchBarAccessory: PropTypes.Requireable<PropTypes.ReactNodeLike>;
3632
- searchText: PropTypes.Requireable<string>;
3633
- enableFiltering: PropTypes.Requireable<boolean>;
3634
- searchBarPlaceholder: PropTypes.Requireable<string>;
3635
- selectedItemId: PropTypes.Requireable<string>;
3636
- throttle: PropTypes.Requireable<boolean>;
3637
- onSearchTextChange: PropTypes.Requireable<(...args: any[]) => any>;
3638
- isLoading: PropTypes.Requireable<boolean>;
3639
- navigationTitle: PropTypes.Requireable<string>;
3640
- actions: PropTypes.Requireable<PropTypes.ReactNodeLike>;
3641
- };
3642
- var displayName: string;
3716
+ /**
3717
+ * See {@link List.Item.Detail.Metadata.Label}
3718
+ */
3719
+ declare const Label_2: FunctionComponent<LabelProps_2>;
3720
+
3721
+ declare interface LabelProps {
3722
+ /**
3723
+ * The title shown above the item.
3724
+ */
3725
+ title: string;
3726
+ /**
3727
+ * An icon to illustrate the value of the item.
3728
+ */
3729
+ icon?: Image.ImageLike | undefined | null;
3730
+ /**
3731
+ * The text value of the item.
3732
+ */
3733
+ text?: string;
3643
3734
  }
3644
3735
 
3645
- export declare namespace List {
3736
+ declare interface LabelProps_2 {
3646
3737
  /**
3647
- * A view to display when there aren't any items available. Use to greet users with a friendly message if the
3648
- * extension requires user input before it can show any list items e.g. when searching for a package, an article etc.
3649
- *
3650
- * @remarks
3651
- * Raycast provides a default `EmptyView` that will be displayed if the {@link List} component either has no children,
3652
- * or if it has children, but none of them match the query in the search bar. This too can be overridden by passing
3653
- * an empty view alongside the other `List.Item`s.
3654
- *
3655
- * @example
3656
- * ```typescript
3657
- * import { useState } from "react";
3658
- * import { List } from "@raycast/api";
3659
- *
3660
- * export default function CommandWithCustomEmptyState() {
3661
- * const [state, setState] = useState({ searchText: "", items: [] });
3662
- *
3663
- * useEffect(() => {
3664
- * // perform an API call that eventually populates `items`.
3665
- * }, [state.searchText])
3666
- *
3667
- * return (
3668
- * <List
3669
- * onSearchTextChange={(newValue) =>
3670
- * setState((previous) => ({ ...previous, searchText: newValue }))
3671
- * }
3672
- * >
3673
- * {state.searchText === "" && state.items.length === 0 ? (
3674
- * <List.EmptyView
3675
- * icon={{ source: "https://placekitten.com/500/500" }}
3676
- * title="Type something to get started"
3677
- * />
3678
- * ) : (
3679
- * state.items.map((item) => <List.Item key={item} title={item} />)
3680
- * )}
3681
- * </List>
3682
- * );
3683
- * }
3684
- * ```
3738
+ * The title of the item.
3685
3739
  */
3686
- const EmptyView: typeof ListEmptyView;
3740
+ title: string;
3687
3741
  /**
3688
- * A item in the {@link List}.
3689
- *
3690
- * @remarks
3691
- * This is one of the foundational UI components of Raycast. A list item represents a single entity. It can be a
3692
- * GitHub pull request, a file, or anything else. You most likely want to perform actions on this item, so make it clear
3693
- * to the user what this list item is about.
3694
- *
3695
- * @example
3696
- * ```typescript
3697
- * import { Icon, List } from "@raycast/api";
3698
- *
3699
- * export default function Command() {
3700
- * return (
3701
- * <List>
3702
- * <List.Item icon={Icon.Star} title="Augustiner Helles" subtitle="0,5 Liter" accessories={[{ text: "Germany" }]} />
3703
- * </List>
3704
- * );
3705
- * }
3706
- * ```
3742
+ * An icon to illustrate the value of the item.
3707
3743
  */
3708
- const Item: typeof ListItem_2;
3744
+ icon?: Image.ImageLike | undefined | null;
3709
3745
  /**
3710
- * A group of related {@link List.Item}.
3711
- *
3712
- * @remarks
3713
- * Sections are a great way to structure your list. For example, group GitHub issues with the same status and order them by priority.
3714
- * This way, users can quickly access what is most relevant.
3715
- *
3716
- * @example
3717
- * ```typescript
3718
- * import { List } from "@raycast/api";
3719
- *
3720
- * export default function Command() {
3721
- * return (
3722
- * <List>
3723
- * <List.Section title="Lager">
3724
- * <List.Item title="Camden Hells" />
3725
- * </List.Section>
3726
- * <List.Section title="IPA">
3727
- * <List.Item title="Sierra Nevada IPA" />
3728
- * </List.Section>
3729
- * </List>
3730
- * );
3731
- * }
3732
- * ```
3746
+ * The text value of the item.
3733
3747
  */
3734
- const Section: typeof ListSection_2;
3748
+ text?: string;
3749
+ }
3750
+
3751
+ /**
3752
+ * See {@link Detail.Metadata.Link}
3753
+ */
3754
+ declare const Link: FunctionComponent<LinkProps>;
3755
+
3756
+ declare interface LinkProps {
3735
3757
  /**
3736
- * A dropdown menu that will be shown in the right-hand-side of the search bar.
3737
- *
3738
- * @example
3739
- * ```typescript
3740
- * import { List } from "@raycast/api";
3741
- *
3742
- * function DrinkDropdown(props: DrinkDropdownProps) {
3743
- * const { isLoading = false, drinkTypes, onDrinkTypeChange } = props;
3744
- * return (
3745
- * <List.Dropdown
3746
- * tooltip="Select Drink Type"
3747
- * disabled={isLoading}
3748
- * storeValue={true}
3749
- * onChange={(newValue) => {
3750
- * onDrinkTypeChange(newValue);
3751
- * }}
3752
- * >
3753
- * <List.Dropdown.Section title="Alcoholic Beverages">
3754
- * {drinkTypes.map((drinkType) => (
3755
- * <List.Dropdown.Item key={drinkType.id} title={drinkType.name} value={drinkType.id} />
3756
- * ))}
3757
- * </List.Dropdown.Section>
3758
- * </List.Dropdown>
3759
- * );
3760
- * }
3761
- *
3762
- * export default function Command() {
3763
- * const drinkTypes = [{ id: 1, name: 'Beer' }, { id: 2, name: 'Wine' }];
3764
- * const onDrinkTypeChange = (newValue) => {
3765
- * console.log(newValue);
3766
- * }
3767
- * return (
3768
- * <List
3769
- * navigationTitle="Search Beers"
3770
- * searchBarPlaceholder="Search your favorite drink"
3771
- * searchBarAccessory={<DrinkDropdown drinkTypes={drinkTypes} onDrinkTypeChange={onDrinkTypeChange} />}
3772
- * >
3773
- * <List.Item title="Augustiner Helles" />
3774
- * <List.Item title="Camden Hells" />
3775
- * <List.Item title="Leffe Blonde" />
3776
- * <List.Item title="Sierra Nevada IPA" />
3777
- * </List>
3778
- * );
3779
- * }
3780
- * ```
3758
+ * The title shown above the item.
3759
+ */
3760
+ title: string;
3761
+ /**
3762
+ * The target of the link.
3763
+ */
3764
+ target: string;
3765
+ /**
3766
+ * The text value of the item.
3781
3767
  */
3782
- const Dropdown: typeof ListDropdown;
3768
+ text: string;
3769
+ }
3770
+
3771
+ /**
3772
+ * Displays {@link List.Section} or {@link List.Item}, optionally {@link List.Dropdown}.
3773
+ *
3774
+ * @remarks
3775
+ * The list uses built-in filtering by indexing the title of list items and additionally keywords.
3776
+ *
3777
+ * @example
3778
+ * ```typescript
3779
+ * import { List } from "@raycast/api";
3780
+ *
3781
+ * function DrinkDropdown(props: DrinkDropdownProps) {
3782
+ * const { isLoading = false, drinkTypes, onDrinkTypeChange } = props;
3783
+ * return (
3784
+ * <List.Dropdown
3785
+ * tooltip="Select Drink Type"
3786
+ * storeValue={true}
3787
+ * onChange={(newValue) => {
3788
+ * onDrinkTypeChange(newValue);
3789
+ * }}
3790
+ * >
3791
+ * <List.Dropdown.Section title="Alcoholic Beverages">
3792
+ * {drinkTypes.map((drinkType) => (
3793
+ * <List.Dropdown.Item key={drinkType.id} title={{ value: drinkType.name, tooltip: drinkType.definition }} value={drinkType.id} />
3794
+ * ))}
3795
+ * </List.Dropdown.Section>
3796
+ * </List.Dropdown>
3797
+ * );
3798
+ * }
3799
+ *
3800
+ * export default function Command() {
3801
+ * const drinkTypes = [
3802
+ * { id: 1, name: 'Beer', definition: "an alcoholic drink made from yeast-fermented malt flavoured with hops" },
3803
+ * { id: 2, name: 'Wine', definition: "an alcoholic drink made from fermented grape juice" }];
3804
+ * const onDrinkTypeChange = (newValue) => {
3805
+ * console.log(newValue);
3806
+ * }
3807
+ * return (
3808
+ * <List
3809
+ * navigationTitle="Search Beers"
3810
+ * searchBarPlaceholder="Search your favorite drink"
3811
+ * searchBarAccessory={<DrinkDropdown drinkTypes={drinkTypes} onDrinkTypeChange={onDrinkTypeChange} />}
3812
+ * >
3813
+ * <List.Item title="Augustiner Helles" />
3814
+ * <List.Item title="Camden Hells" />
3815
+ * <List.Item title="Leffe Blonde" />
3816
+ * <List.Item title="Sierra Nevada IPA" />
3817
+ * </List>
3818
+ * );
3819
+ * }
3820
+ * ```
3821
+ */
3822
+ export declare const List: FunctionComponent<ListProps_2> & ListMembers;
3823
+
3824
+ export declare namespace List {
3783
3825
  /**
3784
3826
  * Props of the {@link List} React component.
3785
3827
  */
3786
- export interface Props extends ActionsInterface, NavigationChildInterface {
3787
- /**
3788
- * List sections or items. If {@link List.Item} elements are specified, a default section is automatically created.
3789
- */
3790
- children?: ReactNode;
3791
- /**
3792
- * Callback triggered when the item selection in the list changes.
3793
- */
3794
- onSelectionChange?: (id?: string) => void;
3795
- /**
3796
- * {@link List.Dropdown} that will be shown in the right-hand-side of the search bar.
3797
- */
3798
- searchBarAccessory?: ReactElement<List.Dropdown.Props> | null | boolean;
3799
- /**
3800
- * The text that will be displayed in the search bar.
3801
- */
3802
- searchText?: string;
3803
- /**
3804
- * Toggles Raycast filtering. When `true`, Raycast will use the query in the search bar to filter list
3805
- * items. When `false`, the extension needs to take care of the filtering.
3806
- *
3807
- * @remarks
3808
- * Having this enabled when filtering items in the extension is unspecified behaviour.
3809
- *
3810
- * @defaultValue false when `onSearchTextChange` is specified, true otherwise.
3811
- */
3812
- enableFiltering?: boolean;
3813
- /**
3814
- * Placeholder text that will be shown in the search bar.
3815
- *
3816
- * @defaultValue Search value...
3817
- */
3818
- searchBarPlaceholder?: string;
3819
- /**
3820
- * Selects the item with the specified id.
3821
- */
3822
- selectedItemId?: string;
3823
- /**
3824
- * Defines whether the {@link List.Props.onSearchTextChange} will be triggered on every keyboard press or with a delay for throttling the events.
3825
- * Recommended to set to `true` when using custom filtering logic with asynchronous operations (e.g. network requests).
3826
- * @defaultValue false
3827
- */
3828
- throttle?: boolean;
3829
- /**
3830
- * Callback triggered when the search bar text changes.
3831
- *
3832
- * @remarks
3833
- * Specifying this implicitly toggles `enableFiltering` to false. To enable native filtering when using `onSearchTextChange`, explicitly set `enableFiltering` to true.
3834
- */
3835
- onSearchTextChange?: (text: string) => void;
3828
+ export type Props = ListProps_2;
3829
+ export namespace EmptyView {
3830
+ export type Props = EmptyViewProps;
3831
+ }
3832
+ export namespace Dropdown {
3836
3833
  /**
3837
- * Whether the List should have an area on the right side of the items to show additional details about the selected item.
3838
- *
3839
- * When true, it is recommended not to show any accessories on the `List.Item` and instead show the additional information in the `List.Item.Detail` view.
3834
+ * Props of the {@link List.Dropdown} React component.
3840
3835
  */
3841
- isShowingDetail?: boolean;
3842
- }
3843
- export namespace EmptyView {
3844
- export interface Props extends ActionsInterface {
3845
- /**
3846
- * An icon displayed in the center of the EmptyView.
3847
- *
3848
- * @remarks
3849
- * If an SVG is used, its longest side will be 128 pixels. Other images will be up/downscaled proportionally so that the longest side is between 64 and 256 pixels.
3850
- * If not specified, Raycast's default `EmptyView` icon will be used.
3851
- */
3852
- icon?: Image.ImageLike;
3836
+ export type Props = DropdownProps_2;
3837
+ export namespace Item {
3853
3838
  /**
3854
- * The main title displayed for the Empty View.
3839
+ * Props of the {@link List.Dropdown.Item} React component.
3855
3840
  */
3856
- title?: string;
3841
+ export type Props = DropdownItemProps_2;
3842
+ }
3843
+ export namespace Section {
3857
3844
  /**
3858
- * An optional description for why the empty view is shown.
3845
+ * Props of the {@link List.Dropdown.Section} React component.
3859
3846
  */
3860
- description?: string;
3847
+ export type Props = DropdownSectionProps_2;
3861
3848
  }
3862
3849
  }
3863
3850
  export namespace Item {
@@ -3877,495 +3864,175 @@ export declare namespace List {
3877
3864
  * }
3878
3865
  * ```
3879
3866
  */
3880
- export interface Accessory {
3881
- /**
3882
- * An optional text that will be used as the label.
3883
- */
3884
- text?: string;
3885
- /**
3886
- * An optional {@link Image.ImageLike} that will be used as the icon.
3887
- * @remarks
3888
- * An image will be shown in front of the text if {@link List.Item.Accessory.text} is specified.
3889
- */
3890
- icon?: Image.ImageLike;
3891
- /**
3892
- * An optional tooltip shown when the accessory is hovered.
3893
- */
3894
- tooltip?: string;
3895
- }
3867
+ export type Accessory = ItemAccessory;
3896
3868
  /**
3897
3869
  * Props of the {@link List.Item} React component.
3898
3870
  */
3899
- export interface Props extends ActionsInterface {
3900
- /**
3901
- * ID of the item.
3902
- * Make sure to assign each item a unique ID or a UUID will be auto generated.
3903
- */
3904
- id?: string;
3905
- /**
3906
- * The main title displayed for that item, optionally with a tooltip.
3907
- */
3908
- title: string | {
3909
- value: string;
3910
- tooltip: string;
3911
- };
3912
- /**
3913
- * An optional subtitle displayed next to the main title, optionally with a tooltip.
3914
- */
3915
- subtitle?: string | {
3916
- value: string;
3917
- tooltip: string;
3918
- };
3919
- /**
3920
- * An optional property used for providing additional indexable strings for search.
3921
- * When filtering the list in Raycast through the search bar, the keywords will be searched in addition to the title.
3922
- */
3923
- keywords?: string[];
3924
- /**
3925
- * An optional icon displayed for the list item.
3926
- */
3927
- icon?: Image.ImageLike | {
3928
- value: Image.ImageLike;
3929
- tooltip: string;
3930
- };
3931
- /**
3932
- * @deprecated Use `accessories={[ { icon: ... } ]}` instead.
3933
- */
3934
- accessoryIcon?: Image.ImageLike;
3935
- /**
3936
- * @deprecated Use `accessories={[ { text: ... } ]}` instead.
3937
- */
3938
- accessoryTitle?: string;
3939
- /**
3940
- * An optional array of {@link List.Item.Accessory} items displayed on the right side in a List.Item.
3941
- */
3942
- accessories?: Accessory[];
3943
- /**
3944
- * An {@link ActionPanel} that will be updated for the selected list item.
3945
- */
3946
- actions?: ReactNode | null;
3947
-
3948
- /**
3949
- * The `List.Item.Detail` to be rendered in the right side area when the parent List is showing details and the item is selected.
3950
- */
3951
- detail?: ReactNode;
3952
- }
3871
+ export type Props = ItemProps;
3953
3872
  export namespace Detail {
3954
3873
  /**
3955
3874
  * Props of the {@link List.Item.Detail} React component.
3956
3875
  */
3957
- export interface Props {
3958
- /**
3959
- * Indicates whether a loading bar should be shown or hidden above the detail
3960
- *
3961
- * @defaultValue false
3962
- */
3963
- isLoading?: boolean;
3964
- /**
3965
- * The CommonMark string to be rendered in the right side area when the parent List is showing details and the item is selected.
3966
- */
3967
- markdown?: string | null;
3968
- }
3876
+ export type Props = DetailProps_3;
3969
3877
  }
3970
3878
  }
3971
3879
  export namespace Section {
3972
3880
  /**
3973
3881
  * Props of the {@link List.Section} React component.
3974
3882
  */
3975
- export interface Props {
3976
- /**
3977
- * The {@link List.Item} elements of the section.
3978
- */
3979
- children?: ReactNode;
3980
- /**
3981
- * ID of the section.
3982
- * Make sure to assign each section a unique ID or a UUID will be auto generated.
3983
- */
3984
- id?: string;
3985
- /**
3986
- * Title displayed above the section.
3987
- */
3988
- title?: string;
3989
- /**
3990
- * An optional subtitle displayed next to the title of the section.
3991
- */
3992
- subtitle?: string;
3993
- }
3994
- }
3995
- export namespace Dropdown {
3996
- /**
3997
- * Props of the {@link List.Dropdown} React component.
3998
- */
3999
- export interface Props {
4000
- /**
4001
- * ID of the dropdown.
4002
- */
4003
- id?: string;
4004
- /**
4005
- * Tooltip displayed when hovering the dropdown.
4006
- */
4007
- tooltip: string;
4008
- /**
4009
- * Placeholder text that will be shown in the dropdown search field.
4010
- *
4011
- * @defaultValue Search...
4012
- */
4013
- placeholder?: string;
4014
- /**
4015
- * Indicates whether the value of the dropdown should be persisted after selection, and restored next time the dropdown is rendered.
4016
- */
4017
- storeValue?: boolean;
4018
- /**
4019
- * The currently value of the dropdown.
4020
- */
4021
- value?: string;
4022
- /**
4023
- * The default value of the dropdown.
4024
- * 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.
4025
- *
4026
- * **If you're using `storeValue` and configured it as `true` _and_ a {@link List.Dropdown.Item} with the same value exists, then it will be selected.**
4027
- *
4028
- * **If you configure `value` at the same time as `defaultValue`, the `value` will have precedence over `defaultValue`.**
4029
- */
4030
- defaultValue?: string;
4031
- /**
4032
- * List sections or items. If {@link List.Dropdown.Item} elements are specified, a default section is automatically created.
4033
- */
4034
- children?: ReactNode;
4035
- /**
4036
- * Callback triggered when the list item selection changes.
4037
- */
4038
- onChange?: (newValue: string) => void;
4039
- }
4040
- export namespace Section {
4041
- /**
4042
- * Props of the {@link List.Dropdown.Section} React component.
4043
- */
4044
- export interface Props {
4045
- /**
4046
- * The item elements of the section.
4047
- */
4048
- children?: ReactNode;
4049
- /**
4050
- * Title displayed above the section
4051
- */
4052
- title?: string;
4053
- }
4054
- }
4055
- export namespace Item {
4056
- /**
4057
- * Props of the {@link List.Dropdown.Item} React component.
4058
- */
4059
- export interface Props {
4060
- /**
4061
- * Value of the dropdown item.
4062
- * Make sure to assign each unique value for each item.
4063
- */
4064
- value: string;
4065
- /**
4066
- * The title displayed for the item.
4067
- */
4068
- title: string;
4069
- /**
4070
- * An optional icon displayed for the item.
4071
- */
4072
- icon?: Image.ImageLike;
4073
- }
4074
- }
3883
+ export type Props = SectionProps_2;
4075
3884
  }
4076
3885
  }
4077
3886
 
4078
3887
  /**
4079
- * See {@link List.Dropdown}
3888
+ * @deprecated Use {@link List.item} instead.
4080
3889
  */
4081
- declare function ListDropdown(props: List.Dropdown.Props): ReactElement<List.Dropdown.Props>;
3890
+ export declare const ListItem: typeof List.Item;
4082
3891
 
4083
- declare namespace ListDropdown {
4084
- var propTypes: {
4085
- id: PropTypes.Requireable<string>;
4086
- tooltip: PropTypes.Validator<string>;
4087
- storeValue: (props: List.Dropdown.Props, propName: keyof List.Dropdown.Props, componentName: string, location: string, propFullName: string) => Error;
4088
- value: PropTypes.Requireable<string>;
4089
- defaultValue: PropTypes.Requireable<string>;
4090
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
4091
- };
4092
- var displayName: string;
3892
+ /**
3893
+ * @deprecated Use {@link List.Item.Props} instead.
3894
+ */
3895
+ export declare interface ListItemProps extends List.Item.Props {
4093
3896
  }
4094
3897
 
4095
- declare namespace ListDropdown {
3898
+ declare interface ListMembers {
4096
3899
  /**
4097
- * Visually separated group of dropdown items in a {@link List.Dropdown}.
3900
+ * A view to display when there aren't any items available. Use to greet users with a friendly message if the
3901
+ * extension requires user input before it can show any list items e.g. when searching for a package, an article etc.
4098
3902
  *
4099
3903
  * @remarks
4100
- * Use sections to group related dropdown items together.
3904
+ * Raycast provides a default `EmptyView` that will be displayed if the {@link List} component either has no children,
3905
+ * or if it has children, but none of them match the query in the search bar. This too can be overridden by passing
3906
+ * an empty view alongside the other `List.Item`s.
4101
3907
  *
4102
3908
  * @example
4103
3909
  * ```typescript
3910
+ * import { useState } from "react";
4104
3911
  * import { List } from "@raycast/api";
4105
3912
  *
4106
- * export default function Command() {
3913
+ * export default function CommandWithCustomEmptyState() {
3914
+ * const [state, setState] = useState({ searchText: "", items: [] });
3915
+ *
3916
+ * useEffect(() => {
3917
+ * // perform an API call that eventually populates `items`.
3918
+ * }, [state.searchText])
3919
+ *
4107
3920
  * return (
4108
- * <List searchBarAccessory={
4109
- * <List.Dropdown tooltip="Dropdown With Sections">
4110
- * <List.Dropdown.Section title="First Section">
4111
- * <List.Dropdown.Item title="One" value="one" />
4112
- * </List.Dropdown.Section>
4113
- * <List.Dropdown.Section title="Second Section">
4114
- * <List.Dropdown.Item title="Two" value="two" />
4115
- * </List.Dropdown.Section>
4116
- * </List.Dropdown>
4117
- * }>
4118
- * <List.Item title="Item in the Main List">
3921
+ * <List
3922
+ * onSearchTextChange={(newValue) =>
3923
+ * setState((previous) => ({ ...previous, searchText: newValue }))
3924
+ * }
3925
+ * >
3926
+ * {state.searchText === "" && state.items.length === 0 ? (
3927
+ * <List.EmptyView
3928
+ * icon={{ source: "https://placekitten.com/500/500" }}
3929
+ * title="Type something to get started"
3930
+ * />
3931
+ * ) : (
3932
+ * state.items.map((item) => <List.Item key={item} title={item} />)
3933
+ * )}
4119
3934
  * </List>
4120
3935
  * );
4121
3936
  * }
4122
3937
  * ```
4123
3938
  */
4124
- const Section: typeof ListDropdownSection;
3939
+ EmptyView: typeof EmptyView;
4125
3940
  /**
4126
- * A dropdown item in a {@link List.Dropdown}
3941
+ * A item in the {@link List}.
3942
+ *
3943
+ * @remarks
3944
+ * This is one of the foundational UI components of Raycast. A list item represents a single entity. It can be a
3945
+ * GitHub pull request, a file, or anything else. You most likely want to perform actions on this item, so make it clear
3946
+ * to the user what this list item is about.
4127
3947
  *
4128
3948
  * @example
4129
3949
  * ```typescript
4130
- * import { List } from "@raycast/api";
3950
+ * import { Icon, List } from "@raycast/api";
4131
3951
  *
4132
3952
  * export default function Command() {
4133
- * return (
4134
- * <List searchBarAccessory={
4135
- * <List.Dropdown tooltip="Dropdown With Items">
4136
- * <List.Dropdown.Item title="One" value="one" />
4137
- * <List.Dropdown.Item title="Two" value="two" />
4138
- * <List.Dropdown.Item title="Three" value="three" />
4139
- * </List.Dropdown>
4140
- * }>
4141
- * <List.Item title="Item in the Main List">
4142
- * </List>
3953
+ * return (
3954
+ * <List>
3955
+ * <List.Item icon={Icon.Star} title="Augustiner Helles" subtitle="0,5 Liter" accessories={[{ text: "Germany" }]} />
3956
+ * </List>
3957
+ * );
3958
+ * }
3959
+ * ```
3960
+ */
3961
+ Item: typeof Item;
3962
+ /**
3963
+ * A group of related {@link List.Item}.
3964
+ *
3965
+ * @remarks
3966
+ * Sections are a great way to structure your list. For example, group GitHub issues with the same status and order them by priority.
3967
+ * This way, users can quickly access what is most relevant.
3968
+ *
3969
+ * @example
3970
+ * ```typescript
3971
+ * import { List } from "@raycast/api";
3972
+ *
3973
+ * export default function Command() {
3974
+ * return (
3975
+ * <List>
3976
+ * <List.Section title="Lager">
3977
+ * <List.Item title="Camden Hells" />
3978
+ * </List.Section>
3979
+ * <List.Section title="IPA">
3980
+ * <List.Item title="Sierra Nevada IPA" />
3981
+ * </List.Section>
3982
+ * </List>
4143
3983
  * );
4144
3984
  * }
4145
3985
  * ```
4146
3986
  */
4147
- const Item: typeof ListDropdownItem;
4148
- }
4149
-
4150
- /**
4151
- * See {@link List.Dropdown.Item}
4152
- */
4153
- declare function ListDropdownItem(props: List.Dropdown.Item.Props): ReactElement<List.Dropdown.Item.Props>;
4154
-
4155
- declare namespace ListDropdownItem {
4156
- var propTypes: {
4157
- value: PropTypes.Requireable<string>;
4158
- title: PropTypes.Validator<string>;
4159
- icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4160
- fileIcon: PropTypes.Validator<string>;
4161
- }>> | Required<PropTypes.InferProps<{
4162
- source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
4163
- light: PropTypes.Validator<string>;
4164
- dark: PropTypes.Validator<string>;
4165
- }>>>;
4166
- fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4167
- light: PropTypes.Validator<string>;
4168
- dark: PropTypes.Validator<string>;
4169
- }>>>;
4170
- mask: PropTypes.Requireable<Image.Mask>;
4171
- tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4172
- light: PropTypes.Validator<string>;
4173
- dark: PropTypes.Validator<string>;
4174
- adjustContrast: PropTypes.Requireable<boolean>;
4175
- }>>>;
4176
- }>>>;
4177
- };
4178
- var displayName: string;
4179
- }
4180
-
4181
- /**
4182
- * See {@link List.Dropdown.Section}
4183
- */
4184
- declare function ListDropdownSection(props: List.Dropdown.Section.Props): ReactElement<List.Dropdown.Section.Props>;
4185
-
4186
- declare namespace ListDropdownSection {
4187
- var propTypes: {
4188
- title: PropTypes.Requireable<string>;
4189
- };
4190
- var displayName: string;
4191
- }
4192
-
4193
- declare function ListEmptyView(props: List.EmptyView.Props): ReactElement<List.EmptyView.Props>;
4194
-
4195
- declare namespace ListEmptyView {
4196
- var propTypes: {
4197
- id: PropTypes.Requireable<string>;
4198
- icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4199
- fileIcon: PropTypes.Validator<string>;
4200
- }>> | Required<PropTypes.InferProps<{
4201
- source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
4202
- light: PropTypes.Validator<string>;
4203
- dark: PropTypes.Validator<string>;
4204
- }>>>;
4205
- fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4206
- light: PropTypes.Validator<string>;
4207
- dark: PropTypes.Validator<string>;
4208
- }>>>;
4209
- mask: PropTypes.Requireable<Image.Mask>;
4210
- tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4211
- light: PropTypes.Validator<string>;
4212
- dark: PropTypes.Validator<string>;
4213
- adjustContrast: PropTypes.Requireable<boolean>;
4214
- }>>>;
4215
- }>>>;
4216
- title: PropTypes.Requireable<string>;
4217
- description: PropTypes.Requireable<string>;
4218
- actions: PropTypes.Requireable<PropTypes.ReactNodeLike>;
4219
- };
4220
- var displayName: string;
4221
- }
4222
-
4223
- /**
4224
- * @deprecated Use {@link List.item} instead.
4225
- */
4226
- export declare const ListItem: typeof List.Item;
4227
-
4228
- /**
4229
- * See {@link List.Item}
4230
- */
4231
- declare function ListItem_2(props: List.Item.Props): ReactElement<List.Item.Props>;
4232
-
4233
- declare namespace ListItem_2 {
4234
- var propTypes: {
4235
- id: PropTypes.Requireable<string>;
4236
- title: PropTypes.Validator<string | Required<PropTypes.InferProps<{
4237
- value: PropTypes.Validator<string>;
4238
- tooltip: PropTypes.Validator<string>;
4239
- }>>>;
4240
- subtitle: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4241
- value: PropTypes.Validator<string>;
4242
- tooltip: PropTypes.Validator<string>;
4243
- }>>>;
4244
- keywords: PropTypes.Requireable<string[]>;
4245
- icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4246
- fileIcon: PropTypes.Validator<string>;
4247
- }>> | Required<PropTypes.InferProps<{
4248
- source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
4249
- light: PropTypes.Validator<string>;
4250
- dark: PropTypes.Validator<string>;
4251
- }>>>;
4252
- fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4253
- light: PropTypes.Validator<string>;
4254
- dark: PropTypes.Validator<string>;
4255
- }>>>;
4256
- mask: PropTypes.Requireable<Image.Mask>;
4257
- tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4258
- light: PropTypes.Validator<string>;
4259
- dark: PropTypes.Validator<string>;
4260
- adjustContrast: PropTypes.Requireable<boolean>;
4261
- }>>>;
4262
- }>> | Required<PropTypes.InferProps<{
4263
- value: PropTypes.Validator<string | Required<PropTypes.InferProps<{
4264
- fileIcon: PropTypes.Validator<string>;
4265
- }>> | Required<PropTypes.InferProps<{
4266
- source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
4267
- light: PropTypes.Validator<string>;
4268
- dark: PropTypes.Validator<string>;
4269
- }>>>;
4270
- fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4271
- light: PropTypes.Validator<string>;
4272
- dark: PropTypes.Validator<string>;
4273
- }>>>;
4274
- mask: PropTypes.Requireable<Image.Mask>;
4275
- tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4276
- light: PropTypes.Validator<string>;
4277
- dark: PropTypes.Validator<string>;
4278
- adjustContrast: PropTypes.Requireable<boolean>;
4279
- }>>>;
4280
- }>>>;
4281
- tooltip: PropTypes.Validator<string>;
4282
- }>>>;
4283
- accessoryTitle: PropTypes.Requireable<string>;
4284
- accessoryIcon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4285
- fileIcon: PropTypes.Validator<string>;
4286
- }>> | Required<PropTypes.InferProps<{
4287
- source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
4288
- light: PropTypes.Validator<string>;
4289
- dark: PropTypes.Validator<string>;
4290
- }>>>;
4291
- fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4292
- light: PropTypes.Validator<string>;
4293
- dark: PropTypes.Validator<string>;
4294
- }>>>;
4295
- mask: PropTypes.Requireable<Image.Mask>;
4296
- tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4297
- light: PropTypes.Validator<string>;
4298
- dark: PropTypes.Validator<string>;
4299
- adjustContrast: PropTypes.Requireable<boolean>;
4300
- }>>>;
4301
- }>>>;
4302
- accessories: PropTypes.Requireable<Required<PropTypes.InferProps<{
4303
- text: PropTypes.Requireable<string>;
4304
- icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4305
- fileIcon: PropTypes.Validator<string>;
4306
- }>> | Required<PropTypes.InferProps<{
4307
- source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
4308
- light: PropTypes.Validator<string>;
4309
- dark: PropTypes.Validator<string>;
4310
- }>>>;
4311
- fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4312
- light: PropTypes.Validator<string>;
4313
- dark: PropTypes.Validator<string>;
4314
- }>>>;
4315
- mask: PropTypes.Requireable<Image.Mask>;
4316
- tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
4317
- light: PropTypes.Validator<string>;
4318
- dark: PropTypes.Validator<string>;
4319
- adjustContrast: PropTypes.Requireable<boolean>;
4320
- }>>>;
4321
- }>>>;
4322
- tooltip: PropTypes.Requireable<string>;
4323
- }>>[]>;
4324
- };
4325
- var displayName: string;
4326
- }
4327
-
4328
- declare namespace ListItem_2 {
3987
+ Section: typeof Section_2;
4329
3988
  /**
4330
- * A Detail view that will be shown in the right-hand-side of the List.
3989
+ * A dropdown menu that will be shown in the right-hand-side of the search bar.
4331
3990
  *
4332
3991
  * @example
4333
3992
  * ```typescript
4334
3993
  * import { List } from "@raycast/api";
4335
3994
  *
3995
+ * function DrinkDropdown(props: DrinkDropdownProps) {
3996
+ * const { isLoading = false, drinkTypes, onDrinkTypeChange } = props;
3997
+ * return (
3998
+ * <List.Dropdown
3999
+ * tooltip="Select Drink Type"
4000
+ * disabled={isLoading}
4001
+ * storeValue={true}
4002
+ * onChange={(newValue) => {
4003
+ * onDrinkTypeChange(newValue);
4004
+ * }}
4005
+ * >
4006
+ * <List.Dropdown.Section title="Alcoholic Beverages">
4007
+ * {drinkTypes.map((drinkType) => (
4008
+ * <List.Dropdown.Item key={drinkType.id} title={drinkType.name} value={drinkType.id} />
4009
+ * ))}
4010
+ * </List.Dropdown.Section>
4011
+ * </List.Dropdown>
4012
+ * );
4013
+ * }
4014
+ *
4336
4015
  * export default function Command() {
4016
+ * const drinkTypes = [{ id: 1, name: 'Beer' }, { id: 2, name: 'Wine' }];
4017
+ * const onDrinkTypeChange = (newValue) => {
4018
+ * console.log(newValue);
4019
+ * }
4337
4020
  * return (
4338
- * <List isShowingDetail>
4339
- * <List.Item
4340
- * title="Pikachu"
4341
- * subtitle="Electric"
4342
- * detail={<List.Item.Detail markdown="![Illustration](https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/25.png)" />}
4343
- * />
4021
+ * <List
4022
+ * navigationTitle="Search Beers"
4023
+ * searchBarPlaceholder="Search your favorite drink"
4024
+ * searchBarAccessory={<DrinkDropdown drinkTypes={drinkTypes} onDrinkTypeChange={onDrinkTypeChange} />}
4025
+ * >
4026
+ * <List.Item title="Augustiner Helles" />
4027
+ * <List.Item title="Camden Hells" />
4028
+ * <List.Item title="Leffe Blonde" />
4029
+ * <List.Item title="Sierra Nevada IPA" />
4344
4030
  * </List>
4345
4031
  * );
4346
4032
  * }
4347
4033
  * ```
4348
4034
  */
4349
- const Detail: typeof ListItemDetail;
4350
- }
4351
-
4352
- /**
4353
- * See {@link List.Item.Detail}
4354
- */
4355
- declare function ListItemDetail(props: List.Item.Detail.Props): ReactElement<List.Item.Detail.Props>;
4356
-
4357
- declare namespace ListItemDetail {
4358
- var propTypes: {
4359
- isLoading: PropTypes.Requireable<boolean>;
4360
- markdown: PropTypes.Requireable<string>;
4361
- };
4362
- var displayName: string;
4363
- }
4364
-
4365
- /**
4366
- * @deprecated Use {@link List.Item.Props} instead.
4367
- */
4368
- export declare interface ListItemProps extends List.Item.Props {
4035
+ Dropdown: typeof Dropdown_2;
4369
4036
  }
4370
4037
 
4371
4038
  /**
@@ -4374,25 +4041,69 @@ export declare interface ListItemProps extends List.Item.Props {
4374
4041
  export declare interface ListProps extends List.Props {
4375
4042
  }
4376
4043
 
4044
+ declare interface ListProps_2 extends ActionsInterface, NavigationChildInterface {
4045
+ /**
4046
+ * List sections or items. If {@link List.Item} elements are specified, a default section is automatically created.
4047
+ */
4048
+ children?: ReactNode;
4049
+ /**
4050
+ * Callback triggered when the item selection in the list changes.
4051
+ */
4052
+ onSelectionChange?: (id?: string) => void;
4053
+ /**
4054
+ * {@link List.Dropdown} that will be shown in the right-hand-side of the search bar.
4055
+ */
4056
+ searchBarAccessory?: ReactElement<DropdownProps_2> | undefined | null;
4057
+ /**
4058
+ * The text that will be displayed in the search bar.
4059
+ */
4060
+ searchText?: string;
4061
+ /**
4062
+ * Toggles Raycast filtering. When `true`, Raycast will use the query in the search bar to filter list
4063
+ * items. When `false`, the extension needs to take care of the filtering.
4064
+ *
4065
+ * @remarks
4066
+ * Having this enabled when filtering items in the extension is unspecified behaviour.
4067
+ *
4068
+ * @defaultValue `false` when `onSearchTextChange` is specified, `true` otherwise.
4069
+ */
4070
+ enableFiltering?: boolean;
4071
+ /**
4072
+ * Placeholder text that will be shown in the search bar.
4073
+ *
4074
+ * @defaultValue `"Search value..."`
4075
+ */
4076
+ searchBarPlaceholder?: string;
4077
+ /**
4078
+ * Selects the item with the specified id.
4079
+ */
4080
+ selectedItemId?: string;
4081
+ /**
4082
+ * Defines whether the {@link List.Props.onSearchTextChange} will be triggered on every keyboard press or with a delay for throttling the events.
4083
+ * Recommended to set to `true` when using custom filtering logic with asynchronous operations (e.g. network requests).
4084
+ * @defaultValue `false`
4085
+ */
4086
+ throttle?: boolean;
4087
+ /**
4088
+ * Callback triggered when the search bar text changes.
4089
+ *
4090
+ * @remarks
4091
+ * Specifying this implicitly toggles `enableFiltering` to false. To enable native filtering when using `onSearchTextChange`, explicitly set `enableFiltering` to true.
4092
+ */
4093
+ onSearchTextChange?: (text: string) => void;
4094
+ /**
4095
+ * Whether the List should have an area on the right side of the items to show additional details about the selected item.
4096
+ *
4097
+ * When true, it is recommended not to show any accessories on the `List.Item` and instead show the additional information in the `List.Item.Detail` view.
4098
+ */
4099
+ isShowingDetail?: boolean;
4100
+ }
4101
+
4377
4102
  /**
4378
4103
  * @deprecated Use {@link List.Section} instead.
4379
4104
  */
4380
4105
  export declare const ListSection: typeof List.Section;
4381
4106
 
4382
- /**
4383
- * See {@link List.Section}
4384
- */
4385
- declare function ListSection_2(props: List.Section.Props): ReactElement<List.Section.Props>;
4386
-
4387
- declare namespace ListSection_2 {
4388
- var propTypes: {
4389
- id: PropTypes.Requireable<string>;
4390
- title: PropTypes.Requireable<string>;
4391
- subtitle: PropTypes.Requireable<string>;
4392
- };
4393
- var displayName: string;
4394
- }
4395
-
4396
4107
  /**
4397
4108
  * @deprecated Use {@link List.Section.Props} instead.
4398
4109
  */
@@ -4530,6 +4241,110 @@ export declare type LocalStorageValue = LocalStorage.Value;
4530
4241
  export declare interface LocalStorageValues extends LocalStorage.Values {
4531
4242
  }
4532
4243
 
4244
+ /**
4245
+ * See {@link Detail.Metadata}
4246
+ */
4247
+ declare const Metadata: FunctionComponent<MetadataProps> & MetadataMembers;
4248
+
4249
+ /**
4250
+ * See {@link List.Item.Detail.Metadata}
4251
+ */
4252
+ declare const Metadata_2: FunctionComponent<MetadataProps_2> & MetadataMembers_2;
4253
+
4254
+ declare interface MetadataMembers {
4255
+ /**
4256
+ * A single value with an optional icon.
4257
+ */
4258
+ Label: typeof Label;
4259
+ /**
4260
+ * A metadata item that shows a separator line. Use it for grouping and visually separating metadata items.
4261
+ */
4262
+ Separator: typeof Separator_2;
4263
+ /**
4264
+ * An item to display a link.
4265
+ */
4266
+ Link: typeof Link;
4267
+ /**
4268
+ * A list of {@link Detail.Metadata.TagList.Item} displayed in a row.
4269
+ */
4270
+ TagList: typeof TagList;
4271
+ }
4272
+
4273
+ declare interface MetadataMembers_2 {
4274
+ /**
4275
+ * A title with, optionally, an icon and/or text to its right.
4276
+ *
4277
+ * @example
4278
+ * ```typescript
4279
+ * import { List } from "@raycast/api";
4280
+ *
4281
+ * export default function Metadata() {
4282
+ * return (
4283
+ * <List isShowingDetail>
4284
+ * <List.Item
4285
+ * title="Bulbasaur"
4286
+ * detail={
4287
+ * <List.Item.Detail
4288
+ * metadata={
4289
+ * <List.Item.Detail.Metadata>
4290
+ * <List.Item.Detail.Metadata.Label title="Type" icon="pokemon_types/grass.svg" text="Grass"/>
4291
+ * </List.Item.Detail.Metadata>
4292
+ * }
4293
+ * />
4294
+ * }
4295
+ * />
4296
+ * </List>
4297
+ * );
4298
+ * }
4299
+ * ```
4300
+ */
4301
+ Label: typeof Label_2;
4302
+ /**
4303
+ * A metadata item that shows a separator line. Use it for grouping and visually separating metadata items.
4304
+ *
4305
+ * @example
4306
+ * ```typescript
4307
+ * import { List } from "@raycast/api";
4308
+ *
4309
+ * export default function Metadata() {
4310
+ * return (
4311
+ * <List isShowingDetail>
4312
+ * <List.Item
4313
+ * title="Bulbasaur"
4314
+ * detail={
4315
+ * <List.Item.Detail
4316
+ * metadata={
4317
+ * <List.Item.Detail.Metadata>
4318
+ * <List.Item.Detail.Metadata.Label title="Type" icon="pokemon_types/grass.svg" text="Grass"/>
4319
+ * <List.Item.Detail.Metadata.Separator />
4320
+ * <List.Item.Detail.Metadata.Label title="Type" icon="pokemon_types/poison.svg" text="Poison"/>
4321
+ * </List.Item.Detail.Metadata>
4322
+ * }
4323
+ * />
4324
+ * }
4325
+ * />
4326
+ * </List>
4327
+ * );
4328
+ * }
4329
+ * ```
4330
+ */
4331
+ Separator: typeof Separator_3;
4332
+ }
4333
+
4334
+ declare interface MetadataProps {
4335
+ /**
4336
+ * The Detail.Metadata.Item elements of the Metadata view.
4337
+ */
4338
+ children: ReactNode;
4339
+ }
4340
+
4341
+ declare interface MetadataProps_2 {
4342
+ /**
4343
+ * The {@link Detail.Metadata.Item}s of the Metadata view.
4344
+ */
4345
+ children: ReactNode;
4346
+ }
4347
+
4533
4348
  /**
4534
4349
  * Return type of the {@link useNavigation} hook to perform push and pop actions.
4535
4350
  */
@@ -4560,7 +4375,7 @@ declare interface NavigationChildInterface {
4560
4375
  /**
4561
4376
  * Indicates whether a loading bar should be shown or hidden below the search bar
4562
4377
  *
4563
- * @defaultValue false
4378
+ * @defaultValue `false`
4564
4379
  */
4565
4380
  isLoading?: boolean;
4566
4381
  }
@@ -4689,7 +4504,7 @@ export declare namespace OAuth {
4689
4504
  /**
4690
4505
  * Use this type for a URI-style app scheme that directly opens Raycast.
4691
4506
  * In the OAuth app, configure `com.raycast:/oauth?package_name=Extension`
4692
- * (Note the single slash Google, for example, would require this flavor for an OAuth app where the Bundle ID is `com.raycast`)
4507
+ * (Note the single slash - Google, for example, would require this flavor for an OAuth app where the Bundle ID is `com.raycast`)
4693
4508
  */
4694
4509
  AppURI = "appURI"
4695
4510
  }
@@ -4804,6 +4619,7 @@ export declare namespace OAuth {
4804
4619
  updatedAt: Date;
4805
4620
  /**
4806
4621
  * A convenience method for checking whether the access token has expired.
4622
+ * The method factors in some seconds of "buffer", so it returns true a couple of seconds before the actual expiration time.
4807
4623
  * This requires the `expiresIn` parameter to be set.
4808
4624
  */
4809
4625
  isExpired(): boolean;
@@ -4861,6 +4677,11 @@ export declare namespace OAuth {
4861
4677
  }
4862
4678
  }
4863
4679
 
4680
+ /**
4681
+ * See {@link Action.Open}
4682
+ */
4683
+ declare const Open: FunctionComponent<OpenProps>;
4684
+
4864
4685
  /**
4865
4686
  * Opens a target with the default application or specified application.
4866
4687
  *
@@ -4878,83 +4699,38 @@ export declare namespace OAuth {
4878
4699
  * };
4879
4700
  * ```
4880
4701
  */
4881
- export declare function open(target: string, application?: Application | string): Promise<void>;
4882
-
4883
- /**
4884
- * @deprecated Use {@link Action.Open} instead.
4885
- */
4886
- export declare const OpenAction: OpenAction_2;
4887
-
4888
- /**
4889
- * See {@link Action.Open}
4890
- */
4891
- declare function OpenAction_2(props: OpenActionProps_2): ReactElement<OpenActionProps_2>;
4892
-
4893
- declare namespace OpenAction_2 {
4894
- var displayName: string;
4895
- }
4896
-
4897
- /**
4898
- * @deprecated Use {@link Action.Open.Props} instead.
4899
- */
4900
- export declare interface OpenActionProps extends Action.Open.Props {
4901
- }
4902
-
4903
- /**
4904
- * See {@link Action.Open.Props}
4905
- */
4906
- declare interface OpenActionProps_2 {
4907
- /**
4908
- * The file, folder or URL to open.
4909
- */
4910
- target: string;
4911
- /**
4912
- * The application name to use for opening the file.
4913
- *
4914
- * @remarks
4915
- * If no application is specified, the default application as determined by the system is used to open the
4916
- * specified file. Note that you can use the application name, app identifier, or absolute path to the app.
4917
- */
4918
- application?: Application | string;
4919
- /**
4920
- * The title for the action.
4921
- */
4922
- title: string;
4923
- /**
4924
- * The icon displayed for the action.
4925
- * @defaultValue {@link Icon.Finder}
4926
- */
4927
- icon?: Image.ImageLike;
4928
- /**
4929
- * The keyboard shortcut for the action.
4930
- */
4931
- shortcut?: Keyboard.Shortcut;
4932
- /**
4933
- * Callback when the file or folder was opened.
4934
- *
4935
- * @remarks
4936
- * This is handy when you want to act on an opened file or folder, e.g. store a history of opened items.
4937
- */
4938
- onOpen?: (target: string) => void;
4702
+ export declare function open(target: string, application?: Application | string): Promise<void>;
4703
+
4704
+ /**
4705
+ * @deprecated Use {@link Action.Open} instead.
4706
+ */
4707
+ export declare const OpenAction: FunctionComponent<OpenProps>;
4708
+
4709
+ /**
4710
+ * @deprecated Use {@link Action.Open.Props} instead.
4711
+ */
4712
+ export declare interface OpenActionProps extends Action.Open.Props {
4939
4713
  }
4940
4714
 
4941
4715
  /**
4942
- * @deprecated Use {@link Action.OpenInBrowser} instead.
4716
+ * Opens Raycast's preference window and selects the current command.
4943
4717
  */
4944
- export declare const OpenInBrowserAction: OpenInBrowserAction_2;
4718
+ export declare function openCommandPreferences(): Promise<void>;
4945
4719
 
4946
4720
  /**
4947
- * See {@link Action.OpenInBrowser}
4721
+ * Opens Raycast's preference window and selects the current extension.
4948
4722
  */
4949
- declare function OpenInBrowserAction_2(props: OpenInBrowserActionProps_2): ReactElement<OpenInBrowserActionProps_2>;
4723
+ export declare function openExtensionPreferences(): Promise<void>;
4950
4724
 
4951
- declare namespace OpenInBrowserAction_2 {
4952
- var displayName: string;
4953
- }
4725
+ /**
4726
+ * See {@link Action.OpenInBrowser}
4727
+ */
4728
+ declare const OpenInBrowser: FunctionComponent<OpenInBrowserProps>;
4954
4729
 
4955
- declare namespace OpenInBrowserAction_2 {
4956
- type Props = OpenInBrowserActionProps_2;
4957
- }
4730
+ /**
4731
+ * @deprecated Use {@link Action.OpenInBrowser} instead.
4732
+ */
4733
+ export declare const OpenInBrowserAction: FunctionComponent<OpenInBrowserProps>;
4958
4734
 
4959
4735
  /**
4960
4736
  * @deprecated Use {@link Action.OpenInBrowser.Props} instead.
@@ -4965,14 +4741,14 @@ export declare interface OpenInBrowserActionProps extends Action.OpenInBrowser.P
4965
4741
  /**
4966
4742
  * See {@link Action.OpenInBrowser.Props}
4967
4743
  */
4968
- declare interface OpenInBrowserActionProps_2 {
4744
+ declare interface OpenInBrowserProps {
4969
4745
  /**
4970
4746
  * The URL to open.
4971
4747
  */
4972
4748
  url: string;
4973
4749
  /**
4974
4750
  * An optional title for the action.
4975
- * @defaultValue Open in Browser
4751
+ * @defaultValue `"Open in Browser"`
4976
4752
  */
4977
4753
  title?: string;
4978
4754
  /**
@@ -4994,18 +4770,52 @@ declare interface OpenInBrowserActionProps_2 {
4994
4770
  }
4995
4771
 
4996
4772
  /**
4997
- * @deprecated Use {@link Action.OpenWith} instead.
4773
+ * See {@link Action.Open.Props}
4998
4774
  */
4999
- export declare const OpenWithAction: OpenWithAction_2;
4775
+ declare interface OpenProps {
4776
+ /**
4777
+ * The file, folder or URL to open.
4778
+ */
4779
+ target: string;
4780
+ /**
4781
+ * The application name to use for opening the file.
4782
+ *
4783
+ * @remarks
4784
+ * If no application is specified, the default application as determined by the system is used to open the
4785
+ * specified file. Note that you can use the application name, app identifier, or absolute path to the app.
4786
+ */
4787
+ application?: Application | string;
4788
+ /**
4789
+ * The title for the action.
4790
+ */
4791
+ title: string;
4792
+ /**
4793
+ * The icon displayed for the action.
4794
+ * @defaultValue {@link Icon.Finder}
4795
+ */
4796
+ icon?: Image.ImageLike;
4797
+ /**
4798
+ * The keyboard shortcut for the action.
4799
+ */
4800
+ shortcut?: Keyboard.Shortcut;
4801
+ /**
4802
+ * Callback when the file or folder was opened.
4803
+ *
4804
+ * @remarks
4805
+ * This is handy when you want to act on an opened file or folder, e.g. store a history of opened items.
4806
+ */
4807
+ onOpen?: (target: string) => void;
4808
+ }
5000
4809
 
5001
4810
  /**
5002
4811
  * See {@link Action.OpenWith}
5003
4812
  */
5004
- declare function OpenWithAction_2(props: OpenWithActionProps_2): ReactElement<OpenWithActionProps_2>;
4813
+ declare const OpenWith: FunctionComponent<OpenWithProps>;
5005
4814
 
5006
- declare namespace OpenWithAction_2 {
5007
- var displayName: string;
5008
- }
4815
+ /**
4816
+ * @deprecated Use {@link Action.OpenWith} instead.
4817
+ */
4818
+ export declare const OpenWithAction: FunctionComponent<OpenWithProps>;
5009
4819
 
5010
4820
  /**
5011
4821
  * @deprecated Use {@link Action.OpenWith.Props} instead.
@@ -5016,14 +4826,14 @@ export declare interface OpenWithActionProps extends Action.OpenWith.Props {
5016
4826
  /**
5017
4827
  * See {@link Action.OpenWith.Props}
5018
4828
  */
5019
- declare interface OpenWithActionProps_2 {
4829
+ declare interface OpenWithProps {
5020
4830
  /**
5021
4831
  * The path to open.
5022
4832
  */
5023
4833
  path: string;
5024
4834
  /**
5025
4835
  * The title for the action.
5026
- * @defaultValue Open With
4836
+ * @defaultValue `"Open With"`
5027
4837
  */
5028
4838
  title?: string;
5029
4839
  /**
@@ -5065,18 +4875,14 @@ declare interface PasswordFieldProps extends FormItemProps_2<string> {
5065
4875
  declare type PasswordFieldRef = FormItemRef;
5066
4876
 
5067
4877
  /**
5068
- * @deprecated Use {@link Action.Paste} instead.
4878
+ * See {@link Action.Paste.Props}
5069
4879
  */
5070
- export declare const PasteAction: PasteAction_2;
4880
+ declare const Paste: FunctionComponent<PasteProps>;
5071
4881
 
5072
4882
  /**
5073
- * See {@link Action.Paste.Props}
4883
+ * @deprecated Use {@link Action.Paste} instead.
5074
4884
  */
5075
- declare function PasteAction_2(props: PasteActionProps_2): ReactElement<PasteActionProps_2>;
5076
-
5077
- declare namespace PasteAction_2 {
5078
- var displayName: string;
5079
- }
4885
+ export declare const PasteAction: FunctionComponent<PasteProps>;
5080
4886
 
5081
4887
  /**
5082
4888
  * @deprecated Use {@link Action.Paste.Props} instead.
@@ -5087,14 +4893,14 @@ export declare interface PasteActionProps extends Action.Paste.Props {
5087
4893
  /**
5088
4894
  * See {@link Action.Paste.Props}
5089
4895
  */
5090
- declare interface PasteActionProps_2 {
4896
+ declare interface PasteProps {
5091
4897
  /**
5092
4898
  * The contents that will be written to the clipboard as string.
5093
4899
  */
5094
4900
  content: string | number;
5095
4901
  /**
5096
4902
  * An optional title for the action.
5097
- * @defaultValue Paste in Active app
4903
+ * @defaultValue `"Paste in Active app"`
5098
4904
  */
5099
4905
  title?: string;
5100
4906
  /**
@@ -5175,7 +4981,7 @@ declare interface Preference_2 {
5175
4981
  * If the preference is required, an onboarding view is shown when the
5176
4982
  * extension is opened for the first time.
5177
4983
  *
5178
- * @defaultValue false
4984
+ * @defaultValue `false`
5179
4985
  */
5180
4986
  required: boolean;
5181
4987
  /**
@@ -5242,18 +5048,14 @@ export declare interface PreferenceValues {
5242
5048
  }
5243
5049
 
5244
5050
  /**
5245
- * @deprecated Use {@link Action.Push} instead.
5051
+ * See {@link Action.Push.Props}
5246
5052
  */
5247
- export declare const PushAction: PushAction_2;
5053
+ declare const Push: FunctionComponent<PushProps>;
5248
5054
 
5249
5055
  /**
5250
- * See {@link Action.Push.Props}
5056
+ * @deprecated Use {@link Action.Push} instead.
5251
5057
  */
5252
- declare function PushAction_2(props: PushActionProps_2): ReactElement<PushActionProps_2>;
5253
-
5254
- declare namespace PushAction_2 {
5255
- var displayName: string;
5256
- }
5058
+ export declare const PushAction: FunctionComponent<PushProps>;
5257
5059
 
5258
5060
  /**
5259
5061
  * @deprecated Use {@link Action.Push.Props} instead.
@@ -5264,7 +5066,7 @@ export declare interface PushActionProps extends Action.Push.Props {
5264
5066
  /**
5265
5067
  * See {@link Action.Push.Props}
5266
5068
  */
5267
- declare interface PushActionProps_2 {
5069
+ declare interface PushProps {
5268
5070
  /**
5269
5071
  * The title displayed for the item.
5270
5072
  */
@@ -5308,7 +5110,7 @@ declare interface Quicklink {
5308
5110
  /**
5309
5111
  * @deprecated Add `nanoid` as a dependency and use it instead.
5310
5112
  */
5311
- export declare const randomId: typeof randomId_2;
5113
+ export declare const randomId: any;
5312
5114
 
5313
5115
  /**
5314
5116
  * @deprecated Use {@link LocalStorage.removeItem} instead
@@ -5318,19 +5120,81 @@ export declare const removeLocalStorageItem: typeof LocalStorage.removeItem;
5318
5120
  /**
5319
5121
  * @deprecated Use `export default function Command() { ... }` instead
5320
5122
  */
5321
- export declare const render: typeof render_2;
5123
+ export declare const render: any;
5124
+
5125
+ /**
5126
+ * See {@link ActionPanel.Section}
5127
+ */
5128
+ declare const Section: FunctionComponent<SectionProps>;
5129
+
5130
+ /**
5131
+ * See {@link List.Section}
5132
+ */
5133
+ declare const Section_2: FunctionComponent<SectionProps_2>;
5134
+
5135
+ declare type SectionChildren = ReactElement<ActionProps> | ReactElement<ActionProps>[] | ReactElement<SubmenuProps> | Array<ReactElement<SubmenuProps>> | Array<ReactElement<SubmenuProps> | ReactElement<ActionProps>> | null;
5136
+
5137
+ /**
5138
+ * See {@link ActionPanel.Section}.
5139
+ */
5140
+ declare interface SectionProps {
5141
+ /**
5142
+ * The item elements of the section.
5143
+ */
5144
+ children?: ReactNode;
5145
+ /**
5146
+ * Title displayed above the section
5147
+ */
5148
+ title?: string;
5149
+ }
5150
+
5151
+ declare interface SectionProps_2 {
5152
+ /**
5153
+ * The {@link List.Item} elements of the section.
5154
+ */
5155
+ children?: ReactNode;
5156
+ /**
5157
+ * ID of the section.
5158
+ * @deprecated - This is an internal prop which not not have been exposed. You can safely remove it.
5159
+ */
5160
+ id?: string;
5161
+ /**
5162
+ * Title displayed above the section.
5163
+ */
5164
+ title?: string;
5165
+ /**
5166
+ * An optional subtitle displayed next to the title of the section.
5167
+ */
5168
+ subtitle?: string;
5169
+ }
5322
5170
 
5323
5171
  /**
5324
5172
  * See {@link Form.Separator}
5325
5173
  */
5326
5174
  declare const Separator: FunctionComponent<SeparatorProps>;
5327
5175
 
5176
+ /**
5177
+ * See {@link Detail.Metadata.Separator}
5178
+ */
5179
+ declare const Separator_2: FunctionComponent<SeparatorProps_2>;
5180
+
5181
+ /**
5182
+ * See {@link List.Item.Detail.Metadata.Label}
5183
+ */
5184
+ declare const Separator_3: FunctionComponent<SeparatorProps_3>;
5185
+
5328
5186
  /**
5329
5187
  * See {@link Form.Separator.Props}
5330
5188
  */
5331
5189
  declare interface SeparatorProps {
5332
5190
  }
5333
5191
 
5192
+ declare interface SeparatorProps_2 {
5193
+ }
5194
+
5195
+ declare interface SeparatorProps_3 {
5196
+ }
5197
+
5334
5198
  /**
5335
5199
  * @deprecated Use {@link LocalStorage.setItem} instead
5336
5200
  */
@@ -5353,6 +5217,11 @@ export declare const setLocalStorageItem: typeof LocalStorage.setItem;
5353
5217
  */
5354
5218
  export declare function showHUD(title: string): Promise<void>;
5355
5219
 
5220
+ /**
5221
+ * See {@link Action.ShowInFinder.Props}
5222
+ */
5223
+ declare const ShowInFinder: FunctionComponent<ShowInFinderProps>;
5224
+
5356
5225
  /**
5357
5226
  * Utils
5358
5227
  */
@@ -5375,16 +5244,7 @@ export declare function showInFinder(path: PathLike): Promise<void>;
5375
5244
  /**
5376
5245
  * @deprecated Use {@link Action.ShowInFinder} instead.
5377
5246
  */
5378
- export declare const ShowInFinderAction: ShowInFinderAction_2;
5379
-
5380
- /**
5381
- * See {@link Action.ShowInFinder.Props}
5382
- */
5383
- declare function ShowInFinderAction_2(props: ShowInFinderActionProps_2): ReactElement<ShowInFinderActionProps_2>;
5384
-
5385
- declare namespace ShowInFinderAction_2 {
5386
- var displayName: string;
5387
- }
5247
+ export declare const ShowInFinderAction: FunctionComponent<ShowInFinderProps>;
5388
5248
 
5389
5249
  /**
5390
5250
  * @deprecated Use {@link Action.ShowInFinder.Props} instead.
@@ -5395,14 +5255,14 @@ export declare interface ShowInFinderActionProps extends Action.ShowInFinder.Pro
5395
5255
  /**
5396
5256
  * See {@link Action.ShowInFinder.Props}
5397
5257
  */
5398
- declare interface ShowInFinderActionProps_2 {
5258
+ declare interface ShowInFinderProps {
5399
5259
  /**
5400
5260
  * The path to open.
5401
5261
  */
5402
5262
  path: PathLike;
5403
5263
  /**
5404
5264
  * An optional title for the action.
5405
- * @defaultValue Show in Finder
5265
+ * @defaultValue `"Show in Finder"`
5406
5266
  */
5407
5267
  title?: string;
5408
5268
  /**
@@ -5489,21 +5349,68 @@ declare interface Snippet {
5489
5349
  /**
5490
5350
  * @deprecated Use the key directly
5491
5351
  */
5492
- export declare const specialKeys: Record<string, string>;
5352
+ export declare const specialKeys: any;
5493
5353
 
5494
5354
  /**
5495
- * @deprecated Use {@link Action.SubmitForm} instead.
5355
+ * See {@link ActionPanel.Submenu}
5356
+ */
5357
+ declare const Submenu: FunctionComponent<SubmenuProps>;
5358
+
5359
+ declare type SubmenuChildren = ReactElement<SectionProps> | ReactElement<SectionProps>[] | SectionChildren | null;
5360
+
5361
+ /**
5362
+ * See {@link ActionPanel.Submenu.Props}.
5496
5363
  */
5497
- export declare const SubmitFormAction: SubmitFormAction_2;
5364
+ declare interface SubmenuProps {
5365
+ /**
5366
+ * ID of the submenu.
5367
+ * @deprecated - This is an internal prop which not not have been exposed. You can safely remove it.
5368
+ */
5369
+ id?: string;
5370
+ /**
5371
+ * The title displayed for submenu.
5372
+ */
5373
+ title: string;
5374
+ /**
5375
+ * The icon displayed for the submenu.
5376
+ */
5377
+ icon?: Image.ImageLike;
5378
+ /**
5379
+ * The keyboard shortcut for the submenu.
5380
+ */
5381
+ shortcut?: Keyboard.Shortcut;
5382
+ /**
5383
+ * Items of the submenu.
5384
+ *
5385
+ * @example
5386
+ * ```typescript
5387
+ * <ActionPanel.Submenu title="Submenu">
5388
+ * <Action title="Just an action" />
5389
+ * </ActionPanel.Submenu>
5390
+ * ```
5391
+ *
5392
+ * @remarks
5393
+ * If {@link Action} elements are specified, a default section is automatically created.
5394
+ * Use {@link ActionPanel.Submenu} as parent when specifying sub-menu's children to make code is more readable.
5395
+ */
5396
+ children?: ReactNode;
5397
+ }
5498
5398
 
5499
5399
  /**
5500
5400
  * See {@link Action.SubmitForm.Props}
5501
5401
  */
5502
- declare function SubmitFormAction_2<Values extends Form.Values = Form.Values>(props: SubmitFormActionProps_2<Values>): ReactElement<SubmitFormActionProps_2<Values>>;
5402
+ declare const SubmitForm: {
5403
+ <T extends FormValues_2>(props: SubmitFormProps<T>): JSX.Element;
5404
+ displayName: string;
5405
+ };
5503
5406
 
5504
- declare namespace SubmitFormAction_2 {
5505
- var displayName: string;
5506
- }
5407
+ /**
5408
+ * @deprecated Use {@link Action.SubmitForm} instead.
5409
+ */
5410
+ export declare const SubmitFormAction: {
5411
+ <T extends FormValues_2>(props: SubmitFormProps<T>): JSX.Element;
5412
+ displayName: string;
5413
+ };
5507
5414
 
5508
5415
  /**
5509
5416
  * @deprecated Use {@link Action.SunmitForm.Props} instead.
@@ -5514,10 +5421,10 @@ export declare interface SubmitFormActionProps<T> extends Action.SubmitForm.Prop
5514
5421
  /**
5515
5422
  * See {@link Action.SubmitForm.Props}
5516
5423
  */
5517
- declare interface SubmitFormActionProps_2<Values> {
5424
+ declare interface SubmitFormProps<T extends Form.Values> {
5518
5425
  /**
5519
5426
  * The title displayed for the item.
5520
- * @defaultValue Submit Form
5427
+ * @defaultValue `"Submit Form"`
5521
5428
  */
5522
5429
  title?: string;
5523
5430
  /**
@@ -5533,13 +5440,82 @@ declare interface SubmitFormActionProps_2<Values> {
5533
5440
  * Use the handler to perform custom validation logic and call other Raycast API methods.
5534
5441
  * The handler receives a the values object containing the user input.
5535
5442
  */
5536
- onSubmit?: (input: Values) => void;
5443
+ onSubmit?: (input: T) => void;
5444
+ }
5445
+
5446
+ /**
5447
+ * See {@link Detail.Metadata.TagList}
5448
+ */
5449
+ declare const TagList: FunctionComponent<TagListProps> & TagListMembers;
5450
+
5451
+ /**
5452
+ * See {@link Detail.Metadata.TagList.Item}
5453
+ */
5454
+ declare const TagListItem: FunctionComponent<TagListItemProps>;
5455
+
5456
+ declare interface TagListItemProps {
5457
+ /**
5458
+ * An optional icon in front of the text of the tag.
5459
+ */
5460
+ icon?: Image.ImageLike | undefined | null;
5461
+ /**
5462
+ * The text of the tag.
5463
+ */
5464
+ text: string;
5465
+ /**
5466
+ * Changes the text color to the provided color and sets a transparent background with the same color.
5467
+ */
5468
+ color?: Color.ColorLike | undefined | null;
5469
+ }
5470
+
5471
+ declare interface TagListMembers {
5472
+ /**
5473
+ * A Tag in a {@link Detail.Metadata.TagList}.
5474
+ */
5475
+ Item: typeof TagListItem;
5476
+ }
5477
+
5478
+ declare interface TagListProps {
5479
+ /**
5480
+ * The title shown above the item.
5481
+ */
5482
+ title: string;
5483
+ /**
5484
+ * The tags contained in the TagList.
5485
+ */
5486
+ children: ReactNode;
5537
5487
  }
5538
5488
 
5539
5489
  /**
5540
5490
  * See {@link Form.TagPicker}
5541
5491
  */
5542
- declare const TagPicker: ForwardRefExoticComponent<TagPickerProps & RefAttributes<FormItemRef>> & {
5492
+ declare const TagPicker: ForwardRefExoticComponent<TagPickerProps & RefAttributes<FormItemRef>> & TagPickerMembers;
5493
+
5494
+ /**
5495
+ * See {@link Form.TagPicker.Item}
5496
+ */
5497
+ declare const TagPickerItem: FunctionComponent<TagPickerItemProps>;
5498
+
5499
+ /**
5500
+ * See {@link Form.TagPicker.Item.Props}
5501
+ */
5502
+ declare interface TagPickerItemProps {
5503
+ /**
5504
+ * Value of the tag.
5505
+ * Make sure to assign unique value for each item.
5506
+ */
5507
+ value: string;
5508
+ /**
5509
+ * The display title of the tag.
5510
+ */
5511
+ title: string;
5512
+ /**
5513
+ * An icon to show in the tag.
5514
+ */
5515
+ icon?: Image.ImageLike;
5516
+ }
5517
+
5518
+ declare interface TagPickerMembers {
5543
5519
  /**
5544
5520
  * A tag picker item in a {@link Form.TagPicker}.
5545
5521
  *
@@ -5567,30 +5543,6 @@ declare const TagPicker: ForwardRefExoticComponent<TagPickerProps & RefAttribute
5567
5543
  * ```
5568
5544
  */
5569
5545
  Item: typeof TagPickerItem;
5570
- };
5571
-
5572
- /**
5573
- * See {@link Form.TagPicker.Item}
5574
- */
5575
- declare const TagPickerItem: FunctionComponent<TagPickerItemProps>;
5576
-
5577
- /**
5578
- * See {@link Form.TagPicker.Item.Props}
5579
- */
5580
- declare interface TagPickerItemProps {
5581
- /**
5582
- * Value of the tag.
5583
- * Make sure to assign unique value for each item.
5584
- */
5585
- value: string;
5586
- /**
5587
- * The display title of the tag.
5588
- */
5589
- title: string;
5590
- /**
5591
- * An icon to show in the tag.
5592
- */
5593
- icon?: Image.ImageLike;
5594
5546
  }
5595
5547
 
5596
5548
  /**
@@ -5675,14 +5627,29 @@ export declare class Toast {
5675
5627
  * Deprecated - Use `showToast` instead
5676
5628
  */
5677
5629
  constructor(props: Toast.Options);
5630
+ /**
5631
+ * The style of a Toast.
5632
+ */
5678
5633
  get style(): Toast.Style;
5679
5634
  set style(style: Toast.Style);
5635
+ /**
5636
+ * The title of a Toast. Displayed on the top.
5637
+ */
5680
5638
  get title(): string;
5681
5639
  set title(title: string);
5640
+ /**
5641
+ * An additional message for the Toast. Useful to show more information, e.g. an identifier of a newly created asset.
5642
+ */
5682
5643
  get message(): string | undefined;
5683
5644
  set message(message: string | undefined);
5645
+ /**
5646
+ * The primary Action the user can take when hovering on the Toast.
5647
+ */
5684
5648
  get primaryAction(): Toast.ActionOptions | undefined;
5685
5649
  set primaryAction(action: Toast.ActionOptions | undefined);
5650
+ /**
5651
+ * The secondary Action the user can take when hovering on the Toast.
5652
+ */
5686
5653
  get secondaryAction(): Toast.ActionOptions | undefined;
5687
5654
  set secondaryAction(action: Toast.ActionOptions | undefined);
5688
5655
  /**
@@ -5795,6 +5762,11 @@ export declare interface ToastOptions extends Toast.Options {
5795
5762
  */
5796
5763
  export declare const ToastStyle: typeof Toast.Style;
5797
5764
 
5765
+ /**
5766
+ * See {@link Action.Trash}
5767
+ */
5768
+ declare const Trash: FunctionComponent<TrashProps>;
5769
+
5798
5770
  /**
5799
5771
  * Moves a file or directory to the Trash.
5800
5772
  *
@@ -5819,16 +5791,7 @@ export declare function trash(path: PathLike | PathLike[]): Promise<void>;
5819
5791
  /**
5820
5792
  * @deprecated Use {@link Action.Trash} instead.
5821
5793
  */
5822
- export declare const TrashAction: TrashAction_2;
5823
-
5824
- /**
5825
- * See {@link Action.Trash}
5826
- */
5827
- declare function TrashAction_2(props: TrashActionProps_2): ReactElement<TrashActionProps_2>;
5828
-
5829
- declare namespace TrashAction_2 {
5830
- var displayName: string;
5831
- }
5794
+ export declare const TrashAction: FunctionComponent<TrashProps>;
5832
5795
 
5833
5796
  /**
5834
5797
  * @deprecated Use {@link Action.Trash.Props} instead.
@@ -5839,14 +5802,14 @@ export declare interface TrashActionProps extends Action.Trash.Props {
5839
5802
  /**
5840
5803
  * See {@link Action.Trash.Props}
5841
5804
  */
5842
- declare interface TrashActionProps_2 {
5805
+ declare interface TrashProps {
5843
5806
  /**
5844
5807
  * The item or items to move to the trash.
5845
5808
  */
5846
5809
  paths: PathLike | PathLike[];
5847
5810
  /**
5848
5811
  * An optional title for the action.
5849
- * @defaultValue Move to Trash
5812
+ * @defaultValue `"Move to Trash"`
5850
5813
  */
5851
5814
  title?: string;
5852
5815
  /**
@@ -5876,7 +5839,7 @@ export declare function useActionPanel(): ActionPanelState;
5876
5839
  /**
5877
5840
  * @deprecated Use `useRef` with `nanoid`
5878
5841
  */
5879
- export declare const useId: typeof useId_2;
5842
+ export declare const useId: any;
5880
5843
 
5881
5844
  /**
5882
5845
  * A hook that lets you push and pop view components in the navigation stack.