@raycast/api 1.27.0 → 1.27.1
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 +1 -1
- package/types/index.d.ts +155 -2
package/bin/arm64/ray
CHANGED
|
Binary file
|
package/bin/x86/ray
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -172,6 +172,26 @@ export function getApplications(path?: PathLike): Promise<Application[]>;
|
|
|
172
172
|
* @category Utilities
|
|
173
173
|
*/
|
|
174
174
|
export function getDefaultApplication(path: PathLike): Promise<Application>;
|
|
175
|
+
/**
|
|
176
|
+
* Opens a target with the default application or specified application.
|
|
177
|
+
*
|
|
178
|
+
* @param target The file, folder or URL to open.
|
|
179
|
+
* @param application The application name to use for opening the file. If no application is specified, the default application as determined by the system
|
|
180
|
+
* is used to open the specified file. Note that you can use the application name, app identifier, or absolute path to the app.
|
|
181
|
+
* @returns A promise that resolves when the target has been opened.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
*
|
|
186
|
+
*
|
|
187
|
+
* export default async () => {
|
|
188
|
+
* await open("https://www.raycast.com", "com.google.Chrome");
|
|
189
|
+
* };
|
|
190
|
+
* ```
|
|
191
|
+
*
|
|
192
|
+
* @category Utilities
|
|
193
|
+
*/
|
|
194
|
+
export function open(target: string, application?: Application | string): Promise<void>;
|
|
175
195
|
/**
|
|
176
196
|
* Copies text to the clipboard.
|
|
177
197
|
*
|
|
@@ -837,10 +857,12 @@ global {
|
|
|
837
857
|
interface IntrinsicElements {
|
|
838
858
|
"ray-form": FormProps;
|
|
839
859
|
"ray-form-textfield": FormTextFieldProps;
|
|
860
|
+
"ray-form-passwordfield": FormPasswordFieldProps;
|
|
840
861
|
"ray-form-textarea": FormTextAreaProps;
|
|
841
862
|
"ray-form-checkbox": FormCheckboxProps;
|
|
842
863
|
"ray-form-datepicker": FormDatePickerProps;
|
|
843
864
|
"ray-form-separator": FormSeparatorProps;
|
|
865
|
+
"ray-form-description": FormDescriptionProps;
|
|
844
866
|
"ray-form-dropdown": FormDropdownProps;
|
|
845
867
|
"ray-form-tagpicker": FormTagPickerProps;
|
|
846
868
|
"ray-form-tagpicker-item": FormTagPickerItemProps;
|
|
@@ -927,9 +949,11 @@ export namespace Form {
|
|
|
927
949
|
var displayName: string;
|
|
928
950
|
var TextField: typeof FormTextField;
|
|
929
951
|
var TextArea: typeof FormTextArea;
|
|
952
|
+
var PasswordField: typeof FormPasswordField;
|
|
930
953
|
var Checkbox: typeof FormCheckbox;
|
|
931
954
|
var DatePicker: typeof FormDatePicker;
|
|
932
955
|
var Separator: typeof FormSeparator;
|
|
956
|
+
var Description: typeof FormDescription;
|
|
933
957
|
var Dropdown: typeof FormDropdown;
|
|
934
958
|
var DropdownSection: typeof FormDropdownSection;
|
|
935
959
|
var DropdownItem: typeof FormDropdownItem;
|
|
@@ -1048,6 +1072,82 @@ export namespace FormTextField {
|
|
|
1048
1072
|
};
|
|
1049
1073
|
var displayName: string;
|
|
1050
1074
|
}
|
|
1075
|
+
/**
|
|
1076
|
+
* Props of the {@link Form.PasswordField} React component.
|
|
1077
|
+
*
|
|
1078
|
+
* @category User Interface
|
|
1079
|
+
* @subcategory Form
|
|
1080
|
+
*/
|
|
1081
|
+
export interface FormPasswordFieldProps extends FormItemProps<string> {
|
|
1082
|
+
/**
|
|
1083
|
+
* Placeholder text shown in the password field.
|
|
1084
|
+
*/
|
|
1085
|
+
placeholder?: string;
|
|
1086
|
+
}
|
|
1087
|
+
/**
|
|
1088
|
+
* A form item with a secure text field for password-entry in which the entered characters must be kept secret.
|
|
1089
|
+
*
|
|
1090
|
+
* @example
|
|
1091
|
+
* Uncontrolled password field
|
|
1092
|
+
*
|
|
1093
|
+
* ```typescript
|
|
1094
|
+
*
|
|
1095
|
+
*
|
|
1096
|
+
* export default function Command() {
|
|
1097
|
+
* return (
|
|
1098
|
+
* <Form
|
|
1099
|
+
* actions={
|
|
1100
|
+
* <ActionPanel>
|
|
1101
|
+
* <SubmitFormAction title="Submit Password" onSubmit={(values) => console.log(values)} />
|
|
1102
|
+
* </ActionPanel>
|
|
1103
|
+
* }
|
|
1104
|
+
* >
|
|
1105
|
+
* <Form.PasswordField id="password" title="Enter Password" />
|
|
1106
|
+
* </Form>
|
|
1107
|
+
* );
|
|
1108
|
+
* }
|
|
1109
|
+
* ```
|
|
1110
|
+
*
|
|
1111
|
+
* @example
|
|
1112
|
+
* Controlled password field
|
|
1113
|
+
*
|
|
1114
|
+
* ```typescript
|
|
1115
|
+
*
|
|
1116
|
+
*
|
|
1117
|
+
*
|
|
1118
|
+
* export default function Command() {
|
|
1119
|
+
* const [password, setPassword] = useState<string>();
|
|
1120
|
+
*
|
|
1121
|
+
* return (
|
|
1122
|
+
* <Form
|
|
1123
|
+
* actions={
|
|
1124
|
+
* <ActionPanel>
|
|
1125
|
+
* <SubmitFormAction title="Submit Password" onSubmit={(values) => console.log(values)} />
|
|
1126
|
+
* </ActionPanel>
|
|
1127
|
+
* }
|
|
1128
|
+
* >
|
|
1129
|
+
* <Form.PasswordField id="password" value={password} onChange={setPassword} />
|
|
1130
|
+
* </Form>
|
|
1131
|
+
* );
|
|
1132
|
+
* }
|
|
1133
|
+
* ```
|
|
1134
|
+
*
|
|
1135
|
+
* @category User Interface
|
|
1136
|
+
* @subcategory Form
|
|
1137
|
+
*/
|
|
1138
|
+
export function FormPasswordField(props: FormPasswordFieldProps): ReactElement<FormPasswordFieldProps>;
|
|
1139
|
+
export namespace FormPasswordField {
|
|
1140
|
+
var propTypes: {
|
|
1141
|
+
id: PropTypes.Validator<string>;
|
|
1142
|
+
title: PropTypes.Requireable<string>;
|
|
1143
|
+
storeValue: PropTypes.Requireable<boolean>;
|
|
1144
|
+
value: PropTypes.Requireable<string>;
|
|
1145
|
+
defaultValue: PropTypes.Requireable<string>;
|
|
1146
|
+
placeholder: PropTypes.Requireable<string>;
|
|
1147
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1148
|
+
};
|
|
1149
|
+
var displayName: string;
|
|
1150
|
+
}
|
|
1051
1151
|
/**
|
|
1052
1152
|
* Props of the {@link Form.TextArea} React component.
|
|
1053
1153
|
*
|
|
@@ -1071,7 +1171,7 @@ export interface FormTextAreaProps extends FormItemProps<string> {
|
|
|
1071
1171
|
*
|
|
1072
1172
|
*
|
|
1073
1173
|
* const DESCRIPTION =
|
|
1074
|
-
* "We spend too much time
|
|
1174
|
+
* "We spend too much time staring at loading indicators. The Raycast team is dedicated to make everybody interact faster with their computers.";
|
|
1075
1175
|
*
|
|
1076
1176
|
* export default function Command() {
|
|
1077
1177
|
* return (
|
|
@@ -1327,6 +1427,58 @@ export interface FormDropdownProps extends FormItemProps<string> {
|
|
|
1327
1427
|
*/
|
|
1328
1428
|
children?: ReactElement<FormDropdownSectionProps> | Array<ReactElement<FormDropdownSectionProps>> | ReactElement<FormDropdownItemProps> | Array<ReactElement<FormDropdownItemProps>> | null;
|
|
1329
1429
|
}
|
|
1430
|
+
/**
|
|
1431
|
+
* Props of the {@link Form.Label} React component.
|
|
1432
|
+
*
|
|
1433
|
+
* @category User Interface
|
|
1434
|
+
* @subcategory Form
|
|
1435
|
+
*/
|
|
1436
|
+
export interface FormDescriptionProps {
|
|
1437
|
+
/**
|
|
1438
|
+
* The display title of the left side from the description item.
|
|
1439
|
+
*/
|
|
1440
|
+
title?: string;
|
|
1441
|
+
/**
|
|
1442
|
+
* Text that will be displayed in the middle.
|
|
1443
|
+
*/
|
|
1444
|
+
text: string;
|
|
1445
|
+
}
|
|
1446
|
+
/**
|
|
1447
|
+
* A form item with a simple text label.
|
|
1448
|
+
*
|
|
1449
|
+
* @remark Do *not* use this component to show validation messages for other form fields.
|
|
1450
|
+
*
|
|
1451
|
+
* @example
|
|
1452
|
+
* Label
|
|
1453
|
+
*
|
|
1454
|
+
* ```typescript
|
|
1455
|
+
*
|
|
1456
|
+
*
|
|
1457
|
+
* export default function Command() {
|
|
1458
|
+
* return (
|
|
1459
|
+
* <Form
|
|
1460
|
+
* actions={
|
|
1461
|
+
* <ActionPanel>
|
|
1462
|
+
* <SubmitFormAction title="Submit" onSubmit={(values) => console.log(values)} />
|
|
1463
|
+
* </ActionPanel>
|
|
1464
|
+
* }
|
|
1465
|
+
* >
|
|
1466
|
+
* <Form.Description title="Import / Export" text="Exporting will back-up your preferences, quicklinks, snippets, floating notes, script-command folder paths, aliases, hotkeys, favorites and other data." />
|
|
1467
|
+
* </Form>
|
|
1468
|
+
* );
|
|
1469
|
+
* }
|
|
1470
|
+
* ```
|
|
1471
|
+
*
|
|
1472
|
+
* @category User Interface
|
|
1473
|
+
* @subcategory Form
|
|
1474
|
+
*/
|
|
1475
|
+
export function FormDescription(props: FormDescriptionProps): ReactElement<FormDescriptionProps>;
|
|
1476
|
+
export namespace FormDescription {
|
|
1477
|
+
var propTypes: {
|
|
1478
|
+
text: PropTypes.Requireable<string>;
|
|
1479
|
+
};
|
|
1480
|
+
var displayName: string;
|
|
1481
|
+
}
|
|
1330
1482
|
/**
|
|
1331
1483
|
* A form item with a dropdown menu.
|
|
1332
1484
|
*
|
|
@@ -2739,7 +2891,7 @@ export interface Preference {
|
|
|
2739
2891
|
/**
|
|
2740
2892
|
* The type of the preference.
|
|
2741
2893
|
*/
|
|
2742
|
-
type: "
|
|
2894
|
+
type: "appPicker" | "checkbox" | "dropdown" | "password" | "textfield";
|
|
2743
2895
|
/**
|
|
2744
2896
|
* Specifies if the preference is required.
|
|
2745
2897
|
*
|
|
@@ -2772,6 +2924,7 @@ export interface Preference {
|
|
|
2772
2924
|
/**
|
|
2773
2925
|
* The default value of the preference if there is no `value` specified.
|
|
2774
2926
|
* For dropdowns, this references the `value` property of an object in the data array.
|
|
2927
|
+
* For app pickers, this references an application name, bundleId or path."
|
|
2775
2928
|
*/
|
|
2776
2929
|
default?: unknown;
|
|
2777
2930
|
/**
|