@raycast/api 1.32.1 → 1.33.2
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 +1649 -909
package/types/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
|
|
3
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
4
|
+
import { FunctionComponent } from 'react';
|
|
3
5
|
import { PathLike } from 'fs';
|
|
4
6
|
import PropTypes from 'prop-types';
|
|
5
|
-
import { default as React_2 } from 'react';
|
|
6
7
|
import { ReactElement } from 'react';
|
|
7
8
|
import { ReactNode } from 'react';
|
|
9
|
+
import { RefAttributes } from 'react';
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* A context-specific action that can be performed by the user.
|
|
@@ -43,22 +45,22 @@ export declare namespace Action {
|
|
|
43
45
|
title: PropTypes.Validator<string>;
|
|
44
46
|
icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
45
47
|
fileIcon: PropTypes.Validator<string>;
|
|
46
|
-
}>> | PropTypes.InferProps<{
|
|
47
|
-
source: PropTypes.
|
|
48
|
+
}>> | Required<PropTypes.InferProps<{
|
|
49
|
+
source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
|
|
48
50
|
light: PropTypes.Validator<string>;
|
|
49
51
|
dark: PropTypes.Validator<string>;
|
|
50
|
-
}
|
|
51
|
-
fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
52
|
+
}>>>;
|
|
53
|
+
fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
52
54
|
light: PropTypes.Validator<string>;
|
|
53
55
|
dark: PropTypes.Validator<string>;
|
|
54
|
-
}
|
|
56
|
+
}>>>;
|
|
55
57
|
mask: PropTypes.Requireable<Image.Mask>;
|
|
56
|
-
tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
58
|
+
tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
57
59
|
light: PropTypes.Validator<string>;
|
|
58
60
|
dark: PropTypes.Validator<string>;
|
|
59
61
|
adjustContrast: PropTypes.Requireable<boolean>;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
+
}>>>;
|
|
63
|
+
}>>>;
|
|
62
64
|
shortcut: PropTypes.Requireable<Required<PropTypes.InferProps<{
|
|
63
65
|
modifiers: PropTypes.Validator<string[]>;
|
|
64
66
|
key: PropTypes.Validator<string>;
|
|
@@ -668,29 +670,29 @@ export declare namespace ActionPanel {
|
|
|
668
670
|
}
|
|
669
671
|
|
|
670
672
|
/**
|
|
671
|
-
* @deprecated Use
|
|
673
|
+
* @deprecated Use {@link ActionPanel.Children} instead.
|
|
672
674
|
*/
|
|
673
675
|
export declare type ActionPanelChildren = ActionPanel.Children;
|
|
674
676
|
|
|
675
677
|
/**
|
|
676
|
-
* @deprecated Use
|
|
678
|
+
* @deprecated Use {@link Action} instead.
|
|
677
679
|
*/
|
|
678
680
|
export declare const ActionPanelItem: typeof Action;
|
|
679
681
|
|
|
680
682
|
/**
|
|
681
|
-
* @deprecated Use
|
|
683
|
+
* @deprecated Use {@link Action.Props} instead.
|
|
682
684
|
*/
|
|
683
685
|
export declare interface ActionPanelItemProps extends Action.Props {
|
|
684
686
|
}
|
|
685
687
|
|
|
686
688
|
/**
|
|
687
|
-
* @deprecated Use
|
|
689
|
+
* @deprecated Use {@link ActionPanel.Props} instead.
|
|
688
690
|
*/
|
|
689
691
|
export declare interface ActionPanelProps extends ActionPanel.Props {
|
|
690
692
|
}
|
|
691
693
|
|
|
692
694
|
/**
|
|
693
|
-
* @deprecated Use
|
|
695
|
+
* @deprecated Use {@link ActionPanel.Section} instead.
|
|
694
696
|
*/
|
|
695
697
|
export declare const ActionPanelSection: typeof ActionPanel.Section;
|
|
696
698
|
|
|
@@ -707,12 +709,12 @@ declare namespace ActionPanelSection_2 {
|
|
|
707
709
|
}
|
|
708
710
|
|
|
709
711
|
/**
|
|
710
|
-
* @deprecated Use
|
|
712
|
+
* @deprecated Use {@link ActionPanel.Section.Children} instead.
|
|
711
713
|
*/
|
|
712
714
|
export declare type ActionPanelSectionChildren = ActionPanel.Section.Children;
|
|
713
715
|
|
|
714
716
|
/**
|
|
715
|
-
* @deprecated Use
|
|
717
|
+
* @deprecated Use {@link ActionPanel.Section.Props} instead.
|
|
716
718
|
*/
|
|
717
719
|
export declare interface ActionPanelSectionProps extends ActionPanel.Section.Props {
|
|
718
720
|
}
|
|
@@ -728,7 +730,7 @@ export declare interface ActionPanelState {
|
|
|
728
730
|
}
|
|
729
731
|
|
|
730
732
|
/**
|
|
731
|
-
* @deprecated Use
|
|
733
|
+
* @deprecated Use {@link ActionPanel.Submenu} instead.
|
|
732
734
|
*/
|
|
733
735
|
export declare const ActionPanelSubmenu: typeof ActionPanel.Submenu;
|
|
734
736
|
|
|
@@ -743,22 +745,22 @@ declare namespace ActionPanelSubmenu_2 {
|
|
|
743
745
|
title: PropTypes.Validator<string>;
|
|
744
746
|
icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
745
747
|
fileIcon: PropTypes.Validator<string>;
|
|
746
|
-
}>> | PropTypes.InferProps<{
|
|
747
|
-
source: PropTypes.
|
|
748
|
+
}>> | Required<PropTypes.InferProps<{
|
|
749
|
+
source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
|
|
748
750
|
light: PropTypes.Validator<string>;
|
|
749
751
|
dark: PropTypes.Validator<string>;
|
|
750
|
-
}
|
|
751
|
-
fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
752
|
+
}>>>;
|
|
753
|
+
fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
752
754
|
light: PropTypes.Validator<string>;
|
|
753
755
|
dark: PropTypes.Validator<string>;
|
|
754
|
-
}
|
|
756
|
+
}>>>;
|
|
755
757
|
mask: PropTypes.Requireable<Image.Mask>;
|
|
756
|
-
tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
758
|
+
tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
757
759
|
light: PropTypes.Validator<string>;
|
|
758
760
|
dark: PropTypes.Validator<string>;
|
|
759
761
|
adjustContrast: PropTypes.Requireable<boolean>;
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
+
}>>>;
|
|
763
|
+
}>>>;
|
|
762
764
|
shortcut: PropTypes.Requireable<Required<PropTypes.InferProps<{
|
|
763
765
|
modifiers: PropTypes.Validator<string[]>;
|
|
764
766
|
key: PropTypes.Validator<string>;
|
|
@@ -768,7 +770,7 @@ declare namespace ActionPanelSubmenu_2 {
|
|
|
768
770
|
}
|
|
769
771
|
|
|
770
772
|
/**
|
|
771
|
-
* @deprecated Use
|
|
773
|
+
* @deprecated Use {@link ActionPanel.Submenu.Props} instead.
|
|
772
774
|
*/
|
|
773
775
|
export declare interface ActionPanelSubmenuProps extends ActionPanel.Submenu.Props {
|
|
774
776
|
}
|
|
@@ -862,24 +864,24 @@ export declare namespace Alert {
|
|
|
862
864
|
}
|
|
863
865
|
|
|
864
866
|
/**
|
|
865
|
-
* @deprecated Use
|
|
867
|
+
* @deprecated Use {@link Alert.ActionOptions} instead
|
|
866
868
|
*/
|
|
867
869
|
export declare interface AlertActionOptions extends Alert.ActionOptions {
|
|
868
870
|
}
|
|
869
871
|
|
|
870
872
|
/**
|
|
871
|
-
* @deprecated Use
|
|
873
|
+
* @deprecated Use {@link Alert.ActionStyle} instead
|
|
872
874
|
*/
|
|
873
875
|
export declare const AlertActionStyle: typeof Alert.ActionStyle;
|
|
874
876
|
|
|
875
877
|
/**
|
|
876
|
-
* @deprecated Use
|
|
878
|
+
* @deprecated Use {@link Alert.Options} instead
|
|
877
879
|
*/
|
|
878
880
|
export declare interface AlertOptions extends Alert.Options {
|
|
879
881
|
}
|
|
880
882
|
|
|
881
883
|
/**
|
|
882
|
-
* @deprecated Use
|
|
884
|
+
* @deprecated Use {@link LocalStorage.allItems} instead
|
|
883
885
|
*/
|
|
884
886
|
export declare const allLocalStorageItems: typeof LocalStorage.allItems;
|
|
885
887
|
|
|
@@ -906,12 +908,32 @@ export declare interface Application {
|
|
|
906
908
|
}
|
|
907
909
|
|
|
908
910
|
/**
|
|
909
|
-
* @
|
|
911
|
+
* See {@link Form.Checkbox}
|
|
912
|
+
*/
|
|
913
|
+
declare const Checkbox: ForwardRefExoticComponent<CheckboxProps & RefAttributes<CheckboxRef>>;
|
|
914
|
+
|
|
915
|
+
/**
|
|
916
|
+
* See {@link Form.Checkbox.Props}
|
|
917
|
+
*/
|
|
918
|
+
declare interface CheckboxProps extends FormItemProps_2<boolean> {
|
|
919
|
+
/**
|
|
920
|
+
* The label displayed on the right side of the checkbox.
|
|
921
|
+
*/
|
|
922
|
+
label: string;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* Form.Checkbox Ref type.
|
|
927
|
+
*/
|
|
928
|
+
declare type CheckboxRef = FormItemRef;
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* @deprecated Use {@link Clipboard.clear} instead
|
|
910
932
|
*/
|
|
911
933
|
export declare const clearClipboard: typeof Clipboard.clear;
|
|
912
934
|
|
|
913
935
|
/**
|
|
914
|
-
* @deprecated Use
|
|
936
|
+
* @deprecated Use {@link LocalStorage.clear} instead
|
|
915
937
|
*/
|
|
916
938
|
export declare const clearLocalStorage: typeof LocalStorage.clear;
|
|
917
939
|
|
|
@@ -1117,7 +1139,7 @@ export declare namespace Color {
|
|
|
1117
1139
|
*
|
|
1118
1140
|
* @defaultValue false
|
|
1119
1141
|
*/
|
|
1120
|
-
adjustContrast?: boolean;
|
|
1142
|
+
adjustContrast?: boolean | undefined | null;
|
|
1121
1143
|
}
|
|
1122
1144
|
/**
|
|
1123
1145
|
* You can use any of the following color formats:
|
|
@@ -1132,7 +1154,7 @@ export declare namespace Color {
|
|
|
1132
1154
|
}
|
|
1133
1155
|
|
|
1134
1156
|
/**
|
|
1135
|
-
* @deprecated Use
|
|
1157
|
+
* @deprecated Use {@link Color.ColorLike} instead
|
|
1136
1158
|
*/
|
|
1137
1159
|
export declare type ColorLike = Color.ColorLike;
|
|
1138
1160
|
|
|
@@ -1157,12 +1179,12 @@ export declare type ColorLike = Color.ColorLike;
|
|
|
1157
1179
|
export declare function confirmAlert(options: Alert.Options): Promise<boolean>;
|
|
1158
1180
|
|
|
1159
1181
|
/**
|
|
1160
|
-
* @deprecated Use
|
|
1182
|
+
* @deprecated Use {@link Clipboard.copy} instead
|
|
1161
1183
|
*/
|
|
1162
1184
|
export declare const copyTextToClipboard: typeof Clipboard.copy;
|
|
1163
1185
|
|
|
1164
1186
|
/**
|
|
1165
|
-
* @deprecated Use
|
|
1187
|
+
* @deprecated Use {@link Action.CopyToClipboard} instead.
|
|
1166
1188
|
*/
|
|
1167
1189
|
export declare const CopyToClipboardAction: CopyToClipboardAction_2;
|
|
1168
1190
|
|
|
@@ -1176,7 +1198,7 @@ declare namespace CopyToClipboardAction_2 {
|
|
|
1176
1198
|
}
|
|
1177
1199
|
|
|
1178
1200
|
/**
|
|
1179
|
-
* @deprecated Use
|
|
1201
|
+
* @deprecated Use {@link Action.CopyToClipboard.Props} instead.
|
|
1180
1202
|
*/
|
|
1181
1203
|
export declare interface CopyToClipboardActionProps extends Action.CopyToClipboard.Props {
|
|
1182
1204
|
}
|
|
@@ -1212,8 +1234,6 @@ declare interface CopyToClipboardActionProps_2 {
|
|
|
1212
1234
|
onCopy?: (content: string | number) => void;
|
|
1213
1235
|
}
|
|
1214
1236
|
|
|
1215
|
-
/* Excluded from this release type: createQuicklink */
|
|
1216
|
-
|
|
1217
1237
|
/**
|
|
1218
1238
|
* See {@link Action.CreateQuicklink}
|
|
1219
1239
|
*/
|
|
@@ -1242,8 +1262,6 @@ declare interface CreateQuicklinkProps {
|
|
|
1242
1262
|
shortcut?: Keyboard.Shortcut;
|
|
1243
1263
|
}
|
|
1244
1264
|
|
|
1245
|
-
/* Excluded from this release type: createSnippet */
|
|
1246
|
-
|
|
1247
1265
|
/**
|
|
1248
1266
|
* See {@link Action.CreateQuicklink}
|
|
1249
1267
|
*/
|
|
@@ -1269,6 +1287,89 @@ declare interface CreateSnippetProps {
|
|
|
1269
1287
|
shortcut?: Keyboard.Shortcut;
|
|
1270
1288
|
}
|
|
1271
1289
|
|
|
1290
|
+
/**
|
|
1291
|
+
* See {@link Form.DatePicker}
|
|
1292
|
+
*/
|
|
1293
|
+
declare const DatePicker: ForwardRefExoticComponent<DatePickerProps & RefAttributes<FormItemRef>> & {
|
|
1294
|
+
/**
|
|
1295
|
+
* The types of date components the user can pick
|
|
1296
|
+
* * `Date` - only year, month, and day can be picked
|
|
1297
|
+
* * `DateTime` - hour and second can be picked in addition to year, month and day
|
|
1298
|
+
*/
|
|
1299
|
+
Type: typeof FormDatePickerType;
|
|
1300
|
+
};
|
|
1301
|
+
|
|
1302
|
+
declare interface DatePickerProps extends FormItemProps_2<Date> {
|
|
1303
|
+
/**
|
|
1304
|
+
* Indicates what types of date components can be picked
|
|
1305
|
+
*
|
|
1306
|
+
* Defaults to {@link FormDatePickerType.DateTime}
|
|
1307
|
+
*/
|
|
1308
|
+
type?: FormDatePickerType;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
/**
|
|
1312
|
+
* Form.DatePicker Ref type.
|
|
1313
|
+
*/
|
|
1314
|
+
declare type DatePickerRef = FormItemRef;
|
|
1315
|
+
|
|
1316
|
+
declare interface DeprecatedFormItems {
|
|
1317
|
+
/**
|
|
1318
|
+
* @deprecated Use {@link Form.Dropdown.Section} instead.
|
|
1319
|
+
*/
|
|
1320
|
+
DropdownSection: typeof DropdownSection;
|
|
1321
|
+
/**
|
|
1322
|
+
* @deprecated Use {@link Form.Dropdown.Item} instead.
|
|
1323
|
+
*/
|
|
1324
|
+
DropdownItem: typeof DropdownItem;
|
|
1325
|
+
/**
|
|
1326
|
+
* @deprecated Use {@link Form.TagPicker.Item} instead.
|
|
1327
|
+
*/
|
|
1328
|
+
TagPickerItem: typeof TagPickerItem;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
/**
|
|
1332
|
+
* A form item with a simple text label.
|
|
1333
|
+
*
|
|
1334
|
+
* _Do **not** use this component to show validation messages for other form fields._
|
|
1335
|
+
*
|
|
1336
|
+
* @example
|
|
1337
|
+
* Label
|
|
1338
|
+
*
|
|
1339
|
+
* ```typescript
|
|
1340
|
+
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
1341
|
+
*
|
|
1342
|
+
* export default function Command() {
|
|
1343
|
+
* return (
|
|
1344
|
+
* <Form
|
|
1345
|
+
* actions={
|
|
1346
|
+
* <ActionPanel>
|
|
1347
|
+
* <Action.SubmitForm title="Submit" onSubmit={(values) => console.log(values)} />
|
|
1348
|
+
* </ActionPanel>
|
|
1349
|
+
* }
|
|
1350
|
+
* >
|
|
1351
|
+
* <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." />
|
|
1352
|
+
* </Form>
|
|
1353
|
+
* );
|
|
1354
|
+
* }
|
|
1355
|
+
* ```
|
|
1356
|
+
*/
|
|
1357
|
+
declare const Description: FunctionComponent<DescriptionProps>;
|
|
1358
|
+
|
|
1359
|
+
/**
|
|
1360
|
+
* Props of the {@link Form.Description} React component.
|
|
1361
|
+
*/
|
|
1362
|
+
declare interface DescriptionProps {
|
|
1363
|
+
/**
|
|
1364
|
+
* The display title of the left side from the description item.
|
|
1365
|
+
*/
|
|
1366
|
+
title?: string;
|
|
1367
|
+
/**
|
|
1368
|
+
* Text that will be displayed in the middle.
|
|
1369
|
+
*/
|
|
1370
|
+
text: string;
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1272
1373
|
/**
|
|
1273
1374
|
* Renders a markdown (CommonMark) string.
|
|
1274
1375
|
*
|
|
@@ -1308,7 +1409,7 @@ export declare namespace Detail {
|
|
|
1308
1409
|
/**
|
|
1309
1410
|
* The `Detail.Metadata` to be rendered in the right side area
|
|
1310
1411
|
*/
|
|
1311
|
-
metadata?:
|
|
1412
|
+
metadata?: ReactNode;
|
|
1312
1413
|
}
|
|
1313
1414
|
/**
|
|
1314
1415
|
* A Metadata view that will be shown in the right-hand-side of the `Detail`.
|
|
@@ -1324,7 +1425,7 @@ export declare namespace Detail {
|
|
|
1324
1425
|
/**
|
|
1325
1426
|
* The Detail.Metadata.Item elements of the Metadata view.
|
|
1326
1427
|
*/
|
|
1327
|
-
children:
|
|
1428
|
+
children: ReactNode;
|
|
1328
1429
|
}
|
|
1329
1430
|
/**
|
|
1330
1431
|
* Props of the Detail.Metadata.Item React component.
|
|
@@ -1444,22 +1545,22 @@ declare namespace DetailMetadataLabel {
|
|
|
1444
1545
|
title: PropTypes.Validator<string>;
|
|
1445
1546
|
icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
1446
1547
|
fileIcon: PropTypes.Validator<string>;
|
|
1447
|
-
}>> | PropTypes.InferProps<{
|
|
1448
|
-
source: PropTypes.
|
|
1548
|
+
}>> | Required<PropTypes.InferProps<{
|
|
1549
|
+
source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
|
|
1449
1550
|
light: PropTypes.Validator<string>;
|
|
1450
1551
|
dark: PropTypes.Validator<string>;
|
|
1451
|
-
}
|
|
1452
|
-
fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
1552
|
+
}>>>;
|
|
1553
|
+
fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
1453
1554
|
light: PropTypes.Validator<string>;
|
|
1454
1555
|
dark: PropTypes.Validator<string>;
|
|
1455
|
-
}
|
|
1556
|
+
}>>>;
|
|
1456
1557
|
mask: PropTypes.Requireable<Image.Mask>;
|
|
1457
|
-
tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
1558
|
+
tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
1458
1559
|
light: PropTypes.Validator<string>;
|
|
1459
1560
|
dark: PropTypes.Validator<string>;
|
|
1460
1561
|
adjustContrast: PropTypes.Requireable<boolean>;
|
|
1461
|
-
}
|
|
1462
|
-
}
|
|
1562
|
+
}>>>;
|
|
1563
|
+
}>>>;
|
|
1463
1564
|
text: PropTypes.Requireable<string>;
|
|
1464
1565
|
};
|
|
1465
1566
|
var displayName: string;
|
|
@@ -1519,39 +1620,163 @@ declare namespace DetailMetadataTagListItem {
|
|
|
1519
1620
|
text: PropTypes.Validator<string>;
|
|
1520
1621
|
icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
1521
1622
|
fileIcon: PropTypes.Validator<string>;
|
|
1522
|
-
}>> | PropTypes.InferProps<{
|
|
1523
|
-
source: PropTypes.
|
|
1623
|
+
}>> | Required<PropTypes.InferProps<{
|
|
1624
|
+
source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
|
|
1524
1625
|
light: PropTypes.Validator<string>;
|
|
1525
1626
|
dark: PropTypes.Validator<string>;
|
|
1526
|
-
}
|
|
1527
|
-
fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
1627
|
+
}>>>;
|
|
1628
|
+
fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
1528
1629
|
light: PropTypes.Validator<string>;
|
|
1529
1630
|
dark: PropTypes.Validator<string>;
|
|
1530
|
-
}
|
|
1631
|
+
}>>>;
|
|
1531
1632
|
mask: PropTypes.Requireable<Image.Mask>;
|
|
1532
|
-
tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
1633
|
+
tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
1533
1634
|
light: PropTypes.Validator<string>;
|
|
1534
1635
|
dark: PropTypes.Validator<string>;
|
|
1535
1636
|
adjustContrast: PropTypes.Requireable<boolean>;
|
|
1536
|
-
}
|
|
1537
|
-
}
|
|
1538
|
-
color: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
1637
|
+
}>>>;
|
|
1638
|
+
}>>>;
|
|
1639
|
+
color: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
1539
1640
|
light: PropTypes.Validator<string>;
|
|
1540
1641
|
dark: PropTypes.Validator<string>;
|
|
1541
1642
|
adjustContrast: PropTypes.Requireable<boolean>;
|
|
1542
|
-
}
|
|
1643
|
+
}>>>;
|
|
1543
1644
|
};
|
|
1544
1645
|
var displayName: string;
|
|
1545
1646
|
}
|
|
1546
1647
|
|
|
1547
1648
|
/**
|
|
1548
|
-
* @deprecated Use
|
|
1649
|
+
* @deprecated Use {@link Detail.Props} instead.
|
|
1549
1650
|
*/
|
|
1550
1651
|
export declare interface DetailProps extends Detail.Props {
|
|
1551
1652
|
}
|
|
1552
1653
|
|
|
1553
1654
|
/**
|
|
1554
|
-
* @
|
|
1655
|
+
* See {@link Form.Dropdown}
|
|
1656
|
+
*/
|
|
1657
|
+
declare const Dropdown: ForwardRefExoticComponent<DropdownProps & RefAttributes<FormItemRef>> & {
|
|
1658
|
+
/**
|
|
1659
|
+
* Visually separated group of dropdown items.
|
|
1660
|
+
*
|
|
1661
|
+
* @remarks
|
|
1662
|
+
* Use sections to group related menu items together.
|
|
1663
|
+
*
|
|
1664
|
+
* @example
|
|
1665
|
+
* ```typescript
|
|
1666
|
+
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
1667
|
+
*
|
|
1668
|
+
* export default function Command() {
|
|
1669
|
+
* return (
|
|
1670
|
+
* <Form
|
|
1671
|
+
* actions={
|
|
1672
|
+
* <ActionPanel>
|
|
1673
|
+
* <Action.SubmitForm title="Submit Favorite" onSubmit={(values) => console.log(values)} />
|
|
1674
|
+
* </ActionPanel>
|
|
1675
|
+
* }
|
|
1676
|
+
* >
|
|
1677
|
+
* <Form.Dropdown id="food" title="Favorite Food">
|
|
1678
|
+
* <Form.Dropdown.Section title="Fruits">
|
|
1679
|
+
* <Form.Dropdown.Item value="apple" title="Apple" icon="🍎" />
|
|
1680
|
+
* <Form.Dropdown.Item value="banana" title="Banana" icon="🍌" />
|
|
1681
|
+
* </Form.Dropdown.Section>
|
|
1682
|
+
* <Form.Dropdown.Section title="Vegetables">
|
|
1683
|
+
* <Form.Dropdown.Item value="broccoli" title="Broccoli" icon="🥦" />
|
|
1684
|
+
* <Form.Dropdown.Item value="carrot" title="Carrot" icon="🥕" />
|
|
1685
|
+
* </Form.Dropdown.Section>
|
|
1686
|
+
* </Form.Dropdown>
|
|
1687
|
+
* </Form>
|
|
1688
|
+
* );
|
|
1689
|
+
* }
|
|
1690
|
+
* ```
|
|
1691
|
+
*/
|
|
1692
|
+
Section: typeof DropdownSection;
|
|
1693
|
+
/**
|
|
1694
|
+
* A dropdown item in a {@link DropdownRef}
|
|
1695
|
+
*
|
|
1696
|
+
* @example
|
|
1697
|
+
* ```typescript
|
|
1698
|
+
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
1699
|
+
*
|
|
1700
|
+
* export default function Command() {
|
|
1701
|
+
* return (
|
|
1702
|
+
* <Form
|
|
1703
|
+
* actions={
|
|
1704
|
+
* <ActionPanel>
|
|
1705
|
+
* <Action.SubmitForm title="Submit Icon" onSubmit={(values) => console.log(values)} />
|
|
1706
|
+
* </ActionPanel>
|
|
1707
|
+
* }
|
|
1708
|
+
* >
|
|
1709
|
+
* <Form.Dropdown id="icon" title="Icon">
|
|
1710
|
+
* <Form.Dropdown.Item value="circle" title="Cirlce" icon={Icon.Circle} />
|
|
1711
|
+
* </Form.Dropdown>
|
|
1712
|
+
* </Form>
|
|
1713
|
+
* );
|
|
1714
|
+
* }
|
|
1715
|
+
* ```
|
|
1716
|
+
*/
|
|
1717
|
+
Item: typeof DropdownItem;
|
|
1718
|
+
};
|
|
1719
|
+
|
|
1720
|
+
/**
|
|
1721
|
+
* See {@link Form.Dropdown.Item}
|
|
1722
|
+
*/
|
|
1723
|
+
declare const DropdownItem: FunctionComponent<DropdownItemProps>;
|
|
1724
|
+
|
|
1725
|
+
/**
|
|
1726
|
+
* See {@link Form.Dropdown.Item.Props}
|
|
1727
|
+
*/
|
|
1728
|
+
declare interface DropdownItemProps {
|
|
1729
|
+
/**
|
|
1730
|
+
* Value of the dropdown item.
|
|
1731
|
+
* Make sure to assign each unique value for each item.
|
|
1732
|
+
*/
|
|
1733
|
+
value: string;
|
|
1734
|
+
/**
|
|
1735
|
+
* The title displayed for the item.
|
|
1736
|
+
*/
|
|
1737
|
+
title: string;
|
|
1738
|
+
/**
|
|
1739
|
+
* A optional icon displayed for the item.
|
|
1740
|
+
*/
|
|
1741
|
+
icon?: Image.ImageLike;
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
/**
|
|
1745
|
+
* See {@link Form.Dropdown.Props}
|
|
1746
|
+
*/
|
|
1747
|
+
declare interface DropdownProps extends FormItemProps_2<string> {
|
|
1748
|
+
/**
|
|
1749
|
+
* Sections or items. If {@link DropdownItem} elements are specified, a default section is automatically created.
|
|
1750
|
+
*/
|
|
1751
|
+
children?: ReactNode;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
/**
|
|
1755
|
+
* Form.Dropdown Ref type.
|
|
1756
|
+
*/
|
|
1757
|
+
declare type DropdownRef = FormItemRef;
|
|
1758
|
+
|
|
1759
|
+
/**
|
|
1760
|
+
* See {@link Form.Dropdown.Section}
|
|
1761
|
+
*/
|
|
1762
|
+
declare const DropdownSection: FunctionComponent<DropdownSectionProps>;
|
|
1763
|
+
|
|
1764
|
+
/**
|
|
1765
|
+
* See {@link Form.Dropdown.Section.Props}
|
|
1766
|
+
*/
|
|
1767
|
+
declare interface DropdownSectionProps {
|
|
1768
|
+
/**
|
|
1769
|
+
* The item elements of the section.
|
|
1770
|
+
*/
|
|
1771
|
+
children?: ReactNode;
|
|
1772
|
+
/**
|
|
1773
|
+
* Title displayed above the section
|
|
1774
|
+
*/
|
|
1775
|
+
title?: string;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
/**
|
|
1779
|
+
* @deprecated Use {@link Color.Dynamic} instead
|
|
1555
1780
|
*/
|
|
1556
1781
|
export declare type DynamicColor = Color.Dynamic;
|
|
1557
1782
|
|
|
@@ -1646,387 +1871,705 @@ export declare interface FileSystemItem {
|
|
|
1646
1871
|
/**
|
|
1647
1872
|
* Shows a list of form items such as {@link Form.TextField}, {@link Form.Checkbox} or {@link Form.Dropdown}.
|
|
1648
1873
|
*/
|
|
1649
|
-
export declare
|
|
1650
|
-
|
|
1651
|
-
export declare namespace Form {
|
|
1652
|
-
var propTypes: {
|
|
1653
|
-
submitTitle: PropTypes.Requireable<string>;
|
|
1654
|
-
navigationTitle: PropTypes.Requireable<string>;
|
|
1655
|
-
isLoading: PropTypes.Requireable<boolean>;
|
|
1656
|
-
};
|
|
1657
|
-
var displayName: string;
|
|
1658
|
-
}
|
|
1874
|
+
export declare const Form: FunctionComponent<FormProps_2> & FormItems & DeprecatedFormItems;
|
|
1659
1875
|
|
|
1660
1876
|
export declare namespace Form {
|
|
1877
|
+
export type ItemProps<T extends FormValue_2> = FormItemProps_2<T>;
|
|
1878
|
+
export type Value = FormValue_2;
|
|
1879
|
+
export type Values = FormValues_2;
|
|
1880
|
+
export type Props = FormProps_2;
|
|
1661
1881
|
/**
|
|
1662
|
-
* @
|
|
1663
|
-
|
|
1664
|
-
const DropdownSection: typeof FormDropdownSection_2;
|
|
1665
|
-
/**
|
|
1666
|
-
* @deprecated Use `Form.Dropdown.Item` instead.
|
|
1667
|
-
*/
|
|
1668
|
-
const DropdownItem: typeof FormDropdownItem_2;
|
|
1669
|
-
/**
|
|
1670
|
-
* @deprecated Use `Form.TagPicker.Item` instead.
|
|
1671
|
-
*/
|
|
1672
|
-
const TagPickerItem: typeof FormTagPickerItem_2;
|
|
1673
|
-
/**
|
|
1674
|
-
* A form item with a text field for input.
|
|
1882
|
+
* A Ref Type for the {@link Form.TextField}.
|
|
1883
|
+
* Use refs to control your Form by calling `Form.TextField.focus()` or `Form.TextField.reset()` functions.
|
|
1675
1884
|
*
|
|
1676
1885
|
* @example
|
|
1677
|
-
*
|
|
1886
|
+
* Using Ref to focus {@link Form.TextField}.
|
|
1678
1887
|
*
|
|
1679
1888
|
* ```typescript
|
|
1680
|
-
* import {
|
|
1889
|
+
* import { Form, ActionPanel, Action } from "@raycast/api";
|
|
1890
|
+
* import { useRef } from "react";
|
|
1681
1891
|
*
|
|
1682
1892
|
* export default function Command() {
|
|
1893
|
+
* const textFieldRef = useRef<Form.TextField>(null);
|
|
1894
|
+
*
|
|
1683
1895
|
* return (
|
|
1684
1896
|
* <Form
|
|
1685
1897
|
* actions={
|
|
1686
1898
|
* <ActionPanel>
|
|
1687
|
-
* <Action.SubmitForm
|
|
1899
|
+
* <Action.SubmitForm
|
|
1900
|
+
* title="Submit"
|
|
1901
|
+
* onSubmit={(values) => {
|
|
1902
|
+
* textFieldRef.current?.focus();
|
|
1903
|
+
* console.log("Values", values);
|
|
1904
|
+
* }}
|
|
1905
|
+
* />
|
|
1688
1906
|
* </ActionPanel>
|
|
1689
1907
|
* }
|
|
1690
1908
|
* >
|
|
1691
|
-
* <Form.TextField id="
|
|
1909
|
+
* <Form.TextField id="textField" title="Your Name" placeholder="César" ref={textFieldRef} />
|
|
1910
|
+
* <Form.TextArea id="textArea" title="About" placeholder="Enter something about you" />
|
|
1692
1911
|
* </Form>
|
|
1693
1912
|
* );
|
|
1694
1913
|
* }
|
|
1695
1914
|
* ```
|
|
1696
1915
|
*
|
|
1697
1916
|
* @example
|
|
1698
|
-
*
|
|
1917
|
+
* Using Ref to reset {@link Form.TextField}.
|
|
1699
1918
|
*
|
|
1700
1919
|
* ```typescript
|
|
1701
|
-
* import {
|
|
1702
|
-
* import {
|
|
1920
|
+
* import { Form, ActionPanel, Action } from "@raycast/api";
|
|
1921
|
+
* import { useRef } from "react";
|
|
1703
1922
|
*
|
|
1704
1923
|
* export default function Command() {
|
|
1705
|
-
* const
|
|
1924
|
+
* const textFieldRef = useRef<Form.TextField>(null);
|
|
1706
1925
|
*
|
|
1707
1926
|
* return (
|
|
1708
1927
|
* <Form
|
|
1709
1928
|
* actions={
|
|
1710
1929
|
* <ActionPanel>
|
|
1711
|
-
* <Action.SubmitForm
|
|
1930
|
+
* <Action.SubmitForm
|
|
1931
|
+
* title="Submit"
|
|
1932
|
+
* onSubmit={(values) => {
|
|
1933
|
+
* textFieldRef.current?.reset();
|
|
1934
|
+
* console.log("Values", values);
|
|
1935
|
+
* }}
|
|
1936
|
+
* />
|
|
1712
1937
|
* </ActionPanel>
|
|
1713
1938
|
* }
|
|
1714
1939
|
* >
|
|
1715
|
-
* <Form.TextField id="
|
|
1940
|
+
* <Form.TextField id="textField" title="Your Name" placeholder="César" ref={textFieldRef} />
|
|
1941
|
+
* <Form.TextArea id="textArea" title="About" placeholder="Enter something about you" />
|
|
1716
1942
|
* </Form>
|
|
1717
1943
|
* );
|
|
1718
1944
|
* }
|
|
1719
1945
|
* ```
|
|
1720
1946
|
*/
|
|
1721
|
-
|
|
1947
|
+
export type TextField = TextFieldRef;
|
|
1948
|
+
export namespace TextField {
|
|
1949
|
+
/**
|
|
1950
|
+
* Props of the {@link Form.TextField} React component.
|
|
1951
|
+
*/
|
|
1952
|
+
export type Props = TextFieldProps;
|
|
1953
|
+
}
|
|
1722
1954
|
/**
|
|
1723
|
-
* A
|
|
1724
|
-
*
|
|
1955
|
+
* A Ref Type for the {@link Form.PasswordField}.
|
|
1956
|
+
* Use refs to control your Form by calling `Form.PasswordField.focus()` or `Form.PasswordField.reset()` functions.
|
|
1725
1957
|
*
|
|
1726
1958
|
* @example
|
|
1727
|
-
*
|
|
1959
|
+
* Using Ref to focus {@link Form.PasswordField}.
|
|
1728
1960
|
*
|
|
1729
1961
|
* ```typescript
|
|
1730
|
-
* import {
|
|
1731
|
-
*
|
|
1732
|
-
* const DESCRIPTION =
|
|
1733
|
-
* "We spend too much time staring at loading indicators. The Raycast team is dedicated to make everybody interact faster with their computers.";
|
|
1962
|
+
* import { Form, ActionPanel, Action } from "@raycast/api";
|
|
1963
|
+
* import { useRef } from "react";
|
|
1734
1964
|
*
|
|
1735
1965
|
* export default function Command() {
|
|
1966
|
+
* const passwordFieldRef = useRef<Form.PasswordField>(null);
|
|
1967
|
+
*
|
|
1736
1968
|
* return (
|
|
1737
1969
|
* <Form
|
|
1738
1970
|
* actions={
|
|
1739
1971
|
* <ActionPanel>
|
|
1740
|
-
* <Action.SubmitForm
|
|
1972
|
+
* <Action.SubmitForm
|
|
1973
|
+
* title="Submit"
|
|
1974
|
+
* onSubmit={(values) => {
|
|
1975
|
+
* passwordFieldRef.current?.focus();
|
|
1976
|
+
* console.log("Values", values);
|
|
1977
|
+
* }}
|
|
1978
|
+
* />
|
|
1741
1979
|
* </ActionPanel>
|
|
1742
1980
|
* }
|
|
1743
1981
|
* >
|
|
1744
|
-
* <Form.
|
|
1982
|
+
* <Form.TextField id="textField" title="Your Name" placeholder="César" />
|
|
1983
|
+
* <Form.PasswordField id="passwordField" title="Enter Password" ref={passwordFieldRef} />
|
|
1745
1984
|
* </Form>
|
|
1746
1985
|
* );
|
|
1747
1986
|
* }
|
|
1748
1987
|
* ```
|
|
1749
1988
|
*
|
|
1750
1989
|
* @example
|
|
1751
|
-
*
|
|
1990
|
+
* Using Ref to reset {@link Form.PasswordField}.
|
|
1752
1991
|
*
|
|
1753
1992
|
* ```typescript
|
|
1754
|
-
* import {
|
|
1755
|
-
* import {
|
|
1993
|
+
* import { Form, ActionPanel, Action } from "@raycast/api";
|
|
1994
|
+
* import { useRef } from "react";
|
|
1756
1995
|
*
|
|
1757
1996
|
* export default function Command() {
|
|
1758
|
-
* const
|
|
1997
|
+
* const passwordFieldRef = useRef<Form.PasswordField>(null);
|
|
1759
1998
|
*
|
|
1760
1999
|
* return (
|
|
1761
2000
|
* <Form
|
|
1762
2001
|
* actions={
|
|
1763
2002
|
* <ActionPanel>
|
|
1764
|
-
* <Action.SubmitForm
|
|
2003
|
+
* <Action.SubmitForm
|
|
2004
|
+
* title="Submit"
|
|
2005
|
+
* onSubmit={(values) => {
|
|
2006
|
+
* passwordFieldRef.current?.reset();
|
|
2007
|
+
* console.log("Values", values);
|
|
2008
|
+
* }}
|
|
2009
|
+
* />
|
|
1765
2010
|
* </ActionPanel>
|
|
1766
2011
|
* }
|
|
1767
2012
|
* >
|
|
1768
|
-
* <Form.
|
|
2013
|
+
* <Form.TextField id="textField" title="Your Name" placeholder="César" ref={passwordFieldRef} />
|
|
2014
|
+
* <Form.PasswordField id="passwordField" title="Enter Password" ref={passwordFieldRef} />
|
|
1769
2015
|
* </Form>
|
|
1770
2016
|
* );
|
|
1771
2017
|
* }
|
|
1772
2018
|
* ```
|
|
1773
2019
|
*/
|
|
1774
|
-
|
|
2020
|
+
export type PasswordField = PasswordFieldRef;
|
|
2021
|
+
export namespace PasswordField {
|
|
2022
|
+
/**
|
|
2023
|
+
* Props of the {@link Form.PasswordField} React component.
|
|
2024
|
+
*/
|
|
2025
|
+
export type Props = PasswordFieldProps;
|
|
2026
|
+
}
|
|
1775
2027
|
/**
|
|
1776
|
-
* A
|
|
2028
|
+
* A Ref Type for the {@link Form.TextArea}.
|
|
2029
|
+
* Use refs to control your Form by calling `Form.TextArea.focus()` or `Form.TextArea.reset()` functions.
|
|
1777
2030
|
*
|
|
1778
2031
|
* @example
|
|
1779
|
-
*
|
|
2032
|
+
* Using Ref to focus {@link Form.TextArea}.
|
|
1780
2033
|
*
|
|
1781
2034
|
* ```typescript
|
|
1782
|
-
* import {
|
|
2035
|
+
* import { Form, ActionPanel, Action } from "@raycast/api";
|
|
2036
|
+
* import { useRef } from "react";
|
|
1783
2037
|
*
|
|
1784
2038
|
* export default function Command() {
|
|
2039
|
+
* const textAreaRef = useRef<Form.TextArea>(null);
|
|
2040
|
+
*
|
|
1785
2041
|
* return (
|
|
1786
2042
|
* <Form
|
|
1787
2043
|
* actions={
|
|
1788
2044
|
* <ActionPanel>
|
|
1789
|
-
* <Action.SubmitForm
|
|
2045
|
+
* <Action.SubmitForm
|
|
2046
|
+
* title="Submit"
|
|
2047
|
+
* onSubmit={(values) => {
|
|
2048
|
+
* textAreaRef.current?.focus();
|
|
2049
|
+
* console.log("Values", values);
|
|
2050
|
+
* }}
|
|
2051
|
+
* />
|
|
1790
2052
|
* </ActionPanel>
|
|
1791
2053
|
* }
|
|
1792
2054
|
* >
|
|
1793
|
-
* <Form.
|
|
2055
|
+
* <Form.TextField id="textField" title="Your Name" placeholder="César" />
|
|
2056
|
+
* <Form.TextArea id="textArea" title="About" placeholder="Enter something about you" ref={textAreaRef} />
|
|
1794
2057
|
* </Form>
|
|
1795
2058
|
* );
|
|
1796
2059
|
* }
|
|
1797
2060
|
* ```
|
|
1798
2061
|
*
|
|
1799
2062
|
* @example
|
|
1800
|
-
*
|
|
2063
|
+
* Using Ref to reset {@link Form.TextArea}.
|
|
1801
2064
|
*
|
|
1802
2065
|
* ```typescript
|
|
1803
|
-
* import {
|
|
1804
|
-
* import {
|
|
2066
|
+
* import { Form, ActionPanel, Action } from "@raycast/api";
|
|
2067
|
+
* import { useRef } from "react";
|
|
1805
2068
|
*
|
|
1806
2069
|
* export default function Command() {
|
|
1807
|
-
* const
|
|
2070
|
+
* const textAreaRef = useRef<Form.TextArea>(null);
|
|
1808
2071
|
*
|
|
1809
2072
|
* return (
|
|
1810
2073
|
* <Form
|
|
1811
2074
|
* actions={
|
|
1812
2075
|
* <ActionPanel>
|
|
1813
|
-
* <Action.SubmitForm
|
|
2076
|
+
* <Action.SubmitForm
|
|
2077
|
+
* title="Submit"
|
|
2078
|
+
* onSubmit={(values) => {
|
|
2079
|
+
* textAreaRef.current?.reset();
|
|
2080
|
+
* console.log("Values", values);
|
|
2081
|
+
* }}
|
|
2082
|
+
* />
|
|
1814
2083
|
* </ActionPanel>
|
|
1815
2084
|
* }
|
|
1816
2085
|
* >
|
|
1817
|
-
* <Form.
|
|
2086
|
+
* <Form.TextField id="textField" title="Your Name" placeholder="César" />
|
|
2087
|
+
* <Form.TextArea id="textArea" title="About" placeholder="Enter something about you" ref={textAreaRef} />
|
|
1818
2088
|
* </Form>
|
|
1819
2089
|
* );
|
|
1820
2090
|
* }
|
|
1821
2091
|
* ```
|
|
1822
2092
|
*/
|
|
1823
|
-
|
|
2093
|
+
export type TextArea = TextAreaRef;
|
|
2094
|
+
export namespace TextArea {
|
|
2095
|
+
/**
|
|
2096
|
+
* Props of the {@link Form.TextArea} React component.
|
|
2097
|
+
*/
|
|
2098
|
+
export type Props = TextAreaProps;
|
|
2099
|
+
}
|
|
2100
|
+
export namespace Description {
|
|
2101
|
+
/**
|
|
2102
|
+
* Props of the {@link Form.Description} React component.
|
|
2103
|
+
*/
|
|
2104
|
+
export type Props = DescriptionProps;
|
|
2105
|
+
}
|
|
2106
|
+
export namespace Separator {
|
|
2107
|
+
/**
|
|
2108
|
+
* Props of the {@link Form.Separator} React component.
|
|
2109
|
+
*/
|
|
2110
|
+
export type Props = SeparatorProps;
|
|
2111
|
+
}
|
|
1824
2112
|
/**
|
|
1825
|
-
* A
|
|
2113
|
+
* A Ref Type for the {@link Form.Checkbox}.
|
|
2114
|
+
* Use refs to control your Form by calling `Form.Checkbox.focus()` or `Form.Checkbox.reset()` functions.
|
|
1826
2115
|
*
|
|
1827
2116
|
* @example
|
|
1828
|
-
*
|
|
2117
|
+
* Using Ref to focus {@link Form.Checkbox}.
|
|
1829
2118
|
*
|
|
1830
2119
|
* ```typescript
|
|
1831
|
-
* import {
|
|
2120
|
+
* import { Form, ActionPanel, Action } from "@raycast/api";
|
|
2121
|
+
* import { useRef } from "react";
|
|
1832
2122
|
*
|
|
1833
2123
|
* export default function Command() {
|
|
2124
|
+
* const checkBoxRef = useRef<Form.Checkbox>(null);
|
|
2125
|
+
*
|
|
1834
2126
|
* return (
|
|
1835
2127
|
* <Form
|
|
1836
2128
|
* actions={
|
|
1837
2129
|
* <ActionPanel>
|
|
1838
|
-
* <Action.SubmitForm
|
|
2130
|
+
* <Action.SubmitForm
|
|
2131
|
+
* title="Submit"
|
|
2132
|
+
* onSubmit={(values) => {
|
|
2133
|
+
* checkBoxRef.current?.focus();
|
|
2134
|
+
* console.log("Values", values);
|
|
2135
|
+
* }}
|
|
2136
|
+
* />
|
|
1839
2137
|
* </ActionPanel>
|
|
1840
2138
|
* }
|
|
1841
2139
|
* >
|
|
1842
|
-
* <Form.
|
|
2140
|
+
* <Form.TextField id="textField" title="Your Name" placeholder="César" />
|
|
2141
|
+
* <Form.Checkbox id="newsletter" label="Subscribe for Newsletter" defaultValue={true} ref={checkBoxRef} />
|
|
2142
|
+
* <Form.TextArea id="textArea" title="About" placeholder="Enter something about you" />
|
|
1843
2143
|
* </Form>
|
|
1844
2144
|
* );
|
|
1845
2145
|
* }
|
|
1846
2146
|
* ```
|
|
1847
2147
|
*
|
|
1848
2148
|
* @example
|
|
1849
|
-
*
|
|
2149
|
+
* Using Ref to reset {@link Form.Checkbox}.
|
|
1850
2150
|
*
|
|
1851
2151
|
* ```typescript
|
|
1852
|
-
* import {
|
|
1853
|
-
* import {
|
|
2152
|
+
* import { Form, ActionPanel, Action } from "@raycast/api";
|
|
2153
|
+
* import { useRef } from "react";
|
|
1854
2154
|
*
|
|
1855
2155
|
* export default function Command() {
|
|
1856
|
-
* const
|
|
2156
|
+
* const checkBoxRef = useRef<Form.Checkbox>(null);
|
|
1857
2157
|
*
|
|
1858
2158
|
* return (
|
|
1859
2159
|
* <Form
|
|
1860
2160
|
* actions={
|
|
1861
2161
|
* <ActionPanel>
|
|
1862
|
-
* <Action.SubmitForm
|
|
2162
|
+
* <Action.SubmitForm
|
|
2163
|
+
* title="Submit"
|
|
2164
|
+
* onSubmit={(values) => {
|
|
2165
|
+
* checkBoxRef.current?.reset();
|
|
2166
|
+
* console.log("Values", values);
|
|
2167
|
+
* }}
|
|
2168
|
+
* />
|
|
1863
2169
|
* </ActionPanel>
|
|
1864
2170
|
* }
|
|
1865
2171
|
* >
|
|
1866
|
-
* <Form.
|
|
2172
|
+
* <Form.TextField id="textField" title="Your Name" placeholder="César" />
|
|
2173
|
+
* <Form.Checkbox id="newsletter" label="Subscribe for Newsletter" defaultValue={true} ref={checkBoxRef} />
|
|
2174
|
+
* <Form.TextArea id="textArea" title="About" placeholder="Enter something about you" />
|
|
1867
2175
|
* </Form>
|
|
1868
2176
|
* );
|
|
1869
2177
|
* }
|
|
1870
2178
|
* ```
|
|
1871
2179
|
*/
|
|
1872
|
-
|
|
2180
|
+
export type Checkbox = CheckboxRef;
|
|
2181
|
+
export namespace Checkbox {
|
|
2182
|
+
/**
|
|
2183
|
+
* Props of the {@link Form.Checkbox} React component.
|
|
2184
|
+
*/
|
|
2185
|
+
export type Props = CheckboxProps;
|
|
2186
|
+
}
|
|
1873
2187
|
/**
|
|
1874
|
-
* A
|
|
1875
|
-
* Use
|
|
2188
|
+
* A Ref Type for the {@link Form.DatePicker}.
|
|
2189
|
+
* Use refs to control your Form by calling `Form.DatePicker.focus()` or `Form.DatePicker.reset()` functions.
|
|
1876
2190
|
*
|
|
1877
2191
|
* @example
|
|
2192
|
+
* Using Ref to focus {@link Form.DatePicker}.
|
|
2193
|
+
*
|
|
1878
2194
|
* ```typescript
|
|
1879
|
-
* import {
|
|
2195
|
+
* import { Form, ActionPanel, Action } from "@raycast/api";
|
|
2196
|
+
* import { useRef } from "react";
|
|
1880
2197
|
*
|
|
1881
2198
|
* export default function Command() {
|
|
2199
|
+
* const datePickerRef = useRef<Form.DatePicker>(null);
|
|
2200
|
+
*
|
|
1882
2201
|
* return (
|
|
1883
2202
|
* <Form
|
|
1884
2203
|
* actions={
|
|
1885
2204
|
* <ActionPanel>
|
|
1886
|
-
* <Action.SubmitForm
|
|
2205
|
+
* <Action.SubmitForm
|
|
2206
|
+
* title="Submit"
|
|
2207
|
+
* onSubmit={(values) => {
|
|
2208
|
+
* datePickerRef.current?.focus();
|
|
2209
|
+
* console.log("Values", values);
|
|
2210
|
+
* }}
|
|
2211
|
+
* />
|
|
1887
2212
|
* </ActionPanel>
|
|
1888
2213
|
* }
|
|
1889
2214
|
* >
|
|
1890
|
-
* <Form.TextField id="
|
|
1891
|
-
* <Form.
|
|
1892
|
-
* <Form.TextArea id="
|
|
2215
|
+
* <Form.TextField id="textField" title="Your Name" placeholder="César" />
|
|
2216
|
+
* <Form.DatePicker id="birthday" title="Date of Birth" type={Form.DatePicker.Type.Date} ref={datePickerRef} />
|
|
2217
|
+
* <Form.TextArea id="textArea" title="About" placeholder="Enter something about you" />
|
|
2218
|
+
* </Form>
|
|
2219
|
+
* );
|
|
2220
|
+
* }
|
|
2221
|
+
* ```
|
|
2222
|
+
*
|
|
2223
|
+
* @example
|
|
2224
|
+
* Using Ref to reset {@link Form.DatePicker}.
|
|
2225
|
+
*
|
|
2226
|
+
* ```typescript
|
|
2227
|
+
* import { Form, ActionPanel, Action } from "@raycast/api";
|
|
2228
|
+
* import { useRef } from "react";
|
|
2229
|
+
*
|
|
2230
|
+
* export default function Command() {
|
|
2231
|
+
* const datePickerRef = useRef<Form.DatePicker>(null);
|
|
2232
|
+
*
|
|
2233
|
+
* return (
|
|
2234
|
+
* <Form
|
|
2235
|
+
* actions={
|
|
2236
|
+
* <ActionPanel>
|
|
2237
|
+
* <Action.SubmitForm
|
|
2238
|
+
* title="Submit"
|
|
2239
|
+
* onSubmit={(values) => {
|
|
2240
|
+
* datePickerRef.current?.reset();
|
|
2241
|
+
* console.log("Values", values);
|
|
2242
|
+
* }}
|
|
2243
|
+
* />
|
|
2244
|
+
* </ActionPanel>
|
|
2245
|
+
* }
|
|
2246
|
+
* >
|
|
2247
|
+
* <Form.TextField id="textField" title="Your Name" placeholder="César" />
|
|
2248
|
+
* <Form.DatePicker id="birthday" title="Date of Birth" type={Form.DatePicker.Type.Date} ref={datePickerRef} />
|
|
2249
|
+
* <Form.TextArea id="textArea" title="About" placeholder="Enter something about you" />
|
|
1893
2250
|
* </Form>
|
|
1894
2251
|
* );
|
|
1895
2252
|
* }
|
|
1896
2253
|
* ```
|
|
1897
2254
|
*/
|
|
1898
|
-
|
|
2255
|
+
export type DatePicker = DatePickerRef;
|
|
2256
|
+
export namespace DatePicker {
|
|
2257
|
+
/**
|
|
2258
|
+
* Props of the {@link Form.DatePicker} React component.
|
|
2259
|
+
*/
|
|
2260
|
+
export type Props = DatePickerProps;
|
|
2261
|
+
}
|
|
1899
2262
|
/**
|
|
1900
|
-
* A
|
|
2263
|
+
* A Ref Type for the {@link Form.Dropdown}.
|
|
2264
|
+
* Use refs to control your Form by calling `Form.Dropdown.focus()` or `Form.Dropdown.reset()` functions.
|
|
1901
2265
|
*
|
|
1902
2266
|
* @example
|
|
1903
|
-
*
|
|
2267
|
+
* Using Ref to focus {@link Form.Dropdown}.
|
|
1904
2268
|
*
|
|
1905
2269
|
* ```typescript
|
|
1906
|
-
* import {
|
|
2270
|
+
* import { Form, ActionPanel, Action } from "@raycast/api";
|
|
2271
|
+
* import { useRef } from "react";
|
|
1907
2272
|
*
|
|
1908
2273
|
* export default function Command() {
|
|
2274
|
+
* const dropdownRef = useRef<Form.Dropdown>(null);
|
|
2275
|
+
*
|
|
1909
2276
|
* return (
|
|
1910
2277
|
* <Form
|
|
1911
2278
|
* actions={
|
|
1912
2279
|
* <ActionPanel>
|
|
1913
|
-
* <Action.SubmitForm
|
|
2280
|
+
* <Action.SubmitForm
|
|
2281
|
+
* title="Submit"
|
|
2282
|
+
* onSubmit={(values) => {
|
|
2283
|
+
* dropdownRef.current?.focus();
|
|
2284
|
+
* console.log("Values", values);
|
|
2285
|
+
* }}
|
|
2286
|
+
* />
|
|
1914
2287
|
* </ActionPanel>
|
|
1915
2288
|
* }
|
|
1916
2289
|
* >
|
|
1917
|
-
* <Form.
|
|
1918
|
-
*
|
|
1919
|
-
*
|
|
1920
|
-
*
|
|
2290
|
+
* <Form.TextField id="textField" title="Your Name" placeholder="César" />
|
|
2291
|
+
* <Form.Dropdown id="number" title="Choose Your Favorite Number" defaultValue={"3"} ref={dropdownRef}>
|
|
2292
|
+
* {[1, 2, 3, 4, 5, 6, 7].map((num) => {
|
|
2293
|
+
* return <Form.Dropdown.Item value={String(num)} title={String(num)} key={num} />;
|
|
2294
|
+
* })}
|
|
1921
2295
|
* </Form.Dropdown>
|
|
2296
|
+
* <Form.TextArea id="textArea" title="About" placeholder="Enter something about you" />
|
|
1922
2297
|
* </Form>
|
|
1923
2298
|
* );
|
|
1924
2299
|
* }
|
|
1925
2300
|
* ```
|
|
1926
2301
|
*
|
|
1927
2302
|
* @example
|
|
1928
|
-
*
|
|
2303
|
+
* Using Ref to reset {@link Form.Dropdown}.
|
|
1929
2304
|
*
|
|
1930
2305
|
* ```typescript
|
|
1931
|
-
* import {
|
|
1932
|
-
* import {
|
|
2306
|
+
* import { Form, ActionPanel, Action } from "@raycast/api";
|
|
2307
|
+
* import { useRef } from "react";
|
|
1933
2308
|
*
|
|
1934
2309
|
* export default function Command() {
|
|
1935
|
-
* const
|
|
2310
|
+
* const dropdownRef = useRef<Form.Dropdown>(null);
|
|
1936
2311
|
*
|
|
1937
2312
|
* return (
|
|
1938
2313
|
* <Form
|
|
1939
2314
|
* actions={
|
|
1940
2315
|
* <ActionPanel>
|
|
1941
|
-
* <Action.SubmitForm
|
|
2316
|
+
* <Action.SubmitForm
|
|
2317
|
+
* title="Submit"
|
|
2318
|
+
* onSubmit={(values) => {
|
|
2319
|
+
* dropdownRef.current?.reset();
|
|
2320
|
+
* console.log("Values", values);
|
|
2321
|
+
* }}
|
|
2322
|
+
* />
|
|
1942
2323
|
* </ActionPanel>
|
|
1943
2324
|
* }
|
|
1944
2325
|
* >
|
|
1945
|
-
* <Form.
|
|
1946
|
-
*
|
|
1947
|
-
*
|
|
1948
|
-
*
|
|
1949
|
-
*
|
|
1950
|
-
* >
|
|
1951
|
-
* <Form.Dropdown.Item value="cpp" title="C++" />
|
|
1952
|
-
* <Form.Dropdown.Item value="javascript" title="JavaScript" />
|
|
1953
|
-
* <Form.Dropdown.Item value="ruby" title="Ruby" />
|
|
1954
|
-
* <Form.Dropdown.Item value="python" title="Python" />
|
|
1955
|
-
* <Form.Dropdown.Item value="swift" title="Swift" />
|
|
1956
|
-
* <Form.Dropdown.Item value="typescript" title="TypeScript" />
|
|
2326
|
+
* <Form.TextField id="textField" title="Your Name" placeholder="César" />
|
|
2327
|
+
* <Form.Dropdown id="number" title="Choose Your Favorite Number" defaultValue={"3"} ref={dropdownRef}>
|
|
2328
|
+
* {[1, 2, 3, 4, 5, 6, 7].map((num) => {
|
|
2329
|
+
* return <Form.Dropdown.Item value={String(num)} title={String(num)} key={num} />;
|
|
2330
|
+
* })}
|
|
1957
2331
|
* </Form.Dropdown>
|
|
2332
|
+
* <Form.TextArea id="textArea" title="About" placeholder="Enter something about you" />
|
|
1958
2333
|
* </Form>
|
|
1959
2334
|
* );
|
|
1960
2335
|
* }
|
|
1961
2336
|
* ```
|
|
1962
2337
|
*/
|
|
1963
|
-
|
|
2338
|
+
export type Dropdown = DropdownRef;
|
|
2339
|
+
export namespace Dropdown {
|
|
2340
|
+
/**
|
|
2341
|
+
* Props of the {@link Form.Dropdown} React component.
|
|
2342
|
+
*/
|
|
2343
|
+
export type Props = DropdownProps;
|
|
2344
|
+
export namespace Section {
|
|
2345
|
+
/**
|
|
2346
|
+
* Props of the {@link Form.Dropdown.Section} React component.
|
|
2347
|
+
*/
|
|
2348
|
+
export type Props = DropdownSectionProps;
|
|
2349
|
+
}
|
|
2350
|
+
export namespace Item {
|
|
2351
|
+
/**
|
|
2352
|
+
* Props of the {@link Form.Dropdown.Item} React component.
|
|
2353
|
+
*/
|
|
2354
|
+
export type Props = DropdownItemProps;
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
1964
2357
|
/**
|
|
1965
|
-
* A
|
|
2358
|
+
* A Ref Type for the {@link Form.TagPicker}.
|
|
2359
|
+
* Use refs to control your Form by calling `Form.TagPicker.focus()` or `Form.TagPicker.reset()` functions.
|
|
1966
2360
|
*
|
|
1967
2361
|
* @example
|
|
1968
|
-
*
|
|
2362
|
+
* Using Ref to focus {@link Form.TagPicker}.
|
|
1969
2363
|
*
|
|
1970
2364
|
* ```typescript
|
|
1971
|
-
* import {
|
|
2365
|
+
* import { Form, ActionPanel, Action } from "@raycast/api";
|
|
2366
|
+
* import { useRef } from "react";
|
|
1972
2367
|
*
|
|
1973
2368
|
* export default function Command() {
|
|
2369
|
+
* const tagPickerRef = useRef<Form.TagPicker>(null);
|
|
2370
|
+
*
|
|
1974
2371
|
* return (
|
|
1975
2372
|
* <Form
|
|
1976
2373
|
* actions={
|
|
1977
2374
|
* <ActionPanel>
|
|
1978
|
-
* <Action.SubmitForm
|
|
2375
|
+
* <Action.SubmitForm
|
|
2376
|
+
* title="Submit"
|
|
2377
|
+
* onSubmit={(values) => {
|
|
2378
|
+
* tagPickerRef.current?.focus();
|
|
2379
|
+
* console.log("Values", values);
|
|
2380
|
+
* }}
|
|
2381
|
+
* />
|
|
1979
2382
|
* </ActionPanel>
|
|
1980
2383
|
* }
|
|
1981
2384
|
* >
|
|
1982
|
-
* <Form.
|
|
1983
|
-
*
|
|
1984
|
-
*
|
|
1985
|
-
*
|
|
2385
|
+
* <Form.TextField id="textField" title="Your Name" placeholder="César" />
|
|
2386
|
+
* <Form.TagPicker id="tags" title="Choose Your Favorite Colors" ref={tagPickerRef}>
|
|
2387
|
+
* {["black", "white", "blue", "yellow", "red"].map((tag) => {
|
|
2388
|
+
* return <Form.TagPicker.Item value={tag} title={tag} key={tag} />;
|
|
2389
|
+
* })}
|
|
1986
2390
|
* </Form.TagPicker>
|
|
2391
|
+
* <Form.TextArea id="textArea" title="About" placeholder="Enter something about you" />
|
|
1987
2392
|
* </Form>
|
|
1988
2393
|
* );
|
|
1989
2394
|
* }
|
|
1990
2395
|
* ```
|
|
1991
2396
|
*
|
|
1992
2397
|
* @example
|
|
1993
|
-
*
|
|
2398
|
+
* Using Ref to reset {@link Form.TagPicker}.
|
|
1994
2399
|
*
|
|
1995
2400
|
* ```typescript
|
|
1996
|
-
* import {
|
|
1997
|
-
* import {
|
|
2401
|
+
* import { Form, ActionPanel, Action } from "@raycast/api";
|
|
2402
|
+
* import { useRef } from "react";
|
|
1998
2403
|
*
|
|
1999
2404
|
* export default function Command() {
|
|
2000
|
-
* const
|
|
2405
|
+
* const tagPickerRef = useRef<Form.TagPicker>(null);
|
|
2001
2406
|
*
|
|
2002
2407
|
* return (
|
|
2003
2408
|
* <Form
|
|
2004
2409
|
* actions={
|
|
2005
2410
|
* <ActionPanel>
|
|
2006
|
-
* <Action.SubmitForm
|
|
2411
|
+
* <Action.SubmitForm
|
|
2412
|
+
* title="Submit"
|
|
2413
|
+
* onSubmit={(values) => {
|
|
2414
|
+
* tagPickerRef.current?.reset();
|
|
2415
|
+
* console.log("Values", values);
|
|
2416
|
+
* }}
|
|
2417
|
+
* />
|
|
2007
2418
|
* </ActionPanel>
|
|
2008
2419
|
* }
|
|
2009
2420
|
* >
|
|
2010
|
-
* <Form.
|
|
2011
|
-
*
|
|
2012
|
-
*
|
|
2013
|
-
*
|
|
2014
|
-
*
|
|
2015
|
-
* <Form.TagPicker.Item value="pol" title="Poland" icon="🇵🇱" />
|
|
2016
|
-
* <Form.TagPicker.Item value="rus" title="Russia" icon="🇷🇺" />
|
|
2017
|
-
* <Form.TagPicker.Item value="sco" title="Scotland" icon="🏴" />
|
|
2421
|
+
* <Form.TextField id="textField" title="Your Name" placeholder="César" />
|
|
2422
|
+
* <Form.TagPicker id="tags" title="Choose Your Favorite Colors" ref={tagPickerRef}>
|
|
2423
|
+
* {["black", "white", "blue", "yellow", "red"].map((tag) => {
|
|
2424
|
+
* return <Form.TagPicker.Item value={tag} title={tag} key={tag} />;
|
|
2425
|
+
* })}
|
|
2018
2426
|
* </Form.TagPicker>
|
|
2427
|
+
* <Form.TextArea id="textArea" title="About" placeholder="Enter something about you" />
|
|
2019
2428
|
* </Form>
|
|
2020
2429
|
* );
|
|
2021
2430
|
* }
|
|
2022
2431
|
* ```
|
|
2023
2432
|
*/
|
|
2024
|
-
|
|
2433
|
+
export type TagPicker = TagPickerRef;
|
|
2434
|
+
export namespace TagPicker {
|
|
2435
|
+
/**
|
|
2436
|
+
* Props of the {@link Form.TagPicker} React component.
|
|
2437
|
+
*/
|
|
2438
|
+
export type Props = TagPickerProps;
|
|
2439
|
+
export namespace Item {
|
|
2440
|
+
/**
|
|
2441
|
+
* Props of the {@link Form.TagPicker.Item} React component.
|
|
2442
|
+
*/
|
|
2443
|
+
export type Props = TagPickerItemProps;
|
|
2444
|
+
}
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
/**
|
|
2449
|
+
* @deprecated Use {@link Form.Checkbox} instead.
|
|
2450
|
+
*/
|
|
2451
|
+
export declare const FormCheckbox: typeof Form.Checkbox;
|
|
2452
|
+
|
|
2453
|
+
/**
|
|
2454
|
+
* @deprecated Use {@link Form.Checkbox.Props} instead.
|
|
2455
|
+
*/
|
|
2456
|
+
export declare interface FormCheckboxProps extends Form.Checkbox.Props {
|
|
2457
|
+
}
|
|
2458
|
+
|
|
2459
|
+
/**
|
|
2460
|
+
* @deprecated Use {@link Form.DatePicker} instead.
|
|
2461
|
+
*/
|
|
2462
|
+
export declare const FormDatePicker: typeof Form.DatePicker;
|
|
2463
|
+
|
|
2464
|
+
/**
|
|
2465
|
+
* @deprecated Use {@link Form.DatePicker.Props} instead.
|
|
2466
|
+
*/
|
|
2467
|
+
export declare interface FormDatePickerProps extends Form.DatePicker.Props {
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
/**
|
|
2471
|
+
* See {@link Form.DatePicker.Type}
|
|
2472
|
+
*/
|
|
2473
|
+
declare enum FormDatePickerType {
|
|
2474
|
+
/**
|
|
2475
|
+
* Only year, month, and day can be picked
|
|
2476
|
+
*/
|
|
2477
|
+
Date = "date",
|
|
2025
2478
|
/**
|
|
2026
|
-
*
|
|
2479
|
+
* hour and second can be picked in addition to year, month and day
|
|
2480
|
+
*/
|
|
2481
|
+
DateTime = "date_time"
|
|
2482
|
+
}
|
|
2483
|
+
|
|
2484
|
+
/**
|
|
2485
|
+
* @deprecated Use {@link Form.Dropdown} instead.
|
|
2486
|
+
*/
|
|
2487
|
+
export declare const FormDropdown: typeof Form.Dropdown;
|
|
2488
|
+
|
|
2489
|
+
/**
|
|
2490
|
+
* @deprecated Use {@link Form.Dropdown.Item} instead.
|
|
2491
|
+
*/
|
|
2492
|
+
export declare const FormDropdownItem: typeof Form.Dropdown.Item;
|
|
2493
|
+
|
|
2494
|
+
/**
|
|
2495
|
+
* @deprecated Use {@link Form.Dropdown.Item.Props} instead.
|
|
2496
|
+
*/
|
|
2497
|
+
export declare interface FormDropdownItemProps extends Form.Dropdown.Item.Props {
|
|
2498
|
+
}
|
|
2499
|
+
|
|
2500
|
+
/**
|
|
2501
|
+
* @deprecated Use {@link Form.Dropdown.Props} instead.
|
|
2502
|
+
*/
|
|
2503
|
+
export declare interface FormDropdownProps extends Form.Dropdown.Props {
|
|
2504
|
+
}
|
|
2505
|
+
|
|
2506
|
+
/**
|
|
2507
|
+
* @deprecated Use {@link Form.Dropdown.Section} instead.
|
|
2508
|
+
*/
|
|
2509
|
+
export declare const FormDropdownSection: typeof Form.Dropdown.Section;
|
|
2510
|
+
|
|
2511
|
+
/**
|
|
2512
|
+
* @deprecated Use {@link Form.Dropdown.Section.Props} instead.
|
|
2513
|
+
*/
|
|
2514
|
+
export declare interface FormDropdownSectionProps extends Form.Dropdown.Section.Props {
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
/**
|
|
2518
|
+
* @deprecated Use {@link Form.ItemProps} instead.
|
|
2519
|
+
*/
|
|
2520
|
+
export declare interface FormItemProps<Value extends Form.Value> extends Form.ItemProps<Value> {
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
/**
|
|
2524
|
+
* Props of the Form.Item React component.
|
|
2525
|
+
*/
|
|
2526
|
+
declare interface FormItemProps_2<T extends FormValue_2> {
|
|
2527
|
+
/**
|
|
2528
|
+
* ID of the form item.
|
|
2529
|
+
* Make sure to assign each form item a unique id.
|
|
2530
|
+
*/
|
|
2531
|
+
id: string;
|
|
2532
|
+
/**
|
|
2533
|
+
* The title displayed on the left side of the item.
|
|
2534
|
+
*/
|
|
2535
|
+
title?: string;
|
|
2536
|
+
/**
|
|
2537
|
+
* An optional info message to describe the form item. It appears on the right side of the item with an info icon. When the icon is hovered, the info message is shown.
|
|
2538
|
+
*/
|
|
2539
|
+
info?: string;
|
|
2540
|
+
/**
|
|
2541
|
+
* Indicates whether the value of the item should be persisted after submitting, and restored next time the form is rendered.
|
|
2542
|
+
*/
|
|
2543
|
+
storeValue?: boolean;
|
|
2544
|
+
/**
|
|
2545
|
+
* Indicates whether the item should be focused automatically once the form is rendered.
|
|
2546
|
+
*/
|
|
2547
|
+
autoFocus?: boolean;
|
|
2548
|
+
/**
|
|
2549
|
+
* The current value of the item.
|
|
2550
|
+
*/
|
|
2551
|
+
value?: T & FormValue_2;
|
|
2552
|
+
/**
|
|
2553
|
+
* The default value of the item.
|
|
2554
|
+
* 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.
|
|
2555
|
+
*
|
|
2556
|
+
* If you're using {@link FormItemProps.storeValue} and configured it as `true` then the stored value will be set.
|
|
2557
|
+
*
|
|
2558
|
+
* If you configure {@link FormItemProps.value} at the same time with {@link FormItemProps.defaultValue}, the `value` will be set instead of `defaultValue`.
|
|
2559
|
+
*/
|
|
2560
|
+
defaultValue?: T & FormValue_2;
|
|
2561
|
+
/**
|
|
2562
|
+
* The callback which will be triggered on the {@link Form.Item.Props.value} change for the item.
|
|
2563
|
+
*/
|
|
2564
|
+
onChange?: (newValue: T & FormValue_2) => void;
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2567
|
+
declare interface FormItems {
|
|
2568
|
+
/**
|
|
2569
|
+
* A form item with a checkbox.
|
|
2027
2570
|
*
|
|
2028
2571
|
* @example
|
|
2029
|
-
* Uncontrolled
|
|
2572
|
+
* Uncontrolled checkbox
|
|
2030
2573
|
*
|
|
2031
2574
|
* ```typescript
|
|
2032
2575
|
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
@@ -2036,48 +2579,46 @@ export declare namespace Form {
|
|
|
2036
2579
|
* <Form
|
|
2037
2580
|
* actions={
|
|
2038
2581
|
* <ActionPanel>
|
|
2039
|
-
* <Action.
|
|
2582
|
+
* <Action.SubmitForm title="Submit Answer" onSubmit={(values) => console.log(values)} />
|
|
2040
2583
|
* </ActionPanel>
|
|
2041
2584
|
* }
|
|
2042
2585
|
* >
|
|
2043
|
-
* <Form.
|
|
2586
|
+
* <Form.Checkbox id="answer" label="Are you happy?" defaultValue={true} />
|
|
2044
2587
|
* </Form>
|
|
2045
2588
|
* );
|
|
2046
2589
|
* }
|
|
2047
2590
|
* ```
|
|
2048
2591
|
*
|
|
2049
2592
|
* @example
|
|
2050
|
-
* Controlled
|
|
2593
|
+
* Controlled checkbox
|
|
2051
2594
|
*
|
|
2052
2595
|
* ```typescript
|
|
2053
2596
|
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
2054
2597
|
* import { useState } from "react";
|
|
2055
2598
|
*
|
|
2056
2599
|
* export default function Command() {
|
|
2057
|
-
* const [
|
|
2600
|
+
* const [checked, setChecked] = useState(true);
|
|
2058
2601
|
*
|
|
2059
2602
|
* return (
|
|
2060
2603
|
* <Form
|
|
2061
2604
|
* actions={
|
|
2062
2605
|
* <ActionPanel>
|
|
2063
|
-
* <Action.SubmitForm title="Submit
|
|
2606
|
+
* <Action.SubmitForm title="Submit Answer" onSubmit={(values) => console.log(values)} />
|
|
2064
2607
|
* </ActionPanel>
|
|
2065
2608
|
* }
|
|
2066
2609
|
* >
|
|
2067
|
-
* <Form.
|
|
2610
|
+
* <Form.Checkbox id="answer" label="Do you like orange juice?" value={checked} onChange={setChecked} />
|
|
2068
2611
|
* </Form>
|
|
2069
2612
|
* );
|
|
2070
2613
|
* }
|
|
2071
2614
|
* ```
|
|
2072
2615
|
*/
|
|
2073
|
-
|
|
2616
|
+
Checkbox: typeof Checkbox;
|
|
2074
2617
|
/**
|
|
2075
|
-
* A form item with a
|
|
2076
|
-
*
|
|
2077
|
-
* _Do **not** use this component to show validation messages for other form fields._
|
|
2618
|
+
* A form item with a date picker.
|
|
2078
2619
|
*
|
|
2079
2620
|
* @example
|
|
2080
|
-
*
|
|
2621
|
+
* Uncontrolled date picker
|
|
2081
2622
|
*
|
|
2082
2623
|
* ```typescript
|
|
2083
2624
|
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
@@ -2087,422 +2628,328 @@ export declare namespace Form {
|
|
|
2087
2628
|
* <Form
|
|
2088
2629
|
* actions={
|
|
2089
2630
|
* <ActionPanel>
|
|
2090
|
-
* <Action.SubmitForm title="Submit" onSubmit={(values) => console.log(values)} />
|
|
2631
|
+
* <Action.SubmitForm title="Submit Form" onSubmit={(values) => console.log(values)} />
|
|
2091
2632
|
* </ActionPanel>
|
|
2092
2633
|
* }
|
|
2093
2634
|
* >
|
|
2094
|
-
* <Form.
|
|
2635
|
+
* <Form.DatePicker id="dateOfBirth" title="Date of Birth" defaultValue={new Date(1955, 1, 24)} />
|
|
2095
2636
|
* </Form>
|
|
2096
2637
|
* );
|
|
2097
2638
|
* }
|
|
2098
2639
|
* ```
|
|
2099
|
-
*/
|
|
2100
|
-
const Description: typeof FormDescription;
|
|
2101
|
-
/**
|
|
2102
|
-
* Props of the {@link Form} React component.
|
|
2103
|
-
*/
|
|
2104
|
-
export interface Props extends ActionsInterface, NavigationChildInterface {
|
|
2105
|
-
/**
|
|
2106
|
-
* The Form.Item elements of the form.
|
|
2107
|
-
*/
|
|
2108
|
-
children?: ReactNode;
|
|
2109
|
-
}
|
|
2110
|
-
/**
|
|
2111
|
-
* A possible form item value that will be used as an input for the submit callback of a form.
|
|
2112
|
-
*/
|
|
2113
|
-
export type Value = string | number | boolean | string[] | number[] | Date | null;
|
|
2114
|
-
/**
|
|
2115
|
-
* Values of items in the form.
|
|
2116
|
-
*
|
|
2117
|
-
* @remarks
|
|
2118
|
-
* For type-safe form values, you can define your own interface. Use the ID's of the form items
|
|
2119
|
-
* as the property names. See the example for more details.
|
|
2120
2640
|
*
|
|
2121
2641
|
* @example
|
|
2122
|
-
*
|
|
2123
|
-
* import { Form, Action } from "@raycast/api";
|
|
2642
|
+
* Controlled date picker
|
|
2124
2643
|
*
|
|
2125
|
-
*
|
|
2126
|
-
*
|
|
2127
|
-
*
|
|
2128
|
-
* }
|
|
2644
|
+
* ```typescript
|
|
2645
|
+
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
2646
|
+
* import { useState } from "react";
|
|
2129
2647
|
*
|
|
2130
2648
|
* export default function Command() {
|
|
2131
|
-
*
|
|
2132
|
-
* console.log(values);
|
|
2133
|
-
* }
|
|
2649
|
+
* const [date, setDate] = useState<Date>();
|
|
2134
2650
|
*
|
|
2135
2651
|
* return (
|
|
2136
2652
|
* <Form
|
|
2137
|
-
*
|
|
2138
|
-
*
|
|
2139
|
-
*
|
|
2140
|
-
*
|
|
2141
|
-
*
|
|
2142
|
-
* >
|
|
2143
|
-
* <Form.
|
|
2144
|
-
* <Form.DatePicker id="due" title="Due Date" />
|
|
2653
|
+
* actions={
|
|
2654
|
+
* <ActionPanel>
|
|
2655
|
+
* <Action.SubmitForm title="Submit Form" onSubmit={(values) => console.log(values)} />
|
|
2656
|
+
* </ActionPanel>
|
|
2657
|
+
* }
|
|
2658
|
+
* >
|
|
2659
|
+
* <Form.DatePicker id="launchDate" title="Launch Date" value={date} onChange={setDate} />
|
|
2145
2660
|
* </Form>
|
|
2146
2661
|
* );
|
|
2147
|
-
* }
|
|
2662
|
+
* }
|
|
2148
2663
|
* ```
|
|
2149
2664
|
*/
|
|
2150
|
-
|
|
2151
|
-
/**
|
|
2152
|
-
* The form value of a given item.
|
|
2153
|
-
*/
|
|
2154
|
-
[item: string]: any;
|
|
2155
|
-
}
|
|
2665
|
+
DatePicker: typeof DatePicker;
|
|
2156
2666
|
/**
|
|
2157
|
-
*
|
|
2667
|
+
* A form item with a simple text label.
|
|
2668
|
+
*
|
|
2669
|
+
* _Do **not** use this component to show validation messages for other form fields._
|
|
2670
|
+
*
|
|
2671
|
+
* @example
|
|
2672
|
+
* Label
|
|
2673
|
+
*
|
|
2674
|
+
* ```typescript
|
|
2675
|
+
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
2676
|
+
*
|
|
2677
|
+
* export default function Command() {
|
|
2678
|
+
* return (
|
|
2679
|
+
* <Form
|
|
2680
|
+
* actions={
|
|
2681
|
+
* <ActionPanel>
|
|
2682
|
+
* <Action.SubmitForm title="Submit" onSubmit={(values) => console.log(values)} />
|
|
2683
|
+
* </ActionPanel>
|
|
2684
|
+
* }
|
|
2685
|
+
* >
|
|
2686
|
+
* <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." />
|
|
2687
|
+
* </Form>
|
|
2688
|
+
* );
|
|
2689
|
+
* }
|
|
2690
|
+
* ```
|
|
2158
2691
|
*/
|
|
2159
|
-
|
|
2160
|
-
/**
|
|
2161
|
-
* ID of the form item.
|
|
2162
|
-
* Make sure to assign each form item a unique id.
|
|
2163
|
-
*/
|
|
2164
|
-
id: string;
|
|
2165
|
-
/**
|
|
2166
|
-
* The title displayed on the left side of the item.
|
|
2167
|
-
*/
|
|
2168
|
-
title?: string;
|
|
2169
|
-
/**
|
|
2170
|
-
* Indicates whether the value of the item should be persisted after submitting, and restored next time the form is rendered.
|
|
2171
|
-
*/
|
|
2172
|
-
storeValue?: boolean;
|
|
2173
|
-
/**
|
|
2174
|
-
* The current value of the item.
|
|
2175
|
-
*/
|
|
2176
|
-
value?: Value;
|
|
2177
|
-
/**
|
|
2178
|
-
* The default value of the item.
|
|
2179
|
-
* 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.
|
|
2180
|
-
*
|
|
2181
|
-
* If you're using {@link Form.Item.Props.storeValue} and configured it as `true` then the stored value will be set.
|
|
2182
|
-
*
|
|
2183
|
-
* If you configure {@link Form.Item.Props.value} at the same time with {@link Form.Item.Props.defaultValue}, the `value` will be set instead of `defaultValue`.
|
|
2184
|
-
*/
|
|
2185
|
-
defaultValue?: Value;
|
|
2186
|
-
/**
|
|
2187
|
-
* The callback which will be triggered on the {@link Form.Item.Props.value} change for the item.
|
|
2188
|
-
*/
|
|
2189
|
-
onChange?: (newValue: Value) => void;
|
|
2190
|
-
}
|
|
2191
|
-
export namespace TextField {
|
|
2192
|
-
/**
|
|
2193
|
-
* Props of the {@link Form.TextField} React component.
|
|
2194
|
-
*/
|
|
2195
|
-
export interface Props extends Form.ItemProps<string> {
|
|
2196
|
-
/**
|
|
2197
|
-
* Placeholder text shown in the text field.
|
|
2198
|
-
*/
|
|
2199
|
-
placeholder?: string;
|
|
2200
|
-
}
|
|
2201
|
-
}
|
|
2202
|
-
export namespace TextArea {
|
|
2203
|
-
/**
|
|
2204
|
-
* Props of the {@link Form.TextArea} React component.
|
|
2205
|
-
*/
|
|
2206
|
-
export interface Props extends Form.ItemProps<string> {
|
|
2207
|
-
/**
|
|
2208
|
-
* Placeholder text shown in the text area.
|
|
2209
|
-
*/
|
|
2210
|
-
placeholder?: string;
|
|
2211
|
-
}
|
|
2212
|
-
}
|
|
2213
|
-
export namespace Dropdown {
|
|
2214
|
-
/**
|
|
2215
|
-
* Props of the {@link Form.Dropdown} React component.
|
|
2216
|
-
* The {@link Form.Dropdown.Props.value} here is ID ({@link Form.Dropdown.Item.Props.id}) of the default selected item.
|
|
2217
|
-
*/
|
|
2218
|
-
export interface Props extends Form.ItemProps<string> {
|
|
2219
|
-
/**
|
|
2220
|
-
* Sections or items. If {@link Form.Dropdown.Item} elements are specified, a default section is automatically created.
|
|
2221
|
-
*/
|
|
2222
|
-
children?: ReactNode;
|
|
2223
|
-
}
|
|
2224
|
-
export namespace Section {
|
|
2225
|
-
/**
|
|
2226
|
-
* Props of the {@link Form.Dropdown.Section} React component.
|
|
2227
|
-
*/
|
|
2228
|
-
export interface Props {
|
|
2229
|
-
/**
|
|
2230
|
-
* The item elements of the section.
|
|
2231
|
-
*/
|
|
2232
|
-
children?: ReactNode;
|
|
2233
|
-
/**
|
|
2234
|
-
* Title displayed above the section
|
|
2235
|
-
*/
|
|
2236
|
-
title?: string;
|
|
2237
|
-
}
|
|
2238
|
-
}
|
|
2239
|
-
export namespace Item {
|
|
2240
|
-
/**
|
|
2241
|
-
* Props of the {@link Form.Dropdown.Item} React component.
|
|
2242
|
-
*/
|
|
2243
|
-
export interface Props {
|
|
2244
|
-
/**
|
|
2245
|
-
* Value of the dropdown item.
|
|
2246
|
-
* Make sure to assign each unique value for each item.
|
|
2247
|
-
*/
|
|
2248
|
-
value: string;
|
|
2249
|
-
/**
|
|
2250
|
-
* The title displayed for the item.
|
|
2251
|
-
*/
|
|
2252
|
-
title: string;
|
|
2253
|
-
/**
|
|
2254
|
-
* A optional icon displayed for the item.
|
|
2255
|
-
*/
|
|
2256
|
-
icon?: Image.ImageLike;
|
|
2257
|
-
}
|
|
2258
|
-
}
|
|
2259
|
-
}
|
|
2260
|
-
export namespace Checkbox {
|
|
2261
|
-
/**
|
|
2262
|
-
* Props of the {@link Form.Checkbox} React component.
|
|
2263
|
-
*/
|
|
2264
|
-
export interface Props extends Form.ItemProps<boolean> {
|
|
2265
|
-
/**
|
|
2266
|
-
* The label displayed on the right side of the checkbox.
|
|
2267
|
-
*/
|
|
2268
|
-
label: string;
|
|
2269
|
-
}
|
|
2270
|
-
}
|
|
2271
|
-
export namespace DatePicker {
|
|
2272
|
-
/**
|
|
2273
|
-
* Props of the {@link Form.DatePicker} React component.
|
|
2274
|
-
*/
|
|
2275
|
-
export interface Props extends Form.ItemProps<Date> {
|
|
2276
|
-
/**
|
|
2277
|
-
* Indicates what types of date components can be picked
|
|
2278
|
-
*
|
|
2279
|
-
* Defaults to {@link Form.DatePicker.Type.DateTime}
|
|
2280
|
-
*/
|
|
2281
|
-
type?: FormDatePickerType;
|
|
2282
|
-
}
|
|
2283
|
-
}
|
|
2284
|
-
export namespace Separator {
|
|
2285
|
-
/**
|
|
2286
|
-
* Props of the {@link Form.Separator} React component.
|
|
2287
|
-
*/
|
|
2288
|
-
export interface Props {
|
|
2289
|
-
}
|
|
2290
|
-
}
|
|
2291
|
-
export namespace TagPicker {
|
|
2292
|
-
/**
|
|
2293
|
-
* Props of the {@link Form.TagPicker} React component.
|
|
2294
|
-
* The {@link Form.TagPicker.Props.value} here is the IDs ({@link Form.TagPicker.Item.Props.id}) of the default selected items.
|
|
2295
|
-
*/
|
|
2296
|
-
export interface Props extends Form.ItemProps<string[]> {
|
|
2297
|
-
/**
|
|
2298
|
-
* The list of tags.
|
|
2299
|
-
*/
|
|
2300
|
-
children?: ReactNode;
|
|
2301
|
-
/**
|
|
2302
|
-
* Placeholder text shown in the token field.
|
|
2303
|
-
*/
|
|
2304
|
-
placeholder?: string;
|
|
2305
|
-
}
|
|
2306
|
-
export namespace Item {
|
|
2307
|
-
/**
|
|
2308
|
-
* Props of the {@link Form.TagPicker.Item} React component.
|
|
2309
|
-
*/
|
|
2310
|
-
export interface Props {
|
|
2311
|
-
/**
|
|
2312
|
-
* Value of the tag.
|
|
2313
|
-
* Make sure to assign unique value for each item.
|
|
2314
|
-
*/
|
|
2315
|
-
value: string;
|
|
2316
|
-
/**
|
|
2317
|
-
* The display title of the tag.
|
|
2318
|
-
*/
|
|
2319
|
-
title: string;
|
|
2320
|
-
/**
|
|
2321
|
-
* An icon to show in the tag.
|
|
2322
|
-
*/
|
|
2323
|
-
icon?: Image.ImageLike;
|
|
2324
|
-
}
|
|
2325
|
-
}
|
|
2326
|
-
}
|
|
2327
|
-
export namespace PasswordField {
|
|
2328
|
-
/**
|
|
2329
|
-
* Props of the {@link Form.PasswordField} React component.
|
|
2330
|
-
*/
|
|
2331
|
-
export interface Props extends Form.ItemProps<string> {
|
|
2332
|
-
/**
|
|
2333
|
-
* Placeholder text shown in the password field.
|
|
2334
|
-
*/
|
|
2335
|
-
placeholder?: string;
|
|
2336
|
-
}
|
|
2337
|
-
}
|
|
2338
|
-
export namespace Description {
|
|
2339
|
-
/**
|
|
2340
|
-
* Props of the {@link Form.Description} React component.
|
|
2341
|
-
*/
|
|
2342
|
-
export interface Props {
|
|
2343
|
-
/**
|
|
2344
|
-
* The display title of the left side from the description item.
|
|
2345
|
-
*/
|
|
2346
|
-
title?: string;
|
|
2347
|
-
/**
|
|
2348
|
-
* Text that will be displayed in the middle.
|
|
2349
|
-
*/
|
|
2350
|
-
text: string;
|
|
2351
|
-
}
|
|
2352
|
-
}
|
|
2353
|
-
}
|
|
2354
|
-
|
|
2355
|
-
/**
|
|
2356
|
-
* @deprecated Use `Form.Checkbox` instead.
|
|
2357
|
-
*/
|
|
2358
|
-
export declare const FormCheckbox: typeof Form.Checkbox;
|
|
2359
|
-
|
|
2360
|
-
/**
|
|
2361
|
-
* See {@link Form.Checkbox}
|
|
2362
|
-
*/
|
|
2363
|
-
declare function FormCheckbox_2(props: Form.Checkbox.Props): ReactElement<Form.Checkbox.Props>;
|
|
2364
|
-
|
|
2365
|
-
declare namespace FormCheckbox_2 {
|
|
2366
|
-
var propTypes: {
|
|
2367
|
-
id: PropTypes.Validator<string>;
|
|
2368
|
-
title: PropTypes.Requireable<string>;
|
|
2369
|
-
storeValue: PropTypes.Requireable<boolean>;
|
|
2370
|
-
value: PropTypes.Requireable<boolean>;
|
|
2371
|
-
defaultValue: PropTypes.Requireable<boolean>;
|
|
2372
|
-
label: PropTypes.Requireable<string>;
|
|
2373
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
2374
|
-
};
|
|
2375
|
-
var displayName: string;
|
|
2376
|
-
}
|
|
2377
|
-
|
|
2378
|
-
/**
|
|
2379
|
-
* @deprecated Use `Form.Checkbox.Props` instead.
|
|
2380
|
-
*/
|
|
2381
|
-
export declare interface FormCheckboxProps extends Form.Checkbox.Props {
|
|
2382
|
-
}
|
|
2383
|
-
|
|
2384
|
-
/**
|
|
2385
|
-
* @deprecated Use `Form.DatePicker` instead.
|
|
2386
|
-
*/
|
|
2387
|
-
export declare const FormDatePicker: typeof Form.DatePicker;
|
|
2388
|
-
|
|
2389
|
-
/**
|
|
2390
|
-
* See {@link Form.DatePicker}
|
|
2391
|
-
*/
|
|
2392
|
-
declare function FormDatePicker_2(props: Form.DatePicker.Props): ReactElement<Form.DatePicker.Props>;
|
|
2393
|
-
|
|
2394
|
-
declare namespace FormDatePicker_2 {
|
|
2395
|
-
var propTypes: {
|
|
2396
|
-
id: PropTypes.Validator<string>;
|
|
2397
|
-
title: PropTypes.Requireable<string>;
|
|
2398
|
-
storeValue: PropTypes.Requireable<boolean>;
|
|
2399
|
-
value: PropTypes.Requireable<Date>;
|
|
2400
|
-
defaultValue: PropTypes.Requireable<Date>;
|
|
2401
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
2402
|
-
};
|
|
2403
|
-
var displayName: string;
|
|
2404
|
-
}
|
|
2405
|
-
|
|
2406
|
-
declare namespace FormDatePicker_2 {
|
|
2692
|
+
Description: typeof Description;
|
|
2407
2693
|
/**
|
|
2408
|
-
*
|
|
2409
|
-
*
|
|
2410
|
-
*
|
|
2694
|
+
* A form item with a dropdown menu.
|
|
2695
|
+
*
|
|
2696
|
+
* @example
|
|
2697
|
+
* Uncontrolled dropdown
|
|
2698
|
+
*
|
|
2699
|
+
* ```typescript
|
|
2700
|
+
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
2701
|
+
*
|
|
2702
|
+
* export default function Command() {
|
|
2703
|
+
* return (
|
|
2704
|
+
* <Form
|
|
2705
|
+
* actions={
|
|
2706
|
+
* <ActionPanel>
|
|
2707
|
+
* <Action.SubmitForm title="Submit Favorite" onSubmit={(values) => console.log(values)} />
|
|
2708
|
+
* </ActionPanel>
|
|
2709
|
+
* }
|
|
2710
|
+
* >
|
|
2711
|
+
* <Form.Dropdown id="emoji" title="Favorite Emoji" defaultValue="lol">
|
|
2712
|
+
* <Form.Dropdown.Item value="poop" title="Pile of poop" icon="💩" />
|
|
2713
|
+
* <Form.Dropdown.Item value="rocket" title="Rocket" icon="🚀" />
|
|
2714
|
+
* <Form.Dropdown.Item value="lol" title="Rolling on the floor laughing face" icon="🤣" />
|
|
2715
|
+
* </Form.Dropdown>
|
|
2716
|
+
* </Form>
|
|
2717
|
+
* );
|
|
2718
|
+
* }
|
|
2719
|
+
* ```
|
|
2720
|
+
*
|
|
2721
|
+
* @example
|
|
2722
|
+
* Controlled dropdown
|
|
2723
|
+
*
|
|
2724
|
+
* ```typescript
|
|
2725
|
+
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
2726
|
+
* import { useState } from "react";
|
|
2727
|
+
*
|
|
2728
|
+
* export default function Command() {
|
|
2729
|
+
* const [programmingLanguage, setProgrammingLanguage] = useState<string>("typescript");
|
|
2730
|
+
*
|
|
2731
|
+
* return (
|
|
2732
|
+
* <Form
|
|
2733
|
+
* actions={
|
|
2734
|
+
* <ActionPanel>
|
|
2735
|
+
* <Action.SubmitForm title="Submit Favorite" onSubmit={(values) => console.log(values)} />
|
|
2736
|
+
* </ActionPanel>
|
|
2737
|
+
* }
|
|
2738
|
+
* >
|
|
2739
|
+
* <Form.Dropdown
|
|
2740
|
+
* id="dropdown"
|
|
2741
|
+
* title="Favorite Language"
|
|
2742
|
+
* value={programmingLanguage}
|
|
2743
|
+
* onChange={setProgrammingLanguage}
|
|
2744
|
+
* >
|
|
2745
|
+
* <Form.Dropdown.Item value="cpp" title="C++" />
|
|
2746
|
+
* <Form.Dropdown.Item value="javascript" title="JavaScript" />
|
|
2747
|
+
* <Form.Dropdown.Item value="ruby" title="Ruby" />
|
|
2748
|
+
* <Form.Dropdown.Item value="python" title="Python" />
|
|
2749
|
+
* <Form.Dropdown.Item value="swift" title="Swift" />
|
|
2750
|
+
* <Form.Dropdown.Item value="typescript" title="TypeScript" />
|
|
2751
|
+
* </Form.Dropdown>
|
|
2752
|
+
* </Form>
|
|
2753
|
+
* );
|
|
2754
|
+
* }
|
|
2755
|
+
* ```
|
|
2411
2756
|
*/
|
|
2412
|
-
|
|
2413
|
-
}
|
|
2414
|
-
|
|
2415
|
-
/**
|
|
2416
|
-
* @deprecated Use `Form.DatePicker.Props` instead.
|
|
2417
|
-
*/
|
|
2418
|
-
export declare interface FormDatePickerProps extends Form.DatePicker.Props {
|
|
2419
|
-
}
|
|
2420
|
-
|
|
2421
|
-
declare enum FormDatePickerType {
|
|
2757
|
+
Dropdown: typeof Dropdown;
|
|
2422
2758
|
/**
|
|
2423
|
-
*
|
|
2759
|
+
* A form item with a secure text field for password-entry in which the entered characters must be kept secret.
|
|
2760
|
+
*
|
|
2761
|
+
* @example
|
|
2762
|
+
* Uncontrolled password field
|
|
2763
|
+
*
|
|
2764
|
+
* ```typescript
|
|
2765
|
+
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
2766
|
+
*
|
|
2767
|
+
* export default function Command() {
|
|
2768
|
+
* return (
|
|
2769
|
+
* <Form
|
|
2770
|
+
* actions={
|
|
2771
|
+
* <ActionPanel>
|
|
2772
|
+
* <Action.SubmitFormAction title="Submit Password" onSubmit={(values) => console.log(values)} />
|
|
2773
|
+
* </ActionPanel>
|
|
2774
|
+
* }
|
|
2775
|
+
* >
|
|
2776
|
+
* <Form.PasswordField id="password" title="Enter Password" />
|
|
2777
|
+
* </Form>
|
|
2778
|
+
* );
|
|
2779
|
+
* }
|
|
2780
|
+
* ```
|
|
2781
|
+
*
|
|
2782
|
+
* @example
|
|
2783
|
+
* Controlled password field
|
|
2784
|
+
*
|
|
2785
|
+
* ```typescript
|
|
2786
|
+
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
2787
|
+
* import { useState } from "react";
|
|
2788
|
+
*
|
|
2789
|
+
* export default function Command() {
|
|
2790
|
+
* const [password, setPassword] = useState<string>();
|
|
2791
|
+
*
|
|
2792
|
+
* return (
|
|
2793
|
+
* <Form
|
|
2794
|
+
* actions={
|
|
2795
|
+
* <ActionPanel>
|
|
2796
|
+
* <Action.SubmitForm title="Submit Password" onSubmit={(values) => console.log(values)} />
|
|
2797
|
+
* </ActionPanel>
|
|
2798
|
+
* }
|
|
2799
|
+
* >
|
|
2800
|
+
* <Form.PasswordField id="password" value={password} onChange={setPassword} />
|
|
2801
|
+
* </Form>
|
|
2802
|
+
* );
|
|
2803
|
+
* }
|
|
2804
|
+
* ```
|
|
2424
2805
|
*/
|
|
2425
|
-
|
|
2806
|
+
PasswordField: typeof PasswordField;
|
|
2426
2807
|
/**
|
|
2427
|
-
*
|
|
2808
|
+
* A form item that shows a separator line.
|
|
2809
|
+
* Use for grouping and visually separating form items.
|
|
2810
|
+
*
|
|
2811
|
+
* @example
|
|
2812
|
+
* ```typescript
|
|
2813
|
+
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
2814
|
+
*
|
|
2815
|
+
* export default function Command() {
|
|
2816
|
+
* return (
|
|
2817
|
+
* <Form
|
|
2818
|
+
* actions={
|
|
2819
|
+
* <ActionPanel>
|
|
2820
|
+
* <Action.SubmitForm title="Submit Form" onSubmit={(values) => console.log(values)} />
|
|
2821
|
+
* </ActionPanel>
|
|
2822
|
+
* }
|
|
2823
|
+
* >
|
|
2824
|
+
* <Form.TextField id="textfield" />
|
|
2825
|
+
* <Form.Separator />
|
|
2826
|
+
* <Form.TextArea id="textarea" />
|
|
2827
|
+
* </Form>
|
|
2828
|
+
* );
|
|
2829
|
+
* }
|
|
2830
|
+
* ```
|
|
2428
2831
|
*/
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2832
|
+
Separator: typeof Separator;
|
|
2833
|
+
/**
|
|
2834
|
+
* A form item with a tag picker that allows the user to select multiple items.
|
|
2835
|
+
*
|
|
2836
|
+
* @example
|
|
2837
|
+
* Uncontrolled tag picker
|
|
2838
|
+
*
|
|
2839
|
+
* ```typescript
|
|
2840
|
+
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
2841
|
+
*
|
|
2842
|
+
* export default function Command() {
|
|
2843
|
+
* return (
|
|
2844
|
+
* <Form
|
|
2845
|
+
* actions={
|
|
2846
|
+
* <ActionPanel>
|
|
2847
|
+
* <Action.SubmitForm title="Submit Favorite" onSubmit={(values) => console.log(values)} />
|
|
2848
|
+
* </ActionPanel>
|
|
2849
|
+
* }
|
|
2850
|
+
* >
|
|
2851
|
+
* <Form.TagPicker id="sports" title="Favorite Sports" defaultValue={["football"]}>
|
|
2852
|
+
* <Form.TagPicker.Item value="basketball" title="Basketball" icon="🏀" />
|
|
2853
|
+
* <Form.TagPicker.Item value="football" title="Football" icon="⚽️" />
|
|
2854
|
+
* <Form.TagPicker.Item value="tennis" title="Tennis" icon="🎾" />
|
|
2855
|
+
* </Form.TagPicker>
|
|
2856
|
+
* </Form>
|
|
2857
|
+
* );
|
|
2858
|
+
* }
|
|
2859
|
+
* ```
|
|
2860
|
+
*
|
|
2861
|
+
* @example
|
|
2862
|
+
* Controlled tag picker
|
|
2863
|
+
*
|
|
2864
|
+
* ```typescript
|
|
2865
|
+
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
2866
|
+
* import { useState } from "react";
|
|
2867
|
+
*
|
|
2868
|
+
* export default function Command() {
|
|
2869
|
+
* const [countries, setCountries] = useState<string[]>(["ger", "ned", "pol"]);
|
|
2870
|
+
*
|
|
2871
|
+
* return (
|
|
2872
|
+
* <Form
|
|
2873
|
+
* actions={
|
|
2874
|
+
* <ActionPanel>
|
|
2875
|
+
* <Action.SubmitForm title="Submit Countries" onSubmit={(values) => console.log(values)} />
|
|
2876
|
+
* </ActionPanel>
|
|
2877
|
+
* }
|
|
2878
|
+
* >
|
|
2879
|
+
* <Form.TagPicker id="countries" title="Visited Countries" value={countries} onChange={setCountries}>
|
|
2880
|
+
* <Form.TagPicker.Item value="ger" title="Germany" icon="🇩🇪" />
|
|
2881
|
+
* <Form.TagPicker.Item value="ind" title="India" icon="🇮🇳" />
|
|
2882
|
+
* <Form.TagPicker.Item value="ned" title="Netherlands" icon="🇳🇱" />
|
|
2883
|
+
* <Form.TagPicker.Item value="nor" title="Norway" icon="🇳🇴" />
|
|
2884
|
+
* <Form.TagPicker.Item value="pol" title="Poland" icon="🇵🇱" />
|
|
2885
|
+
* <Form.TagPicker.Item value="rus" title="Russia" icon="🇷🇺" />
|
|
2886
|
+
* <Form.TagPicker.Item value="sco" title="Scotland" icon="🏴" />
|
|
2887
|
+
* </Form.TagPicker>
|
|
2888
|
+
* </Form>
|
|
2889
|
+
* );
|
|
2890
|
+
* }
|
|
2891
|
+
* ```
|
|
2892
|
+
*/
|
|
2893
|
+
TagPicker: typeof TagPicker;
|
|
2467
2894
|
/**
|
|
2468
|
-
*
|
|
2895
|
+
* A form item with a text area for input.
|
|
2896
|
+
* The item supports multiline text entry.
|
|
2469
2897
|
*
|
|
2470
|
-
* @
|
|
2471
|
-
*
|
|
2898
|
+
* @example
|
|
2899
|
+
* Uncontrolled text area
|
|
2900
|
+
*
|
|
2901
|
+
* ```typescript
|
|
2902
|
+
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
2903
|
+
*
|
|
2904
|
+
* const DESCRIPTION =
|
|
2905
|
+
* "We spend too much time staring at loading indicators. The Raycast team is dedicated to make everybody interact faster with their computers.";
|
|
2906
|
+
*
|
|
2907
|
+
* export default function Command() {
|
|
2908
|
+
* return (
|
|
2909
|
+
* <Form
|
|
2910
|
+
* actions={
|
|
2911
|
+
* <ActionPanel>
|
|
2912
|
+
* <Action.SubmitForm title="Submit Description" onSubmit={(values) => console.log(values)} />
|
|
2913
|
+
* </ActionPanel>
|
|
2914
|
+
* }
|
|
2915
|
+
* >
|
|
2916
|
+
* <Form.TextArea id="description" defaultValue={DESCRIPTION} />
|
|
2917
|
+
* </Form>
|
|
2918
|
+
* );
|
|
2919
|
+
* }
|
|
2920
|
+
* ```
|
|
2472
2921
|
*
|
|
2473
2922
|
* @example
|
|
2923
|
+
* Controlled text area
|
|
2924
|
+
*
|
|
2474
2925
|
* ```typescript
|
|
2475
2926
|
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
2927
|
+
* import { useState } from "react";
|
|
2476
2928
|
*
|
|
2477
2929
|
* export default function Command() {
|
|
2930
|
+
* const [description, setDescription] = useState<string>();
|
|
2931
|
+
*
|
|
2478
2932
|
* return (
|
|
2479
2933
|
* <Form
|
|
2480
2934
|
* actions={
|
|
2481
2935
|
* <ActionPanel>
|
|
2482
|
-
* <Action.SubmitForm title="Submit
|
|
2936
|
+
* <Action.SubmitForm title="Submit Description" onSubmit={(values) => console.log(values)} />
|
|
2483
2937
|
* </ActionPanel>
|
|
2484
2938
|
* }
|
|
2485
2939
|
* >
|
|
2486
|
-
* <Form.
|
|
2487
|
-
* <Form.Dropdown.Section title="Fruits">
|
|
2488
|
-
* <Form.Dropdown.Item value="apple" title="Apple" icon="🍎" />
|
|
2489
|
-
* <Form.Dropdown.Item value="banana" title="Banana" icon="🍌" />
|
|
2490
|
-
* </Form.Dropdown.Section>
|
|
2491
|
-
* <Form.Dropdown.Section title="Vegetables">
|
|
2492
|
-
* <Form.Dropdown.Item value="broccoli" title="Broccoli" icon="🥦" />
|
|
2493
|
-
* <Form.Dropdown.Item value="carrot" title="Carrot" icon="🥕" />
|
|
2494
|
-
* </Form.Dropdown.Section>
|
|
2495
|
-
* </Form.Dropdown>
|
|
2940
|
+
* <Form.TextArea id="description" value={description} onChange={setDescription} />
|
|
2496
2941
|
* </Form>
|
|
2497
2942
|
* );
|
|
2498
2943
|
* }
|
|
2499
2944
|
* ```
|
|
2500
2945
|
*/
|
|
2501
|
-
|
|
2946
|
+
TextArea: typeof TextArea;
|
|
2502
2947
|
/**
|
|
2503
|
-
* A
|
|
2948
|
+
* A form item with a text field for input.
|
|
2504
2949
|
*
|
|
2505
2950
|
* @example
|
|
2951
|
+
* Uncontrolled text field
|
|
2952
|
+
*
|
|
2506
2953
|
* ```typescript
|
|
2507
2954
|
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
2508
2955
|
*
|
|
@@ -2511,310 +2958,171 @@ declare namespace FormDropdown_2 {
|
|
|
2511
2958
|
* <Form
|
|
2512
2959
|
* actions={
|
|
2513
2960
|
* <ActionPanel>
|
|
2514
|
-
* <Action.SubmitForm title="Submit
|
|
2961
|
+
* <Action.SubmitForm title="Submit Name" onSubmit={(values) => console.log(values)} />
|
|
2515
2962
|
* </ActionPanel>
|
|
2516
2963
|
* }
|
|
2517
2964
|
* >
|
|
2518
|
-
* <Form.
|
|
2519
|
-
* <Form.Dropdown.Item value="circle" title="Cirlce" icon={Icon.Circle} />
|
|
2520
|
-
* </Form.Dropdown>
|
|
2965
|
+
* <Form.TextField id="name" defaultValue="Steve" />
|
|
2521
2966
|
* </Form>
|
|
2522
2967
|
* );
|
|
2523
2968
|
* }
|
|
2524
2969
|
* ```
|
|
2525
|
-
*/
|
|
2526
|
-
const Item: typeof FormDropdownItem_2;
|
|
2527
|
-
}
|
|
2528
|
-
|
|
2529
|
-
/**
|
|
2530
|
-
* @deprecated Use `Form.Dropdown.Item` instead.
|
|
2531
|
-
*/
|
|
2532
|
-
export declare const FormDropdownItem: typeof Form.Dropdown.Item;
|
|
2533
|
-
|
|
2534
|
-
/**
|
|
2535
|
-
* See {@link Form.Dropdown.Item}
|
|
2536
|
-
*/
|
|
2537
|
-
declare function FormDropdownItem_2(props: Form.Dropdown.Item.Props): ReactElement<Form.Dropdown.Item.Props>;
|
|
2538
|
-
|
|
2539
|
-
declare namespace FormDropdownItem_2 {
|
|
2540
|
-
var propTypes: {
|
|
2541
|
-
value: PropTypes.Requireable<string>;
|
|
2542
|
-
title: PropTypes.Validator<string>;
|
|
2543
|
-
icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
2544
|
-
fileIcon: PropTypes.Validator<string>;
|
|
2545
|
-
}>> | PropTypes.InferProps<{
|
|
2546
|
-
source: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
2547
|
-
light: PropTypes.Validator<string>;
|
|
2548
|
-
dark: PropTypes.Validator<string>;
|
|
2549
|
-
}>>;
|
|
2550
|
-
fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
2551
|
-
light: PropTypes.Validator<string>;
|
|
2552
|
-
dark: PropTypes.Validator<string>;
|
|
2553
|
-
}>>;
|
|
2554
|
-
mask: PropTypes.Requireable<Image.Mask>;
|
|
2555
|
-
tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
2556
|
-
light: PropTypes.Validator<string>;
|
|
2557
|
-
dark: PropTypes.Validator<string>;
|
|
2558
|
-
adjustContrast: PropTypes.Requireable<boolean>;
|
|
2559
|
-
}>>;
|
|
2560
|
-
}>>;
|
|
2561
|
-
};
|
|
2562
|
-
var displayName: string;
|
|
2563
|
-
}
|
|
2564
|
-
|
|
2565
|
-
/**
|
|
2566
|
-
* @deprecated Use `Form.Dropdown.Item.Props` instead.
|
|
2567
|
-
*/
|
|
2568
|
-
export declare interface FormDropdownItemProps extends Form.Dropdown.Item.Props {
|
|
2569
|
-
}
|
|
2570
|
-
|
|
2571
|
-
/**
|
|
2572
|
-
* @deprecated Use `Form.Dropdown.Props` instead.
|
|
2573
|
-
*/
|
|
2574
|
-
export declare interface FormDropdownProps extends Form.Dropdown.Props {
|
|
2575
|
-
}
|
|
2576
|
-
|
|
2577
|
-
/**
|
|
2578
|
-
* @deprecated Use `Form.Dropdown.Section` instead.
|
|
2579
|
-
*/
|
|
2580
|
-
export declare const FormDropdownSection: typeof Form.Dropdown.Section;
|
|
2581
|
-
|
|
2582
|
-
/**
|
|
2583
|
-
* See {@link Form.Dropdown.Section}
|
|
2584
|
-
*/
|
|
2585
|
-
declare function FormDropdownSection_2(props: Form.Dropdown.Section.Props): ReactElement<Form.Dropdown.Section.Props>;
|
|
2586
|
-
|
|
2587
|
-
declare namespace FormDropdownSection_2 {
|
|
2588
|
-
var propTypes: {
|
|
2589
|
-
title: PropTypes.Requireable<string>;
|
|
2590
|
-
};
|
|
2591
|
-
var displayName: string;
|
|
2592
|
-
}
|
|
2593
|
-
|
|
2594
|
-
/**
|
|
2595
|
-
* @deprecated Use `Form.Dropdown.Section.Props` instead.
|
|
2596
|
-
*/
|
|
2597
|
-
export declare interface FormDropdownSectionProps extends Form.Dropdown.Section.Props {
|
|
2598
|
-
}
|
|
2599
|
-
|
|
2600
|
-
/**
|
|
2601
|
-
* @deprecated Use `Form.ItemProps` instead.
|
|
2602
|
-
*/
|
|
2603
|
-
export declare interface FormItemProps<Value extends Form.Value> extends Form.ItemProps<Value> {
|
|
2604
|
-
}
|
|
2605
|
-
|
|
2606
|
-
/**
|
|
2607
|
-
* See {@link Form.PasswordField}
|
|
2608
|
-
*/
|
|
2609
|
-
declare function FormPasswordField(props: Form.PasswordField.Props): ReactElement<Form.PasswordField.Props>;
|
|
2610
|
-
|
|
2611
|
-
declare namespace FormPasswordField {
|
|
2612
|
-
var propTypes: {
|
|
2613
|
-
id: PropTypes.Validator<string>;
|
|
2614
|
-
title: PropTypes.Requireable<string>;
|
|
2615
|
-
storeValue: PropTypes.Requireable<boolean>;
|
|
2616
|
-
value: PropTypes.Requireable<string>;
|
|
2617
|
-
defaultValue: PropTypes.Requireable<string>;
|
|
2618
|
-
placeholder: PropTypes.Requireable<string>;
|
|
2619
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
2620
|
-
};
|
|
2621
|
-
var displayName: string;
|
|
2622
|
-
}
|
|
2623
|
-
|
|
2624
|
-
/**
|
|
2625
|
-
* @deprecated Use `Form.Props` instead.
|
|
2626
|
-
*/
|
|
2627
|
-
export declare interface FormProps extends Form.Props {
|
|
2628
|
-
}
|
|
2629
|
-
|
|
2630
|
-
/**
|
|
2631
|
-
* @deprecated Use `Form.Separator` instead.
|
|
2632
|
-
*/
|
|
2633
|
-
export declare const FormSeparator: typeof Form.Separator;
|
|
2634
|
-
|
|
2635
|
-
/**
|
|
2636
|
-
* See {@link Form.Separator}
|
|
2637
|
-
*/
|
|
2638
|
-
declare function FormSeparator_2(): ReactElement<Form.Separator.Props>;
|
|
2639
|
-
|
|
2640
|
-
declare namespace FormSeparator_2 {
|
|
2641
|
-
var displayName: string;
|
|
2642
|
-
}
|
|
2643
|
-
|
|
2644
|
-
/**
|
|
2645
|
-
* @deprecated Use `Form.Separator.Props` instead.
|
|
2646
|
-
*/
|
|
2647
|
-
export declare interface FormSeparatorProps extends Form.Separator.Props {
|
|
2648
|
-
}
|
|
2649
|
-
|
|
2650
|
-
/**
|
|
2651
|
-
* @deprecated Use `Form.TagPicker` instead.
|
|
2652
|
-
*/
|
|
2653
|
-
export declare const FormTagPicker: typeof Form.TagPicker;
|
|
2654
|
-
|
|
2655
|
-
/**
|
|
2656
|
-
* See {@link Form.TagPicker}
|
|
2657
|
-
*/
|
|
2658
|
-
declare function FormTagPicker_2(props: Form.TagPicker.Props): ReactElement<Form.TagPicker.Props>;
|
|
2659
|
-
|
|
2660
|
-
declare namespace FormTagPicker_2 {
|
|
2661
|
-
var propTypes: {
|
|
2662
|
-
id: PropTypes.Validator<string>;
|
|
2663
|
-
title: PropTypes.Requireable<string>;
|
|
2664
|
-
storeValue: PropTypes.Requireable<boolean>;
|
|
2665
|
-
placeholder: PropTypes.Requireable<string>;
|
|
2666
|
-
value: PropTypes.Requireable<string[]>;
|
|
2667
|
-
defaultValue: PropTypes.Requireable<string[]>;
|
|
2668
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
2669
|
-
};
|
|
2670
|
-
var displayName: string;
|
|
2671
|
-
}
|
|
2672
|
-
|
|
2673
|
-
declare namespace FormTagPicker_2 {
|
|
2674
|
-
/**
|
|
2675
|
-
* A tag picker item in a {@link Form.TagPicker}.
|
|
2676
2970
|
*
|
|
2677
2971
|
* @example
|
|
2972
|
+
* Controlled text field
|
|
2973
|
+
*
|
|
2678
2974
|
* ```typescript
|
|
2679
|
-
* import { ActionPanel,
|
|
2975
|
+
* import { ActionPanel, Form, Action } from "@raycast/api";
|
|
2976
|
+
* import { useState } from "react";
|
|
2680
2977
|
*
|
|
2681
2978
|
* export default function Command() {
|
|
2979
|
+
* const [name, setName] = useState<string>();
|
|
2980
|
+
*
|
|
2682
2981
|
* return (
|
|
2683
2982
|
* <Form
|
|
2684
2983
|
* actions={
|
|
2685
2984
|
* <ActionPanel>
|
|
2686
|
-
* <Action.SubmitForm title="Submit
|
|
2985
|
+
* <Action.SubmitForm title="Submit Name" onSubmit={(values) => console.log(values)} />
|
|
2687
2986
|
* </ActionPanel>
|
|
2688
2987
|
* }
|
|
2689
2988
|
* >
|
|
2690
|
-
* <Form.
|
|
2691
|
-
* <Form.TagPicker.Item value="red" title="Red" icon={{ source: Icon.Circle, tintColor: Color.Red }} />
|
|
2692
|
-
* <Form.TagPicker.Item value="green" title="Green" icon={{ source: Icon.Circle, tintColor: Color.Green }} />
|
|
2693
|
-
* <Form.TagPicker.Item value="blue" title="Blue" icon={{ source: Icon.Circle, tintColor: Color.Blue }} />
|
|
2694
|
-
* </Form.TagPicker>
|
|
2989
|
+
* <Form.TextField id="name" value={name} onChange={setName} />
|
|
2695
2990
|
* </Form>
|
|
2696
2991
|
* );
|
|
2697
2992
|
* }
|
|
2698
2993
|
* ```
|
|
2699
2994
|
*/
|
|
2700
|
-
|
|
2995
|
+
TextField: typeof TextField;
|
|
2701
2996
|
}
|
|
2702
2997
|
|
|
2703
2998
|
/**
|
|
2704
|
-
* @deprecated Use
|
|
2999
|
+
* @deprecated Use {@link Form.Props} instead.
|
|
2705
3000
|
*/
|
|
2706
|
-
export declare
|
|
3001
|
+
export declare interface FormProps extends Form.Props {
|
|
3002
|
+
}
|
|
2707
3003
|
|
|
2708
3004
|
/**
|
|
2709
|
-
*
|
|
3005
|
+
* Props of the {@link Form} React component.
|
|
2710
3006
|
*/
|
|
2711
|
-
declare
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
title: PropTypes.Validator<string>;
|
|
2717
|
-
icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
2718
|
-
fileIcon: PropTypes.Validator<string>;
|
|
2719
|
-
}>> | PropTypes.InferProps<{
|
|
2720
|
-
source: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
2721
|
-
light: PropTypes.Validator<string>;
|
|
2722
|
-
dark: PropTypes.Validator<string>;
|
|
2723
|
-
}>>;
|
|
2724
|
-
fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
2725
|
-
light: PropTypes.Validator<string>;
|
|
2726
|
-
dark: PropTypes.Validator<string>;
|
|
2727
|
-
}>>;
|
|
2728
|
-
mask: PropTypes.Requireable<Image.Mask>;
|
|
2729
|
-
tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
2730
|
-
light: PropTypes.Validator<string>;
|
|
2731
|
-
dark: PropTypes.Validator<string>;
|
|
2732
|
-
adjustContrast: PropTypes.Requireable<boolean>;
|
|
2733
|
-
}>>;
|
|
2734
|
-
}>>;
|
|
2735
|
-
};
|
|
2736
|
-
var displayName: string;
|
|
3007
|
+
declare interface FormProps_2 extends ActionsInterface, NavigationChildInterface {
|
|
3008
|
+
/**
|
|
3009
|
+
* The Form.Item elements of the form.
|
|
3010
|
+
*/
|
|
3011
|
+
children?: ReactNode;
|
|
2737
3012
|
}
|
|
2738
3013
|
|
|
2739
3014
|
/**
|
|
2740
|
-
* @deprecated Use
|
|
3015
|
+
* @deprecated Use {@link Form.Separator} instead.
|
|
2741
3016
|
*/
|
|
2742
|
-
export declare
|
|
2743
|
-
}
|
|
3017
|
+
export declare const FormSeparator: typeof Form.Separator;
|
|
2744
3018
|
|
|
2745
3019
|
/**
|
|
2746
|
-
* @deprecated Use
|
|
3020
|
+
* @deprecated Use {@link Form.Separator.Props} instead.
|
|
2747
3021
|
*/
|
|
2748
|
-
export declare interface
|
|
3022
|
+
export declare interface FormSeparatorProps extends Form.Separator.Props {
|
|
2749
3023
|
}
|
|
2750
3024
|
|
|
2751
3025
|
/**
|
|
2752
|
-
* @deprecated Use
|
|
3026
|
+
* @deprecated Use {@link Form.TagPicker} instead.
|
|
2753
3027
|
*/
|
|
2754
|
-
export declare const
|
|
3028
|
+
export declare const FormTagPicker: typeof Form.TagPicker;
|
|
2755
3029
|
|
|
2756
3030
|
/**
|
|
2757
|
-
*
|
|
3031
|
+
* @deprecated Use {@link Form.TagPicker.Item} instead.
|
|
2758
3032
|
*/
|
|
2759
|
-
declare
|
|
3033
|
+
export declare const FormTagPickerItem: typeof Form.TagPicker.Item;
|
|
2760
3034
|
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
storeValue: PropTypes.Requireable<boolean>;
|
|
2766
|
-
value: PropTypes.Requireable<string>;
|
|
2767
|
-
defaultValue: PropTypes.Requireable<string>;
|
|
2768
|
-
placeholder: PropTypes.Requireable<string>;
|
|
2769
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
2770
|
-
};
|
|
2771
|
-
var displayName: string;
|
|
3035
|
+
/**
|
|
3036
|
+
* @deprecated Use {@link Form.TagPicker.Item.Props} instead.
|
|
3037
|
+
*/
|
|
3038
|
+
export declare interface FormTagPickerItemProps extends Form.TagPicker.Item.Props {
|
|
2772
3039
|
}
|
|
2773
3040
|
|
|
2774
3041
|
/**
|
|
2775
|
-
* @deprecated Use
|
|
3042
|
+
* @deprecated Use {@link Form.TagPicker.Props} instead.
|
|
2776
3043
|
*/
|
|
2777
|
-
export declare interface
|
|
3044
|
+
export declare interface FormTagPickerProps extends Form.TagPicker.Props {
|
|
2778
3045
|
}
|
|
2779
3046
|
|
|
2780
3047
|
/**
|
|
2781
|
-
* @deprecated Use
|
|
3048
|
+
* @deprecated Use {@link Form.TextArea} instead.
|
|
2782
3049
|
*/
|
|
2783
|
-
export declare const
|
|
3050
|
+
export declare const FormTextArea: typeof Form.TextArea;
|
|
2784
3051
|
|
|
2785
3052
|
/**
|
|
2786
|
-
*
|
|
3053
|
+
* @deprecated Use {@link Form.TextArea.Props} instead.
|
|
2787
3054
|
*/
|
|
2788
|
-
declare
|
|
2789
|
-
|
|
2790
|
-
declare namespace FormTextField_2 {
|
|
2791
|
-
var propTypes: {
|
|
2792
|
-
id: PropTypes.Validator<string>;
|
|
2793
|
-
title: PropTypes.Requireable<string>;
|
|
2794
|
-
storeValue: PropTypes.Requireable<boolean>;
|
|
2795
|
-
value: PropTypes.Requireable<string>;
|
|
2796
|
-
defaultValue: PropTypes.Requireable<string>;
|
|
2797
|
-
placeholder: PropTypes.Requireable<string>;
|
|
2798
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
2799
|
-
};
|
|
2800
|
-
var displayName: string;
|
|
3055
|
+
export declare interface FormTextAreaProps extends Form.TextArea.Props {
|
|
2801
3056
|
}
|
|
2802
3057
|
|
|
2803
3058
|
/**
|
|
2804
|
-
* @deprecated Use
|
|
3059
|
+
* @deprecated Use {@link Form.TextField} instead.
|
|
3060
|
+
*/
|
|
3061
|
+
export declare const FormTextField: typeof Form.TextField;
|
|
3062
|
+
|
|
3063
|
+
/**
|
|
3064
|
+
* @deprecated Use {@link Form.TextField.Props} instead.
|
|
2805
3065
|
*/
|
|
2806
3066
|
export declare interface FormTextFieldProps extends Form.TextField.Props {
|
|
2807
3067
|
}
|
|
2808
3068
|
|
|
2809
3069
|
/**
|
|
2810
|
-
* @deprecated Use
|
|
3070
|
+
* @deprecated Use {@link Form.Value} instead.
|
|
2811
3071
|
*/
|
|
2812
3072
|
export declare type FormValue = Form.Value;
|
|
2813
3073
|
|
|
2814
3074
|
/**
|
|
2815
|
-
*
|
|
3075
|
+
* A possible form item value that will be used as an input for the submit callback of a form.
|
|
3076
|
+
*/
|
|
3077
|
+
declare type FormValue_2 = string | number | boolean | string[] | number[] | Date | null;
|
|
3078
|
+
|
|
3079
|
+
/**
|
|
3080
|
+
* @deprecated Use {@link Form.Values} instead.
|
|
3081
|
+
*/
|
|
3082
|
+
export declare interface FormValues extends Form.Values {
|
|
3083
|
+
}
|
|
3084
|
+
|
|
3085
|
+
/**
|
|
3086
|
+
* Values of items in the form.
|
|
3087
|
+
*
|
|
3088
|
+
* @remarks
|
|
3089
|
+
* For type-safe form values, you can define your own interface. Use the ID's of the form items
|
|
3090
|
+
* as the property names. See the example for more details.
|
|
3091
|
+
*
|
|
3092
|
+
* @example
|
|
3093
|
+
* ```typescript
|
|
3094
|
+
* import { Form, Action } from "@raycast/api";
|
|
3095
|
+
*
|
|
3096
|
+
* interface Values {
|
|
3097
|
+
* todo: string;
|
|
3098
|
+
* due?: Date;
|
|
3099
|
+
* }
|
|
3100
|
+
*
|
|
3101
|
+
* export default function Command() {
|
|
3102
|
+
* function handleSubmit(values: Values) {
|
|
3103
|
+
* console.log(values);
|
|
3104
|
+
* }
|
|
3105
|
+
*
|
|
3106
|
+
* return (
|
|
3107
|
+
* <Form
|
|
3108
|
+
* actions={
|
|
3109
|
+
* <ActionPanel>
|
|
3110
|
+
* <Action.SubmitForm title="Submit" onSubmit={handleSubmit} />
|
|
3111
|
+
* </ActionPanel>
|
|
3112
|
+
* }
|
|
3113
|
+
* >
|
|
3114
|
+
* <Form.TextField id="todo" title="Todo" />
|
|
3115
|
+
* <Form.DatePicker id="due" title="Due Date" />
|
|
3116
|
+
* </Form>
|
|
3117
|
+
* );
|
|
3118
|
+
* };
|
|
3119
|
+
* ```
|
|
2816
3120
|
*/
|
|
2817
|
-
|
|
3121
|
+
declare interface FormValues_2 {
|
|
3122
|
+
/**
|
|
3123
|
+
* The form value of a given item.
|
|
3124
|
+
*/
|
|
3125
|
+
[item: string]: any;
|
|
2818
3126
|
}
|
|
2819
3127
|
|
|
2820
3128
|
/**
|
|
@@ -2855,7 +3163,7 @@ export declare function getApplications(path?: PathLike): Promise<Application[]>
|
|
|
2855
3163
|
export declare function getDefaultApplication(path: PathLike): Promise<Application>;
|
|
2856
3164
|
|
|
2857
3165
|
/**
|
|
2858
|
-
* @deprecated Use
|
|
3166
|
+
* @deprecated Use {@link LocalStorage.getItem} instead
|
|
2859
3167
|
*/
|
|
2860
3168
|
export declare const getLocalStorageItem: typeof LocalStorage.getItem;
|
|
2861
3169
|
|
|
@@ -3036,15 +3344,15 @@ export declare interface Image {
|
|
|
3036
3344
|
/**
|
|
3037
3345
|
* {@link Image.Fallback} image, in case `source` can't be loaded.
|
|
3038
3346
|
*/
|
|
3039
|
-
fallback?: Image.Fallback;
|
|
3347
|
+
fallback?: Image.Fallback | undefined | null;
|
|
3040
3348
|
/**
|
|
3041
3349
|
* A {@link Image.Mask} to apply to the image.
|
|
3042
3350
|
*/
|
|
3043
|
-
mask?: Image.Mask;
|
|
3351
|
+
mask?: Image.Mask | undefined | null;
|
|
3044
3352
|
/**
|
|
3045
3353
|
* A {@link Color.ColorLike} to tint all the non-transparent pixels of the image.
|
|
3046
3354
|
*/
|
|
3047
|
-
tintColor?: Color.ColorLike;
|
|
3355
|
+
tintColor?: Color.ColorLike | undefined | null;
|
|
3048
3356
|
}
|
|
3049
3357
|
|
|
3050
3358
|
export declare namespace Image {
|
|
@@ -3170,22 +3478,22 @@ export declare namespace Image {
|
|
|
3170
3478
|
}
|
|
3171
3479
|
|
|
3172
3480
|
/**
|
|
3173
|
-
* @deprecated Use
|
|
3481
|
+
* @deprecated Use {@link Image.ImageLike} instead
|
|
3174
3482
|
*/
|
|
3175
3483
|
export declare type ImageLike = Image.ImageLike;
|
|
3176
3484
|
|
|
3177
3485
|
/**
|
|
3178
|
-
* @deprecated Use
|
|
3486
|
+
* @deprecated Use {@link Image.Mask} instead
|
|
3179
3487
|
*/
|
|
3180
3488
|
export declare type ImageMask = Image.Mask;
|
|
3181
3489
|
|
|
3182
3490
|
/**
|
|
3183
|
-
* @deprecated Use
|
|
3491
|
+
* @deprecated Use {@link Image.Mask} instead
|
|
3184
3492
|
*/
|
|
3185
3493
|
export declare const ImageMask: typeof Image.Mask;
|
|
3186
3494
|
|
|
3187
3495
|
/**
|
|
3188
|
-
* @deprecated Use
|
|
3496
|
+
* @deprecated Use {@link Image.Source} instead
|
|
3189
3497
|
*/
|
|
3190
3498
|
export declare type ImageSource = Image.Source;
|
|
3191
3499
|
|
|
@@ -3249,18 +3557,18 @@ export declare namespace Keyboard {
|
|
|
3249
3557
|
}
|
|
3250
3558
|
|
|
3251
3559
|
/**
|
|
3252
|
-
* @deprecated Use
|
|
3560
|
+
* @deprecated Use {@link Keyboard.Shortcut} instead
|
|
3253
3561
|
*/
|
|
3254
3562
|
export declare interface KeyboardShortcut extends Keyboard.Shortcut {
|
|
3255
3563
|
}
|
|
3256
3564
|
|
|
3257
3565
|
/**
|
|
3258
|
-
* @deprecated Use
|
|
3566
|
+
* @deprecated Use {@link Keyboard.KeyEquivalent} instead
|
|
3259
3567
|
*/
|
|
3260
3568
|
export declare type KeyEquivalent = Keyboard.KeyEquivalent;
|
|
3261
3569
|
|
|
3262
3570
|
/**
|
|
3263
|
-
* @deprecated Use
|
|
3571
|
+
* @deprecated Use {@link Keyboard.KeyModifier} instead
|
|
3264
3572
|
*/
|
|
3265
3573
|
export declare type KeyModifier = Keyboard.KeyModifier;
|
|
3266
3574
|
|
|
@@ -3286,7 +3594,7 @@ export declare type KeyModifier = Keyboard.KeyModifier;
|
|
|
3286
3594
|
* >
|
|
3287
3595
|
* <List.Dropdown.Section title="Alcoholic Beverages">
|
|
3288
3596
|
* {drinkTypes.map((drinkType) => (
|
|
3289
|
-
* <List.Dropdown.Item key={drinkType.id} title={drinkType.name} value={drinkType.id} />
|
|
3597
|
+
* <List.Dropdown.Item key={drinkType.id} title={{ value: drinkType.name, tooltip: drinkType.definition }} value={drinkType.id} />
|
|
3290
3598
|
* ))}
|
|
3291
3599
|
* </List.Dropdown.Section>
|
|
3292
3600
|
* </List.Dropdown>
|
|
@@ -3294,7 +3602,9 @@ export declare type KeyModifier = Keyboard.KeyModifier;
|
|
|
3294
3602
|
* }
|
|
3295
3603
|
*
|
|
3296
3604
|
* export default function Command() {
|
|
3297
|
-
* const drinkTypes = [
|
|
3605
|
+
* const drinkTypes = [
|
|
3606
|
+
* { id: 1, name: 'Beer', definition: "an alcoholic drink made from yeast-fermented malt flavoured with hops" },
|
|
3607
|
+
* { id: 2, name: 'Wine', definition: "an alcoholic drink made from fermented grape juice" }];
|
|
3298
3608
|
* const onDrinkTypeChange = (newValue) => {
|
|
3299
3609
|
* console.log(newValue);
|
|
3300
3610
|
* }
|
|
@@ -3579,7 +3889,7 @@ export declare namespace List {
|
|
|
3579
3889
|
*/
|
|
3580
3890
|
icon?: Image.ImageLike;
|
|
3581
3891
|
/**
|
|
3582
|
-
* An optional tooltip
|
|
3892
|
+
* An optional tooltip shown when the accessory is hovered.
|
|
3583
3893
|
*/
|
|
3584
3894
|
tooltip?: string;
|
|
3585
3895
|
}
|
|
@@ -3634,7 +3944,7 @@ export declare namespace List {
|
|
|
3634
3944
|
* An {@link ActionPanel} that will be updated for the selected list item.
|
|
3635
3945
|
*/
|
|
3636
3946
|
actions?: ReactNode | null;
|
|
3637
|
-
|
|
3947
|
+
|
|
3638
3948
|
/**
|
|
3639
3949
|
* The `List.Item.Detail` to be rendered in the right side area when the parent List is showing details and the item is selected.
|
|
3640
3950
|
*/
|
|
@@ -3848,22 +4158,22 @@ declare namespace ListDropdownItem {
|
|
|
3848
4158
|
title: PropTypes.Validator<string>;
|
|
3849
4159
|
icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
3850
4160
|
fileIcon: PropTypes.Validator<string>;
|
|
3851
|
-
}>> | PropTypes.InferProps<{
|
|
3852
|
-
source: PropTypes.
|
|
4161
|
+
}>> | Required<PropTypes.InferProps<{
|
|
4162
|
+
source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
|
|
3853
4163
|
light: PropTypes.Validator<string>;
|
|
3854
4164
|
dark: PropTypes.Validator<string>;
|
|
3855
|
-
}
|
|
3856
|
-
fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
4165
|
+
}>>>;
|
|
4166
|
+
fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
3857
4167
|
light: PropTypes.Validator<string>;
|
|
3858
4168
|
dark: PropTypes.Validator<string>;
|
|
3859
|
-
}
|
|
4169
|
+
}>>>;
|
|
3860
4170
|
mask: PropTypes.Requireable<Image.Mask>;
|
|
3861
|
-
tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
4171
|
+
tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
3862
4172
|
light: PropTypes.Validator<string>;
|
|
3863
4173
|
dark: PropTypes.Validator<string>;
|
|
3864
4174
|
adjustContrast: PropTypes.Requireable<boolean>;
|
|
3865
|
-
}
|
|
3866
|
-
}
|
|
4175
|
+
}>>>;
|
|
4176
|
+
}>>>;
|
|
3867
4177
|
};
|
|
3868
4178
|
var displayName: string;
|
|
3869
4179
|
}
|
|
@@ -3887,22 +4197,22 @@ declare namespace ListEmptyView {
|
|
|
3887
4197
|
id: PropTypes.Requireable<string>;
|
|
3888
4198
|
icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
3889
4199
|
fileIcon: PropTypes.Validator<string>;
|
|
3890
|
-
}>> | PropTypes.InferProps<{
|
|
3891
|
-
source: PropTypes.
|
|
4200
|
+
}>> | Required<PropTypes.InferProps<{
|
|
4201
|
+
source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
|
|
3892
4202
|
light: PropTypes.Validator<string>;
|
|
3893
4203
|
dark: PropTypes.Validator<string>;
|
|
3894
|
-
}
|
|
3895
|
-
fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
4204
|
+
}>>>;
|
|
4205
|
+
fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
3896
4206
|
light: PropTypes.Validator<string>;
|
|
3897
4207
|
dark: PropTypes.Validator<string>;
|
|
3898
|
-
}
|
|
4208
|
+
}>>>;
|
|
3899
4209
|
mask: PropTypes.Requireable<Image.Mask>;
|
|
3900
|
-
tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
4210
|
+
tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
3901
4211
|
light: PropTypes.Validator<string>;
|
|
3902
4212
|
dark: PropTypes.Validator<string>;
|
|
3903
4213
|
adjustContrast: PropTypes.Requireable<boolean>;
|
|
3904
|
-
}
|
|
3905
|
-
}
|
|
4214
|
+
}>>>;
|
|
4215
|
+
}>>>;
|
|
3906
4216
|
title: PropTypes.Requireable<string>;
|
|
3907
4217
|
description: PropTypes.Requireable<string>;
|
|
3908
4218
|
actions: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
@@ -3911,7 +4221,7 @@ declare namespace ListEmptyView {
|
|
|
3911
4221
|
}
|
|
3912
4222
|
|
|
3913
4223
|
/**
|
|
3914
|
-
* @deprecated Use
|
|
4224
|
+
* @deprecated Use {@link List.item} instead.
|
|
3915
4225
|
*/
|
|
3916
4226
|
export declare const ListItem: typeof List.Item;
|
|
3917
4227
|
|
|
@@ -3934,81 +4244,81 @@ declare namespace ListItem_2 {
|
|
|
3934
4244
|
keywords: PropTypes.Requireable<string[]>;
|
|
3935
4245
|
icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
3936
4246
|
fileIcon: PropTypes.Validator<string>;
|
|
3937
|
-
}>> | PropTypes.InferProps<{
|
|
3938
|
-
source: PropTypes.
|
|
4247
|
+
}>> | Required<PropTypes.InferProps<{
|
|
4248
|
+
source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
|
|
3939
4249
|
light: PropTypes.Validator<string>;
|
|
3940
4250
|
dark: PropTypes.Validator<string>;
|
|
3941
|
-
}
|
|
3942
|
-
fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
4251
|
+
}>>>;
|
|
4252
|
+
fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
3943
4253
|
light: PropTypes.Validator<string>;
|
|
3944
4254
|
dark: PropTypes.Validator<string>;
|
|
3945
|
-
}
|
|
4255
|
+
}>>>;
|
|
3946
4256
|
mask: PropTypes.Requireable<Image.Mask>;
|
|
3947
|
-
tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
4257
|
+
tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
3948
4258
|
light: PropTypes.Validator<string>;
|
|
3949
4259
|
dark: PropTypes.Validator<string>;
|
|
3950
4260
|
adjustContrast: PropTypes.Requireable<boolean>;
|
|
3951
|
-
}
|
|
3952
|
-
}
|
|
4261
|
+
}>>>;
|
|
4262
|
+
}>> | Required<PropTypes.InferProps<{
|
|
3953
4263
|
value: PropTypes.Validator<string | Required<PropTypes.InferProps<{
|
|
3954
4264
|
fileIcon: PropTypes.Validator<string>;
|
|
3955
|
-
}>> | PropTypes.InferProps<{
|
|
3956
|
-
source: PropTypes.
|
|
4265
|
+
}>> | Required<PropTypes.InferProps<{
|
|
4266
|
+
source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
|
|
3957
4267
|
light: PropTypes.Validator<string>;
|
|
3958
4268
|
dark: PropTypes.Validator<string>;
|
|
3959
|
-
}
|
|
3960
|
-
fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
4269
|
+
}>>>;
|
|
4270
|
+
fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
3961
4271
|
light: PropTypes.Validator<string>;
|
|
3962
4272
|
dark: PropTypes.Validator<string>;
|
|
3963
|
-
}
|
|
4273
|
+
}>>>;
|
|
3964
4274
|
mask: PropTypes.Requireable<Image.Mask>;
|
|
3965
|
-
tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
4275
|
+
tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
3966
4276
|
light: PropTypes.Validator<string>;
|
|
3967
4277
|
dark: PropTypes.Validator<string>;
|
|
3968
4278
|
adjustContrast: PropTypes.Requireable<boolean>;
|
|
3969
|
-
}
|
|
3970
|
-
}
|
|
4279
|
+
}>>>;
|
|
4280
|
+
}>>>;
|
|
3971
4281
|
tooltip: PropTypes.Validator<string>;
|
|
3972
4282
|
}>>>;
|
|
3973
4283
|
accessoryTitle: PropTypes.Requireable<string>;
|
|
3974
4284
|
accessoryIcon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
3975
4285
|
fileIcon: PropTypes.Validator<string>;
|
|
3976
|
-
}>> | PropTypes.InferProps<{
|
|
3977
|
-
source: PropTypes.
|
|
4286
|
+
}>> | Required<PropTypes.InferProps<{
|
|
4287
|
+
source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
|
|
3978
4288
|
light: PropTypes.Validator<string>;
|
|
3979
4289
|
dark: PropTypes.Validator<string>;
|
|
3980
|
-
}
|
|
3981
|
-
fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
4290
|
+
}>>>;
|
|
4291
|
+
fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
3982
4292
|
light: PropTypes.Validator<string>;
|
|
3983
4293
|
dark: PropTypes.Validator<string>;
|
|
3984
|
-
}
|
|
4294
|
+
}>>>;
|
|
3985
4295
|
mask: PropTypes.Requireable<Image.Mask>;
|
|
3986
|
-
tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
4296
|
+
tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
3987
4297
|
light: PropTypes.Validator<string>;
|
|
3988
4298
|
dark: PropTypes.Validator<string>;
|
|
3989
4299
|
adjustContrast: PropTypes.Requireable<boolean>;
|
|
3990
|
-
}
|
|
3991
|
-
}
|
|
4300
|
+
}>>>;
|
|
4301
|
+
}>>>;
|
|
3992
4302
|
accessories: PropTypes.Requireable<Required<PropTypes.InferProps<{
|
|
3993
4303
|
text: PropTypes.Requireable<string>;
|
|
3994
4304
|
icon: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
3995
4305
|
fileIcon: PropTypes.Validator<string>;
|
|
3996
|
-
}>> | PropTypes.InferProps<{
|
|
3997
|
-
source: PropTypes.
|
|
4306
|
+
}>> | Required<PropTypes.InferProps<{
|
|
4307
|
+
source: PropTypes.Validator<string | Required<PropTypes.InferProps<{
|
|
3998
4308
|
light: PropTypes.Validator<string>;
|
|
3999
4309
|
dark: PropTypes.Validator<string>;
|
|
4000
|
-
}
|
|
4001
|
-
fallback: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
4310
|
+
}>>>;
|
|
4311
|
+
fallback: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
4002
4312
|
light: PropTypes.Validator<string>;
|
|
4003
4313
|
dark: PropTypes.Validator<string>;
|
|
4004
|
-
}
|
|
4314
|
+
}>>>;
|
|
4005
4315
|
mask: PropTypes.Requireable<Image.Mask>;
|
|
4006
|
-
tintColor: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
4316
|
+
tintColor: PropTypes.Requireable<string | Required<PropTypes.InferProps<{
|
|
4007
4317
|
light: PropTypes.Validator<string>;
|
|
4008
4318
|
dark: PropTypes.Validator<string>;
|
|
4009
4319
|
adjustContrast: PropTypes.Requireable<boolean>;
|
|
4010
|
-
}
|
|
4011
|
-
}
|
|
4320
|
+
}>>>;
|
|
4321
|
+
}>>>;
|
|
4012
4322
|
tooltip: PropTypes.Requireable<string>;
|
|
4013
4323
|
}>>[]>;
|
|
4014
4324
|
};
|
|
@@ -4053,19 +4363,19 @@ declare namespace ListItemDetail {
|
|
|
4053
4363
|
}
|
|
4054
4364
|
|
|
4055
4365
|
/**
|
|
4056
|
-
* @deprecated Use
|
|
4366
|
+
* @deprecated Use {@link List.Item.Props} instead.
|
|
4057
4367
|
*/
|
|
4058
4368
|
export declare interface ListItemProps extends List.Item.Props {
|
|
4059
4369
|
}
|
|
4060
4370
|
|
|
4061
4371
|
/**
|
|
4062
|
-
* @deprecated Use
|
|
4372
|
+
* @deprecated Use {@link List.Props} instead.
|
|
4063
4373
|
*/
|
|
4064
4374
|
export declare interface ListProps extends List.Props {
|
|
4065
4375
|
}
|
|
4066
4376
|
|
|
4067
4377
|
/**
|
|
4068
|
-
* @deprecated Use
|
|
4378
|
+
* @deprecated Use {@link List.Section} instead.
|
|
4069
4379
|
*/
|
|
4070
4380
|
export declare const ListSection: typeof List.Section;
|
|
4071
4381
|
|
|
@@ -4084,7 +4394,7 @@ declare namespace ListSection_2 {
|
|
|
4084
4394
|
}
|
|
4085
4395
|
|
|
4086
4396
|
/**
|
|
4087
|
-
* @deprecated Use
|
|
4397
|
+
* @deprecated Use {@link List.Section.Props} instead.
|
|
4088
4398
|
*/
|
|
4089
4399
|
export declare interface ListSectionProps extends List.Section.Props {
|
|
4090
4400
|
}
|
|
@@ -4210,12 +4520,12 @@ export declare namespace LocalStorage {
|
|
|
4210
4520
|
}
|
|
4211
4521
|
|
|
4212
4522
|
/**
|
|
4213
|
-
* @deprecated Use
|
|
4523
|
+
* @deprecated Use {@link LocalStorage.Value} instead
|
|
4214
4524
|
*/
|
|
4215
4525
|
export declare type LocalStorageValue = LocalStorage.Value;
|
|
4216
4526
|
|
|
4217
4527
|
/**
|
|
4218
|
-
* @deprecated Use
|
|
4528
|
+
* @deprecated Use {@link LocalStorage.Values} instead
|
|
4219
4529
|
*/
|
|
4220
4530
|
export declare interface LocalStorageValues extends LocalStorage.Values {
|
|
4221
4531
|
}
|
|
@@ -4255,7 +4565,301 @@ declare interface NavigationChildInterface {
|
|
|
4255
4565
|
isLoading?: boolean;
|
|
4256
4566
|
}
|
|
4257
4567
|
|
|
4258
|
-
|
|
4568
|
+
export declare namespace OAuth {
|
|
4569
|
+
export namespace PKCEClient {
|
|
4570
|
+
/**
|
|
4571
|
+
* The options for creating a new {@link PKCEClient}.
|
|
4572
|
+
*/
|
|
4573
|
+
export interface Options {
|
|
4574
|
+
/**
|
|
4575
|
+
* The redirect method for the OAuth flow.
|
|
4576
|
+
* Make sure to set this to the correct method for the provider, see {@link RedirectMethod} for more information.
|
|
4577
|
+
*/
|
|
4578
|
+
redirectMethod: RedirectMethod;
|
|
4579
|
+
/**
|
|
4580
|
+
* The name of the provider, displayed in the OAuth overlay.
|
|
4581
|
+
*/
|
|
4582
|
+
providerName: string;
|
|
4583
|
+
/**
|
|
4584
|
+
* An icon referenced from the assets folder, displayed in the OAuth overlay.
|
|
4585
|
+
* Make sure to provide at least a size of 64x64 pixels.
|
|
4586
|
+
*/
|
|
4587
|
+
providerIcon: string;
|
|
4588
|
+
/**
|
|
4589
|
+
* An optional ID for associating the client with a provider.
|
|
4590
|
+
* Only set this if you use multiple different clients in your extension.
|
|
4591
|
+
*/
|
|
4592
|
+
providerId?: string;
|
|
4593
|
+
/**
|
|
4594
|
+
* An optional description, shown in the OAuth overlay.
|
|
4595
|
+
* You can use this to customize the message for the end user, for example for handling scope changes or other migrations.
|
|
4596
|
+
* Raycast shows a default message if this is not configured.
|
|
4597
|
+
*/
|
|
4598
|
+
description?: string;
|
|
4599
|
+
}
|
|
4600
|
+
}
|
|
4601
|
+
/**
|
|
4602
|
+
* A client for the [OAuth PKCE extension](https://datatracker.ietf.org/doc/html/rfc7636).
|
|
4603
|
+
*
|
|
4604
|
+
* @example
|
|
4605
|
+
* ```typescript
|
|
4606
|
+
* import { OAuth } from "@raycast/api";
|
|
4607
|
+
*
|
|
4608
|
+
* const client = new OAuth.PKCEClient({
|
|
4609
|
+
* redirectMethod: OAuth.RedirectMethod.Web,
|
|
4610
|
+
* providerName: "Twitter",
|
|
4611
|
+
* providerIcon: "twitter-logo.png",
|
|
4612
|
+
* description: "Connect your Twitter account...",
|
|
4613
|
+
* });
|
|
4614
|
+
* ```
|
|
4615
|
+
*/
|
|
4616
|
+
export class PKCEClient {
|
|
4617
|
+
redirectMethod: RedirectMethod;
|
|
4618
|
+
providerName: string;
|
|
4619
|
+
providerIcon: string;
|
|
4620
|
+
providerId?: string;
|
|
4621
|
+
description?: string;
|
|
4622
|
+
private resolvesOnRedirect?;
|
|
4623
|
+
constructor(options: PKCEClient.Options);
|
|
4624
|
+
/**
|
|
4625
|
+
* Creates an authorization request for the provided authorization endpoint, client ID, and scopes.
|
|
4626
|
+
* You need to first create the authorization request before calling {@link authorize}.
|
|
4627
|
+
*
|
|
4628
|
+
* @remarks The generated code challenge for the PKCE request uses the S256 method.
|
|
4629
|
+
*
|
|
4630
|
+
* @returns A promise for an {@link AuthorizationRequest} that you can use as input for {@link authorize}.
|
|
4631
|
+
*/
|
|
4632
|
+
authorizationRequest(options: AuthorizationRequestOptions): Promise<AuthorizationRequest>;
|
|
4633
|
+
/**
|
|
4634
|
+
* Starts the authorization and shows the OAuth overlay in Raycast.
|
|
4635
|
+
* As parameter you can either directly use the returned request from {@link authorizationRequest},
|
|
4636
|
+
* or customize the URL by extracting parameters from {@link AuthorizationRequest} and providing your own URL via {@link AuthorizationOptions}.
|
|
4637
|
+
* Eventually the URL will be used to open the authorization page of the provider in the web browser.
|
|
4638
|
+
*
|
|
4639
|
+
* @returns A promise for an {@link AuthorizationResponse}, which contains the authorization code needed for the token exchange.
|
|
4640
|
+
* The promise is resolved when the user was redirected back from the provider's authorization page to the Raycast extension.
|
|
4641
|
+
*/
|
|
4642
|
+
authorize(options: AuthorizationRequest | AuthorizationOptions): Promise<AuthorizationResponse>;
|
|
4643
|
+
private authorizationURL;
|
|
4644
|
+
/**
|
|
4645
|
+
* Securely stores a {@link TokenSet} for the provider. Use this after fetching the access token from the provider.
|
|
4646
|
+
* If the provider returns a a standard OAuth JSON token response, you can directly pass the {@link TokenResponse}.
|
|
4647
|
+
* At a minimum, you need to set the {@link TokenSet.accessToken}, and typically you also set {@link TokenSet.refreshToken} and {@link TokenSet.isExpired}.
|
|
4648
|
+
* Raycast automatically shows a logout preference for the extension when a token set was saved.
|
|
4649
|
+
*
|
|
4650
|
+
* @remarks If you want to make use of the convenience {@link TokenSet.isExpired} method, the property {@link TokenSet.expiresIn} must be configured.
|
|
4651
|
+
*
|
|
4652
|
+
* @returns A promise that resolves when the token set has been stored.
|
|
4653
|
+
*/
|
|
4654
|
+
setTokens(options: TokenSetOptions | TokenResponse): Promise<void>;
|
|
4655
|
+
/**
|
|
4656
|
+
* Retrieves the stored {@link TokenSet} for the client.
|
|
4657
|
+
* You can use this to initially check whether the authorization flow should be initiated or
|
|
4658
|
+
* the user is already logged in and you might have to refresh the access token.
|
|
4659
|
+
*
|
|
4660
|
+
* @returns A promise that resolves when the token set has been retrieved.
|
|
4661
|
+
*/
|
|
4662
|
+
getTokens(): Promise<TokenSet | undefined>;
|
|
4663
|
+
/**
|
|
4664
|
+
* Removes the stored {@link TokenSet} for the client.
|
|
4665
|
+
*
|
|
4666
|
+
* @remarks Raycast automatically shows a logout preference that removes the token set.
|
|
4667
|
+
* Use this method only if you need to provide an additional logout option in your extension or you want to remove the token set because of a migration.
|
|
4668
|
+
*
|
|
4669
|
+
*/
|
|
4670
|
+
removeTokens(): Promise<void>;
|
|
4671
|
+
}
|
|
4672
|
+
/**
|
|
4673
|
+
* Defines the supported redirect methods for the OAuth flow.
|
|
4674
|
+
* You can choose between web and app-scheme redirect methods, depending on what the provider requires when setting up the OAuth app.
|
|
4675
|
+
* For examples on what redirect URI you need to configure, see the docs for each method.
|
|
4676
|
+
*/
|
|
4677
|
+
export enum RedirectMethod {
|
|
4678
|
+
/**
|
|
4679
|
+
* Use this type for a redirect back to the Raycast website, which will then open the extension.
|
|
4680
|
+
* In the OAuth app, configure either `https://raycast.com/redirect` or `https://raycast.com/redirect?packageName=Extension`
|
|
4681
|
+
* (For example, Twitter would accept the former, while Spotify requires the query parameter.)
|
|
4682
|
+
*/
|
|
4683
|
+
Web = "web",
|
|
4684
|
+
/**
|
|
4685
|
+
* Use this type for an app-scheme based redirect that directly opens Raycast.
|
|
4686
|
+
* In the OAuth app, configure `raycast://oauth?package_name=Extension`
|
|
4687
|
+
*/
|
|
4688
|
+
App = "app",
|
|
4689
|
+
/**
|
|
4690
|
+
* Use this type for a URI-style app scheme that directly opens Raycast.
|
|
4691
|
+
* In the OAuth app, configure `com.raycast:/oauth?package_name=Extension`
|
|
4692
|
+
* (Note the single slash – Google, for example, would require this flavor for an OAuth app where the Bundle ID is `com.raycast`)
|
|
4693
|
+
*/
|
|
4694
|
+
AppURI = "appURI"
|
|
4695
|
+
}
|
|
4696
|
+
/**
|
|
4697
|
+
* The options for an authorization request via {@link PKCEClient.authorizationRequest}.
|
|
4698
|
+
*/
|
|
4699
|
+
export interface AuthorizationRequestOptions {
|
|
4700
|
+
/**
|
|
4701
|
+
* The URL to the authorization endpoint for the OAuth provider.
|
|
4702
|
+
*/
|
|
4703
|
+
endpoint: string;
|
|
4704
|
+
/**
|
|
4705
|
+
* The client ID of the configured OAuth app.
|
|
4706
|
+
*/
|
|
4707
|
+
clientId: string;
|
|
4708
|
+
/**
|
|
4709
|
+
* A space-delimited list of scopes for identifying the resources to access on the user's behalf.
|
|
4710
|
+
* The scopes are typically shown to the user on the provider's consent screen in the browser.
|
|
4711
|
+
* Note that some providers require the same scopes be configured in the registered OAuth app.
|
|
4712
|
+
*/
|
|
4713
|
+
scope: string;
|
|
4714
|
+
/**
|
|
4715
|
+
* Optional additional parameters for the authorization request.
|
|
4716
|
+
* Note that some providers require additional parameters, for example to obtain long-lived refresh tokens.
|
|
4717
|
+
*/
|
|
4718
|
+
extraParameters?: Record<string, string>;
|
|
4719
|
+
}
|
|
4720
|
+
/**
|
|
4721
|
+
* Values of {@link AuthorizationRequest}.
|
|
4722
|
+
* The PKCE client automatically generates the values for you and returns them for {@link PKCEClient.authorizationRequest}.
|
|
4723
|
+
*/
|
|
4724
|
+
export interface AuthorizationRequestURLParams {
|
|
4725
|
+
/**
|
|
4726
|
+
* The PKCE `code_challenge` value.
|
|
4727
|
+
*/
|
|
4728
|
+
codeChallenge: string;
|
|
4729
|
+
/**
|
|
4730
|
+
* The PKCE `code_verifier` value.
|
|
4731
|
+
*/
|
|
4732
|
+
codeVerifier: string;
|
|
4733
|
+
/**
|
|
4734
|
+
* The OAuth `state` value.
|
|
4735
|
+
*/
|
|
4736
|
+
state: string;
|
|
4737
|
+
/**
|
|
4738
|
+
* The OAuth `redirect_uri` value.
|
|
4739
|
+
*/
|
|
4740
|
+
redirectURI: string;
|
|
4741
|
+
}
|
|
4742
|
+
/**
|
|
4743
|
+
* The request returned by {@link PKCEClient.authorizationRequest}.
|
|
4744
|
+
* Can be used as direct input to {@link PKCEClient.authorize}, or
|
|
4745
|
+
* to extract parameters for constructing a custom URL in {@link AuthorizationOptions}.
|
|
4746
|
+
*/
|
|
4747
|
+
export interface AuthorizationRequest extends AuthorizationRequestURLParams {
|
|
4748
|
+
/**
|
|
4749
|
+
* Constructs the full authorization URL.
|
|
4750
|
+
*/
|
|
4751
|
+
toURL(): string;
|
|
4752
|
+
}
|
|
4753
|
+
/**
|
|
4754
|
+
* Options for customizing {@link PKCEClient.authorize}.
|
|
4755
|
+
* You can use values from {@link AuthorizationRequest} to build your own URL.
|
|
4756
|
+
*/
|
|
4757
|
+
export interface AuthorizationOptions {
|
|
4758
|
+
/**
|
|
4759
|
+
* The full authorization URL.
|
|
4760
|
+
*/
|
|
4761
|
+
url: string;
|
|
4762
|
+
}
|
|
4763
|
+
/**
|
|
4764
|
+
* The response returned by {@link PKCEClient.authorize}, containing the authorization code after the provider redirect.
|
|
4765
|
+
* You can then exchange the authorization code for an access token using the provider's token endpoint.
|
|
4766
|
+
*/
|
|
4767
|
+
export interface AuthorizationResponse {
|
|
4768
|
+
/**
|
|
4769
|
+
* The authorization code from the OAuth provider.
|
|
4770
|
+
*/
|
|
4771
|
+
authorizationCode: string;
|
|
4772
|
+
}
|
|
4773
|
+
/**
|
|
4774
|
+
* Describes the TokenSet created from an OAuth provider's token response.
|
|
4775
|
+
* The `accessToken` is the only required parameter but typically OAuth providers also return a refresh token, an expires value, and the scope.
|
|
4776
|
+
* Securely store a token set via {@link PKCEClient.setTokens} and retrieve it via {@link PKCEClient.getTokens}.
|
|
4777
|
+
*/
|
|
4778
|
+
export interface TokenSet {
|
|
4779
|
+
/**
|
|
4780
|
+
* The access token returned by an OAuth token request.
|
|
4781
|
+
*/
|
|
4782
|
+
accessToken: string;
|
|
4783
|
+
/**
|
|
4784
|
+
* An optional refresh token returned by an OAuth token request.
|
|
4785
|
+
*/
|
|
4786
|
+
refreshToken?: string;
|
|
4787
|
+
/**
|
|
4788
|
+
* An optional id token returned by an identity request (e.g. /me, Open ID Connect).
|
|
4789
|
+
*/
|
|
4790
|
+
idToken?: string;
|
|
4791
|
+
/**
|
|
4792
|
+
* An optional expires value (in seconds) returned by an OAuth token request.
|
|
4793
|
+
*/
|
|
4794
|
+
expiresIn?: number;
|
|
4795
|
+
/**
|
|
4796
|
+
* The optional space-delimited list of scopes returned by an OAuth token request.
|
|
4797
|
+
* You can use this to compare the currently stored access scopes against new access scopes the extension might require in a future version,
|
|
4798
|
+
* and then ask the user to re-authorize with new scopes.
|
|
4799
|
+
*/
|
|
4800
|
+
scope?: string;
|
|
4801
|
+
/**
|
|
4802
|
+
* The date when the token set was stored via {@link PKCEClient.setTokens}.
|
|
4803
|
+
*/
|
|
4804
|
+
updatedAt: Date;
|
|
4805
|
+
/**
|
|
4806
|
+
* A convenience method for checking whether the access token has expired.
|
|
4807
|
+
* This requires the `expiresIn` parameter to be set.
|
|
4808
|
+
*/
|
|
4809
|
+
isExpired(): boolean;
|
|
4810
|
+
}
|
|
4811
|
+
/**
|
|
4812
|
+
* Options for a {@link TokenSet} to store via {@link PKCEClient.setTokens}.
|
|
4813
|
+
*/
|
|
4814
|
+
export interface TokenSetOptions {
|
|
4815
|
+
/**
|
|
4816
|
+
* The access token returned by an OAuth token request.
|
|
4817
|
+
*/
|
|
4818
|
+
accessToken: string;
|
|
4819
|
+
/**
|
|
4820
|
+
* An optional refresh token returned by an OAuth token request.
|
|
4821
|
+
*/
|
|
4822
|
+
refreshToken?: string;
|
|
4823
|
+
/**
|
|
4824
|
+
* An optional id token returned by an identity request (e.g. /me, Open ID Connect).
|
|
4825
|
+
*/
|
|
4826
|
+
idToken?: string;
|
|
4827
|
+
/**
|
|
4828
|
+
* An optional expires value (in seconds) returned by an OAuth token request.
|
|
4829
|
+
*/
|
|
4830
|
+
expiresIn?: number;
|
|
4831
|
+
/**
|
|
4832
|
+
* The optional scope value returned by an OAuth token request.
|
|
4833
|
+
*/
|
|
4834
|
+
scope?: string;
|
|
4835
|
+
}
|
|
4836
|
+
/**
|
|
4837
|
+
* Defines the standard JSON response for an OAuth token request.
|
|
4838
|
+
* The response can be directly used to store a {@link TokenSet} via {@link PKCEClient.setTokens}.
|
|
4839
|
+
*/
|
|
4840
|
+
export interface TokenResponse {
|
|
4841
|
+
/**
|
|
4842
|
+
* The `access_token` value returned by an OAuth token request.
|
|
4843
|
+
*/
|
|
4844
|
+
access_token: string;
|
|
4845
|
+
/**
|
|
4846
|
+
* An optional `refresh_token` value returned by an OAuth token request.
|
|
4847
|
+
*/
|
|
4848
|
+
refresh_token?: string;
|
|
4849
|
+
/**
|
|
4850
|
+
* An optional `id_token` value returned by an identity request (e.g. /me, Open ID Connect).
|
|
4851
|
+
*/
|
|
4852
|
+
id_token?: string;
|
|
4853
|
+
/**
|
|
4854
|
+
* An optional `expires_in` value (in seconds) returned by an OAuth token request.
|
|
4855
|
+
*/
|
|
4856
|
+
expires_in?: number;
|
|
4857
|
+
/**
|
|
4858
|
+
* The optional `scope` value returned by an OAuth token request.
|
|
4859
|
+
*/
|
|
4860
|
+
scope?: string;
|
|
4861
|
+
}
|
|
4862
|
+
}
|
|
4259
4863
|
|
|
4260
4864
|
/**
|
|
4261
4865
|
* Opens a target with the default application or specified application.
|
|
@@ -4277,7 +4881,7 @@ declare interface NavigationChildInterface {
|
|
|
4277
4881
|
export declare function open(target: string, application?: Application | string): Promise<void>;
|
|
4278
4882
|
|
|
4279
4883
|
/**
|
|
4280
|
-
* @deprecated Use
|
|
4884
|
+
* @deprecated Use {@link Action.Open} instead.
|
|
4281
4885
|
*/
|
|
4282
4886
|
export declare const OpenAction: OpenAction_2;
|
|
4283
4887
|
|
|
@@ -4291,7 +4895,7 @@ declare namespace OpenAction_2 {
|
|
|
4291
4895
|
}
|
|
4292
4896
|
|
|
4293
4897
|
/**
|
|
4294
|
-
* @deprecated Use
|
|
4898
|
+
* @deprecated Use {@link Action.Open.Props} instead.
|
|
4295
4899
|
*/
|
|
4296
4900
|
export declare interface OpenActionProps extends Action.Open.Props {
|
|
4297
4901
|
}
|
|
@@ -4335,7 +4939,7 @@ declare interface OpenActionProps_2 {
|
|
|
4335
4939
|
}
|
|
4336
4940
|
|
|
4337
4941
|
/**
|
|
4338
|
-
* @deprecated Use
|
|
4942
|
+
* @deprecated Use {@link Action.OpenInBrowser} instead.
|
|
4339
4943
|
*/
|
|
4340
4944
|
export declare const OpenInBrowserAction: OpenInBrowserAction_2;
|
|
4341
4945
|
|
|
@@ -4353,7 +4957,7 @@ declare namespace OpenInBrowserAction_2 {
|
|
|
4353
4957
|
}
|
|
4354
4958
|
|
|
4355
4959
|
/**
|
|
4356
|
-
* @deprecated Use
|
|
4960
|
+
* @deprecated Use {@link Action.OpenInBrowser.Props} instead.
|
|
4357
4961
|
*/
|
|
4358
4962
|
export declare interface OpenInBrowserActionProps extends Action.OpenInBrowser.Props {
|
|
4359
4963
|
}
|
|
@@ -4390,7 +4994,7 @@ declare interface OpenInBrowserActionProps_2 {
|
|
|
4390
4994
|
}
|
|
4391
4995
|
|
|
4392
4996
|
/**
|
|
4393
|
-
* @deprecated Use
|
|
4997
|
+
* @deprecated Use {@link Action.OpenWith} instead.
|
|
4394
4998
|
*/
|
|
4395
4999
|
export declare const OpenWithAction: OpenWithAction_2;
|
|
4396
5000
|
|
|
@@ -4404,7 +5008,7 @@ declare namespace OpenWithAction_2 {
|
|
|
4404
5008
|
}
|
|
4405
5009
|
|
|
4406
5010
|
/**
|
|
4407
|
-
* @deprecated Use
|
|
5011
|
+
* @deprecated Use {@link Action.OpenWith.Props} instead.
|
|
4408
5012
|
*/
|
|
4409
5013
|
export declare interface OpenWithActionProps extends Action.OpenWith.Props {
|
|
4410
5014
|
}
|
|
@@ -4441,7 +5045,27 @@ declare interface OpenWithActionProps_2 {
|
|
|
4441
5045
|
}
|
|
4442
5046
|
|
|
4443
5047
|
/**
|
|
4444
|
-
* @
|
|
5048
|
+
* See {@link Form.PasswordField}
|
|
5049
|
+
*/
|
|
5050
|
+
declare const PasswordField: ForwardRefExoticComponent<PasswordFieldProps & RefAttributes<PasswordFieldRef>>;
|
|
5051
|
+
|
|
5052
|
+
/**
|
|
5053
|
+
* See {@link Form.PasswordField.Props}
|
|
5054
|
+
*/
|
|
5055
|
+
declare interface PasswordFieldProps extends FormItemProps_2<string> {
|
|
5056
|
+
/**
|
|
5057
|
+
* Placeholder text shown in the password field.
|
|
5058
|
+
*/
|
|
5059
|
+
placeholder?: string;
|
|
5060
|
+
}
|
|
5061
|
+
|
|
5062
|
+
/**
|
|
5063
|
+
* Form.PasswordField Ref type.
|
|
5064
|
+
*/
|
|
5065
|
+
declare type PasswordFieldRef = FormItemRef;
|
|
5066
|
+
|
|
5067
|
+
/**
|
|
5068
|
+
* @deprecated Use {@link Action.Paste} instead.
|
|
4445
5069
|
*/
|
|
4446
5070
|
export declare const PasteAction: PasteAction_2;
|
|
4447
5071
|
|
|
@@ -4455,7 +5079,7 @@ declare namespace PasteAction_2 {
|
|
|
4455
5079
|
}
|
|
4456
5080
|
|
|
4457
5081
|
/**
|
|
4458
|
-
* @deprecated Use
|
|
5082
|
+
* @deprecated Use {@link Action.Paste.Props} instead.
|
|
4459
5083
|
*/
|
|
4460
5084
|
export declare interface PasteActionProps extends Action.Paste.Props {
|
|
4461
5085
|
}
|
|
@@ -4492,7 +5116,7 @@ declare interface PasteActionProps_2 {
|
|
|
4492
5116
|
}
|
|
4493
5117
|
|
|
4494
5118
|
/**
|
|
4495
|
-
* @deprecated Use
|
|
5119
|
+
* @deprecated Use {@link Clipboard.paste} instead
|
|
4496
5120
|
*/
|
|
4497
5121
|
export declare const pasteText: typeof Clipboard.paste;
|
|
4498
5122
|
|
|
@@ -4524,7 +5148,7 @@ export declare function popToRoot(options?: {
|
|
|
4524
5148
|
}): Promise<void>;
|
|
4525
5149
|
|
|
4526
5150
|
/**
|
|
4527
|
-
* @deprecated Use
|
|
5151
|
+
* @deprecated Use {@link getPreferenceValues} instead.
|
|
4528
5152
|
*/
|
|
4529
5153
|
export declare interface Preference extends Preference_2 {
|
|
4530
5154
|
}
|
|
@@ -4596,12 +5220,12 @@ declare interface Preference_2 {
|
|
|
4596
5220
|
}
|
|
4597
5221
|
|
|
4598
5222
|
/**
|
|
4599
|
-
* @deprecated Use
|
|
5223
|
+
* @deprecated Use {@link getPreferenceValues} instead.
|
|
4600
5224
|
*/
|
|
4601
5225
|
export declare type Preferences = Preferences_2;
|
|
4602
5226
|
|
|
4603
5227
|
/**
|
|
4604
|
-
* @deprecated Use
|
|
5228
|
+
* @deprecated Use {@link getPreferenceValues} instead.
|
|
4605
5229
|
*/
|
|
4606
5230
|
export declare const preferences: Preferences_2;
|
|
4607
5231
|
|
|
@@ -4618,7 +5242,7 @@ export declare interface PreferenceValues {
|
|
|
4618
5242
|
}
|
|
4619
5243
|
|
|
4620
5244
|
/**
|
|
4621
|
-
* @deprecated Use
|
|
5245
|
+
* @deprecated Use {@link Action.Push} instead.
|
|
4622
5246
|
*/
|
|
4623
5247
|
export declare const PushAction: PushAction_2;
|
|
4624
5248
|
|
|
@@ -4632,7 +5256,7 @@ declare namespace PushAction_2 {
|
|
|
4632
5256
|
}
|
|
4633
5257
|
|
|
4634
5258
|
/**
|
|
4635
|
-
* @deprecated Use
|
|
5259
|
+
* @deprecated Use {@link Action.Push.Props} instead.
|
|
4636
5260
|
*/
|
|
4637
5261
|
export declare interface PushActionProps extends Action.Push.Props {
|
|
4638
5262
|
}
|
|
@@ -4686,10 +5310,8 @@ declare interface Quicklink {
|
|
|
4686
5310
|
*/
|
|
4687
5311
|
export declare const randomId: typeof randomId_2;
|
|
4688
5312
|
|
|
4689
|
-
/* Excluded from this release type: randomId_2 */
|
|
4690
|
-
|
|
4691
5313
|
/**
|
|
4692
|
-
* @deprecated Use
|
|
5314
|
+
* @deprecated Use {@link LocalStorage.removeItem} instead
|
|
4693
5315
|
*/
|
|
4694
5316
|
export declare const removeLocalStorageItem: typeof LocalStorage.removeItem;
|
|
4695
5317
|
|
|
@@ -4698,14 +5320,21 @@ export declare const removeLocalStorageItem: typeof LocalStorage.removeItem;
|
|
|
4698
5320
|
*/
|
|
4699
5321
|
export declare const render: typeof render_2;
|
|
4700
5322
|
|
|
4701
|
-
|
|
5323
|
+
/**
|
|
5324
|
+
* See {@link Form.Separator}
|
|
5325
|
+
*/
|
|
5326
|
+
declare const Separator: FunctionComponent<SeparatorProps>;
|
|
4702
5327
|
|
|
4703
5328
|
/**
|
|
4704
|
-
* @
|
|
5329
|
+
* See {@link Form.Separator.Props}
|
|
4705
5330
|
*/
|
|
4706
|
-
|
|
5331
|
+
declare interface SeparatorProps {
|
|
5332
|
+
}
|
|
4707
5333
|
|
|
4708
|
-
|
|
5334
|
+
/**
|
|
5335
|
+
* @deprecated Use {@link LocalStorage.setItem} instead
|
|
5336
|
+
*/
|
|
5337
|
+
export declare const setLocalStorageItem: typeof LocalStorage.setItem;
|
|
4709
5338
|
|
|
4710
5339
|
/**
|
|
4711
5340
|
* A HUD will automatically hide the main window and show a compact message at the bottom of the screen.
|
|
@@ -4744,7 +5373,7 @@ export declare function showHUD(title: string): Promise<void>;
|
|
|
4744
5373
|
export declare function showInFinder(path: PathLike): Promise<void>;
|
|
4745
5374
|
|
|
4746
5375
|
/**
|
|
4747
|
-
* @deprecated Use
|
|
5376
|
+
* @deprecated Use {@link Action.ShowInFinder} instead.
|
|
4748
5377
|
*/
|
|
4749
5378
|
export declare const ShowInFinderAction: ShowInFinderAction_2;
|
|
4750
5379
|
|
|
@@ -4758,7 +5387,7 @@ declare namespace ShowInFinderAction_2 {
|
|
|
4758
5387
|
}
|
|
4759
5388
|
|
|
4760
5389
|
/**
|
|
4761
|
-
* @deprecated Use
|
|
5390
|
+
* @deprecated Use {@link Action.ShowInFinder.Props} instead.
|
|
4762
5391
|
*/
|
|
4763
5392
|
export declare interface ShowInFinderActionProps extends Action.ShowInFinder.Props {
|
|
4764
5393
|
}
|
|
@@ -4863,7 +5492,7 @@ declare interface Snippet {
|
|
|
4863
5492
|
export declare const specialKeys: Record<string, string>;
|
|
4864
5493
|
|
|
4865
5494
|
/**
|
|
4866
|
-
* @deprecated Use
|
|
5495
|
+
* @deprecated Use {@link Action.SubmitForm} instead.
|
|
4867
5496
|
*/
|
|
4868
5497
|
export declare const SubmitFormAction: SubmitFormAction_2;
|
|
4869
5498
|
|
|
@@ -4877,7 +5506,7 @@ declare namespace SubmitFormAction_2 {
|
|
|
4877
5506
|
}
|
|
4878
5507
|
|
|
4879
5508
|
/**
|
|
4880
|
-
* @deprecated Use
|
|
5509
|
+
* @deprecated Use {@link Action.SunmitForm.Props} instead.
|
|
4881
5510
|
*/
|
|
4882
5511
|
export declare interface SubmitFormActionProps<T> extends Action.SubmitForm.Props<T> {
|
|
4883
5512
|
}
|
|
@@ -4907,6 +5536,119 @@ declare interface SubmitFormActionProps_2<Values> {
|
|
|
4907
5536
|
onSubmit?: (input: Values) => void;
|
|
4908
5537
|
}
|
|
4909
5538
|
|
|
5539
|
+
/**
|
|
5540
|
+
* See {@link Form.TagPicker}
|
|
5541
|
+
*/
|
|
5542
|
+
declare const TagPicker: ForwardRefExoticComponent<TagPickerProps & RefAttributes<FormItemRef>> & {
|
|
5543
|
+
/**
|
|
5544
|
+
* A tag picker item in a {@link Form.TagPicker}.
|
|
5545
|
+
*
|
|
5546
|
+
* @example
|
|
5547
|
+
* ```typescript
|
|
5548
|
+
* import { ActionPanel, Color, Form, Icon, Action } from "@raycast/api";
|
|
5549
|
+
*
|
|
5550
|
+
* export default function Command() {
|
|
5551
|
+
* return (
|
|
5552
|
+
* <Form
|
|
5553
|
+
* actions={
|
|
5554
|
+
* <ActionPanel>
|
|
5555
|
+
* <Action.SubmitForm title="Submit Color" onSubmit={(values) => console.log(values)} />
|
|
5556
|
+
* </ActionPanel>
|
|
5557
|
+
* }
|
|
5558
|
+
* >
|
|
5559
|
+
* <Form.TagPicker id="color" title="Color">
|
|
5560
|
+
* <Form.TagPicker.Item value="red" title="Red" icon={{ source: Icon.Circle, tintColor: Color.Red }} />
|
|
5561
|
+
* <Form.TagPicker.Item value="green" title="Green" icon={{ source: Icon.Circle, tintColor: Color.Green }} />
|
|
5562
|
+
* <Form.TagPicker.Item value="blue" title="Blue" icon={{ source: Icon.Circle, tintColor: Color.Blue }} />
|
|
5563
|
+
* </Form.TagPicker>
|
|
5564
|
+
* </Form>
|
|
5565
|
+
* );
|
|
5566
|
+
* }
|
|
5567
|
+
* ```
|
|
5568
|
+
*/
|
|
5569
|
+
Item: typeof TagPickerItem;
|
|
5570
|
+
};
|
|
5571
|
+
|
|
5572
|
+
/**
|
|
5573
|
+
* See {@link Form.TagPicker.Item}
|
|
5574
|
+
*/
|
|
5575
|
+
declare const TagPickerItem: FunctionComponent<TagPickerItemProps>;
|
|
5576
|
+
|
|
5577
|
+
/**
|
|
5578
|
+
* See {@link Form.TagPicker.Item.Props}
|
|
5579
|
+
*/
|
|
5580
|
+
declare interface TagPickerItemProps {
|
|
5581
|
+
/**
|
|
5582
|
+
* Value of the tag.
|
|
5583
|
+
* Make sure to assign unique value for each item.
|
|
5584
|
+
*/
|
|
5585
|
+
value: string;
|
|
5586
|
+
/**
|
|
5587
|
+
* The display title of the tag.
|
|
5588
|
+
*/
|
|
5589
|
+
title: string;
|
|
5590
|
+
/**
|
|
5591
|
+
* An icon to show in the tag.
|
|
5592
|
+
*/
|
|
5593
|
+
icon?: Image.ImageLike;
|
|
5594
|
+
}
|
|
5595
|
+
|
|
5596
|
+
/**
|
|
5597
|
+
* See {@link Form.TagPicker.Props}
|
|
5598
|
+
*/
|
|
5599
|
+
declare interface TagPickerProps extends FormItemProps_2<string[]> {
|
|
5600
|
+
/**
|
|
5601
|
+
* The list of tags.
|
|
5602
|
+
*/
|
|
5603
|
+
children?: ReactNode;
|
|
5604
|
+
/**
|
|
5605
|
+
* Placeholder text shown in the token field.
|
|
5606
|
+
*/
|
|
5607
|
+
placeholder?: string;
|
|
5608
|
+
}
|
|
5609
|
+
|
|
5610
|
+
/**
|
|
5611
|
+
* Form.TagPicker Ref type.
|
|
5612
|
+
*/
|
|
5613
|
+
declare type TagPickerRef = FormItemRef;
|
|
5614
|
+
|
|
5615
|
+
/**
|
|
5616
|
+
* See {@link Form.TextArea}
|
|
5617
|
+
*/
|
|
5618
|
+
declare const TextArea: ForwardRefExoticComponent<TextAreaProps & RefAttributes<TextAreaRef>>;
|
|
5619
|
+
|
|
5620
|
+
/**
|
|
5621
|
+
* See {@link Form.TextArea.Props}
|
|
5622
|
+
*/
|
|
5623
|
+
declare interface TextAreaProps extends FormItemProps_2<string> {
|
|
5624
|
+
/**
|
|
5625
|
+
* Placeholder text shown in the text area.
|
|
5626
|
+
*/
|
|
5627
|
+
placeholder?: string;
|
|
5628
|
+
}
|
|
5629
|
+
|
|
5630
|
+
/**
|
|
5631
|
+
* Form.TextArea Ref type.
|
|
5632
|
+
*/
|
|
5633
|
+
declare type TextAreaRef = FormItemRef;
|
|
5634
|
+
|
|
5635
|
+
/**
|
|
5636
|
+
* See {@link Form.TextField}
|
|
5637
|
+
*/
|
|
5638
|
+
declare const TextField: ForwardRefExoticComponent<TextFieldProps & RefAttributes<TextFieldRef>>;
|
|
5639
|
+
|
|
5640
|
+
/**
|
|
5641
|
+
* See {@link Form.TextField.Props}
|
|
5642
|
+
*/
|
|
5643
|
+
declare interface TextFieldProps extends FormItemProps_2<string> {
|
|
5644
|
+
/**
|
|
5645
|
+
* Placeholder text shown in the text field.
|
|
5646
|
+
*/
|
|
5647
|
+
placeholder?: string;
|
|
5648
|
+
}
|
|
5649
|
+
|
|
5650
|
+
declare type TextFieldRef = FormItemRef;
|
|
5651
|
+
|
|
4910
5652
|
/**
|
|
4911
5653
|
* A Toast with a certain style, title, and message.
|
|
4912
5654
|
*
|
|
@@ -5037,19 +5779,19 @@ export declare namespace Toast {
|
|
|
5037
5779
|
}
|
|
5038
5780
|
|
|
5039
5781
|
/**
|
|
5040
|
-
* @deprecated Use
|
|
5782
|
+
* @deprecated Use {@link Toast.ActionOptions} instead
|
|
5041
5783
|
*/
|
|
5042
5784
|
export declare interface ToastActionOptions extends Toast.ActionOptions {
|
|
5043
5785
|
}
|
|
5044
5786
|
|
|
5045
5787
|
/**
|
|
5046
|
-
* @deprecated Use
|
|
5788
|
+
* @deprecated Use {@link Toast.Options} instead
|
|
5047
5789
|
*/
|
|
5048
5790
|
export declare interface ToastOptions extends Toast.Options {
|
|
5049
5791
|
}
|
|
5050
5792
|
|
|
5051
5793
|
/**
|
|
5052
|
-
* @deprecated Use
|
|
5794
|
+
* @deprecated Use {@link Toast.Style} instead
|
|
5053
5795
|
*/
|
|
5054
5796
|
export declare const ToastStyle: typeof Toast.Style;
|
|
5055
5797
|
|
|
@@ -5075,7 +5817,7 @@ export declare const ToastStyle: typeof Toast.Style;
|
|
|
5075
5817
|
export declare function trash(path: PathLike | PathLike[]): Promise<void>;
|
|
5076
5818
|
|
|
5077
5819
|
/**
|
|
5078
|
-
* @deprecated Use
|
|
5820
|
+
* @deprecated Use {@link Action.Trash} instead.
|
|
5079
5821
|
*/
|
|
5080
5822
|
export declare const TrashAction: TrashAction_2;
|
|
5081
5823
|
|
|
@@ -5089,7 +5831,7 @@ declare namespace TrashAction_2 {
|
|
|
5089
5831
|
}
|
|
5090
5832
|
|
|
5091
5833
|
/**
|
|
5092
|
-
* @deprecated Use
|
|
5834
|
+
* @deprecated Use {@link Action.Trash.Props} instead.
|
|
5093
5835
|
*/
|
|
5094
5836
|
export declare interface TrashActionProps extends Action.Trash.Props {
|
|
5095
5837
|
}
|
|
@@ -5136,8 +5878,6 @@ export declare function useActionPanel(): ActionPanelState;
|
|
|
5136
5878
|
*/
|
|
5137
5879
|
export declare const useId: typeof useId_2;
|
|
5138
5880
|
|
|
5139
|
-
/* Excluded from this release type: useId_2 */
|
|
5140
|
-
|
|
5141
5881
|
/**
|
|
5142
5882
|
* A hook that lets you push and pop view components in the navigation stack.
|
|
5143
5883
|
*
|