@raycast/api 1.39.3 → 1.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/api.d.ts +206 -24
  2. package/package.json +16 -1
  3. package/types/index.d.ts +206 -24
package/api.d.ts CHANGED
@@ -1128,7 +1128,7 @@ declare interface ConvenienceActions {
1128
1128
  * import { useState } from "react";
1129
1129
  *
1130
1130
  * export default function Command() {
1131
- * const [name, setName] = useState<string>();
1131
+ * const [name, setName] = useState<string>("");
1132
1132
  *
1133
1133
  * return (
1134
1134
  * <Form
@@ -1352,7 +1352,7 @@ declare interface DatePickerMembers {
1352
1352
  Type: typeof DatePickerType;
1353
1353
  }
1354
1354
 
1355
- declare interface DatePickerProps extends FormItemProps_2<Date> {
1355
+ declare interface DatePickerProps extends FormItemProps_2<Date | null> {
1356
1356
  /**
1357
1357
  * Indicates what types of date components can be picked
1358
1358
  *
@@ -1689,6 +1689,13 @@ declare interface DropdownItemProps {
1689
1689
  * A optional icon displayed for the item.
1690
1690
  */
1691
1691
  icon?: Image.ImageLike;
1692
+ /**
1693
+ * An optional property used for providing additional indexable strings for search.
1694
+ * When filtering the items in Raycast, the keywords will be searched in addition to the title.
1695
+ *
1696
+ * @defaultValue The title of its section if any
1697
+ */
1698
+ keywords?: string[];
1692
1699
  }
1693
1700
 
1694
1701
  declare interface DropdownItemProps_2 {
@@ -1705,6 +1712,13 @@ declare interface DropdownItemProps_2 {
1705
1712
  * An optional icon displayed for the item.
1706
1713
  */
1707
1714
  icon?: Image.ImageLike | undefined | null;
1715
+ /**
1716
+ * An optional property used for providing additional indexable strings for search.
1717
+ * When filtering the items in Raycast, the keywords will be searched in addition to the title.
1718
+ *
1719
+ * @defaultValue The title of its section if any
1720
+ */
1721
+ keywords?: string[];
1708
1722
  }
1709
1723
 
1710
1724
  declare interface DropdownItemProps_3 {
@@ -1721,6 +1735,13 @@ declare interface DropdownItemProps_3 {
1721
1735
  * An optional icon displayed for the item.
1722
1736
  */
1723
1737
  icon?: Image.ImageLike | undefined | null;
1738
+ /**
1739
+ * An optional property used for providing additional indexable strings for search.
1740
+ * When filtering the items in Raycast, the keywords will be searched in addition to the title.
1741
+ *
1742
+ * @defaultValue The title of its section if any
1743
+ */
1744
+ keywords?: string[];
1724
1745
  }
1725
1746
 
1726
1747
  declare interface DropdownMembers {
@@ -3132,7 +3153,7 @@ declare interface FormMembers {
3132
3153
  * import { useState } from "react";
3133
3154
  *
3134
3155
  * export default function Command() {
3135
- * const [date, setDate] = useState<Date>();
3156
+ * const [date, setDate] = useState<Date | null>(null);
3136
3157
  *
3137
3158
  * return (
3138
3159
  * <Form
@@ -3162,13 +3183,7 @@ declare interface FormMembers {
3162
3183
  *
3163
3184
  * export default function Command() {
3164
3185
  * return (
3165
- * <Form
3166
- * actions={
3167
- * <ActionPanel>
3168
- * <Action.SubmitForm title="Submit" onSubmit={(values) => console.log(values)} />
3169
- * </ActionPanel>
3170
- * }
3171
- * >
3186
+ * <Form>
3172
3187
  * <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." />
3173
3188
  * </Form>
3174
3189
  * );
@@ -3273,7 +3288,7 @@ declare interface FormMembers {
3273
3288
  * import { useState } from "react";
3274
3289
  *
3275
3290
  * export default function Command() {
3276
- * const [password, setPassword] = useState<string>();
3291
+ * const [password, setPassword] = useState<string>("");
3277
3292
  *
3278
3293
  * return (
3279
3294
  * <Form
@@ -3300,13 +3315,7 @@ declare interface FormMembers {
3300
3315
  *
3301
3316
  * export default function Command() {
3302
3317
  * return (
3303
- * <Form
3304
- * actions={
3305
- * <ActionPanel>
3306
- * <Action.SubmitForm title="Submit Form" onSubmit={(values) => console.log(values)} />
3307
- * </ActionPanel>
3308
- * }
3309
- * >
3318
+ * <Form>
3310
3319
  * <Form.TextField id="textfield" />
3311
3320
  * <Form.Separator />
3312
3321
  * <Form.TextArea id="textarea" />
@@ -3413,7 +3422,7 @@ declare interface FormMembers {
3413
3422
  * import { useState } from "react";
3414
3423
  *
3415
3424
  * export default function Command() {
3416
- * const [description, setDescription] = useState<string>();
3425
+ * const [description, setDescription] = useState<string>("");
3417
3426
  *
3418
3427
  * return (
3419
3428
  * <Form
@@ -3462,7 +3471,7 @@ declare interface FormMembers {
3462
3471
  * import { useState } from "react";
3463
3472
  *
3464
3473
  * export default function Command() {
3465
- * const [name, setName] = useState<string>();
3474
+ * const [name, setName] = useState<string>("");
3466
3475
  *
3467
3476
  * return (
3468
3477
  * <Form
@@ -3583,7 +3592,7 @@ export declare interface FormValues extends Form.Values {
3583
3592
  *
3584
3593
  * @example
3585
3594
  * ```typescript
3586
- * import { Form, Action } from "@raycast/api";
3595
+ * import { Form, Action, ActionPanel } from "@raycast/api";
3587
3596
  *
3588
3597
  * interface Values {
3589
3598
  * todo: string;
@@ -4001,6 +4010,10 @@ declare interface GridMembers {
4001
4010
  }
4002
4011
 
4003
4012
  declare interface GridProps extends ActionsInterface, NavigationChildInterface {
4013
+ /**
4014
+ * A reference to an {@link ActionPanel}. It will only be shown when there aren't any children.
4015
+ */
4016
+ actions?: ReactNode;
4004
4017
  /**
4005
4018
  * Grid sections or items. If {@link Grid.Item} elements are specified, a default section is automatically created.
4006
4019
  */
@@ -4725,6 +4738,34 @@ declare type ItemAccessory = ({
4725
4738
  tooltip?: string | undefined | null;
4726
4739
  };
4727
4740
 
4741
+ /**
4742
+ * An interface describing Action events in callbacks
4743
+ *
4744
+ * @example
4745
+ * ```typescript
4746
+ *import { MenuBarExtra } from "@raycast/api";
4747
+ *
4748
+ *export default function Command() {
4749
+ * return (
4750
+ * <MenuBarExtra>
4751
+ * <MenuBarExtra.Item
4752
+ * title="Log Action Event Type"
4753
+ * onAction={(event: MenuBarExtra.ActionEvent) => console.log("Action Event Type", event.type)} />
4754
+ * <MenuBarExtra>
4755
+ * );
4756
+ *}
4757
+ * ```
4758
+ */
4759
+ declare interface ItemActionEvent {
4760
+ /**
4761
+ * A type of the action event
4762
+ *
4763
+ * * `left-click` is a left mouse click on the {@link MenuBarExtra.Item} or a {@link Keyboard.Shortcut}
4764
+ * * `right-click` is a right mouse click on the {@link MenuBarExtra.Item}
4765
+ */
4766
+ type: "left-click" | "right-click";
4767
+ }
4768
+
4728
4769
  declare interface ItemMembers {
4729
4770
  /**
4730
4771
  * A Detail view that will be shown in the right-hand-side of the List.
@@ -4875,7 +4916,7 @@ declare interface ItemProps_3 {
4875
4916
  /**
4876
4917
  * An action handler called when the user clicks the item.
4877
4918
  */
4878
- onAction?: () => void;
4919
+ onAction?: (event: ItemActionEvent) => void;
4879
4920
  /**
4880
4921
  * A shortcut used to invoke this item when its parent menu is open.
4881
4922
  */
@@ -5326,6 +5367,10 @@ export declare interface ListProps extends List.Props {
5326
5367
  }
5327
5368
 
5328
5369
  declare interface ListProps_2 extends ActionsInterface, NavigationChildInterface {
5370
+ /**
5371
+ * A reference to an {@link ActionPanel}. It will only be shown when there aren't any children.
5372
+ */
5373
+ actions?: ReactNode;
5329
5374
  /**
5330
5375
  * List sections or items. If {@link List.Item} elements are specified, a default section is automatically created.
5331
5376
  */
@@ -5525,15 +5570,149 @@ export declare type LocalStorageValue = LocalStorage.Value;
5525
5570
  export declare interface LocalStorageValues extends LocalStorage.Values {
5526
5571
  }
5527
5572
 
5573
+ /**
5574
+ * Adds an item to the menu bar, optionally with a menu attached in case its `children` prop is non-empty.
5575
+ *
5576
+ * @remarks
5577
+ * `menu-bar` commands don't always need to return a `MenuBarExtra`. Sometimes it makes sense to remove an item from the
5578
+ * menu bar, in which case you can write your command logic to return `null` instead.
5579
+ *
5580
+ * @example
5581
+ * ```typescript
5582
+ * import { Icon, MenuBarExtra, open } from "@raycast/api";
5583
+ * import { useBookmarks } from "./hooks";
5584
+ *
5585
+ * export default function Command() {
5586
+ * const [newBookmarks, archivedBookmarks, isLoading] = useBookmarks();
5587
+ *
5588
+ * return (
5589
+ * <MenuBarExtra icon={Icon.Bookmark} isLoading={isLoading}>
5590
+ * <MenuBarExtra.Item title="New" />
5591
+ * {newBookmarks.map((bookmark) => (
5592
+ * <MenuBarExtra.Item key={bookmark.url} title={bookmark.name} onAction={() => open(bookmark.url)} />
5593
+ * ))}
5594
+ * <MenuBarExtra.Separator />
5595
+ * <MenuBarExtra.Item title="Archived" />
5596
+ * {archivedBookmarks.map((bookmark) => (
5597
+ * <MenuBarExtra.Item key={bookmark.url} title={bookmark.name} onAction={() => open(bookmark.url)} />
5598
+ * ))}
5599
+ * </MenuBarExtra>
5600
+ * );
5601
+ * }
5602
+ * ```
5603
+ */
5528
5604
  export declare const MenuBarExtra: FunctionComponent<MenuBarExtraProps> & MenuBarExtraMembers;
5529
5605
 
5530
5606
  export declare namespace MenuBarExtra {
5531
5607
  export type Props = MenuBarExtraProps;
5608
+ /**
5609
+ * An interface describing Action events in callbacks
5610
+ *
5611
+ * @example
5612
+ * ```typescript
5613
+ *import { MenuBarExtra } from "@raycast/api";
5614
+ *
5615
+ *export default function Command() {
5616
+ * return (
5617
+ * <MenuBarExtra>
5618
+ * <MenuBarExtra.Item
5619
+ * title="Log Action Event Type"
5620
+ * onAction={(event: MenuBarExtra.ActionEvent) => console.log("Action Event Type", event.type)} />
5621
+ * <MenuBarExtra>
5622
+ * );
5623
+ *}
5624
+ * ```
5625
+ */
5626
+ export type ActionEvent = ItemActionEvent;
5532
5627
  }
5533
5628
 
5534
5629
  declare interface MenuBarExtraMembers {
5630
+ /**
5631
+ * An item in the {@link MenuBarExtra} or {@link MenuBarExtra.Submenu}.
5632
+ *
5633
+ * @remarks
5634
+ * An item that only provides only a `title` (and optionally `icon`) prop will be rendered as disabled. Use this to create section titles.
5635
+ *
5636
+ * @remarks
5637
+ * An item that provides an `onAction` prop alongside `title` (and optionally `icon`) will _not_ be rendered as
5638
+ * disabled. When users click this item in the menu bar, the action handler will be executed.
5639
+ *
5640
+ * @example
5641
+ * ```typescript
5642
+ * import { MenuBarExtra } from "@raycast/api";
5643
+ *
5644
+ * export default function Command() {
5645
+ * return (
5646
+ * <MenuBarExtra icon="https://github.githubassets.com/favicons/favicon.png" tooltip="Your Pull Requests">
5647
+ * <MenuBarExtra.Item title="Unseen" />
5648
+ * <MenuBarExtra.Item
5649
+ * title="Example Unseen Pull Request"
5650
+ * onAction={() => {
5651
+ * console.log("unseen pull request clicked");
5652
+ * }}
5653
+ * />
5654
+ * </MenuBarExtra>
5655
+ * );
5656
+ * }
5657
+ * ```
5658
+ */
5535
5659
  Item: typeof Item_3;
5660
+ /**
5661
+ * A visual separator between two items of type {@link MenuBarExtra.Item} or {@link MenuBarExtra.Submenu}.
5662
+ *
5663
+ * @example
5664
+ * ```typescript
5665
+ * import { MenuBarExtra } from "@raycast/api";
5666
+ *
5667
+ * export default function Command() {
5668
+ * return (
5669
+ * <MenuBarExtra icon="https://github.githubassets.com/favicons/favicon.png" tooltip="Your Pull Requests">
5670
+ * <MenuBarExtra.Item title="Item 1" />
5671
+ * <MenuBarExtra.Separator />
5672
+ * <MenuBarExtra.Item title="Item 2" />
5673
+ * <MenuBarExtra.Separator />
5674
+ * <MenuBarExtra.Submenu title="Submenu 1">
5675
+ * <MenuBarExtra.Item title="Submenu 1 Item 1" />
5676
+ * </MenuBarExtra.Submenu>
5677
+ * <MenuBarExtra.Separator />
5678
+ * <MenuBarExtra.Submenu title="Submenu 2">
5679
+ * <MenuBarExtra.Item title="Submenu 2 Item 1" />
5680
+ * </MenuBarExtra.Submenu>
5681
+ * </MenuBarExtra>
5682
+ * );
5683
+ * }
5684
+ * ```
5685
+ */
5536
5686
  Separator: typeof Separator_4;
5687
+ /**
5688
+ * A group of related {@link MenuBarExtra.Item} or {@link MenuBarExtra.Submenu}.
5689
+ *
5690
+ * @remarks
5691
+ * {@link MenuBarExtra.Submenu}s reveal their items when people interact with them. They're a good way to group items
5692
+ * that naturally belong together, but keep in mind that submenus add complexity to your interface - so use them
5693
+ * sparingly!
5694
+ *
5695
+ * @example
5696
+ * ```typescript
5697
+ * import { MenuBarExtra } from "@raycast/api";
5698
+ *
5699
+ * export default function Command() {
5700
+ * return (
5701
+ * <MenuBarExtra icon="https://github.githubassets.com/favicons/favicon.png" tooltip="Your Pull Requests">
5702
+ * <MenuBarExtra.Submenu title="Submenu With Item">
5703
+ * <MenuBarExtra.Item title="Item" />
5704
+ * </MenuBarExtra.Submenu>
5705
+ * <MenuBarExtra.Submenu title="Disabled Submenu" />
5706
+ * <MenuBarExtra.Submenu title="Submenu With Submenu">
5707
+ * <MenuBarExtra.Submenu title="Child Submenu">
5708
+ * <MenuBarExtra.Item title="Item" />
5709
+ * </MenuBarExtra.Submenu>
5710
+ * </MenuBarExtra.Submenu>
5711
+ * </MenuBarExtra>
5712
+ * );
5713
+ * }
5714
+ * ```
5715
+ */
5537
5716
  Submenu: typeof Submenu_2;
5538
5717
  }
5539
5718
 
@@ -5820,8 +5999,11 @@ export declare namespace OAuth {
5820
5999
  export enum RedirectMethod {
5821
6000
  /**
5822
6001
  * Use this type for a redirect back to the Raycast website, which will then open the extension.
5823
- * In the OAuth app, configure either `https://raycast.com/redirect` or `https://raycast.com/redirect?packageName=Extension`
5824
- * (For example, Twitter would accept the former, while Spotify requires the query parameter.)
6002
+ * In the OAuth app, configure `https://raycast.com/redirect?packageName=Extension`
6003
+ * (This is a static redirect URL for all extensions.)
6004
+ * If the provider does not accept query parameters in redirect URLs, you can alternatively use `https://raycast.com/redirect/extension`
6005
+ * and then customize the {@link OAuth.AuthorizationRequest} via its `extraParameters` property. For example add:
6006
+ * `extraParameters: { "redirect_uri": "https://raycast.com/redirect/extension" }`
5825
6007
  */
5826
6008
  Web = "web",
5827
6009
  /**
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@raycast/api",
3
- "version": "1.39.3",
3
+ "version": "1.40.0",
4
4
  "description": "Build extensions for Raycast with React and Node.js.",
5
5
  "author": "Raycast Technologies Ltd.",
6
6
  "homepage": "https://developers.raycast.com",
7
+ "repository": {
8
+ "url": "https://github.com/raycast/extensions"
9
+ },
7
10
  "license": "MIT",
8
11
  "types": "types/index.d.ts",
9
12
  "dependencies": {
@@ -12,6 +15,18 @@
12
15
  "react": "18.1.0",
13
16
  "react-reconciler": "0.28.0"
14
17
  },
18
+ "peerDependencies": {
19
+ "@types/node": "16.10.3",
20
+ "@types/react": "18.0.9"
21
+ },
22
+ "peerDependenciesMeta": {
23
+ "@types/node": {
24
+ "optional": true
25
+ },
26
+ "@types/react": {
27
+ "optional": true
28
+ }
29
+ },
15
30
  "scripts": {
16
31
  "postinstall": "bin/ray npm-post-install"
17
32
  },
package/types/index.d.ts CHANGED
@@ -1128,7 +1128,7 @@ declare interface ConvenienceActions {
1128
1128
  * import { useState } from "react";
1129
1129
  *
1130
1130
  * export default function Command() {
1131
- * const [name, setName] = useState<string>();
1131
+ * const [name, setName] = useState<string>("");
1132
1132
  *
1133
1133
  * return (
1134
1134
  * <Form
@@ -1352,7 +1352,7 @@ declare interface DatePickerMembers {
1352
1352
  Type: typeof DatePickerType;
1353
1353
  }
1354
1354
 
1355
- declare interface DatePickerProps extends FormItemProps_2<Date> {
1355
+ declare interface DatePickerProps extends FormItemProps_2<Date | null> {
1356
1356
  /**
1357
1357
  * Indicates what types of date components can be picked
1358
1358
  *
@@ -1689,6 +1689,13 @@ declare interface DropdownItemProps {
1689
1689
  * A optional icon displayed for the item.
1690
1690
  */
1691
1691
  icon?: Image.ImageLike;
1692
+ /**
1693
+ * An optional property used for providing additional indexable strings for search.
1694
+ * When filtering the items in Raycast, the keywords will be searched in addition to the title.
1695
+ *
1696
+ * @defaultValue The title of its section if any
1697
+ */
1698
+ keywords?: string[];
1692
1699
  }
1693
1700
 
1694
1701
  declare interface DropdownItemProps_2 {
@@ -1705,6 +1712,13 @@ declare interface DropdownItemProps_2 {
1705
1712
  * An optional icon displayed for the item.
1706
1713
  */
1707
1714
  icon?: Image.ImageLike | undefined | null;
1715
+ /**
1716
+ * An optional property used for providing additional indexable strings for search.
1717
+ * When filtering the items in Raycast, the keywords will be searched in addition to the title.
1718
+ *
1719
+ * @defaultValue The title of its section if any
1720
+ */
1721
+ keywords?: string[];
1708
1722
  }
1709
1723
 
1710
1724
  declare interface DropdownItemProps_3 {
@@ -1721,6 +1735,13 @@ declare interface DropdownItemProps_3 {
1721
1735
  * An optional icon displayed for the item.
1722
1736
  */
1723
1737
  icon?: Image.ImageLike | undefined | null;
1738
+ /**
1739
+ * An optional property used for providing additional indexable strings for search.
1740
+ * When filtering the items in Raycast, the keywords will be searched in addition to the title.
1741
+ *
1742
+ * @defaultValue The title of its section if any
1743
+ */
1744
+ keywords?: string[];
1724
1745
  }
1725
1746
 
1726
1747
  declare interface DropdownMembers {
@@ -3132,7 +3153,7 @@ declare interface FormMembers {
3132
3153
  * import { useState } from "react";
3133
3154
  *
3134
3155
  * export default function Command() {
3135
- * const [date, setDate] = useState<Date>();
3156
+ * const [date, setDate] = useState<Date | null>(null);
3136
3157
  *
3137
3158
  * return (
3138
3159
  * <Form
@@ -3162,13 +3183,7 @@ declare interface FormMembers {
3162
3183
  *
3163
3184
  * export default function Command() {
3164
3185
  * return (
3165
- * <Form
3166
- * actions={
3167
- * <ActionPanel>
3168
- * <Action.SubmitForm title="Submit" onSubmit={(values) => console.log(values)} />
3169
- * </ActionPanel>
3170
- * }
3171
- * >
3186
+ * <Form>
3172
3187
  * <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." />
3173
3188
  * </Form>
3174
3189
  * );
@@ -3273,7 +3288,7 @@ declare interface FormMembers {
3273
3288
  * import { useState } from "react";
3274
3289
  *
3275
3290
  * export default function Command() {
3276
- * const [password, setPassword] = useState<string>();
3291
+ * const [password, setPassword] = useState<string>("");
3277
3292
  *
3278
3293
  * return (
3279
3294
  * <Form
@@ -3300,13 +3315,7 @@ declare interface FormMembers {
3300
3315
  *
3301
3316
  * export default function Command() {
3302
3317
  * return (
3303
- * <Form
3304
- * actions={
3305
- * <ActionPanel>
3306
- * <Action.SubmitForm title="Submit Form" onSubmit={(values) => console.log(values)} />
3307
- * </ActionPanel>
3308
- * }
3309
- * >
3318
+ * <Form>
3310
3319
  * <Form.TextField id="textfield" />
3311
3320
  * <Form.Separator />
3312
3321
  * <Form.TextArea id="textarea" />
@@ -3413,7 +3422,7 @@ declare interface FormMembers {
3413
3422
  * import { useState } from "react";
3414
3423
  *
3415
3424
  * export default function Command() {
3416
- * const [description, setDescription] = useState<string>();
3425
+ * const [description, setDescription] = useState<string>("");
3417
3426
  *
3418
3427
  * return (
3419
3428
  * <Form
@@ -3462,7 +3471,7 @@ declare interface FormMembers {
3462
3471
  * import { useState } from "react";
3463
3472
  *
3464
3473
  * export default function Command() {
3465
- * const [name, setName] = useState<string>();
3474
+ * const [name, setName] = useState<string>("");
3466
3475
  *
3467
3476
  * return (
3468
3477
  * <Form
@@ -3583,7 +3592,7 @@ export declare interface FormValues extends Form.Values {
3583
3592
  *
3584
3593
  * @example
3585
3594
  * ```typescript
3586
- * import { Form, Action } from "@raycast/api";
3595
+ * import { Form, Action, ActionPanel } from "@raycast/api";
3587
3596
  *
3588
3597
  * interface Values {
3589
3598
  * todo: string;
@@ -4001,6 +4010,10 @@ declare interface GridMembers {
4001
4010
  }
4002
4011
 
4003
4012
  declare interface GridProps extends ActionsInterface, NavigationChildInterface {
4013
+ /**
4014
+ * A reference to an {@link ActionPanel}. It will only be shown when there aren't any children.
4015
+ */
4016
+ actions?: ReactNode;
4004
4017
  /**
4005
4018
  * Grid sections or items. If {@link Grid.Item} elements are specified, a default section is automatically created.
4006
4019
  */
@@ -4725,6 +4738,34 @@ declare type ItemAccessory = ({
4725
4738
  tooltip?: string | undefined | null;
4726
4739
  };
4727
4740
 
4741
+ /**
4742
+ * An interface describing Action events in callbacks
4743
+ *
4744
+ * @example
4745
+ * ```typescript
4746
+ *import { MenuBarExtra } from "@raycast/api";
4747
+ *
4748
+ *export default function Command() {
4749
+ * return (
4750
+ * <MenuBarExtra>
4751
+ * <MenuBarExtra.Item
4752
+ * title="Log Action Event Type"
4753
+ * onAction={(event: MenuBarExtra.ActionEvent) => console.log("Action Event Type", event.type)} />
4754
+ * <MenuBarExtra>
4755
+ * );
4756
+ *}
4757
+ * ```
4758
+ */
4759
+ declare interface ItemActionEvent {
4760
+ /**
4761
+ * A type of the action event
4762
+ *
4763
+ * * `left-click` is a left mouse click on the {@link MenuBarExtra.Item} or a {@link Keyboard.Shortcut}
4764
+ * * `right-click` is a right mouse click on the {@link MenuBarExtra.Item}
4765
+ */
4766
+ type: "left-click" | "right-click";
4767
+ }
4768
+
4728
4769
  declare interface ItemMembers {
4729
4770
  /**
4730
4771
  * A Detail view that will be shown in the right-hand-side of the List.
@@ -4875,7 +4916,7 @@ declare interface ItemProps_3 {
4875
4916
  /**
4876
4917
  * An action handler called when the user clicks the item.
4877
4918
  */
4878
- onAction?: () => void;
4919
+ onAction?: (event: ItemActionEvent) => void;
4879
4920
  /**
4880
4921
  * A shortcut used to invoke this item when its parent menu is open.
4881
4922
  */
@@ -5326,6 +5367,10 @@ export declare interface ListProps extends List.Props {
5326
5367
  }
5327
5368
 
5328
5369
  declare interface ListProps_2 extends ActionsInterface, NavigationChildInterface {
5370
+ /**
5371
+ * A reference to an {@link ActionPanel}. It will only be shown when there aren't any children.
5372
+ */
5373
+ actions?: ReactNode;
5329
5374
  /**
5330
5375
  * List sections or items. If {@link List.Item} elements are specified, a default section is automatically created.
5331
5376
  */
@@ -5525,15 +5570,149 @@ export declare type LocalStorageValue = LocalStorage.Value;
5525
5570
  export declare interface LocalStorageValues extends LocalStorage.Values {
5526
5571
  }
5527
5572
 
5573
+ /**
5574
+ * Adds an item to the menu bar, optionally with a menu attached in case its `children` prop is non-empty.
5575
+ *
5576
+ * @remarks
5577
+ * `menu-bar` commands don't always need to return a `MenuBarExtra`. Sometimes it makes sense to remove an item from the
5578
+ * menu bar, in which case you can write your command logic to return `null` instead.
5579
+ *
5580
+ * @example
5581
+ * ```typescript
5582
+ * import { Icon, MenuBarExtra, open } from "@raycast/api";
5583
+ * import { useBookmarks } from "./hooks";
5584
+ *
5585
+ * export default function Command() {
5586
+ * const [newBookmarks, archivedBookmarks, isLoading] = useBookmarks();
5587
+ *
5588
+ * return (
5589
+ * <MenuBarExtra icon={Icon.Bookmark} isLoading={isLoading}>
5590
+ * <MenuBarExtra.Item title="New" />
5591
+ * {newBookmarks.map((bookmark) => (
5592
+ * <MenuBarExtra.Item key={bookmark.url} title={bookmark.name} onAction={() => open(bookmark.url)} />
5593
+ * ))}
5594
+ * <MenuBarExtra.Separator />
5595
+ * <MenuBarExtra.Item title="Archived" />
5596
+ * {archivedBookmarks.map((bookmark) => (
5597
+ * <MenuBarExtra.Item key={bookmark.url} title={bookmark.name} onAction={() => open(bookmark.url)} />
5598
+ * ))}
5599
+ * </MenuBarExtra>
5600
+ * );
5601
+ * }
5602
+ * ```
5603
+ */
5528
5604
  export declare const MenuBarExtra: FunctionComponent<MenuBarExtraProps> & MenuBarExtraMembers;
5529
5605
 
5530
5606
  export declare namespace MenuBarExtra {
5531
5607
  export type Props = MenuBarExtraProps;
5608
+ /**
5609
+ * An interface describing Action events in callbacks
5610
+ *
5611
+ * @example
5612
+ * ```typescript
5613
+ *import { MenuBarExtra } from "@raycast/api";
5614
+ *
5615
+ *export default function Command() {
5616
+ * return (
5617
+ * <MenuBarExtra>
5618
+ * <MenuBarExtra.Item
5619
+ * title="Log Action Event Type"
5620
+ * onAction={(event: MenuBarExtra.ActionEvent) => console.log("Action Event Type", event.type)} />
5621
+ * <MenuBarExtra>
5622
+ * );
5623
+ *}
5624
+ * ```
5625
+ */
5626
+ export type ActionEvent = ItemActionEvent;
5532
5627
  }
5533
5628
 
5534
5629
  declare interface MenuBarExtraMembers {
5630
+ /**
5631
+ * An item in the {@link MenuBarExtra} or {@link MenuBarExtra.Submenu}.
5632
+ *
5633
+ * @remarks
5634
+ * An item that only provides only a `title` (and optionally `icon`) prop will be rendered as disabled. Use this to create section titles.
5635
+ *
5636
+ * @remarks
5637
+ * An item that provides an `onAction` prop alongside `title` (and optionally `icon`) will _not_ be rendered as
5638
+ * disabled. When users click this item in the menu bar, the action handler will be executed.
5639
+ *
5640
+ * @example
5641
+ * ```typescript
5642
+ * import { MenuBarExtra } from "@raycast/api";
5643
+ *
5644
+ * export default function Command() {
5645
+ * return (
5646
+ * <MenuBarExtra icon="https://github.githubassets.com/favicons/favicon.png" tooltip="Your Pull Requests">
5647
+ * <MenuBarExtra.Item title="Unseen" />
5648
+ * <MenuBarExtra.Item
5649
+ * title="Example Unseen Pull Request"
5650
+ * onAction={() => {
5651
+ * console.log("unseen pull request clicked");
5652
+ * }}
5653
+ * />
5654
+ * </MenuBarExtra>
5655
+ * );
5656
+ * }
5657
+ * ```
5658
+ */
5535
5659
  Item: typeof Item_3;
5660
+ /**
5661
+ * A visual separator between two items of type {@link MenuBarExtra.Item} or {@link MenuBarExtra.Submenu}.
5662
+ *
5663
+ * @example
5664
+ * ```typescript
5665
+ * import { MenuBarExtra } from "@raycast/api";
5666
+ *
5667
+ * export default function Command() {
5668
+ * return (
5669
+ * <MenuBarExtra icon="https://github.githubassets.com/favicons/favicon.png" tooltip="Your Pull Requests">
5670
+ * <MenuBarExtra.Item title="Item 1" />
5671
+ * <MenuBarExtra.Separator />
5672
+ * <MenuBarExtra.Item title="Item 2" />
5673
+ * <MenuBarExtra.Separator />
5674
+ * <MenuBarExtra.Submenu title="Submenu 1">
5675
+ * <MenuBarExtra.Item title="Submenu 1 Item 1" />
5676
+ * </MenuBarExtra.Submenu>
5677
+ * <MenuBarExtra.Separator />
5678
+ * <MenuBarExtra.Submenu title="Submenu 2">
5679
+ * <MenuBarExtra.Item title="Submenu 2 Item 1" />
5680
+ * </MenuBarExtra.Submenu>
5681
+ * </MenuBarExtra>
5682
+ * );
5683
+ * }
5684
+ * ```
5685
+ */
5536
5686
  Separator: typeof Separator_4;
5687
+ /**
5688
+ * A group of related {@link MenuBarExtra.Item} or {@link MenuBarExtra.Submenu}.
5689
+ *
5690
+ * @remarks
5691
+ * {@link MenuBarExtra.Submenu}s reveal their items when people interact with them. They're a good way to group items
5692
+ * that naturally belong together, but keep in mind that submenus add complexity to your interface - so use them
5693
+ * sparingly!
5694
+ *
5695
+ * @example
5696
+ * ```typescript
5697
+ * import { MenuBarExtra } from "@raycast/api";
5698
+ *
5699
+ * export default function Command() {
5700
+ * return (
5701
+ * <MenuBarExtra icon="https://github.githubassets.com/favicons/favicon.png" tooltip="Your Pull Requests">
5702
+ * <MenuBarExtra.Submenu title="Submenu With Item">
5703
+ * <MenuBarExtra.Item title="Item" />
5704
+ * </MenuBarExtra.Submenu>
5705
+ * <MenuBarExtra.Submenu title="Disabled Submenu" />
5706
+ * <MenuBarExtra.Submenu title="Submenu With Submenu">
5707
+ * <MenuBarExtra.Submenu title="Child Submenu">
5708
+ * <MenuBarExtra.Item title="Item" />
5709
+ * </MenuBarExtra.Submenu>
5710
+ * </MenuBarExtra.Submenu>
5711
+ * </MenuBarExtra>
5712
+ * );
5713
+ * }
5714
+ * ```
5715
+ */
5537
5716
  Submenu: typeof Submenu_2;
5538
5717
  }
5539
5718
 
@@ -5820,8 +5999,11 @@ export declare namespace OAuth {
5820
5999
  export enum RedirectMethod {
5821
6000
  /**
5822
6001
  * Use this type for a redirect back to the Raycast website, which will then open the extension.
5823
- * In the OAuth app, configure either `https://raycast.com/redirect` or `https://raycast.com/redirect?packageName=Extension`
5824
- * (For example, Twitter would accept the former, while Spotify requires the query parameter.)
6002
+ * In the OAuth app, configure `https://raycast.com/redirect?packageName=Extension`
6003
+ * (This is a static redirect URL for all extensions.)
6004
+ * If the provider does not accept query parameters in redirect URLs, you can alternatively use `https://raycast.com/redirect/extension`
6005
+ * and then customize the {@link OAuth.AuthorizationRequest} via its `extraParameters` property. For example add:
6006
+ * `extraParameters: { "redirect_uri": "https://raycast.com/redirect/extension" }`
5825
6007
  */
5826
6008
  Web = "web",
5827
6009
  /**