@raycast/api 1.26.2 → 1.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/bin/arm64/ray +0 -0
  2. package/bin/x86/ray +0 -0
  3. package/package.json +3 -3
  4. package/types/api/app/app.d.ts +171 -0
  5. package/types/api/app/clipboard.d.ts +47 -0
  6. package/types/api/app/index.d.ts +4 -0
  7. package/types/api/app/keyboard.d.ts +56 -0
  8. package/types/api/app/localStorage.d.ts +117 -0
  9. package/types/api/components/ActionPanel.d.ts +297 -0
  10. package/types/api/components/Detail.d.ts +40 -0
  11. package/types/api/components/Form.d.ts +992 -0
  12. package/types/api/components/List.d.ts +275 -0
  13. package/types/api/components/actions/Action.d.ts +396 -0
  14. package/types/api/components/actions/CopyToClipboardAction.d.ts +39 -0
  15. package/types/api/components/actions/OpenAction.d.ts +47 -0
  16. package/types/api/components/actions/OpenInBrowserAction.d.ts +42 -0
  17. package/types/api/components/actions/OpenWithAction.d.ts +40 -0
  18. package/types/api/components/actions/PasteAction.d.ts +39 -0
  19. package/types/api/components/actions/PushAction.d.ts +38 -0
  20. package/types/api/components/actions/ShowInFinderAction.d.ts +42 -0
  21. package/types/api/components/actions/SubmitFormAction.d.ts +34 -0
  22. package/types/api/components/actions/TrashAction.d.ts +43 -0
  23. package/types/api/components/actions/index.d.ts +1 -0
  24. package/types/api/components/index.d.ts +5 -0
  25. package/types/api/components/propTypes.d.ts +1 -0
  26. package/types/api/components/types.d.ts +30 -0
  27. package/types/api/deprecated.d.ts +410 -0
  28. package/types/api/environment/environment.d.ts +48 -0
  29. package/types/api/environment/index.d.ts +3 -0
  30. package/types/api/environment/preferences.d.ts +31 -0
  31. package/types/api/environment/workspace.d.ts +62 -0
  32. package/types/api/hooks/index.d.ts +1 -0
  33. package/types/api/hooks/useNavigation.d.ts +66 -0
  34. package/types/api/index.d.ts +6 -0
  35. package/types/api/internal/comm/index.d.ts +1 -0
  36. package/types/api/internal/components/ErrorBoundary.d.ts +1 -0
  37. package/types/api/internal/components/Navigation.d.ts +1 -0
  38. package/types/api/internal/components/Root.d.ts +1 -0
  39. package/types/api/internal/components/index.d.ts +4 -0
  40. package/types/api/internal/components/portal/components/portal/Portal.d.ts +4 -0
  41. package/types/api/internal/components/portal/components/portal/index.d.ts +1 -0
  42. package/types/api/internal/components/portal/components/portalHost/PortalHost.d.ts +4 -0
  43. package/types/api/internal/components/portal/components/portalHost/index.d.ts +1 -0
  44. package/types/api/internal/components/portal/components/portalProvider/PortalProvider.d.ts +4 -0
  45. package/types/api/internal/components/portal/components/portalProvider/index.d.ts +1 -0
  46. package/types/api/internal/components/portal/contexts/index.d.ts +1 -0
  47. package/types/api/internal/components/portal/contexts/portal.d.ts +5 -0
  48. package/types/api/internal/components/portal/hooks/index.d.ts +2 -0
  49. package/types/api/internal/components/portal/hooks/usePortal.d.ts +8 -0
  50. package/types/api/internal/components/portal/hooks/usePortalState.d.ts +1 -0
  51. package/types/api/internal/components/portal/index.d.ts +5 -0
  52. package/types/api/internal/components/portal/state/constants.d.ts +9 -0
  53. package/types/api/internal/components/portal/state/index.d.ts +3 -0
  54. package/types/api/internal/components/portal/state/reducer.d.ts +3 -0
  55. package/types/api/internal/components/portal/utilities/logger.d.ts +9 -0
  56. package/types/api/internal/devtools/index.d.ts +1 -0
  57. package/types/api/internal/devtools/react.d.ts +1 -0
  58. package/types/api/internal/hooks/index.d.ts +2 -0
  59. package/types/api/internal/hooks/useActionPanel.d.ts +1 -0
  60. package/types/api/internal/hooks/useId.d.ts +1 -0
  61. package/types/api/internal/index.d.ts +6 -0
  62. package/types/api/internal/rendering/callbacks.d.ts +1 -0
  63. package/types/api/internal/rendering/index.d.ts +5 -0
  64. package/types/api/internal/rendering/node-builders/actions.d.ts +1 -0
  65. package/types/api/internal/rendering/node-builders/detail.d.ts +1 -0
  66. package/types/api/internal/rendering/node-builders/forms.d.ts +1 -0
  67. package/types/api/internal/rendering/node-builders/keyboard.d.ts +1 -0
  68. package/types/api/internal/rendering/node-builders/list.d.ts +1 -0
  69. package/types/api/internal/rendering/node-builders/navigationStack.d.ts +1 -0
  70. package/types/api/internal/rendering/node-builders/root.d.ts +1 -0
  71. package/types/api/internal/rendering/node-builders/types.d.ts +1 -0
  72. package/types/api/internal/rendering/node-builders/utils.d.ts +1 -0
  73. package/types/api/internal/rendering/reconciler.d.ts +1 -0
  74. package/types/api/internal/rendering/renderer.d.ts +1 -0
  75. package/types/api/internal/utils/ids.d.ts +1 -0
  76. package/types/api/internal/utils/index.d.ts +1 -0
  77. package/types/api/ui/color.d.ts +115 -0
  78. package/types/api/ui/errors.d.ts +1 -0
  79. package/types/api/ui/feedback/alert.d.ts +97 -0
  80. package/types/api/ui/feedback/hud.d.ts +16 -0
  81. package/types/api/ui/feedback/index.d.ts +3 -0
  82. package/types/api/ui/feedback/toast.d.ts +171 -0
  83. package/types/api/ui/icon.d.ts +88 -0
  84. package/types/api/ui/image.d.ts +161 -0
  85. package/types/api/ui/index.d.ts +5 -0
  86. package/types/core/message-types.d.ts +17 -0
  87. package/types/core/preferences.d.ts +69 -0
  88. package/types/index.d.ts +2814 -2139
@@ -0,0 +1,410 @@
1
+ import { Clipboard, Keyboard, LocalStorage } from "./app";
2
+ 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 { Alert, Toast as _Toast, Image, Color } from "./ui";
5
+ import { Preference as _Preference, Preferences as _Preferences } from "../core/preferences";
6
+ /*********************************
7
+ * Deprecated on v1.28.0
8
+ *********************************/
9
+ /**
10
+ * @deprecated Use `Clipboard.copy` instead
11
+ */
12
+ export declare const copyTextToClipboard: typeof Clipboard.copy;
13
+ /**
14
+ * @deprecated Use `Clipboard.clear` instead
15
+ */
16
+ export declare const clearClipboard: typeof Clipboard.clear;
17
+ /**
18
+ * @deprecated Use `Clipboard.paste` instead
19
+ */
20
+ export declare const pasteText: typeof Clipboard.paste;
21
+ /**
22
+ * @deprecated Use `LocalStorage.allItems` instead
23
+ */
24
+ export declare const allLocalStorageItems: typeof LocalStorage.allItems;
25
+ /**
26
+ * @deprecated Use `LocalStorage.getItem` instead
27
+ */
28
+ export declare const getLocalStorageItem: typeof LocalStorage.getItem;
29
+ /**
30
+ * @deprecated Use `LocalStorage.setItem` instead
31
+ */
32
+ export declare const setLocalStorageItem: typeof LocalStorage.setItem;
33
+ /**
34
+ * @deprecated Use `LocalStorage.removeItem` instead
35
+ */
36
+ export declare const removeLocalStorageItem: typeof LocalStorage.removeItem;
37
+ /**
38
+ * @deprecated Use `LocalStorage.clear` instead
39
+ */
40
+ export declare const clearLocalStorage: typeof LocalStorage.clear;
41
+ /**
42
+ * @deprecated Use `LocalStorage.Value` instead
43
+ */
44
+ export declare type LocalStorageValue = LocalStorage.Value;
45
+ /**
46
+ * @deprecated Use `LocalStorage.Values` instead
47
+ */
48
+ export interface LocalStorageValues extends LocalStorage.Values {
49
+ }
50
+ /**
51
+ * @deprecated Use `Keyboard.Shortcut` instead
52
+ */
53
+ export interface KeyboardShortcut extends Keyboard.Shortcut {
54
+ }
55
+ /**
56
+ * @deprecated Use `Keyboard.specialKeys` instead
57
+ */
58
+ export declare const specialKeys: Record<string, string>;
59
+ /**
60
+ * @deprecated Use `Keyboard.KeyModifier` instead
61
+ */
62
+ export declare type KeyModifier = Keyboard.KeyModifier;
63
+ /**
64
+ * @deprecated Use `Keyboard.KeyEquivalent` instead
65
+ */
66
+ export declare type KeyEquivalent = Keyboard.KeyEquivalent;
67
+ /**
68
+ * @deprecated Use `getPreferenceValues()` instead.
69
+ */
70
+ export declare type Preferences = _Preferences;
71
+ /**
72
+ * @deprecated Use `getPreferenceValues()` instead.
73
+ */
74
+ export interface Preference extends _Preference {
75
+ }
76
+ /**
77
+ * @deprecated Use `getPreferenceValues()` instead.
78
+ */
79
+ export declare const preferences: _Preferences;
80
+ /**
81
+ * @deprecated Use `Action.CopyToClipboard` instead.
82
+ */
83
+ export declare const CopyToClipboardAction: typeof import("./components/actions/CopyToClipboardAction").CopyToClipboardAction;
84
+ /**
85
+ * @deprecated Use `Action.CopyToClipboard.Props` instead.
86
+ */
87
+ export interface CopyToClipboardActionProps extends Action.CopyToClipboard.Props {
88
+ }
89
+ /**
90
+ * @deprecated Use `Action.Open` instead.
91
+ */
92
+ export declare const OpenAction: typeof import("./components/actions/OpenAction").OpenAction;
93
+ /**
94
+ * @deprecated Use `Action.Open.Props` instead.
95
+ */
96
+ export interface OpenActionProps extends Action.Open.Props {
97
+ }
98
+ /**
99
+ * @deprecated Use `Action.OpenInBrowser` instead.
100
+ */
101
+ export declare const OpenInBrowserAction: typeof import("./components/actions/OpenInBrowserAction").OpenInBrowserAction;
102
+ /**
103
+ * @deprecated Use `Action.OpenInBrowser.Props` instead.
104
+ */
105
+ export interface OpenInBrowserActionProps extends Action.OpenInBrowser.Props {
106
+ }
107
+ /**
108
+ * @deprecated Use `Action.OpenWith` instead.
109
+ */
110
+ export declare const OpenWithAction: typeof import("./components/actions/OpenWithAction").OpenWithAction;
111
+ /**
112
+ * @deprecated Use `Action.OpenWith.Props` instead.
113
+ */
114
+ export interface OpenWithActionProps extends Action.OpenWith.Props {
115
+ }
116
+ /**
117
+ * @deprecated Use `Action.Paste` instead.
118
+ */
119
+ export declare const PasteAction: typeof import("./components/actions/PasteAction").PasteAction;
120
+ /**
121
+ * @deprecated Use `Action.Paste.Props` instead.
122
+ */
123
+ export interface PasteActionProps extends Action.Paste.Props {
124
+ }
125
+ /**
126
+ * @deprecated Use `Action.Push` instead.
127
+ */
128
+ export declare const PushAction: typeof import("./components/actions/PushAction").PushAction;
129
+ /**
130
+ * @deprecated Use `Action.Push.Props` instead.
131
+ */
132
+ export interface PushActionProps extends Action.Push.Props {
133
+ }
134
+ /**
135
+ * @deprecated Use `Action.ShowInFinder` instead.
136
+ */
137
+ export declare const ShowInFinderAction: typeof import("./components/actions/ShowInFinderAction").ShowInFinderAction;
138
+ /**
139
+ * @deprecated Use `Action.ShowInFinder.Props` instead.
140
+ */
141
+ export interface ShowInFinderActionProps extends Action.ShowInFinder.Props {
142
+ }
143
+ /**
144
+ * @deprecated Use `Action.SubmitForm` instead.
145
+ */
146
+ export declare const SubmitFormAction: typeof import("./components/actions/SubmitFormAction").SubmitFormAction;
147
+ /**
148
+ * @deprecated Use `Action.SunmitForm.Props` instead.
149
+ */
150
+ export interface SubmitFormActionProps<T> extends Action.SubmitForm.Props<T> {
151
+ }
152
+ /**
153
+ * @deprecated Use `Action.Trash` instead.
154
+ */
155
+ export declare const TrashAction: typeof import("./components/actions/TrashAction").TrashAction;
156
+ /**
157
+ * @deprecated Use `Action.Trash.Props` instead.
158
+ */
159
+ export interface TrashActionProps extends Action.Trash.Props {
160
+ }
161
+ /**
162
+ * @deprecated Use `ActionPanel.Props` instead.
163
+ */
164
+ export interface ActionPanelProps extends ActionPanel.Props {
165
+ }
166
+ /**
167
+ * @deprecated Use `ActionPanel.Children` instead.
168
+ */
169
+ export declare type ActionPanelChildren = ActionPanel.Children;
170
+ /**
171
+ * @deprecated Use `Action` instead.
172
+ */
173
+ export declare const ActionPanelItem: typeof Action;
174
+ /**
175
+ * @deprecated Use `Action.Props` instead.
176
+ */
177
+ export interface ActionPanelItemProps extends Action.Props {
178
+ }
179
+ /**
180
+ * @deprecated Use `ActionPanel.Submenu` instead.
181
+ */
182
+ export declare const ActionPanelSubmenu: typeof ActionPanel.Submenu;
183
+ /**
184
+ * @deprecated Use `ActionPanel.Submenu.Props` instead.
185
+ */
186
+ export interface ActionPanelSubmenuProps extends ActionPanel.Submenu.Props {
187
+ }
188
+ /**
189
+ * @deprecated Use `ActionPanel.Section` instead.
190
+ */
191
+ export declare const ActionPanelSection: typeof ActionPanel.Section;
192
+ /**
193
+ * @deprecated Use `ActionPanel.Section.Props` instead.
194
+ */
195
+ export interface ActionPanelSectionProps extends ActionPanel.Section.Props {
196
+ }
197
+ /**
198
+ * @deprecated Use `ActionPanel.Section.Children` instead.
199
+ */
200
+ export declare type ActionPanelSectionChildren = ActionPanel.Section.Children;
201
+ /**
202
+ * @deprecated Use `Detail.Props` instead.
203
+ */
204
+ export interface DetailProps extends Detail.Props {
205
+ }
206
+ /**
207
+ * @deprecated Use `Form.Value` instead.
208
+ */
209
+ export declare type FormValue = Form.Value;
210
+ /**
211
+ * @deprecated Use `Form.Values` instead.
212
+ */
213
+ export interface FormValues extends Form.Values {
214
+ }
215
+ /**
216
+ * @deprecated Use `Form.Props` instead.
217
+ */
218
+ export interface FormProps extends Form.Props {
219
+ }
220
+ /**
221
+ * @deprecated Use `Form.ItemProps` instead.
222
+ */
223
+ export interface FormItemProps<Value extends Form.Value> extends Form.ItemProps<Value> {
224
+ }
225
+ /**
226
+ * @deprecated Use `Form.Dropdown.Section` instead.
227
+ */
228
+ export declare const FormDropdownSection: typeof Form.Dropdown.Section;
229
+ /**
230
+ * @deprecated Use `Form.Dropdown.Section.Props` instead.
231
+ */
232
+ export interface FormDropdownSectionProps extends Form.Dropdown.Section.Props {
233
+ }
234
+ /**
235
+ * @deprecated Use `Form.Dropdown.Item` instead.
236
+ */
237
+ export declare const FormDropdownItem: typeof Form.Dropdown.Item;
238
+ /**
239
+ * @deprecated Use `Form.Dropdown.Item.Props` instead.
240
+ */
241
+ export interface FormDropdownItemProps extends Form.Dropdown.Item.Props {
242
+ }
243
+ /**
244
+ * @deprecated Use `Form.TagPicker.Item` instead.
245
+ */
246
+ export declare const FormTagPickerItem: typeof Form.TagPicker.Item;
247
+ /**
248
+ * @deprecated Use `Form.TagPicker.Item.Props` instead.
249
+ */
250
+ export interface FormTagPickerItemProps extends Form.TagPicker.Item.Props {
251
+ }
252
+ /**
253
+ * @deprecated Use `Form.TextField` instead.
254
+ */
255
+ export declare const FormTextField: typeof Form.TextField;
256
+ /**
257
+ * @deprecated Use `Form.TextField.Props` instead.
258
+ */
259
+ export interface FormTextFieldProps extends Form.TextField.Props {
260
+ }
261
+ /**
262
+ * @deprecated Use `Form.TextArea` instead.
263
+ */
264
+ export declare const FormTextArea: typeof Form.TextArea;
265
+ /**
266
+ * @deprecated Use `Form.TextArea.Props` instead.
267
+ */
268
+ export interface FormTextAreaProps extends Form.TextArea.Props {
269
+ }
270
+ /**
271
+ * @deprecated Use `Form.Checkbox` instead.
272
+ */
273
+ export declare const FormCheckbox: typeof Form.Checkbox;
274
+ /**
275
+ * @deprecated Use `Form.Checkbox.Props` instead.
276
+ */
277
+ export interface FormCheckboxProps extends Form.Checkbox.Props {
278
+ }
279
+ /**
280
+ * @deprecated Use `Form.DatePicker` instead.
281
+ */
282
+ export declare const FormDatePicker: typeof Form.DatePicker;
283
+ /**
284
+ * @deprecated Use `Form.DatePicker.Props` instead.
285
+ */
286
+ export interface FormDatePickerProps extends Form.DatePicker.Props {
287
+ }
288
+ /**
289
+ * @deprecated Use `Form.Separator` instead.
290
+ */
291
+ export declare const FormSeparator: typeof Form.Separator;
292
+ /**
293
+ * @deprecated Use `Form.Separator.Props` instead.
294
+ */
295
+ export interface FormSeparatorProps extends Form.Separator.Props {
296
+ }
297
+ /**
298
+ * @deprecated Use `Form.Dropdown` instead.
299
+ */
300
+ export declare const FormDropdown: typeof Form.Dropdown;
301
+ /**
302
+ * @deprecated Use `Form.Dropdown.Props` instead.
303
+ */
304
+ export interface FormDropdownProps extends Form.Dropdown.Props {
305
+ }
306
+ /**
307
+ * @deprecated Use `Form.TagPicker` instead.
308
+ */
309
+ export declare const FormTagPicker: typeof Form.TagPicker;
310
+ /**
311
+ * @deprecated Use `Form.TagPicker.Props` instead.
312
+ */
313
+ export interface FormTagPickerProps extends Form.TagPicker.Props {
314
+ }
315
+ /**
316
+ * @deprecated Use `List.Props` instead.
317
+ */
318
+ export interface ListProps extends List.Props {
319
+ }
320
+ /**
321
+ * @deprecated Use `List.Section` instead.
322
+ */
323
+ export declare const ListSection: typeof List.Section;
324
+ /**
325
+ * @deprecated Use `List.Section.Props` instead.
326
+ */
327
+ export interface ListSectionProps extends List.Section.Props {
328
+ }
329
+ /**
330
+ * @deprecated Use `List.item` instead.
331
+ */
332
+ export declare const ListItem: typeof List.Item;
333
+ /**
334
+ * @deprecated Use `List.Item.Props` instead.
335
+ */
336
+ export interface ListItemProps extends List.Item.Props {
337
+ }
338
+ /**
339
+ * @deprecated Add `nanoid` as a dependency and use it instead.
340
+ */
341
+ export declare const randomId: typeof _randomId;
342
+ /**
343
+ * @deprecated
344
+ */
345
+ export declare const useId: typeof _useId;
346
+ /**
347
+ * @deprecated
348
+ */
349
+ export declare const useActionPanel: typeof _useActionPanel;
350
+ /**
351
+ * @deprecated
352
+ */
353
+ export interface ActionPanelState extends _ActionPanelState {
354
+ }
355
+ /**
356
+ * @deprecated Use `Alert.Options` instead
357
+ */
358
+ export interface AlertOptions extends Alert.Options {
359
+ }
360
+ /**
361
+ * @deprecated Use `Alert.ActionOptions` instead
362
+ */
363
+ export interface AlertActionOptions extends Alert.ActionOptions {
364
+ }
365
+ /**
366
+ * @deprecated Use `Alert.ActionStyle` instead
367
+ */
368
+ export declare const AlertActionStyle: typeof Alert.ActionStyle;
369
+ /**
370
+ * @deprecated Use `Toast.Options` instead
371
+ */
372
+ export interface ToastOptions extends _Toast.Options {
373
+ }
374
+ /**
375
+ * @deprecated Use `Toast.ActionOptions` instead
376
+ */
377
+ export interface ToastActionOptions extends _Toast.ActionOptions {
378
+ }
379
+ /**
380
+ * @deprecated Use `Toast.Style` instead
381
+ */
382
+ export declare const ToastStyle: typeof _Toast.Style;
383
+ /**
384
+ * @deprecated Use `Image.ImageLike` instead
385
+ */
386
+ export declare type ImageLike = Image.ImageLike;
387
+ /**
388
+ * @deprecated Use `Image.Source` instead
389
+ */
390
+ export declare type ImageSource = Image.Source;
391
+ /**
392
+ * @deprecated Use `Image.Mask` instead
393
+ */
394
+ export declare type ImageMask = Image.Mask;
395
+ /**
396
+ * @deprecated Use `Image.Mask` instead
397
+ */
398
+ export declare const ImageMask: typeof Image.Mask;
399
+ /**
400
+ * @deprecated Use `Color.Dynamic` instead
401
+ */
402
+ export declare type DynamicColor = Color.Dynamic;
403
+ /**
404
+ * @deprecated Use `Color.ColorLike` instead
405
+ */
406
+ export declare type ColorLike = Color.ColorLike;
407
+ /**
408
+ * @deprecated Use `export default function Command() { ... }` instead
409
+ */
410
+ export declare const render: typeof _render;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Holds data about the environment the command is running in. Use the global {@link environment} object to retrieve values.
3
+ */
4
+ export interface Environment {
5
+ /**
6
+ * The version of the main Raycast app
7
+ */
8
+ raycastVersion: string;
9
+ /**
10
+ * The name of the extension, as specified in package.json
11
+ */
12
+ extensionName: string;
13
+ /**
14
+ * The name of the launched command, as specified in package.json
15
+ */
16
+ commandName: string;
17
+ /**
18
+ * The absolute path to the assets directory of the extension.
19
+ *
20
+ * @remarks
21
+ * This directory is used internally to load icons, images, and other bundled assets.
22
+ */
23
+ assetsPath: string;
24
+ /**
25
+ * The absolute path for the support directory of an extension. Use it to read and write files related to your extension or command.
26
+ */
27
+ supportPath: string;
28
+ /**
29
+ * Indicates whether the command is a development command (vs. an installed command from the Store).
30
+ */
31
+ isDevelopment: boolean;
32
+ }
33
+ /**
34
+ * Contains environment values such as the Raycast version, extension info, and paths.
35
+ *
36
+ * @example
37
+ * ```typescript
38
+ * import { environment } from "@raycast/api";
39
+ *
40
+ * console.log(`Raycast version: ${environment.raycastVersion}`);
41
+ * console.log(`Extension name: ${environment.extensionName}`);
42
+ * console.log(`Command name: ${environment.commandName}`);
43
+ * console.log(`Assets path: ${environment.assetsPath}`);
44
+ * console.log(`Support path: ${environment.supportPath}`);
45
+ * console.log(`Is development mode: ${environment.isDevelopment}`);
46
+ * ```
47
+ */
48
+ export declare const environment: Environment;
@@ -0,0 +1,3 @@
1
+ export * from "./environment";
2
+ export * from "./preferences";
3
+ export * from "./workspace";
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Values of preference items.
3
+ */
4
+ export interface PreferenceValues {
5
+ [name: string]: any;
6
+ }
7
+ /**
8
+ * A function to access the preference values that have been passed to the command.
9
+ *
10
+ * @returns An object with the preference names as property key and the typed value as property value.
11
+ *
12
+ * @remarks
13
+ * Each preference name is mapped to its value and the defined default values are used as fallback values.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * import { getPreferenceValues } from "@raycast/api";
18
+ *
19
+ * interface Preferences {
20
+ * name: string;
21
+ * bodyWeight?: string;
22
+ * bodyHeight?: string;
23
+ * }
24
+ *
25
+ * export default async () => {
26
+ * const preferences = getPreferenceValues<Preferences>();
27
+ * console.log(preferences);
28
+ * };
29
+ * ```
30
+ */
31
+ export declare function getPreferenceValues<Values extends PreferenceValues = PreferenceValues>(): Values;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Gets the selected text of the frontmost application.
3
+ *
4
+ * @throws An error when no text is selected in the frontmost application.
5
+ * @returns A Promise that resolves with the selected text.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * import { getSelectedText, Clipboard, showToast, Toast } from "@raycast/api";
10
+ *
11
+ * export default async () => {
12
+ * try {
13
+ * const selectedText = await getSelectedText();
14
+ * const transformedText = selectedText.toUpperCase();
15
+ * await Clipboard.paste(transformedText);
16
+ * } catch (error) {
17
+ * await showToast({
18
+ * style: Toast.Style.Failure,
19
+ * title: "Cannot transform text",
20
+ * message: String(error)
21
+ * });
22
+ * }
23
+ * };
24
+ * ```
25
+ */
26
+ export declare function getSelectedText(): Promise<string>;
27
+ /**
28
+ * Holds data about a File System item. Use the {@link getSelectedFinderItems} method to retrieve values.
29
+ */
30
+ export interface FileSystemItem {
31
+ /**
32
+ * The path to the item
33
+ */
34
+ path: string;
35
+ }
36
+ /**
37
+ * Gets the selected items from Finder.
38
+ *
39
+ * @throws An error when Finder is not the frontmost application.
40
+ * @returns A Promise that resolves with the selected file system items.
41
+ *
42
+ * @example
43
+ * ```typescript
44
+ * import { getSelectedFinderItems, Clipboard, showToast, Toast } from "@raycast/api";
45
+ *
46
+ * export default async () => {
47
+ * try {
48
+ * const selectedItems = await getSelectedFinderItems();
49
+ * if (selectedItems.length) {
50
+ * await Clipboard.paste(selectedItems[0].path);
51
+ * }
52
+ * } catch (error) {
53
+ * await showToast({
54
+ * style: Toast.Style.Failure,
55
+ * title: "Cannot copy file path",
56
+ * message: String(error)
57
+ * });
58
+ * }
59
+ * };
60
+ * ```
61
+ */
62
+ export declare function getSelectedFinderItems(): Promise<FileSystemItem[]>;
@@ -0,0 +1 @@
1
+ export * from "./useNavigation";
@@ -0,0 +1,66 @@
1
+ import { ReactNode } from "react";
2
+ /**
3
+ * Return type of the {@link useNavigation} hook to perform push and pop actions.
4
+ */
5
+ export interface Navigation {
6
+ /**
7
+ * Push a new view component to the navigation stack.
8
+ *
9
+ * @param component - The React component to push to the navigation stack.
10
+ */
11
+ push: (component: ReactNode) => void;
12
+ /**
13
+ * Pop current view component from the navigation stack.
14
+ */
15
+ pop: () => void;
16
+ }
17
+ /**
18
+ * A hook that lets you push and pop view components in the navigation stack.
19
+ *
20
+ * @remarks
21
+ * You most likely won't use this hook too often. To push a new component, use the {@link PushAction}.
22
+ * When a user presses `ESC`, we automatically push to the previous component.
23
+ *
24
+ * @returns A {@link Navigation} object with {@link Navigation.push} and {@link Navigation.pop} functions.
25
+ * Use the functions to alter the navigation stack.
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * import { ActionPanel, Detail, useNavigation, Action } from "@raycast/api";
30
+ *
31
+ * function Ping() {
32
+ * const { push } = useNavigation();
33
+ *
34
+ * return (
35
+ * <Detail
36
+ * markdown="Ping"
37
+ * actions={
38
+ * <ActionPanel>
39
+ * <Action title="Push" onAction={() => push(<Pong />)} />
40
+ * </ActionPanel>
41
+ * }
42
+ * />
43
+ * );
44
+ * }
45
+ *
46
+ * function Pong() {
47
+ * const { pop } = useNavigation();
48
+ *
49
+ * return (
50
+ * <Detail
51
+ * markdown="Pong"
52
+ * actions={
53
+ * <ActionPanel>
54
+ * <Action title="Pop" onAction={pop} />
55
+ * </ActionPanel>
56
+ * }
57
+ * />
58
+ * );
59
+ * }
60
+ *
61
+ * export default function Command() {
62
+ * return <Ping />;
63
+ * }
64
+ * ```
65
+ */
66
+ export declare function useNavigation(): Navigation;
@@ -0,0 +1,6 @@
1
+ export * from "./app";
2
+ export * from "./components";
3
+ export * from "./environment";
4
+ export * from "./hooks";
5
+ export * from "./ui";
6
+ export * from "./deprecated";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export * from "./portal";
2
+ export * from "./ErrorBoundary";
3
+ export * from "./Navigation";
4
+ export * from "./Root";
@@ -0,0 +1,4 @@
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;
@@ -0,0 +1 @@
1
+ export { default } from './Portal';
@@ -0,0 +1,4 @@
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;
@@ -0,0 +1 @@
1
+ export { default } from './PortalHost';
@@ -0,0 +1,4 @@
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;
@@ -0,0 +1 @@
1
+ export { default } from './PortalProvider';
@@ -0,0 +1 @@
1
+ export { PortalDispatchContext, PortalStateContext } from './portal';
@@ -0,0 +1,5 @@
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>>;