@raycast/api 1.27.0 → 1.29.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 (91) hide show
  1. package/bin/arm64/ray +0 -0
  2. package/bin/x86/ray +0 -0
  3. package/package.json +2 -2
  4. package/types/api/app/app.d.ts +171 -0
  5. package/types/api/app/clipboard.d.ts +47 -0
  6. package/types/api/app/index.d.ts +4 -0
  7. package/types/api/app/keyboard.d.ts +56 -0
  8. package/types/api/app/localStorage.d.ts +117 -0
  9. package/types/api/components/ActionPanel.d.ts +297 -0
  10. package/types/api/components/Detail.d.ts +40 -0
  11. package/types/api/components/Form.d.ts +992 -0
  12. package/types/api/components/List.d.ts +275 -0
  13. package/types/api/components/actions/Action.d.ts +454 -0
  14. package/types/api/components/actions/CopyToClipboardAction.d.ts +40 -0
  15. package/types/api/components/actions/CreateQuicklinkAction.d.ts +42 -0
  16. package/types/api/components/actions/CreateSnippetAction.d.ts +40 -0
  17. package/types/api/components/actions/OpenAction.d.ts +47 -0
  18. package/types/api/components/actions/OpenInBrowserAction.d.ts +43 -0
  19. package/types/api/components/actions/OpenWithAction.d.ts +40 -0
  20. package/types/api/components/actions/PasteAction.d.ts +40 -0
  21. package/types/api/components/actions/PushAction.d.ts +38 -0
  22. package/types/api/components/actions/ShowInFinderAction.d.ts +42 -0
  23. package/types/api/components/actions/SubmitFormAction.d.ts +35 -0
  24. package/types/api/components/actions/TrashAction.d.ts +43 -0
  25. package/types/api/components/actions/index.d.ts +1 -0
  26. package/types/api/components/index.d.ts +5 -0
  27. package/types/api/components/propTypes.d.ts +1 -0
  28. package/types/api/components/types.d.ts +30 -0
  29. package/types/api/deprecated.d.ts +410 -0
  30. package/types/api/environment/environment.d.ts +48 -0
  31. package/types/api/environment/index.d.ts +3 -0
  32. package/types/api/environment/preferences.d.ts +31 -0
  33. package/types/api/environment/workspace.d.ts +62 -0
  34. package/types/api/hooks/index.d.ts +1 -0
  35. package/types/api/hooks/useNavigation.d.ts +66 -0
  36. package/types/api/index.d.ts +6 -0
  37. package/types/api/internal/comm/index.d.ts +1 -0
  38. package/types/api/internal/components/ErrorBoundary.d.ts +1 -0
  39. package/types/api/internal/components/Navigation.d.ts +1 -0
  40. package/types/api/internal/components/Root.d.ts +1 -0
  41. package/types/api/internal/components/index.d.ts +4 -0
  42. package/types/api/internal/components/portal/components/portal/Portal.d.ts +4 -0
  43. package/types/api/internal/components/portal/components/portal/index.d.ts +1 -0
  44. package/types/api/internal/components/portal/components/portalHost/PortalHost.d.ts +4 -0
  45. package/types/api/internal/components/portal/components/portalHost/index.d.ts +1 -0
  46. package/types/api/internal/components/portal/components/portalProvider/PortalProvider.d.ts +4 -0
  47. package/types/api/internal/components/portal/components/portalProvider/index.d.ts +1 -0
  48. package/types/api/internal/components/portal/contexts/index.d.ts +1 -0
  49. package/types/api/internal/components/portal/contexts/portal.d.ts +5 -0
  50. package/types/api/internal/components/portal/hooks/index.d.ts +2 -0
  51. package/types/api/internal/components/portal/hooks/usePortal.d.ts +8 -0
  52. package/types/api/internal/components/portal/hooks/usePortalState.d.ts +1 -0
  53. package/types/api/internal/components/portal/index.d.ts +5 -0
  54. package/types/api/internal/components/portal/state/constants.d.ts +9 -0
  55. package/types/api/internal/components/portal/state/index.d.ts +3 -0
  56. package/types/api/internal/components/portal/state/reducer.d.ts +3 -0
  57. package/types/api/internal/components/portal/utilities/logger.d.ts +9 -0
  58. package/types/api/internal/devtools/index.d.ts +1 -0
  59. package/types/api/internal/devtools/react.d.ts +1 -0
  60. package/types/api/internal/hooks/index.d.ts +2 -0
  61. package/types/api/internal/hooks/useActionPanel.d.ts +1 -0
  62. package/types/api/internal/hooks/useId.d.ts +1 -0
  63. package/types/api/internal/index.d.ts +6 -0
  64. package/types/api/internal/rendering/callbacks.d.ts +1 -0
  65. package/types/api/internal/rendering/index.d.ts +6 -0
  66. package/types/api/internal/rendering/logger.d.ts +1 -0
  67. package/types/api/internal/rendering/node-builders/actions.d.ts +3 -0
  68. package/types/api/internal/rendering/node-builders/detail.d.ts +1 -0
  69. package/types/api/internal/rendering/node-builders/forms.d.ts +1 -0
  70. package/types/api/internal/rendering/node-builders/keyboard.d.ts +1 -0
  71. package/types/api/internal/rendering/node-builders/list.d.ts +2 -0
  72. package/types/api/internal/rendering/node-builders/navigationStack.d.ts +1 -0
  73. package/types/api/internal/rendering/node-builders/root.d.ts +1 -0
  74. package/types/api/internal/rendering/node-builders/types.d.ts +1 -0
  75. package/types/api/internal/rendering/node-builders/utils.d.ts +1 -0
  76. package/types/api/internal/rendering/reconciler.d.ts +1 -0
  77. package/types/api/internal/rendering/renderer.d.ts +1 -0
  78. package/types/api/internal/utils/ids.d.ts +1 -0
  79. package/types/api/internal/utils/index.d.ts +1 -0
  80. package/types/api/ui/color.d.ts +115 -0
  81. package/types/api/ui/errors.d.ts +1 -0
  82. package/types/api/ui/feedback/alert.d.ts +97 -0
  83. package/types/api/ui/feedback/hud.d.ts +16 -0
  84. package/types/api/ui/feedback/index.d.ts +3 -0
  85. package/types/api/ui/feedback/toast.d.ts +174 -0
  86. package/types/api/ui/icon.d.ts +88 -0
  87. package/types/api/ui/image.d.ts +162 -0
  88. package/types/api/ui/index.d.ts +5 -0
  89. package/types/core/message-types.d.ts +17 -0
  90. package/types/core/preferences.d.ts +69 -0
  91. package/types/index.d.ts +2816 -2422
@@ -0,0 +1,275 @@
1
+ import { ReactElement, ReactNode } from "react";
2
+ import { Image } from "../ui";
3
+ import { ActionsInterface, NavigationChildInterface } from "./types";
4
+ import PropTypes from "prop-types";
5
+ /**
6
+ * Displays {@link List.Section} or {@link List.Item}.
7
+ *
8
+ * @remarks
9
+ * The list uses built-in filtering by indexing the title of list items and additionally keywords.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * import { List } from "@raycast/api";
14
+ *
15
+ * export default function Command() {
16
+ * return (
17
+ * <List navigationTitle="Search Beers" searchBarPlaceholder="Search your favorite beer">
18
+ * <List.Item title="Augustiner Helles" />
19
+ * <List.Item title="Camden Hells" />
20
+ * <List.Item title="Leffe Blonde" />
21
+ * <List.Item title="Sierra Nevada IPA" />
22
+ * </List>
23
+ * );
24
+ * }
25
+ * ```
26
+ */
27
+ export declare function List(props: List.Props): ReactElement<List.Props>;
28
+ export declare namespace List {
29
+ var propTypes: {
30
+ selectedItemId: PropTypes.Requireable<string>;
31
+ searchBarPlaceholder: PropTypes.Requireable<string>;
32
+ throttle: PropTypes.Requireable<boolean>;
33
+ onSearchTextChange: PropTypes.Requireable<(...args: any[]) => any>;
34
+ onSelectionChange: PropTypes.Requireable<(...args: any[]) => any>;
35
+ };
36
+ var displayName: string;
37
+ }
38
+ /**
39
+ * See {@link List.Section}
40
+ */
41
+ declare function ListSection(props: List.Section.Props): ReactElement<List.Section.Props>;
42
+ declare namespace ListSection {
43
+ var propTypes: {
44
+ id: PropTypes.Requireable<string>;
45
+ title: PropTypes.Requireable<string>;
46
+ subtitle: PropTypes.Requireable<string>;
47
+ };
48
+ var displayName: string;
49
+ }
50
+ /**
51
+ * See {@link List.Item}
52
+ */
53
+ declare function ListItem(props: List.Item.Props): ReactElement<List.Item.Props>;
54
+ declare namespace ListItem {
55
+ var propTypes: {
56
+ id: PropTypes.Requireable<string>;
57
+ title: PropTypes.Validator<string>;
58
+ subtitle: PropTypes.Requireable<string>;
59
+ accessoryTitle: PropTypes.Requireable<string>;
60
+ keywords: PropTypes.Requireable<string[]>;
61
+ icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
62
+ fileIcon: PropTypes.Validator<string>;
63
+ }>> | PropTypes.InferProps<{
64
+ source: PropTypes.Requireable<string | PropTypes.InferProps<{
65
+ light: PropTypes.Validator<string>;
66
+ dark: PropTypes.Validator<string>;
67
+ }>>;
68
+ 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
+ light: PropTypes.Validator<string>;
92
+ dark: PropTypes.Validator<string>;
93
+ }>>;
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
+ */
116
+ mask: PropTypes.Requireable<Image.Mask>;
117
+ tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
118
+ light: PropTypes.Validator<string>;
119
+ dark: PropTypes.Validator<string>;
120
+ adjustContrast: PropTypes.Requireable<boolean>;
121
+ }>>;
122
+ }>>;
123
+ };
124
+ var displayName: string;
125
+ }
126
+ export declare namespace List {
127
+ /**
128
+ * A item in the {@link List}.
129
+ *
130
+ * @remarks
131
+ * This is one of the foundational UI components of Raycast. A list item represents a single entity. It can be a
132
+ * GitHub pull request, a file, or anything else. You most likely want to perform actions on this item, so make it clear
133
+ * to the user what this list item is about.
134
+ *
135
+ * @example
136
+ * ```typescript
137
+ * import { Icon, List } from "@raycast/api";
138
+ *
139
+ * export default function Command() {
140
+ * return (
141
+ * <List>
142
+ * <List.Item icon={Icon.Star} title="Augustiner Helles" subtitle="0,5 Liter" accessoryTitle="Germany" />
143
+ * </List>
144
+ * );
145
+ * }
146
+ * ```
147
+ */
148
+ const Item: typeof ListItem;
149
+ /**
150
+ * A group of related {@link List.Item}.
151
+ *
152
+ * @remarks
153
+ * Sections are a great way to structure your list. For example, group GitHub issues with the same status and order them by priority.
154
+ * This way, users can quickly access what is most relevant.
155
+ *
156
+ * @example
157
+ * ```typescript
158
+ * import { List } from "@raycast/api";
159
+ *
160
+ * export default function Command() {
161
+ * return (
162
+ * <List>
163
+ * <List.Section title="Lager">
164
+ * <List.Item title="Camden Hells" />
165
+ * </List.Section>
166
+ * <List.Section title="IPA">
167
+ * <List.Item title="Sierra Nevada IPA" />
168
+ * </List.Section>
169
+ * </List>
170
+ * );
171
+ * }
172
+ * ```
173
+ */
174
+ const Section: typeof ListSection;
175
+ /**
176
+ * Props of the {@link List} React component.
177
+ */
178
+ interface Props extends ActionsInterface, NavigationChildInterface {
179
+ /**
180
+ * List sections or items. If {@link List.Item} elements are specified, a default section is automatically created.
181
+ */
182
+ children?: ReactNode;
183
+ /**
184
+ * Callback triggered when the item selection in the list changes.
185
+ */
186
+ onSelectionChange?: (id?: string) => void;
187
+ /**
188
+ * Placeholder text that will be shown in the search bar.
189
+ *
190
+ * @defaultValue Search value...
191
+ */
192
+ searchBarPlaceholder?: string;
193
+ /**
194
+ * Selects the item with the specified id.
195
+ */
196
+ selectedItemId?: string;
197
+ /**
198
+ * Defines whether the {@link ListProps.onSearchTextChange} will be triggered on every keyboard press or with a delay for throttling the events.
199
+ * Recommended to set to `true` when using custom filtering logic with asynchronous operations (e.g. network requests).
200
+ * @defaultValue false
201
+ */
202
+ throttle?: boolean;
203
+ /**
204
+ * Callback triggered when the search bar text changes.
205
+ * Note that built-in list filtering will be disabled when this callback is set.
206
+ */
207
+ onSearchTextChange?: (text: string) => void;
208
+ }
209
+ namespace Item {
210
+ /**
211
+ * Props of the {@link List.Item} React component.
212
+ */
213
+ interface Props extends ActionsInterface {
214
+ /**
215
+ * ID of the item.
216
+ * Make sure to assign each item a unique ID or a UUID will be auto generated.
217
+ */
218
+ id?: string;
219
+ /**
220
+ * The main title displayed for that item.
221
+ */
222
+ title: string;
223
+ /**
224
+ * An optional subtitle displayed next to the main title.
225
+ */
226
+ subtitle?: string;
227
+ /**
228
+ * An additional title displayed for the item.
229
+ */
230
+ accessoryTitle?: string;
231
+ /**
232
+ * An optional property used for providing additional indexable strings for search.
233
+ * When filtering the list in Raycast through the search bar, the keywords will be searched in addition to the title.
234
+ */
235
+ keywords?: string[];
236
+ /**
237
+ * A optional icon displayed for the list item.
238
+ */
239
+ icon?: Image.ImageLike;
240
+ /**
241
+ * A optional icon displayed as accessory for the list item.
242
+ */
243
+ accessoryIcon?: Image.ImageLike;
244
+ /**
245
+ * An {@link ActionPanel} that will be updated for the selected list item.
246
+ */
247
+ actions?: ReactNode | null;
248
+ }
249
+ }
250
+ namespace Section {
251
+ /**
252
+ * Props of the {@link List.Section} React component.
253
+ */
254
+ interface Props {
255
+ /**
256
+ * The {@link List.Item} elements of the section.
257
+ */
258
+ children?: ReactNode;
259
+ /**
260
+ * ID of the section.
261
+ * Make sure to assign each section a unique ID or a UUID will be auto generated.
262
+ */
263
+ id?: string;
264
+ /**
265
+ * Title displayed above the section.
266
+ */
267
+ title?: string;
268
+ /**
269
+ * An optional subtitle displayed next to the title of the section.
270
+ */
271
+ subtitle?: string;
272
+ }
273
+ }
274
+ }
275
+ export {};