@raycast/api 1.30.2 → 1.32.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/README.md +2 -2
- package/bin/arm64/ray +0 -0
- package/bin/ray +10 -4
- package/bin/x86/ray +0 -0
- package/package.json +2 -2
- package/types/index.d.ts +5192 -4098
- package/types/api/app/app.d.ts +0 -171
- package/types/api/app/clipboard.d.ts +0 -63
- package/types/api/app/index.d.ts +0 -4
- package/types/api/app/keyboard.d.ts +0 -56
- package/types/api/app/localStorage.d.ts +0 -117
- package/types/api/components/ActionPanel.d.ts +0 -261
- package/types/api/components/Detail.d.ts +0 -38
- package/types/api/components/Form.d.ts +0 -1016
- package/types/api/components/List.d.ts +0 -579
- package/types/api/components/actions/Action.d.ts +0 -458
- package/types/api/components/actions/CopyToClipboardAction.d.ts +0 -40
- package/types/api/components/actions/CreateQuicklinkAction.d.ts +0 -42
- package/types/api/components/actions/CreateSnippetAction.d.ts +0 -40
- package/types/api/components/actions/OpenAction.d.ts +0 -47
- package/types/api/components/actions/OpenInBrowserAction.d.ts +0 -43
- package/types/api/components/actions/OpenWithAction.d.ts +0 -40
- package/types/api/components/actions/PasteAction.d.ts +0 -40
- package/types/api/components/actions/PushAction.d.ts +0 -38
- package/types/api/components/actions/ShowInFinderAction.d.ts +0 -42
- package/types/api/components/actions/SubmitFormAction.d.ts +0 -35
- package/types/api/components/actions/TrashAction.d.ts +0 -43
- package/types/api/components/actions/index.d.ts +0 -1
- package/types/api/components/index.d.ts +0 -5
- package/types/api/components/propTypes.d.ts +0 -1
- package/types/api/components/types.d.ts +0 -30
- package/types/api/deprecated.d.ts +0 -415
- package/types/api/environment/environment.d.ts +0 -48
- package/types/api/environment/index.d.ts +0 -3
- package/types/api/environment/preferences.d.ts +0 -31
- package/types/api/environment/workspace.d.ts +0 -62
- package/types/api/hooks/index.d.ts +0 -1
- package/types/api/hooks/useNavigation.d.ts +0 -66
- package/types/api/index.d.ts +0 -6
- package/types/api/internal/comm/index.d.ts +0 -1
- package/types/api/internal/components/ErrorBoundary.d.ts +0 -1
- package/types/api/internal/components/Navigation.d.ts +0 -1
- package/types/api/internal/components/Root.d.ts +0 -1
- package/types/api/internal/components/index.d.ts +0 -3
- package/types/api/internal/devtools/actionPanel.d.ts +0 -1
- package/types/api/internal/devtools/index.d.ts +0 -2
- package/types/api/internal/devtools/react.d.ts +0 -1
- package/types/api/internal/hooks/index.d.ts +0 -1
- package/types/api/internal/hooks/useId.d.ts +0 -1
- package/types/api/internal/index.d.ts +0 -6
- package/types/api/internal/rendering/callbacks.d.ts +0 -1
- package/types/api/internal/rendering/index.d.ts +0 -6
- package/types/api/internal/rendering/logger.d.ts +0 -4
- package/types/api/internal/rendering/node-builders/actions.d.ts +0 -3
- package/types/api/internal/rendering/node-builders/detail.d.ts +0 -2
- package/types/api/internal/rendering/node-builders/forms.d.ts +0 -2
- package/types/api/internal/rendering/node-builders/keyboard.d.ts +0 -1
- package/types/api/internal/rendering/node-builders/list.d.ts +0 -4
- package/types/api/internal/rendering/node-builders/navigationStack.d.ts +0 -1
- package/types/api/internal/rendering/node-builders/root.d.ts +0 -1
- package/types/api/internal/rendering/node-builders/types.d.ts +0 -1
- package/types/api/internal/rendering/node-builders/utils.d.ts +0 -1
- package/types/api/internal/rendering/reconciler/index.d.ts +0 -1
- package/types/api/internal/rendering/reconciler/noHydratation.d.ts +0 -37
- package/types/api/internal/rendering/reconciler/noMutation.d.ts +0 -18
- package/types/api/internal/rendering/renderer.d.ts +0 -1
- package/types/api/internal/utils/ids.d.ts +0 -1
- package/types/api/internal/utils/index.d.ts +0 -3
- package/types/api/internal/utils/internal-children.d.ts +0 -26
- package/types/api/internal/utils/propTypes.d.ts +0 -3
- package/types/api/ui/color.d.ts +0 -115
- package/types/api/ui/errors.d.ts +0 -1
- package/types/api/ui/feedback/alert.d.ts +0 -97
- package/types/api/ui/feedback/hud.d.ts +0 -16
- package/types/api/ui/feedback/index.d.ts +0 -3
- package/types/api/ui/feedback/toast.d.ts +0 -174
- package/types/api/ui/icon.d.ts +0 -88
- package/types/api/ui/image.d.ts +0 -162
- package/types/api/ui/index.d.ts +0 -5
- package/types/core/message-types.d.ts +0 -17
- package/types/core/preferences.d.ts +0 -69
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A HUD will automatically hide the main window and show a compact message at the bottom of the screen.
|
|
3
|
-
*
|
|
4
|
-
* @param title - The title that will be displayed in the HUD.
|
|
5
|
-
* @returns A Promise that resolves when the HUD is shown.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* import { showHUD } from "@raycast/api";
|
|
10
|
-
*
|
|
11
|
-
* export default async () => {
|
|
12
|
-
* await showHUD("Hey there 👋");
|
|
13
|
-
* };
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export declare function showHUD(title: string): Promise<void>;
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { Keyboard } from "../../app";
|
|
2
|
-
/**
|
|
3
|
-
* Creates and shows a Toast with the given {@link Toast.Options}.
|
|
4
|
-
*
|
|
5
|
-
* @param options - The options to customize the Toast.
|
|
6
|
-
* @returns A Promise that resolves with the shown Toast. The Toast can be used to change or hide it.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import { showToast, Toast } from "@raycast/api";
|
|
11
|
-
*
|
|
12
|
-
* export default async () => {
|
|
13
|
-
* const success = false;
|
|
14
|
-
*
|
|
15
|
-
* if (success) {
|
|
16
|
-
* await showToast({ title: "Dinner is ready", message: "Pizza margherita" });
|
|
17
|
-
* } else {
|
|
18
|
-
* await showToast({ style: Toast.Style.Failure, title: "Dinner isn't ready", message: "Pizza dropped on the floor" });
|
|
19
|
-
* }
|
|
20
|
-
* };
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* When showing an animated Toast, you can later on update it:
|
|
24
|
-
* @example
|
|
25
|
-
* ```typescript
|
|
26
|
-
* import { showToast, Toast } from "@raycast/api";
|
|
27
|
-
* import { setTimeout } from "timers/promises";
|
|
28
|
-
*
|
|
29
|
-
* export default async () => {
|
|
30
|
-
* const toast = await showToast({ style: Toast.Style.Animated, title: "Uploading image" });
|
|
31
|
-
*
|
|
32
|
-
* try {
|
|
33
|
-
* // upload the image
|
|
34
|
-
* await setTimeout(1000);
|
|
35
|
-
*
|
|
36
|
-
* toast.style = Toast.Style.Success;
|
|
37
|
-
* toast.title = "Uploaded image";
|
|
38
|
-
* } catch (err) {
|
|
39
|
-
* toast.style = Toast.Style.Failure;
|
|
40
|
-
* toast.title = "Failed to upload image";
|
|
41
|
-
* toast.message = err.message;
|
|
42
|
-
* }
|
|
43
|
-
* };
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
export declare function showToast(options: Toast.Options): Promise<Toast>;
|
|
47
|
-
export declare function showToast(style: Toast.Style, title: string, message?: string): Promise<Toast>;
|
|
48
|
-
/**
|
|
49
|
-
* A Toast with a certain style, title, and message.
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```typescript
|
|
53
|
-
* import { showToast, Toast } from "@raycast/api";
|
|
54
|
-
* import { setTimeout } from "timers/promises";
|
|
55
|
-
*
|
|
56
|
-
* export default async () => {
|
|
57
|
-
* const toast = await showToast({ style: Toast.Style.Animated, title: "Uploading image" });
|
|
58
|
-
*
|
|
59
|
-
* await setTimeout(1000);
|
|
60
|
-
*
|
|
61
|
-
* toast.style = Toast.Style.Success;
|
|
62
|
-
* toast.title = "Uploaded image";
|
|
63
|
-
* };
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
export declare class Toast {
|
|
67
|
-
private options;
|
|
68
|
-
private id;
|
|
69
|
-
private callbacks;
|
|
70
|
-
/**
|
|
71
|
-
* Deprecated - Use `showToast` instead
|
|
72
|
-
*/
|
|
73
|
-
constructor(props: Toast.Options);
|
|
74
|
-
get style(): Toast.Style;
|
|
75
|
-
set style(style: Toast.Style);
|
|
76
|
-
get title(): string;
|
|
77
|
-
set title(title: string);
|
|
78
|
-
get message(): string | undefined;
|
|
79
|
-
set message(message: string | undefined);
|
|
80
|
-
get primaryAction(): Toast.ActionOptions | undefined;
|
|
81
|
-
set primaryAction(action: Toast.ActionOptions | undefined);
|
|
82
|
-
get secondaryAction(): Toast.ActionOptions | undefined;
|
|
83
|
-
set secondaryAction(action: Toast.ActionOptions | undefined);
|
|
84
|
-
/**
|
|
85
|
-
* Shows the Toast.
|
|
86
|
-
*
|
|
87
|
-
* @returns A Promise that resolves when the toast is shown.
|
|
88
|
-
*/
|
|
89
|
-
show(): Promise<void>;
|
|
90
|
-
/**
|
|
91
|
-
* Hides the Toast.
|
|
92
|
-
*
|
|
93
|
-
* @returns A Promise that resolves when toast is hidden.
|
|
94
|
-
*/
|
|
95
|
-
hide(): Promise<void>;
|
|
96
|
-
private update;
|
|
97
|
-
}
|
|
98
|
-
export declare namespace Toast {
|
|
99
|
-
/**
|
|
100
|
-
* The options to create a {@link Toast}.
|
|
101
|
-
*
|
|
102
|
-
* @example
|
|
103
|
-
* ```typescript
|
|
104
|
-
* import { showToast, Toast } from "@raycast/api";
|
|
105
|
-
*
|
|
106
|
-
* export default async () => {
|
|
107
|
-
* const options: Toast.Options = {
|
|
108
|
-
* style: Toast.Style.Success,
|
|
109
|
-
* title: "Finished cooking",
|
|
110
|
-
* message: "Delicious pasta for lunch",
|
|
111
|
-
* primaryAction: {
|
|
112
|
-
* title: 'Do something',
|
|
113
|
-
* onAction: () => {
|
|
114
|
-
* console.log("The toast action has been triggered")
|
|
115
|
-
* }
|
|
116
|
-
* }
|
|
117
|
-
* };
|
|
118
|
-
* await showToast(options);
|
|
119
|
-
* };
|
|
120
|
-
* ```
|
|
121
|
-
*/
|
|
122
|
-
interface Options {
|
|
123
|
-
/**
|
|
124
|
-
* The title of a Toast. Displayed on the top.
|
|
125
|
-
*/
|
|
126
|
-
title: string;
|
|
127
|
-
/**
|
|
128
|
-
* An additional message for the Toast. Useful to show more information, e.g. an identifier of a newly created asset.
|
|
129
|
-
*/
|
|
130
|
-
message?: string;
|
|
131
|
-
/**
|
|
132
|
-
* The style of a Toast.
|
|
133
|
-
*/
|
|
134
|
-
style?: Style;
|
|
135
|
-
/**
|
|
136
|
-
* The primary Action the user can take when hovering on the Toast.
|
|
137
|
-
*/
|
|
138
|
-
primaryAction?: ActionOptions;
|
|
139
|
-
/**
|
|
140
|
-
* The secondary Action the user can take when hovering on the Toast.
|
|
141
|
-
*/
|
|
142
|
-
secondaryAction?: ActionOptions;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* The options to create a {@link Toast} Action.
|
|
146
|
-
*/
|
|
147
|
-
interface ActionOptions {
|
|
148
|
-
/**
|
|
149
|
-
* The title of the action.
|
|
150
|
-
*/
|
|
151
|
-
title: string;
|
|
152
|
-
/**
|
|
153
|
-
* The keyboard shortcut for the action.
|
|
154
|
-
*/
|
|
155
|
-
shortcut?: Keyboard.Shortcut;
|
|
156
|
-
/**
|
|
157
|
-
* A callback called when the action is triggered.
|
|
158
|
-
*/
|
|
159
|
-
onAction: (toast: Toast) => void;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Defines the visual style of the Toast.
|
|
163
|
-
*
|
|
164
|
-
* @remarks
|
|
165
|
-
* Use {@link Toast.Style.Success} for confirmations and {@link Toast.Style.Failure} for displaying errors.
|
|
166
|
-
* Use {@link Toast.Style.Animated} when your Toast should be shown until a process is completed.
|
|
167
|
-
* You can hide it later by using {@link Toast.hide} or update the properties of an existing Toast.
|
|
168
|
-
*/
|
|
169
|
-
enum Style {
|
|
170
|
-
Success = "SUCCESS",
|
|
171
|
-
Failure = "FAILURE",
|
|
172
|
-
Animated = "ANIMATED"
|
|
173
|
-
}
|
|
174
|
-
}
|
package/types/api/ui/icon.d.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* List of built-in icons that can be used for actions or list items.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```typescript
|
|
6
|
-
* import { Icon, List } from "@raycast/api";
|
|
7
|
-
*
|
|
8
|
-
* export default function Command() {
|
|
9
|
-
* return (
|
|
10
|
-
* <List>
|
|
11
|
-
* <List.Item title="Icon" icon={Icon.Circle} />
|
|
12
|
-
* </List>
|
|
13
|
-
* );
|
|
14
|
-
* };
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export declare enum Icon {
|
|
18
|
-
ArrowClockwise = "arrow-clockwise-16",
|
|
19
|
-
ArrowRight = "arrow-right-16",
|
|
20
|
-
Binoculars = "binoculars-16",
|
|
21
|
-
Bubble = "bubble-left-16",
|
|
22
|
-
Calendar = "calendar-16",
|
|
23
|
-
Checkmark = "checkmark-circle-16",
|
|
24
|
-
ChevronDown = "chevron-down-16",
|
|
25
|
-
ChevronUp = "chevron-up-16",
|
|
26
|
-
Circle = "circle-16",
|
|
27
|
-
Clipboard = "doc-on-clipboard-16",
|
|
28
|
-
Clock = "clock-16",
|
|
29
|
-
Desktop = "desktopcomputer-16",
|
|
30
|
-
Document = "doc-16",
|
|
31
|
-
Dot = "dot-16",
|
|
32
|
-
Download = "square-and-arrow-down-16",
|
|
33
|
-
Envelope = "envelope-16",
|
|
34
|
-
ExclamationMark = "exclamation-mark-triangle-16",
|
|
35
|
-
Eye = "eye-16",
|
|
36
|
-
EyeSlash = "eye-slash-16",
|
|
37
|
-
Finder = "finder-16",
|
|
38
|
-
Gear = "gearshape-16",
|
|
39
|
-
Globe = "globe-16",
|
|
40
|
-
Hammer = "hammer-16",
|
|
41
|
-
LevelMeter = "level-meter-16",
|
|
42
|
-
Link = "link-16",
|
|
43
|
-
List = "main-list-view-16",
|
|
44
|
-
MagnifyingGlass = "magnifyingglass-16",
|
|
45
|
-
MemoryChip = "memorychip-16",
|
|
46
|
-
Message = "message-16",
|
|
47
|
-
Pencil = "pencil-16",
|
|
48
|
-
Person = "person-crop-circle-16",
|
|
49
|
-
Phone = "phone-16",
|
|
50
|
-
Pin = "pin-16",
|
|
51
|
-
Plus = "plus-16",
|
|
52
|
-
Sidebar = "sidebar-right-16",
|
|
53
|
-
SpeakerArrowDown = "speaker-arrow-down-16",
|
|
54
|
-
SpeakerArrowUp = "speaker-arrow-up-16",
|
|
55
|
-
SpeakerSlash = "speaker-slash-16",
|
|
56
|
-
Star = "star-16",
|
|
57
|
-
Text = "text-alignleft-16",
|
|
58
|
-
TextDocument = "doc-plaintext-16",
|
|
59
|
-
QuestionMark = "questionmark-circle-16",
|
|
60
|
-
Terminal = "terminal-16",
|
|
61
|
-
Trash = "trash-16",
|
|
62
|
-
Upload = "square-and-arrow-up-16",
|
|
63
|
-
Video = "video-16",
|
|
64
|
-
Window = "macwindow-16",
|
|
65
|
-
XmarkCircle = "xmark-circle-16"
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* An icon as it's used in the Finder.
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* ```typescript
|
|
72
|
-
* import { List } from "@raycast/api";
|
|
73
|
-
*
|
|
74
|
-
* export default function Command() {
|
|
75
|
-
* return (
|
|
76
|
-
* <List>
|
|
77
|
-
* <List.Item title="File icon" icon={{ fileIcon: __filename }} />
|
|
78
|
-
* </List>
|
|
79
|
-
* );
|
|
80
|
-
* };
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
export interface FileIcon {
|
|
84
|
-
/**
|
|
85
|
-
* The path to a file or folder to get its icon from.
|
|
86
|
-
*/
|
|
87
|
-
fileIcon: string;
|
|
88
|
-
}
|
package/types/api/ui/image.d.ts
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { Color } from "./color";
|
|
2
|
-
import { FileIcon, Icon } from "./icon";
|
|
3
|
-
/**
|
|
4
|
-
* Display different types of images, including network images or bundled assets.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```typescript
|
|
8
|
-
* // Built-in icon
|
|
9
|
-
* const icon = Icon.Eye
|
|
10
|
-
*
|
|
11
|
-
* // Built-in icon with tint color
|
|
12
|
-
* const tintedIcon = { source: Icon.Bubble, tintColor: Color.Red }
|
|
13
|
-
*
|
|
14
|
-
* // Bundled asset with circular mask
|
|
15
|
-
* const avatar = { source: "avatar.png", mask: Image.Mask.Circle }
|
|
16
|
-
*
|
|
17
|
-
* // Theme-aware icon
|
|
18
|
-
* const icon = { source: { light: "icon-light.png", dark: "icon-dark.png" }}
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* @remark
|
|
22
|
-
* Apply image transforms to the source, such as a `mask` or a `tintColor`.
|
|
23
|
-
*/
|
|
24
|
-
export interface Image {
|
|
25
|
-
/**
|
|
26
|
-
* The {@link Image.Source} of the image.
|
|
27
|
-
*/
|
|
28
|
-
source: Image.Source;
|
|
29
|
-
/**
|
|
30
|
-
* {@link Image.Fallback} image, in case `source` can't be loaded.
|
|
31
|
-
*/
|
|
32
|
-
fallback?: Image.Fallback;
|
|
33
|
-
/**
|
|
34
|
-
* A {@link Image.Mask} to apply to the image.
|
|
35
|
-
*/
|
|
36
|
-
mask?: Image.Mask;
|
|
37
|
-
/**
|
|
38
|
-
* A {@link Color.ColorLike} to tint all the non-transparent pixels of the image.
|
|
39
|
-
*/
|
|
40
|
-
tintColor?: Color.ColorLike;
|
|
41
|
-
}
|
|
42
|
-
export declare namespace Image {
|
|
43
|
-
/**
|
|
44
|
-
* Image is a string representing a URL.
|
|
45
|
-
*/
|
|
46
|
-
type URL = string;
|
|
47
|
-
/**
|
|
48
|
-
* Image is a string denoting an asset from the `assets/` folder.
|
|
49
|
-
*/
|
|
50
|
-
type Asset = string;
|
|
51
|
-
/**
|
|
52
|
-
* Union type for the supported image types.
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* ```typescript
|
|
56
|
-
* import { Icon, Image, List } from "@raycast/api";
|
|
57
|
-
*
|
|
58
|
-
* export default function Command() {
|
|
59
|
-
* return (
|
|
60
|
-
* <List>
|
|
61
|
-
* <List.Item title="String" icon="https://raycast.com/uploads/avatar.png" />
|
|
62
|
-
* <List.Item title="Icon" icon={Icon.Circle} />
|
|
63
|
-
* <List.Item title="FileIcon" icon={{ fileIcon: __filename }} />
|
|
64
|
-
* <List.Item title="Image" icon={{ source: "https://raycast.com/uploads/avatar.png", mask: Image.Mask.Circle }} />
|
|
65
|
-
* </List>
|
|
66
|
-
* );
|
|
67
|
-
* };
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
|
-
type ImageLike = URL | Asset | Icon | FileIcon | Image;
|
|
71
|
-
/**
|
|
72
|
-
* The source of an {@link Image}. Can be either a remote URL, a local file resource, a built-in {@link Icon} or
|
|
73
|
-
* a single emoji.
|
|
74
|
-
*
|
|
75
|
-
* @remarks
|
|
76
|
-
* For consistency, it's best to use the built-in {@link Icon} in lists, the Action Panel, and other places. If a
|
|
77
|
-
* specific icon isn't built-in, you can reference custom ones from the `assets` folder of the extension by file name,
|
|
78
|
-
* e.g. `my-icon.png`. Alternatively, you can reference an absolute HTTPS URL that points to an image or use an emoji.
|
|
79
|
-
* You can also specify different remote or local assets for light and dark theme.
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
* ```typescript
|
|
83
|
-
* import { Icon, List } from "@raycast/api";
|
|
84
|
-
*
|
|
85
|
-
* export default function Command() {
|
|
86
|
-
* return (
|
|
87
|
-
* <List>
|
|
88
|
-
* <List.Item title="String" icon={{ source: "https://raycast.com/uploads/avatar.png" }} />
|
|
89
|
-
* <List.Item title="Icon" icon={{ source: Icon.Circle }} />
|
|
90
|
-
* <List.Item
|
|
91
|
-
* title="Theme"
|
|
92
|
-
* icon={{
|
|
93
|
-
* source: { light: "https://raycast.com/uploads/avatar.png", dark: "https://raycast.com/uploads/avatar.png" },
|
|
94
|
-
* }}
|
|
95
|
-
* />
|
|
96
|
-
* </List>
|
|
97
|
-
* );
|
|
98
|
-
* };
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
|
-
type Source = URL | Asset | Icon | {
|
|
102
|
-
light: URL | Asset;
|
|
103
|
-
dark: URL | Asset;
|
|
104
|
-
};
|
|
105
|
-
/**
|
|
106
|
-
* Fallback {@link Image} source. Can be a local file resource, a built-in {@link Icon}, a single emoji, or a theme-aware asset.
|
|
107
|
-
* Any specified `mask` or `tintColor` will also apply to the fallback image.
|
|
108
|
-
*
|
|
109
|
-
* @example
|
|
110
|
-
* ```typescript
|
|
111
|
-
* import { Icon, List } from "@raycast/api";
|
|
112
|
-
*
|
|
113
|
-
* export default function Command() {
|
|
114
|
-
* return (
|
|
115
|
-
* <List>
|
|
116
|
-
* <List.Item title="String" icon={{ source: "https://raycast.com/uploads/avatar.png", fallback: Icon.Circle }} />
|
|
117
|
-
* <List.Item title="Icon" icon={{ source: Icon.Circle }} />
|
|
118
|
-
* <List.Item
|
|
119
|
-
* title="Theme"
|
|
120
|
-
* icon={{
|
|
121
|
-
* source: { light: "https://raycast.com/uploads/avatar.png", dark: "https://raycast.com/uploads/avatar.png" },
|
|
122
|
-
* }}
|
|
123
|
-
* />
|
|
124
|
-
* </List>
|
|
125
|
-
* );
|
|
126
|
-
* };
|
|
127
|
-
* ```
|
|
128
|
-
*/
|
|
129
|
-
type Fallback = Asset | Icon | {
|
|
130
|
-
light: Asset;
|
|
131
|
-
dark: Asset;
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* Available masks that can be used to change the shape of an image.
|
|
135
|
-
*
|
|
136
|
-
* @remarks
|
|
137
|
-
* Can be handy to shape avatars or other items in a list.
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
140
|
-
* ```typescript
|
|
141
|
-
* import { Image, List } from "@raycast/api";
|
|
142
|
-
*
|
|
143
|
-
* export default function Command() {
|
|
144
|
-
* return (
|
|
145
|
-
* <List>
|
|
146
|
-
* <List.Item title="Icon" icon={{ source: "https://raycast.com/uploads/avatar.png", mask: Image.Mask.Circle }} />
|
|
147
|
-
* </List>
|
|
148
|
-
* );
|
|
149
|
-
* };
|
|
150
|
-
* ```
|
|
151
|
-
*/
|
|
152
|
-
enum Mask {
|
|
153
|
-
/**
|
|
154
|
-
* Masks an image with a circle. Good to use for avatars.
|
|
155
|
-
*/
|
|
156
|
-
Circle = "circle",
|
|
157
|
-
/**
|
|
158
|
-
* Masks an image with a rounded rectangle.
|
|
159
|
-
*/
|
|
160
|
-
RoundedRectangle = "roundedRectangle"
|
|
161
|
-
}
|
|
162
|
-
}
|
package/types/api/ui/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare type WorkerMessage = RequestMessage | NotifyMessage | ResultMessage;
|
|
2
|
-
export declare type RequestMessage = {
|
|
3
|
-
kind: "request";
|
|
4
|
-
id: string;
|
|
5
|
-
method: string;
|
|
6
|
-
params: MessageParams;
|
|
7
|
-
};
|
|
8
|
-
export declare type NotifyMessage = {
|
|
9
|
-
kind: "notify";
|
|
10
|
-
method: string;
|
|
11
|
-
params: MessageParams;
|
|
12
|
-
};
|
|
13
|
-
export declare type ResultMessage = {
|
|
14
|
-
kind: "result";
|
|
15
|
-
id: string;
|
|
16
|
-
result: MessageResult;
|
|
17
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A record type holding the preferences (entered in Raycast Preferences) that have been passed to the command.
|
|
3
|
-
*/
|
|
4
|
-
export declare type Preferences = Record<string, Preference>;
|
|
5
|
-
/**
|
|
6
|
-
* Holds data about a single preference item (entered in Raycast Preferences).
|
|
7
|
-
*
|
|
8
|
-
* @remarks
|
|
9
|
-
* The object maps to a defined preference in the `package.json` manifest file.
|
|
10
|
-
*/
|
|
11
|
-
export interface Preference {
|
|
12
|
-
/**
|
|
13
|
-
* The name of the preference.
|
|
14
|
-
*/
|
|
15
|
-
name: string;
|
|
16
|
-
/**
|
|
17
|
-
* The type of the preference.
|
|
18
|
-
*/
|
|
19
|
-
type: "appPicker" | "checkbox" | "dropdown" | "password" | "textfield";
|
|
20
|
-
/**
|
|
21
|
-
* Specifies if the preference is required.
|
|
22
|
-
*
|
|
23
|
-
* @remarks
|
|
24
|
-
* If the preference is required, an onboarding view is shown when the
|
|
25
|
-
* extension is opened for the first time.
|
|
26
|
-
*
|
|
27
|
-
* @defaultValue false
|
|
28
|
-
*/
|
|
29
|
-
required: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* The title of the preference.
|
|
32
|
-
*
|
|
33
|
-
* @remarks
|
|
34
|
-
* The title is also shown in the Raycast preferences.
|
|
35
|
-
*/
|
|
36
|
-
title: string;
|
|
37
|
-
/**
|
|
38
|
-
* The description of the preference.
|
|
39
|
-
*
|
|
40
|
-
* @remarks
|
|
41
|
-
* The description is shown in the Raycast preferences as well as in the
|
|
42
|
-
* onboarding view for required preferences.
|
|
43
|
-
*/
|
|
44
|
-
description: string;
|
|
45
|
-
/**
|
|
46
|
-
* The value of the preference.
|
|
47
|
-
*/
|
|
48
|
-
value?: unknown;
|
|
49
|
-
/**
|
|
50
|
-
* The default value of the preference if there is no `value` specified.
|
|
51
|
-
* For dropdowns, this references the `value` property of an object in the data array.
|
|
52
|
-
* For app pickers, this references an application name, bundleId or path."
|
|
53
|
-
*/
|
|
54
|
-
default?: unknown;
|
|
55
|
-
/**
|
|
56
|
-
* A placeholder that is used for text fields and passwords.
|
|
57
|
-
*/
|
|
58
|
-
placeholder?: string;
|
|
59
|
-
/**
|
|
60
|
-
* A label that is used for checkboxes.
|
|
61
|
-
* You can create checkbox groups by setting this property and leaving the title property empty for all checkboxes except the first.
|
|
62
|
-
*/
|
|
63
|
-
label?: string;
|
|
64
|
-
/**
|
|
65
|
-
* The data that is used for dropdowns.
|
|
66
|
-
* For the dropdown items, add an array of objects with `title` and `value` properties, such as: `{"title": "Foo", "value": "bar"}`
|
|
67
|
-
*/
|
|
68
|
-
data?: unknown[];
|
|
69
|
-
}
|