@raycast/api 1.31.0 → 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 -0
- 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 -263
- package/types/api/components/Form.d.ts +0 -1016
- package/types/api/components/List.d.ts +0 -738
- 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 -53
- 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 -4
- package/types/api/internal/rendering/node-builders/forms.d.ts +0 -3
- package/types/api/internal/rendering/node-builders/keyboard.d.ts +0 -1
- package/types/api/internal/rendering/node-builders/list.d.ts +0 -5
- 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 -2
- package/types/api/internal/rendering/reconciler/instance.d.ts +0 -3
- 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 -4
- package/types/api/internal/utils/internal-children.d.ts +0 -26
- package/types/api/internal/utils/invariant.d.ts +0 -4
- 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 -89
- 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,738 +0,0 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import { Image } from "../ui";
|
|
4
|
-
import { ActionsInterface, NavigationChildInterface } from "./types";
|
|
5
|
-
/**
|
|
6
|
-
* Displays {@link List.Section} or {@link List.Item}, optionally {@link List.Dropdown}.
|
|
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
|
-
* 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
|
-
*
|
|
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
|
-
* }
|
|
39
|
-
* return (
|
|
40
|
-
* <List
|
|
41
|
-
* navigationTitle="Search Beers"
|
|
42
|
-
* searchBarPlaceholder="Search your favorite drink"
|
|
43
|
-
* searchBarAccessory={<DrinkDropdown drinkTypes={drinkTypes} onDrinkTypeChange={onDrinkTypeChange} />}
|
|
44
|
-
* >
|
|
45
|
-
* <List.Item title="Augustiner Helles" />
|
|
46
|
-
* <List.Item title="Camden Hells" />
|
|
47
|
-
* <List.Item title="Leffe Blonde" />
|
|
48
|
-
* <List.Item title="Sierra Nevada IPA" />
|
|
49
|
-
* </List>
|
|
50
|
-
* );
|
|
51
|
-
* }
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
export declare function List(props: List.Props): ReactElement<List.Props>;
|
|
55
|
-
export declare namespace List {
|
|
56
|
-
var propTypes: {
|
|
57
|
-
onSelectionChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
58
|
-
searchBarAccessory: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
59
|
-
searchText: PropTypes.Requireable<string>;
|
|
60
|
-
enableFiltering: PropTypes.Requireable<boolean>;
|
|
61
|
-
searchBarPlaceholder: PropTypes.Requireable<string>;
|
|
62
|
-
selectedItemId: PropTypes.Requireable<string>;
|
|
63
|
-
throttle: PropTypes.Requireable<boolean>;
|
|
64
|
-
onSearchTextChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
65
|
-
isLoading: PropTypes.Requireable<boolean>;
|
|
66
|
-
navigationTitle: PropTypes.Requireable<string>;
|
|
67
|
-
actions: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
68
|
-
};
|
|
69
|
-
var displayName: string;
|
|
70
|
-
}
|
|
71
|
-
declare function ListEmptyView(props: List.EmptyView.Props): ReactElement<List.EmptyView.Props>;
|
|
72
|
-
declare namespace ListEmptyView {
|
|
73
|
-
var propTypes: {
|
|
74
|
-
id: PropTypes.Requireable<string>;
|
|
75
|
-
icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
76
|
-
fileIcon: PropTypes.Validator<string>;
|
|
77
|
-
}>> | PropTypes.InferProps<{
|
|
78
|
-
source: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
79
|
-
light: PropTypes.Validator<string>;
|
|
80
|
-
dark: PropTypes.Validator<string>;
|
|
81
|
-
}>>;
|
|
82
|
-
fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
83
|
-
light: PropTypes.Validator<string>;
|
|
84
|
-
dark: PropTypes.Validator<string>;
|
|
85
|
-
}>>;
|
|
86
|
-
mask: PropTypes.Requireable<Image.Mask>;
|
|
87
|
-
tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
88
|
-
light: PropTypes.Validator<string>;
|
|
89
|
-
dark: PropTypes.Validator<string>;
|
|
90
|
-
adjustContrast: PropTypes.Requireable<boolean>;
|
|
91
|
-
}>>;
|
|
92
|
-
}>>;
|
|
93
|
-
title: PropTypes.Requireable<string>;
|
|
94
|
-
description: PropTypes.Requireable<string>;
|
|
95
|
-
actions: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
96
|
-
};
|
|
97
|
-
var displayName: string;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* See {@link List.Section}
|
|
101
|
-
*/
|
|
102
|
-
declare function ListSection(props: List.Section.Props): ReactElement<List.Section.Props>;
|
|
103
|
-
declare namespace ListSection {
|
|
104
|
-
var propTypes: {
|
|
105
|
-
id: PropTypes.Requireable<string>;
|
|
106
|
-
title: PropTypes.Requireable<string>;
|
|
107
|
-
subtitle: PropTypes.Requireable<string>;
|
|
108
|
-
};
|
|
109
|
-
var displayName: string;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* See {@link List.Item}
|
|
113
|
-
*/
|
|
114
|
-
declare function ListItem(props: List.Item.Props): ReactElement<List.Item.Props>;
|
|
115
|
-
declare namespace ListItem {
|
|
116
|
-
var propTypes: {
|
|
117
|
-
id: PropTypes.Requireable<string>;
|
|
118
|
-
title: PropTypes.Validator<string>;
|
|
119
|
-
subtitle: PropTypes.Requireable<string>;
|
|
120
|
-
keywords: PropTypes.Requireable<string[]>;
|
|
121
|
-
icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
122
|
-
fileIcon: PropTypes.Validator<string>;
|
|
123
|
-
}>> | PropTypes.InferProps<{
|
|
124
|
-
source: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
125
|
-
light: PropTypes.Validator<string>;
|
|
126
|
-
dark: PropTypes.Validator<string>;
|
|
127
|
-
}>>;
|
|
128
|
-
fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
129
|
-
light: PropTypes.Validator<string>;
|
|
130
|
-
dark: PropTypes.Validator<string>;
|
|
131
|
-
}>>;
|
|
132
|
-
mask: PropTypes.Requireable<Image.Mask>;
|
|
133
|
-
tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
134
|
-
light: PropTypes.Validator<string>;
|
|
135
|
-
dark: PropTypes.Validator<string>;
|
|
136
|
-
adjustContrast: PropTypes.Requireable<boolean>;
|
|
137
|
-
}>>;
|
|
138
|
-
}>>;
|
|
139
|
-
accessoryTitle: PropTypes.Requireable<string>;
|
|
140
|
-
accessoryIcon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
141
|
-
fileIcon: PropTypes.Validator<string>;
|
|
142
|
-
}>> | PropTypes.InferProps<{
|
|
143
|
-
source: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
144
|
-
light: PropTypes.Validator<string>;
|
|
145
|
-
dark: PropTypes.Validator<string>;
|
|
146
|
-
}>>;
|
|
147
|
-
fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
148
|
-
light: PropTypes.Validator<string>;
|
|
149
|
-
dark: PropTypes.Validator<string>;
|
|
150
|
-
}>>;
|
|
151
|
-
mask: PropTypes.Requireable<Image.Mask>;
|
|
152
|
-
tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
153
|
-
light: PropTypes.Validator<string>;
|
|
154
|
-
dark: PropTypes.Validator<string>;
|
|
155
|
-
adjustContrast: PropTypes.Requireable<boolean>;
|
|
156
|
-
}>>;
|
|
157
|
-
}>>;
|
|
158
|
-
accessories: PropTypes.Requireable<Required<PropTypes.InferProps<{
|
|
159
|
-
text: PropTypes.Requireable<string>;
|
|
160
|
-
icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
161
|
-
fileIcon: PropTypes.Validator<string>;
|
|
162
|
-
}>> | PropTypes.InferProps<{
|
|
163
|
-
source: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
164
|
-
light: PropTypes.Validator<string>;
|
|
165
|
-
dark: PropTypes.Validator<string>;
|
|
166
|
-
}>>;
|
|
167
|
-
fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
168
|
-
light: PropTypes.Validator<string>;
|
|
169
|
-
dark: PropTypes.Validator<string>;
|
|
170
|
-
}>>;
|
|
171
|
-
mask: PropTypes.Requireable<Image.Mask>;
|
|
172
|
-
tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
173
|
-
light: PropTypes.Validator<string>;
|
|
174
|
-
dark: PropTypes.Validator<string>;
|
|
175
|
-
adjustContrast: PropTypes.Requireable<boolean>;
|
|
176
|
-
}>>;
|
|
177
|
-
}>>;
|
|
178
|
-
}>>[]>;
|
|
179
|
-
};
|
|
180
|
-
var displayName: string;
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* See {@link List.Item.Detail}
|
|
184
|
-
*/
|
|
185
|
-
declare function ListItemDetail(props: List.Item.Detail.Props): ReactElement<List.Item.Detail.Props>;
|
|
186
|
-
declare namespace ListItemDetail {
|
|
187
|
-
var propTypes: {
|
|
188
|
-
isLoading: PropTypes.Requireable<boolean>;
|
|
189
|
-
markdown: PropTypes.Requireable<string>;
|
|
190
|
-
};
|
|
191
|
-
var displayName: string;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* See {@link List.Dropdown}
|
|
195
|
-
*/
|
|
196
|
-
declare function ListDropdown(props: List.Dropdown.Props): ReactElement<List.Dropdown.Props>;
|
|
197
|
-
declare namespace ListDropdown {
|
|
198
|
-
var propTypes: {
|
|
199
|
-
id: PropTypes.Requireable<string>;
|
|
200
|
-
tooltip: PropTypes.Validator<string>;
|
|
201
|
-
storeValue: (props: List.Dropdown.Props, propName: keyof List.Dropdown.Props, componentName: string, location: string, propFullName: string) => Error;
|
|
202
|
-
value: PropTypes.Requireable<string>;
|
|
203
|
-
defaultValue: PropTypes.Requireable<string>;
|
|
204
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
205
|
-
};
|
|
206
|
-
var displayName: string;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* See {@link List.Dropdown.Section}
|
|
210
|
-
*/
|
|
211
|
-
declare function ListDropdownSection(props: List.Dropdown.Section.Props): ReactElement<List.Dropdown.Section.Props>;
|
|
212
|
-
declare namespace ListDropdownSection {
|
|
213
|
-
var propTypes: {
|
|
214
|
-
title: PropTypes.Requireable<string>;
|
|
215
|
-
};
|
|
216
|
-
var displayName: string;
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* See {@link List.Dropdown.Item}
|
|
220
|
-
*/
|
|
221
|
-
declare function ListDropdownItem(props: List.Dropdown.Item.Props): ReactElement<List.Dropdown.Item.Props>;
|
|
222
|
-
declare namespace ListDropdownItem {
|
|
223
|
-
var propTypes: {
|
|
224
|
-
value: PropTypes.Requireable<string>;
|
|
225
|
-
title: PropTypes.Validator<string>;
|
|
226
|
-
icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
227
|
-
fileIcon: PropTypes.Validator<string>;
|
|
228
|
-
}>> | PropTypes.InferProps<{
|
|
229
|
-
source: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
230
|
-
light: PropTypes.Validator<string>;
|
|
231
|
-
dark: PropTypes.Validator<string>;
|
|
232
|
-
}>>;
|
|
233
|
-
fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
234
|
-
light: PropTypes.Validator<string>;
|
|
235
|
-
dark: PropTypes.Validator<string>;
|
|
236
|
-
}>>;
|
|
237
|
-
mask: PropTypes.Requireable<Image.Mask>;
|
|
238
|
-
tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
239
|
-
light: PropTypes.Validator<string>;
|
|
240
|
-
dark: PropTypes.Validator<string>;
|
|
241
|
-
adjustContrast: PropTypes.Requireable<boolean>;
|
|
242
|
-
}>>;
|
|
243
|
-
}>>;
|
|
244
|
-
};
|
|
245
|
-
var displayName: string;
|
|
246
|
-
}
|
|
247
|
-
export declare namespace List {
|
|
248
|
-
/**
|
|
249
|
-
* A view to display when there aren't any items available. Use to greet users with a friendly message if the
|
|
250
|
-
* extension requires user input before it can show any list items e.g. when searching for a package, an article etc.
|
|
251
|
-
*
|
|
252
|
-
* @remarks
|
|
253
|
-
* Raycast provides a default `EmptyView` that will be displayed if the {@link List} component either has no children,
|
|
254
|
-
* or if it has children, but none of them match the query in the search bar. This too can be overridden by passing
|
|
255
|
-
* an empty view alongside the other `List.Item`s.
|
|
256
|
-
*
|
|
257
|
-
* @example
|
|
258
|
-
* import { useState } from "react";
|
|
259
|
-
* import { List } from "@raycast/api";
|
|
260
|
-
*
|
|
261
|
-
* export default function CommandWithCustomEmptyState() {
|
|
262
|
-
* const [state, setState] = useState({ searchText: "", items: [] });
|
|
263
|
-
*
|
|
264
|
-
* useEffect(() => {
|
|
265
|
-
* // perform an API call that eventually populates `items`.
|
|
266
|
-
* }, [state.searchText])
|
|
267
|
-
*
|
|
268
|
-
* return (
|
|
269
|
-
* <List
|
|
270
|
-
* onSearchTextChange={(newValue) =>
|
|
271
|
-
* setState((previous) => ({ ...previous, searchText: newValue }))
|
|
272
|
-
* }
|
|
273
|
-
* >
|
|
274
|
-
* {state.searchText === "" && state.items.length === 0 ? (
|
|
275
|
-
* <List.EmptyView
|
|
276
|
-
* icon={{ source: "https://placekitten.com/500/500" }}
|
|
277
|
-
* title="Type something to get started"
|
|
278
|
-
* />
|
|
279
|
-
* ) : (
|
|
280
|
-
* state.items.map((item) => <List.Item key={item} title={item} />)
|
|
281
|
-
* )}
|
|
282
|
-
* </List>
|
|
283
|
-
* );
|
|
284
|
-
* }
|
|
285
|
-
*/
|
|
286
|
-
const EmptyView: typeof ListEmptyView;
|
|
287
|
-
/**
|
|
288
|
-
* A item in the {@link List}.
|
|
289
|
-
*
|
|
290
|
-
* @remarks
|
|
291
|
-
* This is one of the foundational UI components of Raycast. A list item represents a single entity. It can be a
|
|
292
|
-
* GitHub pull request, a file, or anything else. You most likely want to perform actions on this item, so make it clear
|
|
293
|
-
* to the user what this list item is about.
|
|
294
|
-
*
|
|
295
|
-
* @example
|
|
296
|
-
* ```typescript
|
|
297
|
-
* import { Icon, List } from "@raycast/api";
|
|
298
|
-
*
|
|
299
|
-
* export default function Command() {
|
|
300
|
-
* return (
|
|
301
|
-
* <List>
|
|
302
|
-
* <List.Item icon={Icon.Star} title="Augustiner Helles" subtitle="0,5 Liter" accessories={[{ text: "Germany" }]} />
|
|
303
|
-
* </List>
|
|
304
|
-
* );
|
|
305
|
-
* }
|
|
306
|
-
* ```
|
|
307
|
-
*/
|
|
308
|
-
const Item: typeof ListItem;
|
|
309
|
-
/**
|
|
310
|
-
* A group of related {@link List.Item}.
|
|
311
|
-
*
|
|
312
|
-
* @remarks
|
|
313
|
-
* Sections are a great way to structure your list. For example, group GitHub issues with the same status and order them by priority.
|
|
314
|
-
* This way, users can quickly access what is most relevant.
|
|
315
|
-
*
|
|
316
|
-
* @example
|
|
317
|
-
* ```typescript
|
|
318
|
-
* import { List } from "@raycast/api";
|
|
319
|
-
*
|
|
320
|
-
* export default function Command() {
|
|
321
|
-
* return (
|
|
322
|
-
* <List>
|
|
323
|
-
* <List.Section title="Lager">
|
|
324
|
-
* <List.Item title="Camden Hells" />
|
|
325
|
-
* </List.Section>
|
|
326
|
-
* <List.Section title="IPA">
|
|
327
|
-
* <List.Item title="Sierra Nevada IPA" />
|
|
328
|
-
* </List.Section>
|
|
329
|
-
* </List>
|
|
330
|
-
* );
|
|
331
|
-
* }
|
|
332
|
-
* ```
|
|
333
|
-
*/
|
|
334
|
-
const Section: typeof ListSection;
|
|
335
|
-
/**
|
|
336
|
-
* A dropdown menu that will be shown in the right-hand-side of the search bar.
|
|
337
|
-
*
|
|
338
|
-
* @example
|
|
339
|
-
* ```typescript
|
|
340
|
-
* import { List } from "@raycast/api";
|
|
341
|
-
*
|
|
342
|
-
* function DrinkDropdown(props: DrinkDropdownProps) {
|
|
343
|
-
* const { isLoading = false, drinkTypes, onDrinkTypeChange } = props;
|
|
344
|
-
* return (
|
|
345
|
-
* <List.Dropdown
|
|
346
|
-
* tooltip="Select Drink Type"
|
|
347
|
-
* disabled={isLoading}
|
|
348
|
-
* storeValue={true}
|
|
349
|
-
* onChange={(newValue) => {
|
|
350
|
-
* onDrinkTypeChange(newValue);
|
|
351
|
-
* }}
|
|
352
|
-
* >
|
|
353
|
-
* <List.Dropdown.Section title="Alcoholic Beverages">
|
|
354
|
-
* {drinkTypes.map((drinkType) => (
|
|
355
|
-
* <List.Dropdown.Item key={drinkType.id} title={drinkType.name} value={drinkType.id} />
|
|
356
|
-
* ))}
|
|
357
|
-
* </List.Dropdown.Section>
|
|
358
|
-
* </List.Dropdown>
|
|
359
|
-
* );
|
|
360
|
-
* }
|
|
361
|
-
*
|
|
362
|
-
* export default function Command() {
|
|
363
|
-
* const drinkTypes = [{ id: 1, name: 'Beer' }, { id: 2, name: 'Wine' }];
|
|
364
|
-
* const onDrinkTypeChange = (newValue) => {
|
|
365
|
-
* console.log(newValue);
|
|
366
|
-
* }
|
|
367
|
-
* return (
|
|
368
|
-
* <List
|
|
369
|
-
* navigationTitle="Search Beers"
|
|
370
|
-
* searchBarPlaceholder="Search your favorite drink"
|
|
371
|
-
* searchBarAccessory={<DrinkDropdown drinkTypes={drinkTypes} onDrinkTypeChange={onDrinkTypeChange} />}
|
|
372
|
-
* >
|
|
373
|
-
* <List.Item title="Augustiner Helles" />
|
|
374
|
-
* <List.Item title="Camden Hells" />
|
|
375
|
-
* <List.Item title="Leffe Blonde" />
|
|
376
|
-
* <List.Item title="Sierra Nevada IPA" />
|
|
377
|
-
* </List>
|
|
378
|
-
* );
|
|
379
|
-
* }
|
|
380
|
-
* ```
|
|
381
|
-
*/
|
|
382
|
-
const Dropdown: typeof ListDropdown;
|
|
383
|
-
/**
|
|
384
|
-
* Props of the {@link List} React component.
|
|
385
|
-
*/
|
|
386
|
-
interface Props extends ActionsInterface, NavigationChildInterface {
|
|
387
|
-
/**
|
|
388
|
-
* List sections or items. If {@link List.Item} elements are specified, a default section is automatically created.
|
|
389
|
-
*/
|
|
390
|
-
children?: ReactNode;
|
|
391
|
-
/**
|
|
392
|
-
* Callback triggered when the item selection in the list changes.
|
|
393
|
-
*/
|
|
394
|
-
onSelectionChange?: (id?: string) => void;
|
|
395
|
-
/**
|
|
396
|
-
* {@link List.Dropdown} that will be shown in the right-hand-side of the search bar.
|
|
397
|
-
*/
|
|
398
|
-
searchBarAccessory?: ReactElement<List.Dropdown.Props> | null | boolean;
|
|
399
|
-
/**
|
|
400
|
-
* The text that will be displayed in the search bar.
|
|
401
|
-
*/
|
|
402
|
-
searchText?: string;
|
|
403
|
-
/**
|
|
404
|
-
* Toggles Raycast filtering. When `true`, Raycast will use the query in the search bar to filter list
|
|
405
|
-
* items. When `false`, the extension needs to take care of the filtering.
|
|
406
|
-
*
|
|
407
|
-
* @remarks
|
|
408
|
-
* Having this enabled when filtering items in the extension is unspecified behaviour.
|
|
409
|
-
*
|
|
410
|
-
* @defaultValue false when `onSearchTextChange` is specified, true otherwise.
|
|
411
|
-
*/
|
|
412
|
-
enableFiltering?: boolean;
|
|
413
|
-
/**
|
|
414
|
-
* Placeholder text that will be shown in the search bar.
|
|
415
|
-
*
|
|
416
|
-
* @defaultValue Search value...
|
|
417
|
-
*/
|
|
418
|
-
searchBarPlaceholder?: string;
|
|
419
|
-
/**
|
|
420
|
-
* Selects the item with the specified id.
|
|
421
|
-
*/
|
|
422
|
-
selectedItemId?: string;
|
|
423
|
-
/**
|
|
424
|
-
* Defines whether the {@link ListProps.onSearchTextChange} will be triggered on every keyboard press or with a delay for throttling the events.
|
|
425
|
-
* Recommended to set to `true` when using custom filtering logic with asynchronous operations (e.g. network requests).
|
|
426
|
-
* @defaultValue false
|
|
427
|
-
*/
|
|
428
|
-
throttle?: boolean;
|
|
429
|
-
/**
|
|
430
|
-
* Callback triggered when the search bar text changes.
|
|
431
|
-
*
|
|
432
|
-
* @remarks
|
|
433
|
-
* Specifying this implicitly toggles `enableFiltering` to false. To enable native filtering when using `onSearchTextChange`, explicitly set `enableFiltering` to true.
|
|
434
|
-
*/
|
|
435
|
-
onSearchTextChange?: (text: string) => void;
|
|
436
|
-
/**
|
|
437
|
-
* Whether the List should have an area on the right side of the items to show additional details about the selected item.
|
|
438
|
-
*
|
|
439
|
-
* 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.
|
|
440
|
-
*/
|
|
441
|
-
isShowingDetail?: boolean;
|
|
442
|
-
}
|
|
443
|
-
namespace EmptyView {
|
|
444
|
-
interface Props extends ActionsInterface {
|
|
445
|
-
/**
|
|
446
|
-
* An icon displayed in the center of the EmptyView.
|
|
447
|
-
*
|
|
448
|
-
* @remarks
|
|
449
|
-
* If an SVG is used, its longest side will be 128 pixels. Other images will be up/downscaled proportionally so that the longest side is between 64 and 256 pixels.
|
|
450
|
-
* If not specified, Raycast's default `EmptyView` icon will be used.
|
|
451
|
-
*/
|
|
452
|
-
icon?: Image.ImageLike;
|
|
453
|
-
/**
|
|
454
|
-
* The main title displayed for the Empty View.
|
|
455
|
-
*/
|
|
456
|
-
title?: string;
|
|
457
|
-
/**
|
|
458
|
-
* An optional description for why the empty view is shown.
|
|
459
|
-
*/
|
|
460
|
-
description?: string;
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
namespace Item {
|
|
464
|
-
/**
|
|
465
|
-
* An interface describing an accessory item in a {@link List.Item}
|
|
466
|
-
*
|
|
467
|
-
* @example
|
|
468
|
-
* ```typescript
|
|
469
|
-
* import { List } from "@raycast/api";
|
|
470
|
-
*
|
|
471
|
-
* export default function Command() {
|
|
472
|
-
* return (
|
|
473
|
-
* <List>
|
|
474
|
-
* <List.Item title="An Item with Accessories" accessories={[{ text: `An Accessory Text`, icon: Icon.Hammer }, { icon: Icon.Person }, { text: "Just Do It!" }]} />
|
|
475
|
-
* </List>
|
|
476
|
-
* );
|
|
477
|
-
* }
|
|
478
|
-
* ```
|
|
479
|
-
*/
|
|
480
|
-
interface Accessory {
|
|
481
|
-
/**
|
|
482
|
-
* An optional text that will be used as the label.
|
|
483
|
-
*/
|
|
484
|
-
text?: string;
|
|
485
|
-
/**
|
|
486
|
-
* An optional {@link Image.ImageLike} that will be used as the icon.
|
|
487
|
-
* @remarks
|
|
488
|
-
* An image will be shown in front of the text if {@link List.Item.Accessory.text} is specified.
|
|
489
|
-
*/
|
|
490
|
-
icon?: Image.ImageLike;
|
|
491
|
-
}
|
|
492
|
-
/**
|
|
493
|
-
* Props of the {@link List.Item} React component.
|
|
494
|
-
*/
|
|
495
|
-
interface Props extends ActionsInterface {
|
|
496
|
-
/**
|
|
497
|
-
* ID of the item.
|
|
498
|
-
* Make sure to assign each item a unique ID or a UUID will be auto generated.
|
|
499
|
-
*/
|
|
500
|
-
id?: string;
|
|
501
|
-
/**
|
|
502
|
-
* The main title displayed for that item.
|
|
503
|
-
*/
|
|
504
|
-
title: string;
|
|
505
|
-
/**
|
|
506
|
-
* An optional subtitle displayed next to the main title.
|
|
507
|
-
*/
|
|
508
|
-
subtitle?: string;
|
|
509
|
-
/**
|
|
510
|
-
* An optional property used for providing additional indexable strings for search.
|
|
511
|
-
* When filtering the list in Raycast through the search bar, the keywords will be searched in addition to the title.
|
|
512
|
-
*/
|
|
513
|
-
keywords?: string[];
|
|
514
|
-
/**
|
|
515
|
-
* An optional icon displayed for the list item.
|
|
516
|
-
*/
|
|
517
|
-
icon?: Image.ImageLike;
|
|
518
|
-
/**
|
|
519
|
-
* @deprecated Use "accessories={[ { icon: ... } ]}" instead.
|
|
520
|
-
*/
|
|
521
|
-
accessoryIcon?: Image.ImageLike;
|
|
522
|
-
/**
|
|
523
|
-
* @deprecated Use "accessories={[ { text: ... } ]}" instead.
|
|
524
|
-
*/
|
|
525
|
-
accessoryTitle?: string;
|
|
526
|
-
/**
|
|
527
|
-
* An optional array of {@link List.Item.Accessory} items displayed on the right side in a List.Item.
|
|
528
|
-
*/
|
|
529
|
-
accessories?: Accessory[];
|
|
530
|
-
/**
|
|
531
|
-
* An {@link ActionPanel} that will be updated for the selected list item.
|
|
532
|
-
*/
|
|
533
|
-
actions?: ReactNode | null;
|
|
534
|
-
/**
|
|
535
|
-
* The `List.Item.Detail` to be rendered in the right side area when the parent List is showing details and the item is selected.
|
|
536
|
-
*/
|
|
537
|
-
detail?: ReactNode;
|
|
538
|
-
}
|
|
539
|
-
namespace Detail {
|
|
540
|
-
/**
|
|
541
|
-
* Props of the {@link List.Item.Detail} React component.
|
|
542
|
-
*/
|
|
543
|
-
interface Props {
|
|
544
|
-
/**
|
|
545
|
-
* Indicates whether a loading bar should be shown or hidden above the detail
|
|
546
|
-
*
|
|
547
|
-
* @defaultValue false
|
|
548
|
-
*/
|
|
549
|
-
isLoading?: boolean;
|
|
550
|
-
/**
|
|
551
|
-
* The CommonMark string to be rendered in the right side area when the parent List is showing details and the item is selected.
|
|
552
|
-
*/
|
|
553
|
-
markdown?: string | null;
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
namespace Section {
|
|
558
|
-
/**
|
|
559
|
-
* Props of the {@link List.Section} React component.
|
|
560
|
-
*/
|
|
561
|
-
interface Props {
|
|
562
|
-
/**
|
|
563
|
-
* The {@link List.Item} elements of the section.
|
|
564
|
-
*/
|
|
565
|
-
children?: ReactNode;
|
|
566
|
-
/**
|
|
567
|
-
* ID of the section.
|
|
568
|
-
* Make sure to assign each section a unique ID or a UUID will be auto generated.
|
|
569
|
-
*/
|
|
570
|
-
id?: string;
|
|
571
|
-
/**
|
|
572
|
-
* Title displayed above the section.
|
|
573
|
-
*/
|
|
574
|
-
title?: string;
|
|
575
|
-
/**
|
|
576
|
-
* An optional subtitle displayed next to the title of the section.
|
|
577
|
-
*/
|
|
578
|
-
subtitle?: string;
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
namespace Dropdown {
|
|
582
|
-
/**
|
|
583
|
-
* Props of the {@link List.Dropdown} React component.
|
|
584
|
-
*/
|
|
585
|
-
interface Props {
|
|
586
|
-
/**
|
|
587
|
-
* ID of the dropdown.
|
|
588
|
-
*/
|
|
589
|
-
id?: string;
|
|
590
|
-
/**
|
|
591
|
-
* Tooltip displayed when hovering the dropdown.
|
|
592
|
-
*/
|
|
593
|
-
tooltip: string;
|
|
594
|
-
/**
|
|
595
|
-
* Placeholder text that will be shown in the dropdown search field.
|
|
596
|
-
*
|
|
597
|
-
* @defaultValue Search...
|
|
598
|
-
*/
|
|
599
|
-
placeholder?: string;
|
|
600
|
-
/**
|
|
601
|
-
* Indicates whether the value of the dropdown should be persisted after selection, and restored next time the dropdown is rendered.
|
|
602
|
-
*/
|
|
603
|
-
storeValue?: boolean;
|
|
604
|
-
/**
|
|
605
|
-
* The currently value of the dropdown.
|
|
606
|
-
*/
|
|
607
|
-
value?: string;
|
|
608
|
-
/**
|
|
609
|
-
* The default value of the dropdown.
|
|
610
|
-
* 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.
|
|
611
|
-
* @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.
|
|
612
|
-
* @important If you configure `value` at the same time as `defaultValue`, the `value` will have precedence over `defaultValue`.
|
|
613
|
-
*/
|
|
614
|
-
defaultValue?: string;
|
|
615
|
-
/**
|
|
616
|
-
* List sections or items. If {@link List.Dropdown.Item} elements are specified, a default section is automatically created.
|
|
617
|
-
*/
|
|
618
|
-
children?: ReactNode;
|
|
619
|
-
/**
|
|
620
|
-
* Callback triggered when the list item selection changes.
|
|
621
|
-
*/
|
|
622
|
-
onChange?: (newValue: string) => void;
|
|
623
|
-
}
|
|
624
|
-
namespace Section {
|
|
625
|
-
/**
|
|
626
|
-
* Props of the {@link List.Dropdown.Section} React component.
|
|
627
|
-
*/
|
|
628
|
-
interface Props {
|
|
629
|
-
/**
|
|
630
|
-
* The item elements of the section.
|
|
631
|
-
*/
|
|
632
|
-
children?: ReactNode;
|
|
633
|
-
/**
|
|
634
|
-
* Title displayed above the section
|
|
635
|
-
*/
|
|
636
|
-
title?: string;
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
namespace Item {
|
|
640
|
-
/**
|
|
641
|
-
* Props of the {@link List.Dropdown.Item} React component.
|
|
642
|
-
*/
|
|
643
|
-
interface Props {
|
|
644
|
-
/**
|
|
645
|
-
* Value of the dropdown item.
|
|
646
|
-
* Make sure to assign each unique value for each item.
|
|
647
|
-
*/
|
|
648
|
-
value: string;
|
|
649
|
-
/**
|
|
650
|
-
* The title displayed for the item.
|
|
651
|
-
*/
|
|
652
|
-
title: string;
|
|
653
|
-
/**
|
|
654
|
-
* An optional icon displayed for the item.
|
|
655
|
-
*/
|
|
656
|
-
icon?: Image.ImageLike;
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
declare namespace ListDropdown {
|
|
662
|
-
/**
|
|
663
|
-
* Visually separated group of dropdown items in a {@link List.Dropdown}.
|
|
664
|
-
*
|
|
665
|
-
* @remarks
|
|
666
|
-
* Use sections to group related dropdown items together.
|
|
667
|
-
*
|
|
668
|
-
* @example
|
|
669
|
-
* ```typescript
|
|
670
|
-
* import { List } from "@raycast/api";
|
|
671
|
-
*
|
|
672
|
-
* export default function Command() {
|
|
673
|
-
* return (
|
|
674
|
-
* <List searchBarAccessory={
|
|
675
|
-
* <List.Dropdown tooltip="Dropdown With Sections">
|
|
676
|
-
* <List.Dropdown.Section title="First Section">
|
|
677
|
-
* <List.Dropdown.Item title="One" value="one" />
|
|
678
|
-
* </List.Dropdown.Section>
|
|
679
|
-
* <List.Dropdown.Section title="Second Section">
|
|
680
|
-
* <List.Dropdown.Item title="Two" value="two" />
|
|
681
|
-
* </List.Dropdown.Section>
|
|
682
|
-
* </List.Dropdown>
|
|
683
|
-
* }>
|
|
684
|
-
* <List.Item title="Item in the Main List">
|
|
685
|
-
* </List>
|
|
686
|
-
* );
|
|
687
|
-
* }
|
|
688
|
-
* ```
|
|
689
|
-
*/
|
|
690
|
-
const Section: typeof ListDropdownSection;
|
|
691
|
-
/**
|
|
692
|
-
* A dropdown item in a {@link List.Dropdown}
|
|
693
|
-
*
|
|
694
|
-
* @example
|
|
695
|
-
* ```typescript
|
|
696
|
-
* import { List } from "@raycast/api";
|
|
697
|
-
*
|
|
698
|
-
* export default function Command() {
|
|
699
|
-
* return (
|
|
700
|
-
* <List searchBarAccessory={
|
|
701
|
-
* <List.Dropdown tooltip="Dropdown With Items">
|
|
702
|
-
* <List.Dropdown.Item title="One" value="one" />
|
|
703
|
-
* <List.Dropdown.Item title="Two" value="two" />
|
|
704
|
-
* <List.Dropdown.Item title="Three" value="three" />
|
|
705
|
-
* </List.Dropdown>
|
|
706
|
-
* }>
|
|
707
|
-
* <List.Item title="Item in the Main List">
|
|
708
|
-
* </List>
|
|
709
|
-
* );
|
|
710
|
-
* }
|
|
711
|
-
* ```
|
|
712
|
-
*/
|
|
713
|
-
const Item: typeof ListDropdownItem;
|
|
714
|
-
}
|
|
715
|
-
declare namespace ListItem {
|
|
716
|
-
/**
|
|
717
|
-
* A Detail view that will be shown in the right-hand-side of the List.
|
|
718
|
-
*
|
|
719
|
-
* @example
|
|
720
|
-
* ```typescript
|
|
721
|
-
* import { List } from "@raycast/api";
|
|
722
|
-
*
|
|
723
|
-
* export default function Command() {
|
|
724
|
-
* return (
|
|
725
|
-
* <List isShowingDetail>
|
|
726
|
-
* <List.Item
|
|
727
|
-
* title="Pikachu"
|
|
728
|
-
* subtitle="Electric"
|
|
729
|
-
* detail={<List.Item.Detail markdown="" />}
|
|
730
|
-
* />
|
|
731
|
-
* </List>
|
|
732
|
-
* );
|
|
733
|
-
* }
|
|
734
|
-
* ```
|
|
735
|
-
*/
|
|
736
|
-
const Detail: typeof ListItemDetail;
|
|
737
|
-
}
|
|
738
|
-
export {};
|