@raycast/api 1.29.1 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/bin/arm64/ray +0 -0
  2. package/bin/x86/ray +0 -0
  3. package/package.json +1 -1
  4. package/types/api/app/clipboard.d.ts +16 -0
  5. package/types/api/components/ActionPanel.d.ts +0 -36
  6. package/types/api/components/Detail.d.ts +1 -3
  7. package/types/api/components/Form.d.ts +25 -1
  8. package/types/api/components/List.d.ts +358 -54
  9. package/types/api/components/actions/Action.d.ts +4 -0
  10. package/types/api/deprecated.d.ts +8 -3
  11. package/types/api/internal/components/index.d.ts +0 -1
  12. package/types/api/internal/{hooks/useActionPanel.d.ts → devtools/actionPanel.d.ts} +0 -0
  13. package/types/api/internal/devtools/index.d.ts +1 -0
  14. package/types/api/internal/hooks/index.d.ts +0 -1
  15. package/types/api/internal/rendering/logger.d.ts +4 -1
  16. package/types/api/internal/rendering/node-builders/detail.d.ts +2 -1
  17. package/types/api/internal/rendering/node-builders/forms.d.ts +2 -1
  18. package/types/api/internal/rendering/node-builders/list.d.ts +2 -0
  19. package/types/api/internal/rendering/node-builders/types.d.ts +1 -1
  20. package/types/api/internal/rendering/{reconciler.d.ts → reconciler/index.d.ts} +0 -0
  21. package/types/api/internal/rendering/reconciler/noHydratation.d.ts +37 -0
  22. package/types/api/internal/rendering/reconciler/noMutation.d.ts +18 -0
  23. package/types/api/internal/utils/index.d.ts +2 -0
  24. package/types/api/internal/utils/internal-children.d.ts +26 -0
  25. package/types/api/internal/utils/propTypes.d.ts +3 -0
  26. package/types/api/internal/components/portal/components/portal/Portal.d.ts +0 -4
  27. package/types/api/internal/components/portal/components/portal/index.d.ts +0 -1
  28. package/types/api/internal/components/portal/components/portalHost/PortalHost.d.ts +0 -4
  29. package/types/api/internal/components/portal/components/portalHost/index.d.ts +0 -1
  30. package/types/api/internal/components/portal/components/portalProvider/PortalProvider.d.ts +0 -4
  31. package/types/api/internal/components/portal/components/portalProvider/index.d.ts +0 -1
  32. package/types/api/internal/components/portal/contexts/index.d.ts +0 -1
  33. package/types/api/internal/components/portal/contexts/portal.d.ts +0 -5
  34. package/types/api/internal/components/portal/hooks/index.d.ts +0 -2
  35. package/types/api/internal/components/portal/hooks/usePortal.d.ts +0 -8
  36. package/types/api/internal/components/portal/hooks/usePortalState.d.ts +0 -1
  37. package/types/api/internal/components/portal/index.d.ts +0 -5
  38. package/types/api/internal/components/portal/state/constants.d.ts +0 -9
  39. package/types/api/internal/components/portal/state/index.d.ts +0 -3
  40. package/types/api/internal/components/portal/state/reducer.d.ts +0 -3
  41. package/types/api/internal/components/portal/utilities/logger.d.ts +0 -9
package/bin/arm64/ray CHANGED
Binary file
package/bin/x86/ray CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raycast/api",
3
- "version": "1.29.1",
3
+ "version": "1.30.0",
4
4
  "description": "Build extensions for Raycast with React and Node.js.",
5
5
  "author": "Raycast Technologies Ltd.",
6
6
  "homepage": "https://developers.raycast.com",
@@ -45,3 +45,19 @@ export declare function clear(): Promise<void>;
45
45
  * ```
46
46
  */
47
47
  export declare function paste(text: string): Promise<void>;
48
+ /**
49
+ * Reads the clipboard as plain text.
50
+ *
51
+ * @returns A promise that resolves when the clipboard content was read as plain text.
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * import { Clipboard } from "@raycast/api";
56
+ *
57
+ * export default async () => {
58
+ * const text = await Clipboard.readText();
59
+ * console.log(text);
60
+ * };
61
+ * ```
62
+ */
63
+ export declare function readText(): Promise<string | undefined>;
@@ -71,42 +71,6 @@ declare namespace ActionPanelSubmenu {
71
71
  light: PropTypes.Validator<string>;
72
72
  dark: PropTypes.Validator<string>;
73
73
  }>>;
74
- /**
75
- * Exposes a list of actions that can be performed by the user.
76
- *
77
- * @remarks
78
- * Often items are context-aware, e.g. based on the selected list item. Actions can be grouped into semantic
79
- * sections and can have keyboard shortcuts assigned.
80
- *
81
- * The first and second action become the primary and secondary action. They automatically get the default keyboard shortcuts assigned.
82
- * 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
83
- * `⌘` `⇧` `↵` for the secondary.
84
- *
85
- * @example
86
- * ```typescript
87
- * import { ActionPanel, Action, List } from "@raycast/api";
88
- *
89
- * export default function Command() {
90
- * return (
91
- * <List navigationTitle="Open Pull Requests">
92
- * <List.Item
93
- * title="Docs: Update API Reference"
94
- * subtitle="#1"
95
- * actions={
96
- * <ActionPanel title="#1 in raycast/extensions">
97
- * <Action.OpenInBrowser url="https://github.com/raycast/extensions/pull/1" />
98
- * <Action.CopyToClipboard
99
- * title="Copy Pull Request URL"
100
- * content="https://github.com/raycast/extensions/pull/1"
101
- * />
102
- * </ActionPanel>
103
- * }
104
- * />
105
- * </List>
106
- * );
107
- * }
108
- * ```
109
- */
110
74
  fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
111
75
  light: PropTypes.Validator<string>;
112
76
  dark: PropTypes.Validator<string>;
@@ -1,4 +1,4 @@
1
- import { ReactElement, ReactNode } from "react";
1
+ import { ReactElement } from "react";
2
2
  import { ActionsInterface, NavigationChildInterface } from "./types";
3
3
  import PropTypes from "prop-types";
4
4
  /**
@@ -34,7 +34,5 @@ export declare namespace Detail {
34
34
  * The CommonMark string to be rendered.
35
35
  */
36
36
  markdown?: string | null;
37
- /** @deprecated - Use the `markdown` prop instead */
38
- children?: ReactNode;
39
37
  }
40
38
  }
@@ -300,6 +300,24 @@ declare namespace FormTagPicker {
300
300
  */
301
301
  const Item: typeof FormTagPickerItem;
302
302
  }
303
+ declare enum FormDatePickerType {
304
+ /**
305
+ * Only year, month, and day can be picked
306
+ */
307
+ Date = "date",
308
+ /**
309
+ * hour and second can be picked in addition to year, month and day
310
+ */
311
+ DateTime = "date_time"
312
+ }
313
+ declare namespace FormDatePicker {
314
+ /**
315
+ * The types of date components the user can pick
316
+ * * `Date` – only year, month, and day can be picked
317
+ * * `DateTime` – hour and second can be picked in addition to year, month and day
318
+ */
319
+ const Type: typeof FormDatePickerType;
320
+ }
303
321
  export declare namespace Form {
304
322
  /**
305
323
  * @deprecated Use `Form.Dropdown.Section` instead.
@@ -849,7 +867,7 @@ export declare namespace Form {
849
867
  */
850
868
  interface Props extends Form.ItemProps<string> {
851
869
  /**
852
- * Placeholder text shown in the text field.
870
+ * Placeholder text shown in the text area.
853
871
  */
854
872
  placeholder?: string;
855
873
  }
@@ -917,6 +935,12 @@ export declare namespace Form {
917
935
  * Props of the {@link Form.DatePicker} React component.
918
936
  */
919
937
  interface Props extends Form.ItemProps<Date> {
938
+ /**
939
+ * Indicates what types of date components can be picked
940
+ *
941
+ * @default Form.DatePicker.Type.DateTime
942
+ */
943
+ type?: FormDatePickerType;
920
944
  }
921
945
  }
922
946
  namespace Separator {
@@ -1,9 +1,9 @@
1
1
  import { ReactElement, ReactNode } from "react";
2
+ import PropTypes from "prop-types";
2
3
  import { Image } from "../ui";
3
4
  import { ActionsInterface, NavigationChildInterface } from "./types";
4
- import PropTypes from "prop-types";
5
5
  /**
6
- * Displays {@link List.Section} or {@link List.Item}.
6
+ * Displays {@link List.Section} or {@link List.Item}, optionally {@link List.Dropdown}.
7
7
  *
8
8
  * @remarks
9
9
  * The list uses built-in filtering by indexing the title of list items and additionally keywords.
@@ -12,9 +12,36 @@ import PropTypes from "prop-types";
12
12
  * ```typescript
13
13
  * import { List } from "@raycast/api";
14
14
  *
15
+ * function DrinkDropdown(props: DrinkDropdownProps) {
16
+ * const { isLoading = false, drinkTypes, onDrinkTypeChange } = props;
17
+ * return (
18
+ * <List.Dropdown
19
+ * tooltip="Select Drink Type"
20
+ * storeValue={true}
21
+ * onChange={(newValue) => {
22
+ * onDrinkTypeChange(newValue);
23
+ * }}
24
+ * >
25
+ * <List.Dropdown.Section title="Alcoholic Beverages">
26
+ * {drinkTypes.map((drinkType) => (
27
+ * <List.Dropdown.Item key={drinkType.id} title={drinkType.name} value={drinkType.id} />
28
+ * ))}
29
+ * </List.Dropdown.Section>
30
+ * </List.Dropdown>
31
+ * );
32
+ * }
33
+ *
15
34
  * export default function Command() {
35
+ * const drinkTypes = [{ id: 1, name: 'Beer' }, { id: 2, name: 'Wine' }];
36
+ * const onDrinkTypeChange = (newValue) => {
37
+ * console.log(newValue);
38
+ * }
16
39
  * return (
17
- * <List navigationTitle="Search Beers" searchBarPlaceholder="Search your favorite beer">
40
+ * <List
41
+ * navigationTitle="Search Beers"
42
+ * searchBarPlaceholder="Search your favorite drink"
43
+ * searchBarAccessory={<DrinkDropdown drinkTypes={drinkTypes} onDrinkTypeChange={onDrinkTypeChange} />}
44
+ * >
18
45
  * <List.Item title="Augustiner Helles" />
19
46
  * <List.Item title="Camden Hells" />
20
47
  * <List.Item title="Leffe Blonde" />
@@ -27,11 +54,16 @@ import PropTypes from "prop-types";
27
54
  export declare function List(props: List.Props): ReactElement<List.Props>;
28
55
  export declare namespace List {
29
56
  var propTypes: {
30
- selectedItemId: PropTypes.Requireable<string>;
57
+ onSelectionChange: PropTypes.Requireable<(...args: any[]) => any>;
58
+ searchBarAccessory: PropTypes.Requireable<PropTypes.ReactNodeLike>;
59
+ searchText: PropTypes.Requireable<string>;
60
+ enableFiltering: PropTypes.Requireable<boolean>;
31
61
  searchBarPlaceholder: PropTypes.Requireable<string>;
62
+ selectedItemId: PropTypes.Requireable<string>;
32
63
  throttle: PropTypes.Requireable<boolean>;
33
64
  onSearchTextChange: PropTypes.Requireable<(...args: any[]) => any>;
34
- onSelectionChange: PropTypes.Requireable<(...args: any[]) => any>;
65
+ isLoading: PropTypes.Requireable<boolean>;
66
+ navigationTitle: PropTypes.Requireable<string>;
35
67
  };
36
68
  var displayName: string;
37
69
  }
@@ -66,53 +98,74 @@ declare namespace ListItem {
66
98
  dark: PropTypes.Validator<string>;
67
99
  }>>;
68
100
  fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
69
- /**
70
- * Displays {@link List.Section} or {@link List.Item}.
71
- *
72
- * @remarks
73
- * The list uses built-in filtering by indexing the title of list items and additionally keywords.
74
- *
75
- * @example
76
- * ```typescript
77
- * import { List } from "@raycast/api";
78
- *
79
- * export default function Command() {
80
- * return (
81
- * <List navigationTitle="Search Beers" searchBarPlaceholder="Search your favorite beer">
82
- * <List.Item title="Augustiner Helles" />
83
- * <List.Item title="Camden Hells" />
84
- * <List.Item title="Leffe Blonde" />
85
- * <List.Item title="Sierra Nevada IPA" />
86
- * </List>
87
- * );
88
- * }
89
- * ```
90
- */
91
101
  light: PropTypes.Validator<string>;
92
102
  dark: PropTypes.Validator<string>;
93
103
  }>>;
94
- /**
95
- * Displays {@link List.Section} or {@link List.Item}.
96
- *
97
- * @remarks
98
- * The list uses built-in filtering by indexing the title of list items and additionally keywords.
99
- *
100
- * @example
101
- * ```typescript
102
- * import { List } from "@raycast/api";
103
- *
104
- * export default function Command() {
105
- * return (
106
- * <List navigationTitle="Search Beers" searchBarPlaceholder="Search your favorite beer">
107
- * <List.Item title="Augustiner Helles" />
108
- * <List.Item title="Camden Hells" />
109
- * <List.Item title="Leffe Blonde" />
110
- * <List.Item title="Sierra Nevada IPA" />
111
- * </List>
112
- * );
113
- * }
114
- * ```
115
- */
104
+ mask: PropTypes.Requireable<Image.Mask>;
105
+ tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
106
+ light: PropTypes.Validator<string>;
107
+ dark: PropTypes.Validator<string>;
108
+ adjustContrast: PropTypes.Requireable<boolean>;
109
+ }>>;
110
+ }>>;
111
+ };
112
+ var displayName: string;
113
+ }
114
+ /**
115
+ * See {@link List.Item.Detail}
116
+ */
117
+ declare function ListItemDetail(props: List.Item.Detail.Props): ReactElement<List.Item.Detail.Props>;
118
+ declare namespace ListItemDetail {
119
+ var propTypes: {
120
+ isLoading: PropTypes.Requireable<boolean>;
121
+ markdown: PropTypes.Requireable<string>;
122
+ };
123
+ var displayName: string;
124
+ }
125
+ /**
126
+ * See {@link List.Dropdown}
127
+ */
128
+ declare function ListDropdown(props: List.Dropdown.Props): ReactElement<List.Dropdown.Props>;
129
+ declare namespace ListDropdown {
130
+ var propTypes: {
131
+ id: PropTypes.Requireable<string>;
132
+ tooltip: PropTypes.Validator<string>;
133
+ storeValue: (props: List.Dropdown.Props, propName: keyof List.Dropdown.Props, componentName: string, location: string, propFullName: string) => Error;
134
+ value: PropTypes.Requireable<string>;
135
+ defaultValue: PropTypes.Requireable<string>;
136
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
137
+ };
138
+ var displayName: string;
139
+ }
140
+ /**
141
+ * See {@link List.Dropdown.Section}
142
+ */
143
+ declare function ListDropdownSection(props: List.Dropdown.Section.Props): ReactElement<List.Dropdown.Section.Props>;
144
+ declare namespace ListDropdownSection {
145
+ var propTypes: {
146
+ title: PropTypes.Requireable<string>;
147
+ };
148
+ var displayName: string;
149
+ }
150
+ /**
151
+ * See {@link List.Dropdown.Item}
152
+ */
153
+ declare function ListDropdownItem(props: List.Dropdown.Item.Props): ReactElement<List.Dropdown.Item.Props>;
154
+ declare namespace ListDropdownItem {
155
+ var propTypes: {
156
+ value: PropTypes.Requireable<string>;
157
+ title: PropTypes.Validator<string>;
158
+ icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
159
+ fileIcon: PropTypes.Validator<string>;
160
+ }>> | PropTypes.InferProps<{
161
+ source: PropTypes.Requireable<string | PropTypes.InferProps<{
162
+ light: PropTypes.Validator<string>;
163
+ dark: PropTypes.Validator<string>;
164
+ }>>;
165
+ fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
166
+ light: PropTypes.Validator<string>;
167
+ dark: PropTypes.Validator<string>;
168
+ }>>;
116
169
  mask: PropTypes.Requireable<Image.Mask>;
117
170
  tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
118
171
  light: PropTypes.Validator<string>;
@@ -172,6 +225,54 @@ export declare namespace List {
172
225
  * ```
173
226
  */
174
227
  const Section: typeof ListSection;
228
+ /**
229
+ * A dropdown menu that will be shown in the right-hand-side of the search bar.
230
+ *
231
+ * @example
232
+ * ```typescript
233
+ * import { List } from "@raycast/api";
234
+ *
235
+ * function DrinkDropdown(props: DrinkDropdownProps) {
236
+ * const { isLoading = false, drinkTypes, onDrinkTypeChange } = props;
237
+ * return (
238
+ * <List.Dropdown
239
+ * tooltip="Select Drink Type"
240
+ * disabled={isLoading}
241
+ * storeValue={true}
242
+ * onChange={(newValue) => {
243
+ * onDrinkTypeChange(newValue);
244
+ * }}
245
+ * >
246
+ * <List.Dropdown.Section title="Alcoholic Beverages">
247
+ * {drinkTypes.map((drinkType) => (
248
+ * <List.Dropdown.Item key={drinkType.id} title={drinkType.name} value={drinkType.id} />
249
+ * ))}
250
+ * </List.Dropdown.Section>
251
+ * </List.Dropdown>
252
+ * );
253
+ * }
254
+ *
255
+ * export default function Command() {
256
+ * const drinkTypes = [{ id: 1, name: 'Beer' }, { id: 2, name: 'Wine' }];
257
+ * const onDrinkTypeChange = (newValue) => {
258
+ * console.log(newValue);
259
+ * }
260
+ * return (
261
+ * <List
262
+ * navigationTitle="Search Beers"
263
+ * searchBarPlaceholder="Search your favorite drink"
264
+ * searchBarAccessory={<DrinkDropdown drinkTypes={drinkTypes} onDrinkTypeChange={onDrinkTypeChange} />}
265
+ * >
266
+ * <List.Item title="Augustiner Helles" />
267
+ * <List.Item title="Camden Hells" />
268
+ * <List.Item title="Leffe Blonde" />
269
+ * <List.Item title="Sierra Nevada IPA" />
270
+ * </List>
271
+ * );
272
+ * }
273
+ * ```
274
+ */
275
+ const Dropdown: typeof ListDropdown;
175
276
  /**
176
277
  * Props of the {@link List} React component.
177
278
  */
@@ -184,6 +285,24 @@ export declare namespace List {
184
285
  * Callback triggered when the item selection in the list changes.
185
286
  */
186
287
  onSelectionChange?: (id?: string) => void;
288
+ /**
289
+ * {@link List.Dropdown} that will be shown in the right-hand-side of the search bar.
290
+ */
291
+ searchBarAccessory?: ReactElement<List.Dropdown.Props> | null | boolean;
292
+ /**
293
+ * The text that will be displayed in the search bar.
294
+ */
295
+ searchText?: string;
296
+ /**
297
+ * Toggles Raycast filtering. When `true`, Raycast will use the query in the search bar to filter list
298
+ * items. When `false`, the extension needs to take care of the filtering.
299
+ *
300
+ * @remarks
301
+ * Having this enabled when filtering items in the extension is unspecified behaviour.
302
+ *
303
+ * @defaultValue false when `onSearchTextChange` is specified, true otherwise.
304
+ */
305
+ enableFiltering?: boolean;
187
306
  /**
188
307
  * Placeholder text that will be shown in the search bar.
189
308
  *
@@ -202,9 +321,17 @@ export declare namespace List {
202
321
  throttle?: boolean;
203
322
  /**
204
323
  * Callback triggered when the search bar text changes.
205
- * Note that built-in list filtering will be disabled when this callback is set.
324
+ *
325
+ * @remarks
326
+ * Specifying this implicitly toggles `enableFiltering` to false. To enable native filtering when using `onSearchTextChange`, explicitly set `enableFiltering` to true.
206
327
  */
207
328
  onSearchTextChange?: (text: string) => void;
329
+ /**
330
+ * Whether the List should have an area on the right side of the items to show additional details about the selected item.
331
+ *
332
+ * 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.
333
+ */
334
+ isShowingDetail?: boolean;
208
335
  }
209
336
  namespace Item {
210
337
  /**
@@ -224,10 +351,6 @@ export declare namespace List {
224
351
  * An optional subtitle displayed next to the main title.
225
352
  */
226
353
  subtitle?: string;
227
- /**
228
- * An additional title displayed for the item.
229
- */
230
- accessoryTitle?: string;
231
354
  /**
232
355
  * An optional property used for providing additional indexable strings for search.
233
356
  * When filtering the list in Raycast through the search bar, the keywords will be searched in addition to the title.
@@ -241,10 +364,35 @@ export declare namespace List {
241
364
  * A optional icon displayed as accessory for the list item.
242
365
  */
243
366
  accessoryIcon?: Image.ImageLike;
367
+ /**
368
+ * An additional title displayed for the item.
369
+ */
370
+ accessoryTitle?: string;
244
371
  /**
245
372
  * An {@link ActionPanel} that will be updated for the selected list item.
246
373
  */
247
374
  actions?: ReactNode | null;
375
+ /**
376
+ * The `List.Item.Detail` to be rendered in the right side area when the parent List is showing details and the item is selected.
377
+ */
378
+ detail?: ReactNode;
379
+ }
380
+ namespace Detail {
381
+ /**
382
+ * Props of the {@link List.Item.Detail} React component.
383
+ */
384
+ interface Props {
385
+ /**
386
+ * Indicates whether a loading bar should be shown or hidden above the detail
387
+ *
388
+ * @defaultValue false
389
+ */
390
+ isLoading?: boolean;
391
+ /**
392
+ * The CommonMark string to be rendered in the right side area when the parent List is showing details and the item is selected.
393
+ */
394
+ markdown?: string | null;
395
+ }
248
396
  }
249
397
  }
250
398
  namespace Section {
@@ -271,5 +419,161 @@ export declare namespace List {
271
419
  subtitle?: string;
272
420
  }
273
421
  }
422
+ namespace Dropdown {
423
+ /**
424
+ * Props of the {@link List.Dropdown} React component.
425
+ */
426
+ interface Props {
427
+ /**
428
+ * ID of the dropdown.
429
+ */
430
+ id?: string;
431
+ /**
432
+ * Tooltip displayed when hovering the dropdown.
433
+ */
434
+ tooltip: string;
435
+ /**
436
+ * Placeholder text that will be shown in the dropdown search field.
437
+ *
438
+ * @defaultValue Search...
439
+ */
440
+ placeholder?: string;
441
+ /**
442
+ * Indicates whether the value of the dropdown should be persisted after selection, and restored next time the dropdown is rendered.
443
+ */
444
+ storeValue?: boolean;
445
+ /**
446
+ * The currently value of the dropdown.
447
+ */
448
+ value?: string;
449
+ /**
450
+ * The default value of the dropdown.
451
+ * 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.
452
+ * @important 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.
453
+ * @important If you configure `value` at the same time as `defaultValue`, the `value` will have precedence over `defaultValue`.
454
+ */
455
+ defaultValue?: string;
456
+ /**
457
+ * List sections or items. If {@link List.Dropdown.Item} elements are specified, a default section is automatically created.
458
+ */
459
+ children?: ReactNode;
460
+ /**
461
+ * Callback triggered when the list item selection changes.
462
+ */
463
+ onChange?: (newValue: string) => void;
464
+ }
465
+ namespace Section {
466
+ /**
467
+ * Props of the {@link List.Dropdown.Section} React component.
468
+ */
469
+ interface Props {
470
+ /**
471
+ * The item elements of the section.
472
+ */
473
+ children?: ReactNode;
474
+ /**
475
+ * Title displayed above the section
476
+ */
477
+ title?: string;
478
+ }
479
+ }
480
+ namespace Item {
481
+ /**
482
+ * Props of the {@link List.Dropdown.Item} React component.
483
+ */
484
+ interface Props {
485
+ /**
486
+ * Value of the dropdown item.
487
+ * Make sure to assign each unique value for each item.
488
+ */
489
+ value: string;
490
+ /**
491
+ * The title displayed for the item.
492
+ */
493
+ title: string;
494
+ /**
495
+ * A optional icon displayed for the item.
496
+ */
497
+ icon?: Image.ImageLike;
498
+ }
499
+ }
500
+ }
501
+ }
502
+ declare namespace ListDropdown {
503
+ /**
504
+ * Visually separated group of dropdown items in a {@link List.Dropdown}.
505
+ *
506
+ * @remarks
507
+ * Use sections to group related dropdown items together.
508
+ *
509
+ * @example
510
+ * ```typescript
511
+ * import { List } from "@raycast/api";
512
+ *
513
+ * export default function Command() {
514
+ * return (
515
+ * <List searchBarAccessory={
516
+ * <List.Dropdown tooltip="Dropdown With Sections">
517
+ * <List.Dropdown.Section title="First Section">
518
+ * <List.Dropdown.Item title="One" value="one" />
519
+ * </List.Dropdown.Section>
520
+ * <List.Dropdown.Section title="Second Section">
521
+ * <List.Dropdown.Item title="Two" value="two" />
522
+ * </List.Dropdown.Section>
523
+ * </List.Dropdown>
524
+ * }>
525
+ * <List.Item title="Item in the Main List">
526
+ * </List>
527
+ * );
528
+ * }
529
+ * ```
530
+ */
531
+ const Section: typeof ListDropdownSection;
532
+ /**
533
+ * A dropdown item in a {@link List.Dropdown}
534
+ *
535
+ * @example
536
+ * ```typescript
537
+ * import { List } from "@raycast/api";
538
+ *
539
+ * export default function Command() {
540
+ * return (
541
+ * <List searchBarAccessory={
542
+ * <List.Dropdown tooltip="Dropdown With Items">
543
+ * <List.Dropdown.Item title="One" value="one" />
544
+ * <List.Dropdown.Item title="Two" value="two" />
545
+ * <List.Dropdown.Item title="Three" value="three" />
546
+ * </List.Dropdown>
547
+ * }>
548
+ * <List.Item title="Item in the Main List">
549
+ * </List>
550
+ * );
551
+ * }
552
+ * ```
553
+ */
554
+ const Item: typeof ListDropdownItem;
555
+ }
556
+ declare namespace ListItem {
557
+ /**
558
+ * A Detail view that will be shown in the right-hand-side of the List.
559
+ *
560
+ * @example
561
+ * ```typescript
562
+ * import { List } from "@raycast/api";
563
+ *
564
+ * export default function Command() {
565
+ * return (
566
+ * <List isShowingDetail>
567
+ * <List.Item
568
+ * title="Pikachu"
569
+ * subtitle="Electric"
570
+ * detail={<List.Item.Detail markdown="![Illustration](https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/25.png)" />}
571
+ * />
572
+ * </List>
573
+ * );
574
+ * }
575
+ * ```
576
+ */
577
+ const Detail: typeof ListItemDetail;
274
578
  }
275
579
  export {};
@@ -378,6 +378,10 @@ export declare namespace Action {
378
378
  icon?: Image.ImageLike;
379
379
  /**
380
380
  * The keyboard shortcut for the item.
381
+ *
382
+ * @remarks
383
+ * The first and second action in an {@link ActionPanel} become the primary and secondary action. They automatically get the default keyboard shortcuts assigned.
384
+ * 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.
381
385
  */
382
386
  shortcut?: Keyboard.Shortcut;
383
387
  /**
@@ -1,6 +1,7 @@
1
+ import { ReactNode } from "react";
1
2
  import { Clipboard, Keyboard, LocalStorage } from "./app";
2
3
  import { Action, ActionPanel, Form, List, Detail } from "./components";
3
- import { randomId as _randomId, useId as _useId, useActionPanel as _useActionPanel, ActionPanelState as _ActionPanelState, render as _render } from "./internal";
4
+ import { randomId as _randomId, useId as _useId, render as _render } from "./internal";
4
5
  import { Alert, Toast as _Toast, Image, Color } from "./ui";
5
6
  import { Preference as _Preference, Preferences as _Preferences } from "../core/preferences";
6
7
  /*********************************
@@ -346,11 +347,15 @@ export declare const useId: typeof _useId;
346
347
  /**
347
348
  * @deprecated
348
349
  */
349
- export declare const useActionPanel: typeof _useActionPanel;
350
+ export declare function useActionPanel(): ActionPanelState;
350
351
  /**
351
352
  * @deprecated
352
353
  */
353
- export interface ActionPanelState extends _ActionPanelState {
354
+ export interface ActionPanelState {
355
+ /**
356
+ * @deprecated
357
+ */
358
+ update: (actionPanel: ReactNode) => void;
354
359
  }
355
360
  /**
356
361
  * @deprecated Use `Alert.Options` instead
@@ -1,4 +1,3 @@
1
- export * from "./portal";
2
1
  export * from "./ErrorBoundary";
3
2
  export * from "./Navigation";
4
3
  export * from "./Root";
@@ -1 +1,2 @@
1
1
  export * from "./react";
2
+ export * from "./actionPanel";
@@ -1,2 +1 @@
1
1
  export * from "./useId";
2
- export * from "./useActionPanel";
@@ -1 +1,4 @@
1
- export {};
1
+ export declare function reactRenderDebugLog(...params: unknown[]): void;
2
+ export declare function reconcilerDebugLog(...params: unknown[]): void;
3
+ export declare function benchmarkingStart(label?: string): void;
4
+ export declare function benchmarkingStop(label?: string): void;
@@ -1 +1,2 @@
1
- export {};
1
+ import { RaycastElement } from "./types";
2
+ export declare function appendDetailChildElement(detailElement: RaycastElement, childElement: RaycastElement): void;
@@ -1 +1,2 @@
1
- export {};
1
+ import { RaycastElement } from "./types";
2
+ export declare function appendFormChildElement(formElement: RaycastElement, childElement: RaycastElement): void;
@@ -1,2 +1,4 @@
1
1
  import { RaycastElement } from "./types";
2
2
  export declare function appendListChildElement(listElement: RaycastElement, childElement: RaycastElement): void;
3
+ export declare function appendListDropdownChildElement(listElement: RaycastElement, childElement: RaycastElement): void;
4
+ export declare function appendListItemChildElement(listItemElement: RaycastElement, childElement: RaycastElement): void;
@@ -1 +1 @@
1
- export {};
1
+ export declare const AllPropsFromChildren: PropsFromChildren[];
@@ -0,0 +1,37 @@
1
+ declare function shim(): any;
2
+ export declare const supportsHydration = false;
3
+ export declare const canHydrateInstance: typeof shim;
4
+ export declare const canHydrateTextInstance: typeof shim;
5
+ export declare const canHydrateSuspenseInstance: typeof shim;
6
+ export declare const isSuspenseInstancePending: typeof shim;
7
+ export declare const isSuspenseInstanceFallback: typeof shim;
8
+ export declare const registerSuspenseInstanceRetry: typeof shim;
9
+ export declare const getNextHydratableSibling: typeof shim;
10
+ export declare const getFirstHydratableChild: typeof shim;
11
+ export declare const getFirstHydratableChildWithinContainer: typeof shim;
12
+ export declare const getFirstHydratableChildWithinSuspenseInstance: typeof shim;
13
+ export declare const hydrateInstance: typeof shim;
14
+ export declare const hydrateTextInstance: typeof shim;
15
+ export declare const hydrateSuspenseInstance: typeof shim;
16
+ export declare const getNextHydratableInstanceAfterSuspenseInstance: typeof shim;
17
+ export declare const commitHydratedContainer: typeof shim;
18
+ export declare const commitHydratedSuspenseInstance: typeof shim;
19
+ export declare const clearSuspenseBoundary: typeof shim;
20
+ export declare const clearSuspenseBoundaryFromContainer: typeof shim;
21
+ export declare const shouldDeleteUnhydratedTailInstances: typeof shim;
22
+ export declare const didNotMatchHydratedContainerTextInstance: typeof shim;
23
+ export declare const didNotMatchHydratedTextInstance: typeof shim;
24
+ export declare const didNotHydrateInstanceWithinContainer: typeof shim;
25
+ export declare const didNotHydrateInstanceWithinSuspenseInstance: typeof shim;
26
+ export declare const didNotHydrateInstance: typeof shim;
27
+ export declare const didNotFindHydratableInstanceWithinContainer: typeof shim;
28
+ export declare const didNotFindHydratableTextInstanceWithinContainer: typeof shim;
29
+ export declare const didNotFindHydratableSuspenseInstanceWithinContainer: typeof shim;
30
+ export declare const didNotFindHydratableInstanceWithinSuspenseInstance: typeof shim;
31
+ export declare const didNotFindHydratableTextInstanceWithinSuspenseInstance: typeof shim;
32
+ export declare const didNotFindHydratableSuspenseInstanceWithinSuspenseInstance: typeof shim;
33
+ export declare const didNotFindHydratableInstance: typeof shim;
34
+ export declare const didNotFindHydratableTextInstance: typeof shim;
35
+ export declare const didNotFindHydratableSuspenseInstance: typeof shim;
36
+ export declare const errorHydratingContainer: typeof shim;
37
+ export {};
@@ -0,0 +1,18 @@
1
+ declare function shim(): any;
2
+ export declare const supportsMutation = false;
3
+ export declare const appendChild: typeof shim;
4
+ export declare const appendChildToContainer: typeof shim;
5
+ export declare const commitTextUpdate: typeof shim;
6
+ export declare const commitMount: typeof shim;
7
+ export declare const commitUpdate: typeof shim;
8
+ export declare const insertBefore: typeof shim;
9
+ export declare const insertInContainerBefore: typeof shim;
10
+ export declare const removeChild: typeof shim;
11
+ export declare const removeChildFromContainer: typeof shim;
12
+ export declare const resetTextContent: typeof shim;
13
+ export declare const hideInstance: typeof shim;
14
+ export declare const hideTextInstance: typeof shim;
15
+ export declare const unhideInstance: typeof shim;
16
+ export declare const unhideTextInstance: typeof shim;
17
+ export declare const clearContainer: typeof shim;
18
+ export {};
@@ -1 +1,3 @@
1
1
  export * from "./ids";
2
+ export * from "./internal-children";
3
+ export * from "./propTypes";
@@ -0,0 +1,26 @@
1
+ import { ReactNode } from "react";
2
+ import { RaycastElement } from "../rendering/node-builders/types";
3
+ /**
4
+ * Users are expected to pass some components as props.
5
+ * However, because internally we take that prop and pass it as a child (to go throught the react reconciler),
6
+ * it means that a user could also pass the component as a child instead of using the prop.
7
+ *
8
+ * To circumvent this, in development mode we wrap the components passed as a prop with an `internal` flag context;
9
+ *
10
+ * Components that can be "internal" must listen to this context and pass it as a prop so that during
11
+ * reconciliation, if the flag is falsy the component is not added to the render tree and a warning is printed.
12
+ */
13
+ export declare const InternalChildContext: import("react").Context<boolean>;
14
+ /**
15
+ * Method to wrap a component prop with the internal dev flag
16
+ * @see {@link InternalChildContext}
17
+ */
18
+ export declare function propToInternalChild(prop?: ReactNode): {};
19
+ /**
20
+ * Check if the child has the internal flag set.
21
+ * Output a warning otherwise.
22
+ */
23
+ export declare function internalChildInvariant(child: RaycastElement, warning: string): boolean;
24
+ export declare type MaybeInternalComponent<T> = T & {
25
+ internal?: boolean;
26
+ };
@@ -0,0 +1,3 @@
1
+ declare function getPropType(propValue: unknown): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "array";
2
+ declare function getPreciseType(propValue: unknown): string;
3
+ export { getPropType, getPreciseType };
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import type { PortalProps } from './types';
3
- declare const Portal: import("react").MemoExoticComponent<({ name: _providedName, hostName, handleOnMount, handleOnUnmount, children, }: PortalProps) => any>;
4
- export default Portal;
@@ -1 +0,0 @@
1
- export { default } from './Portal';
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import type { PortalHostProps } from './types';
3
- declare const PortalHost: React.MemoExoticComponent<({ name }: PortalHostProps) => JSX.Element>;
4
- export default PortalHost;
@@ -1 +0,0 @@
1
- export { default } from './PortalHost';
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import type { PortalProviderProps } from './types';
3
- declare const PortalProvider: React.MemoExoticComponent<({ children }: PortalProviderProps) => JSX.Element>;
4
- export default PortalProvider;
@@ -1 +0,0 @@
1
- export { default } from './PortalProvider';
@@ -1 +0,0 @@
1
- export { PortalDispatchContext, PortalStateContext } from './portal';
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- import type { ActionTypes } from '../state';
3
- import type { PortalType } from '../types';
4
- export declare const PortalStateContext: import("react").Context<Record<string, PortalType[]>>;
5
- export declare const PortalDispatchContext: import("react").Context<import("react").Dispatch<ActionTypes>>;
@@ -1,2 +0,0 @@
1
- export { usePortal } from './usePortal';
2
- export { usePortalState } from './usePortalState';
@@ -1,8 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export declare const usePortal: (hostName?: string) => {
3
- registerHost: () => void;
4
- deregisterHost: () => void;
5
- addPortal: (name: string, node: ReactNode) => void;
6
- updatePortal: (name: string, node: ReactNode) => void;
7
- removePortal: (name: string) => void;
8
- };
@@ -1 +0,0 @@
1
- export declare const usePortalState: (hostName: string) => import("../types").PortalType[];
@@ -1,5 +0,0 @@
1
- export { default as Portal } from './components/portal';
2
- export { default as PortalHost } from './components/portalHost';
3
- export { default as PortalProvider } from './components/portalProvider';
4
- export { usePortal } from './hooks/usePortal';
5
- export { enableLogging } from './utilities/logger';
@@ -1,9 +0,0 @@
1
- declare enum ACTIONS {
2
- REGISTER_HOST = 0,
3
- DEREGISTER_HOST = 1,
4
- ADD_PORTAL = 2,
5
- UPDATE_PORTAL = 3,
6
- REMOVE_PORTAL = 4
7
- }
8
- declare const INITIAL_STATE: {};
9
- export { ACTIONS, INITIAL_STATE };
@@ -1,3 +0,0 @@
1
- export { reducer } from './reducer';
2
- export { ACTIONS, INITIAL_STATE } from './constants';
3
- export type { ActionTypes } from './types';
@@ -1,3 +0,0 @@
1
- import type { PortalType } from '../types';
2
- import type { ActionTypes } from './types';
3
- export declare const reducer: (state: Record<string, Array<PortalType>>, action: ActionTypes) => Record<string, PortalType[]>;
@@ -1,9 +0,0 @@
1
- interface PrintOptions {
2
- component?: string;
3
- method?: string;
4
- params?: Record<string, any> | string | number | boolean;
5
- }
6
- declare type Print = (options: PrintOptions) => void;
7
- declare const enableLogging: () => void;
8
- declare let print: Print;
9
- export { print, enableLogging };