@raycast/api 1.27.1 → 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.
- package/bin/arm64/ray +0 -0
- package/bin/x86/ray +0 -0
- package/package.json +2 -2
- package/types/api/app/app.d.ts +171 -0
- package/types/api/app/clipboard.d.ts +47 -0
- package/types/api/app/index.d.ts +4 -0
- package/types/api/app/keyboard.d.ts +56 -0
- package/types/api/app/localStorage.d.ts +117 -0
- package/types/api/components/ActionPanel.d.ts +297 -0
- package/types/api/components/Detail.d.ts +40 -0
- package/types/api/components/Form.d.ts +992 -0
- package/types/api/components/List.d.ts +275 -0
- package/types/api/components/actions/Action.d.ts +396 -0
- package/types/api/components/actions/CopyToClipboardAction.d.ts +39 -0
- package/types/api/components/actions/OpenAction.d.ts +47 -0
- package/types/api/components/actions/OpenInBrowserAction.d.ts +42 -0
- package/types/api/components/actions/OpenWithAction.d.ts +40 -0
- package/types/api/components/actions/PasteAction.d.ts +39 -0
- package/types/api/components/actions/PushAction.d.ts +38 -0
- package/types/api/components/actions/ShowInFinderAction.d.ts +42 -0
- package/types/api/components/actions/SubmitFormAction.d.ts +34 -0
- package/types/api/components/actions/TrashAction.d.ts +43 -0
- package/types/api/components/actions/index.d.ts +1 -0
- package/types/api/components/index.d.ts +5 -0
- package/types/api/components/propTypes.d.ts +1 -0
- package/types/api/components/types.d.ts +30 -0
- package/types/api/deprecated.d.ts +410 -0
- package/types/api/environment/environment.d.ts +48 -0
- package/types/api/environment/index.d.ts +3 -0
- package/types/api/environment/preferences.d.ts +31 -0
- package/types/api/environment/workspace.d.ts +62 -0
- package/types/api/hooks/index.d.ts +1 -0
- package/types/api/hooks/useNavigation.d.ts +66 -0
- package/types/api/index.d.ts +6 -0
- package/types/api/internal/comm/index.d.ts +1 -0
- package/types/api/internal/components/ErrorBoundary.d.ts +1 -0
- package/types/api/internal/components/Navigation.d.ts +1 -0
- package/types/api/internal/components/Root.d.ts +1 -0
- package/types/api/internal/components/index.d.ts +4 -0
- package/types/api/internal/components/portal/components/portal/Portal.d.ts +4 -0
- package/types/api/internal/components/portal/components/portal/index.d.ts +1 -0
- package/types/api/internal/components/portal/components/portalHost/PortalHost.d.ts +4 -0
- package/types/api/internal/components/portal/components/portalHost/index.d.ts +1 -0
- package/types/api/internal/components/portal/components/portalProvider/PortalProvider.d.ts +4 -0
- package/types/api/internal/components/portal/components/portalProvider/index.d.ts +1 -0
- package/types/api/internal/components/portal/contexts/index.d.ts +1 -0
- package/types/api/internal/components/portal/contexts/portal.d.ts +5 -0
- package/types/api/internal/components/portal/hooks/index.d.ts +2 -0
- package/types/api/internal/components/portal/hooks/usePortal.d.ts +8 -0
- package/types/api/internal/components/portal/hooks/usePortalState.d.ts +1 -0
- package/types/api/internal/components/portal/index.d.ts +5 -0
- package/types/api/internal/components/portal/state/constants.d.ts +9 -0
- package/types/api/internal/components/portal/state/index.d.ts +3 -0
- package/types/api/internal/components/portal/state/reducer.d.ts +3 -0
- package/types/api/internal/components/portal/utilities/logger.d.ts +9 -0
- package/types/api/internal/devtools/index.d.ts +1 -0
- package/types/api/internal/devtools/react.d.ts +1 -0
- package/types/api/internal/hooks/index.d.ts +2 -0
- package/types/api/internal/hooks/useActionPanel.d.ts +1 -0
- package/types/api/internal/hooks/useId.d.ts +1 -0
- package/types/api/internal/index.d.ts +6 -0
- package/types/api/internal/rendering/callbacks.d.ts +1 -0
- package/types/api/internal/rendering/index.d.ts +5 -0
- package/types/api/internal/rendering/node-builders/actions.d.ts +1 -0
- package/types/api/internal/rendering/node-builders/detail.d.ts +1 -0
- package/types/api/internal/rendering/node-builders/forms.d.ts +1 -0
- package/types/api/internal/rendering/node-builders/keyboard.d.ts +1 -0
- package/types/api/internal/rendering/node-builders/list.d.ts +1 -0
- package/types/api/internal/rendering/node-builders/navigationStack.d.ts +1 -0
- package/types/api/internal/rendering/node-builders/root.d.ts +1 -0
- package/types/api/internal/rendering/node-builders/types.d.ts +1 -0
- package/types/api/internal/rendering/node-builders/utils.d.ts +1 -0
- package/types/api/internal/rendering/reconciler.d.ts +1 -0
- package/types/api/internal/rendering/renderer.d.ts +1 -0
- package/types/api/internal/utils/ids.d.ts +1 -0
- package/types/api/internal/utils/index.d.ts +1 -0
- package/types/api/ui/color.d.ts +115 -0
- package/types/api/ui/errors.d.ts +1 -0
- package/types/api/ui/feedback/alert.d.ts +97 -0
- package/types/api/ui/feedback/hud.d.ts +16 -0
- package/types/api/ui/feedback/index.d.ts +3 -0
- package/types/api/ui/feedback/toast.d.ts +171 -0
- package/types/api/ui/icon.d.ts +88 -0
- package/types/api/ui/image.d.ts +161 -0
- package/types/api/ui/index.d.ts +5 -0
- package/types/core/message-types.d.ts +17 -0
- package/types/core/preferences.d.ts +69 -0
- package/types/index.d.ts +2777 -2536
|
@@ -0,0 +1,161 @@
|
|
|
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} or a single emoji.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* import { Icon, List } from "@raycast/api";
|
|
111
|
+
*
|
|
112
|
+
* export default function Command() {
|
|
113
|
+
* return (
|
|
114
|
+
* <List>
|
|
115
|
+
* <List.Item title="String" icon={{ source: "https://raycast.com/uploads/avatar.png", fallback: Icon.Circle }} />
|
|
116
|
+
* <List.Item title="Icon" icon={{ source: Icon.Circle }} />
|
|
117
|
+
* <List.Item
|
|
118
|
+
* title="Theme"
|
|
119
|
+
* icon={{
|
|
120
|
+
* source: { light: "https://raycast.com/uploads/avatar.png", dark: "https://raycast.com/uploads/avatar.png" },
|
|
121
|
+
* }}
|
|
122
|
+
* />
|
|
123
|
+
* </List>
|
|
124
|
+
* );
|
|
125
|
+
* };
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
type Fallback = Asset | Icon | {
|
|
129
|
+
light: Asset;
|
|
130
|
+
dark: Asset;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Available masks that can be used to change the shape of an image.
|
|
134
|
+
*
|
|
135
|
+
* @remarks
|
|
136
|
+
* Can be handy to shape avatars or other items in a list.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```typescript
|
|
140
|
+
* import { Image, List } from "@raycast/api";
|
|
141
|
+
*
|
|
142
|
+
* export default function Command() {
|
|
143
|
+
* return (
|
|
144
|
+
* <List>
|
|
145
|
+
* <List.Item title="Icon" icon={{ source: "https://raycast.com/uploads/avatar.png", mask: Image.Mask.Circle }} />
|
|
146
|
+
* </List>
|
|
147
|
+
* );
|
|
148
|
+
* };
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
enum Mask {
|
|
152
|
+
/**
|
|
153
|
+
* Masks an image with a circle. Good to use for avatars.
|
|
154
|
+
*/
|
|
155
|
+
Circle = "circle",
|
|
156
|
+
/**
|
|
157
|
+
* Masks an image with a rounded rectangle.
|
|
158
|
+
*/
|
|
159
|
+
RoundedRectangle = "roundedRectangle"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
}
|