@raycast/api 1.43.2 → 1.45.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 +190 -106
  2. package/package.json +1 -1
  3. package/types/index.d.ts +190 -106
package/api.d.ts CHANGED
@@ -550,13 +550,8 @@ declare interface Arguments {
550
550
  [item: string]: any;
551
551
  }
552
552
 
553
- /**
554
- * An interface describing top-level props for arguments
555
- */
553
+ /** @deprecated Use {@Link LaunchProps} directly */
556
554
  export declare interface ArgumentsLaunchProps {
557
- /**
558
- * Use these values to populate the initial state for your command.
559
- */
560
555
  arguments?: Arguments;
561
556
  }
562
557
 
@@ -732,7 +727,7 @@ export declare namespace Clipboard {
732
727
  * };
733
728
  * ```
734
729
  */
735
- export function copy(content: string | Content): Promise<void>;
730
+ export function copy(content: string | number | Content): Promise<void>;
736
731
  /**
737
732
  * Clears the current clipboard contents.
738
733
  *
@@ -763,7 +758,7 @@ export declare namespace Clipboard {
763
758
  * };
764
759
  * ```
765
760
  */
766
- export function paste(content: string | Content): Promise<void>;
761
+ export function paste(content: string | number | Content): Promise<void>;
767
762
  /**
768
763
  * Reads the clipboard as plain text.
769
764
  *
@@ -804,19 +799,26 @@ export declare namespace Clipboard {
804
799
  } | {
805
800
  /**
806
801
  * The file representation of the content.
807
- *
808
- * @remarks
809
- * At the moment only file paths represented as a string are supported.
810
802
  */
811
803
  file: PathLike;
804
+ } | {
805
+ /**
806
+ * The HTML representation of the content.
807
+ */
808
+ html: string;
809
+ /**
810
+ * The alternative text representation of the content.
811
+ */
812
+ text?: string;
812
813
  };
813
814
  }
814
815
 
815
816
  /**
816
817
  * Closes the main Raycast window.
817
818
  *
818
- * @param options - Can be used to clear the root search. Defaults to not clearing the root search after
819
- * the window was closed.
819
+ * @param options - A parameter object with the properties:
820
+ * `clearRootSearch`: clears the text in the root search bar and scrolls to the top; default is `false`
821
+ * `popToRootType`: defines the pop to root behavior ({@link PopToRootType}); the default is to to respect the user's "Pop to Root Search" preference in Raycast
820
822
  * @returns A Promise that resolves when the main window is closed.
821
823
  *
822
824
  * @example
@@ -832,6 +834,7 @@ export declare namespace Clipboard {
832
834
  */
833
835
  export declare function closeMainWindow(options?: {
834
836
  clearRootSearch?: boolean;
837
+ popToRootType?: PopToRootType;
835
838
  }): Promise<void>;
836
839
 
837
840
  /**
@@ -849,7 +852,6 @@ export declare function closeMainWindow(options?: {
849
852
  * <List>
850
853
  * <List.Item title="Blue" icon={{ source: Icon.Circle, tintColor: Color.Blue }} />
851
854
  * <List.Item title="Green" icon={{ source: Icon.Circle, tintColor: Color.Green }} />
852
- * <List.Item title="Brown" icon={{ source: Icon.Circle, tintColor: Color.Brown }} />
853
855
  * <List.Item title="Magenta" icon={{ source: Icon.Circle, tintColor: Color.Magenta }} />
854
856
  * <List.Item title="Orange" icon={{ source: Icon.Circle, tintColor: Color.Orange }} />
855
857
  * <List.Item title="Purple" icon={{ source: Icon.Circle, tintColor: Color.Purple }} />
@@ -864,7 +866,6 @@ export declare function closeMainWindow(options?: {
864
866
  */
865
867
  export declare enum Color {
866
868
  Blue = "raycast-blue",
867
- Brown = "raycast-brown",
868
869
  Green = "raycast-green",
869
870
  Magenta = "raycast-magenta",
870
871
  Orange = "raycast-orange",
@@ -949,6 +950,12 @@ export declare namespace Color {
949
950
  * - Keywords, e.g. `red`
950
951
  */
951
952
  export type Raw = string;
953
+ /** The standard colors. Use those colors for consistency.
954
+ *
955
+ * @remarks
956
+ * The colors automatically adapt to the Raycast theme (light or dark).
957
+ */
958
+ const Brown: Color.Dynamic;
952
959
  }
953
960
 
954
961
  /**
@@ -1313,9 +1320,9 @@ export declare interface CopyToClipboardActionProps extends Action.CopyToClipboa
1313
1320
  */
1314
1321
  declare interface CopyToClipboardProps {
1315
1322
  /**
1316
- * The contents that will be written to the clipboard as string.
1323
+ * The contents that will be copied to the clipboard.
1317
1324
  */
1318
- content: string | number;
1325
+ content: string | number | Clipboard.Content;
1319
1326
  /**
1320
1327
  * An optional title for the action.
1321
1328
  * @defaultValue `"Copy to Clipboard"`
@@ -1336,7 +1343,7 @@ declare interface CopyToClipboardProps {
1336
1343
  * @remarks
1337
1344
  * This is handy when you want to act on the copied content, e.g. up-rank recently copied content.
1338
1345
  */
1339
- onCopy?: (content: string | number) => void;
1346
+ onCopy?: (content: string | number | Clipboard.Content) => void;
1340
1347
  }
1341
1348
 
1342
1349
  /**
@@ -1878,14 +1885,20 @@ declare interface DropdownMembers_2 {
1878
1885
  /**
1879
1886
  * See {@link Form.Dropdown.Props}
1880
1887
  */
1881
- declare interface DropdownProps extends FormItemProps_2<string> {
1888
+ declare interface DropdownProps extends FormItemProps_2<string>, SearchBarInterface {
1889
+ /**
1890
+ * Placeholder text that will be shown in the dropdown search field.
1891
+ *
1892
+ * @defaultValue `"Search..."`
1893
+ */
1894
+ placeholder?: string;
1882
1895
  /**
1883
1896
  * Sections or items. If {@link Form.Dropdown.Item} elements are specified, a default section is automatically created.
1884
1897
  */
1885
1898
  children?: ReactNode;
1886
1899
  }
1887
1900
 
1888
- declare interface DropdownProps_2 {
1901
+ declare interface DropdownProps_2 extends SearchBarInterface {
1889
1902
  /**
1890
1903
  * ID of the dropdown.
1891
1904
  */
@@ -2032,12 +2045,16 @@ export declare interface Environment {
2032
2045
  * The theme used by the Raycast application.
2033
2046
  */
2034
2047
  theme: "light" | "dark";
2048
+ /**
2049
+ * The text size used by the Raycast application.
2050
+ */
2051
+ textSize: "medium" | "large";
2035
2052
  /**
2036
2053
  * The type of launch for the command (user initiated or background).
2037
2054
  */
2038
2055
  launchType: LaunchType;
2039
2056
  /**
2040
- * Any custom context values passed from a programmatic command launch via `launchCommand`.
2057
+ * @deprecated Use the top-level prop `launchContext` instead.
2041
2058
  */
2042
2059
  launchContext?: LaunchContext;
2043
2060
  }
@@ -3048,14 +3065,8 @@ declare interface FormItemRef {
3048
3065
  reset: () => void;
3049
3066
  }
3050
3067
 
3051
- /**
3052
- * An interface describing top-level props for Form drafts
3053
- */
3068
+ /** @deprecated Use {@Link LaunchProps} directly */
3054
3069
  export declare interface FormLaunchProps {
3055
- /**
3056
- * When a user enters the command via a draft, this object will contain the user inputs that were saved as a draft.
3057
- * Use its values to populate the initial state for your Form.
3058
- */
3059
3070
  draftValues?: Form.Values;
3060
3071
  }
3061
3072
 
@@ -3748,7 +3759,7 @@ export declare function getApplications(path?: PathLike): Promise<Application[]>
3748
3759
  * Returns the default application that the file would be opened with.
3749
3760
  *
3750
3761
  * @param path - The path of the file or folder to get the default application for.
3751
- * @returns The default {@link Application} that would open the file. Throws an error if no application was found.
3762
+ * @returns A Promise that resolves with the default {@link Application} that would open the file. If no application was found, the promise will be rejected.
3752
3763
  *
3753
3764
  * @example
3754
3765
  * ```typescript
@@ -3762,6 +3773,23 @@ export declare function getApplications(path?: PathLike): Promise<Application[]>
3762
3773
  */
3763
3774
  export declare function getDefaultApplication(path: PathLike): Promise<Application>;
3764
3775
 
3776
+ /**
3777
+ * Returns the frontmost application.
3778
+ *
3779
+ * @returns A Promise that resolves with the frontmost {@link Application}. If no application was found, the promise will be rejected.
3780
+ *
3781
+ * @example
3782
+ * ```typescript
3783
+ * import { getFrontmostApplication } from "@raycast/api";
3784
+ *
3785
+ * export default async () => {
3786
+ * const frontmostApplication = await getFrontmostApplication();
3787
+ * console.log(`The frontmost application is: ${frontmostApplication.name}`);
3788
+ * };
3789
+ * ```
3790
+ */
3791
+ export declare function getFrontmostApplication(): Promise<Application>;
3792
+
3765
3793
  /**
3766
3794
  * @deprecated Use {@link LocalStorage.getItem} instead
3767
3795
  */
@@ -3796,8 +3824,7 @@ export declare function getPreferenceValues<Values extends PreferenceValues = Pr
3796
3824
  /**
3797
3825
  * Gets the selected items from Finder.
3798
3826
  *
3799
- * @throws An error when Finder is not the frontmost application.
3800
- * @returns A Promise that resolves with the selected file system items.
3827
+ * @returns A Promise that resolves with the selected file system items. If Finder is not the frontmost application, the promise will be rejected.
3801
3828
  *
3802
3829
  * @example
3803
3830
  * ```typescript
@@ -3824,8 +3851,7 @@ export declare function getSelectedFinderItems(): Promise<FileSystemItem[]>;
3824
3851
  /**
3825
3852
  * Gets the selected text of the frontmost application.
3826
3853
  *
3827
- * @throws An error when no text is selected in the frontmost application.
3828
- * @returns A Promise that resolves with the selected text.
3854
+ * @returns A Promise that resolves with the selected text. If no text is selected in the frontmost application, the promise will be rejected.
3829
3855
  *
3830
3856
  * @example
3831
3857
  * ```typescript
@@ -4138,7 +4164,7 @@ declare interface GridMembers {
4138
4164
  Dropdown: typeof Dropdown_2;
4139
4165
  }
4140
4166
 
4141
- declare interface GridProps extends ActionsInterface, NavigationChildInterface {
4167
+ declare interface GridProps extends ActionsInterface, NavigationChildInterface, SearchBarInterface {
4142
4168
  /**
4143
4169
  * A reference to an {@link ActionPanel}. It will only be shown when there aren't any children.
4144
4170
  */
@@ -4198,19 +4224,6 @@ declare interface GridProps extends ActionsInterface, NavigationChildInterface {
4198
4224
  * @defaultValue `false` when `onSearchTextChange` is specified, `true` otherwise.
4199
4225
  */
4200
4226
  enableFiltering?: boolean;
4201
- /**
4202
- * Toggles Raycast filtering. When `true`, Raycast will use the query in the search bar to filter the
4203
- * items. When `false`, the extension needs to take care of the filtering.
4204
- *
4205
- * You can further define how native filtering orders grid sections by setting an object with a `keepSectionOrder` property:
4206
- * When `true`, ensures that Raycast filtering maintains the section order as defined in the extension.
4207
- * When `false`, filtering may change the section order depending on the ranking values of the items.
4208
- *
4209
- * @defaultValue `false` when `onSearchTextChange` is specified, `true` otherwise.
4210
- */
4211
- filtering?: boolean | {
4212
- keepSectionOrder: boolean;
4213
- };
4214
4227
  /**
4215
4228
  * Placeholder text that will be shown in the search bar.
4216
4229
  *
@@ -4221,19 +4234,6 @@ declare interface GridProps extends ActionsInterface, NavigationChildInterface {
4221
4234
  * Selects the item with the specified id.
4222
4235
  */
4223
4236
  selectedItemId?: string;
4224
- /**
4225
- * Defines whether the {@link Grid.Props.onSearchTextChange} will be triggered on every keyboard press or with a delay for throttling the events.
4226
- * Recommended to set to `true` when using custom filtering logic with asynchronous operations (e.g. network requests).
4227
- * @defaultValue `false`
4228
- */
4229
- throttle?: boolean;
4230
- /**
4231
- * Callback triggered when the search bar text changes.
4232
- *
4233
- * @remarks
4234
- * Specifying this implicitly toggles `filtering` to false. To enable native filtering when using `onSearchTextChange`, explicitly set `filtering` to true.
4235
- */
4236
- onSearchTextChange?: (text: string) => void;
4237
4237
  }
4238
4238
 
4239
4239
  /**
@@ -4883,14 +4883,34 @@ declare const Item_3: FunctionComponent<ItemProps_3>;
4883
4883
 
4884
4884
  declare type ItemAccessory = ({
4885
4885
  /**
4886
- * An optional text that will be used as the label.
4886
+ * An optional text that will be used as the label, optionally colored.
4887
+ * Color changes the text color to the provided color.
4888
+ * Defaults to {@link Color.SecondaryText}.
4889
+ */
4890
+ text?: string | undefined | null | {
4891
+ value: string | undefined | null;
4892
+ color?: Color;
4893
+ };
4894
+ } | {
4895
+ /**
4896
+ * An optional Date that will be used as the label, optionally colored. The date is formatted relatively to the current time (for example `new Date()` will be displayed as `"now"`, yesterday's Date will be displayed as "1d", etc.).
4897
+ * Color changes the text color to the provided color.
4898
+ * Defaults to {@link Color.SecondaryText}.
4887
4899
  */
4888
- text?: string | undefined | null;
4900
+ date?: Date | undefined | null | {
4901
+ value: Date | undefined | null;
4902
+ color?: Color;
4903
+ };
4889
4904
  } | {
4890
4905
  /**
4891
- * An optional Date that will be used as the label. The date is formatted relatively to the current time (for example `new Date()` will be displayed as `"now"`, yesterday's Date will be displayed as "1d", etc.).
4906
+ * A string or Date that will be used as the label, optionally colored. The date is formatted relatively to the current time (for example `new Date()` will be displayed as `"now"`, yesterday's Date will be displayed as "1d", etc.).
4907
+ * Color changes the text color to the provided color and sets a transparent background with the same color.
4908
+ * Defaults to {@link Color.SecondaryText}.
4892
4909
  */
4893
- date?: Date | undefined | null;
4910
+ tag: string | Date | undefined | null | {
4911
+ value: string | Date | undefined | null;
4912
+ color?: Color;
4913
+ };
4894
4914
  }) & {
4895
4915
  /**
4896
4916
  * An optional {@link Image.ImageLike} that will be used as the icon.
@@ -4967,14 +4987,14 @@ declare interface ItemProps extends ActionsInterface {
4967
4987
  */
4968
4988
  title: string | {
4969
4989
  value: string;
4970
- tooltip: string;
4990
+ tooltip?: string | null;
4971
4991
  };
4972
4992
  /**
4973
4993
  * An optional subtitle displayed next to the main title, optionally with a tooltip.
4974
4994
  */
4975
4995
  subtitle?: string | {
4976
- value: string | undefined | null;
4977
- tooltip: string;
4996
+ value?: string | null;
4997
+ tooltip?: string | null;
4978
4998
  };
4979
4999
  /**
4980
5000
  * An optional property used for providing additional indexable strings for search.
@@ -5072,7 +5092,7 @@ declare interface ItemProps_3 {
5072
5092
  */
5073
5093
  title: string;
5074
5094
  /**
5075
- * The subtitle displayed for this item in a slightly dimmed text color.
5095
+ * The subtitle displayed for this item.
5076
5096
  */
5077
5097
  subtitle?: string;
5078
5098
  /**
@@ -5184,8 +5204,12 @@ declare interface LabelProps {
5184
5204
  icon?: Image.ImageLike | undefined | null;
5185
5205
  /**
5186
5206
  * The text value of the item.
5207
+ * Specifying `color` will display the text in the provided color. Defaults to {@link Color.SecondaryText}.
5187
5208
  */
5188
- text?: string;
5209
+ text?: string | {
5210
+ value: string;
5211
+ color?: Color | null;
5212
+ };
5189
5213
  }
5190
5214
 
5191
5215
  /**
@@ -5226,7 +5250,37 @@ declare interface LaunchContext {
5226
5250
  /**
5227
5251
  * The top-level props that a Command receives on launch
5228
5252
  */
5229
- export declare type LaunchProps = ArgumentsLaunchProps | FormLaunchProps;
5253
+ export declare type LaunchProps<T extends {
5254
+ arguments?: Arguments;
5255
+ draftValues?: Form.Values;
5256
+ launchContext?: LaunchContext;
5257
+ } = {
5258
+ arguments: Arguments;
5259
+ draftValues: Form.Values;
5260
+ launchContext?: LaunchContext;
5261
+ }> = {
5262
+ /**
5263
+ * The type of launch for the command (user initiated or background).
5264
+ */
5265
+ launchType: LaunchType;
5266
+ /**
5267
+ * Use these values to populate the initial state for your command.
5268
+ */
5269
+ arguments: T["arguments"];
5270
+ /**
5271
+ * When a user enters the command via a draft, this object will contain the user inputs that were saved as a draft.
5272
+ * Use its values to populate the initial state for your Form.
5273
+ */
5274
+ draftValues?: T["draftValues"];
5275
+ /**
5276
+ * When the command is launched programmatically via `launchCommand`, this object contains the value passed to `context`.
5277
+ */
5278
+ launchContext?: T["launchContext"];
5279
+ /**
5280
+ * When the command is launched as a fallback command, this string contains the text of the root search.
5281
+ */
5282
+ fallbackText?: string;
5283
+ };
5230
5284
 
5231
5285
  export declare enum LaunchType {
5232
5286
  /**
@@ -5567,7 +5621,7 @@ declare interface ListMembers {
5567
5621
  export declare interface ListProps extends List.Props {
5568
5622
  }
5569
5623
 
5570
- declare interface ListProps_2 extends ActionsInterface, NavigationChildInterface {
5624
+ declare interface ListProps_2 extends ActionsInterface, NavigationChildInterface, SearchBarInterface {
5571
5625
  /**
5572
5626
  * A reference to an {@link ActionPanel}. It will only be shown when there aren't any children.
5573
5627
  */
@@ -5602,19 +5656,6 @@ declare interface ListProps_2 extends ActionsInterface, NavigationChildInterface
5602
5656
  * @defaultValue `false` when `onSearchTextChange` is specified, `true` otherwise.
5603
5657
  */
5604
5658
  enableFiltering?: boolean;
5605
- /**
5606
- * Toggles Raycast filtering. When `true`, Raycast will use the query in the search bar to filter the
5607
- * items. When `false`, the extension needs to take care of the filtering.
5608
- *
5609
- * You can further define how native filtering orders list sections by setting an object with a `keepSectionOrder` property:
5610
- * When `true`, ensures that Raycast filtering maintains the section order as defined in the extension.
5611
- * When `false`, filtering may change the section order depending on the ranking values of list items.
5612
- *
5613
- * @defaultValue `false` when `onSearchTextChange` is specified, `true` otherwise.
5614
- */
5615
- filtering?: boolean | {
5616
- keepSectionOrder: boolean;
5617
- };
5618
5659
  /**
5619
5660
  * Placeholder text that will be shown in the search bar.
5620
5661
  *
@@ -5625,19 +5666,6 @@ declare interface ListProps_2 extends ActionsInterface, NavigationChildInterface
5625
5666
  * Selects the item with the specified id.
5626
5667
  */
5627
5668
  selectedItemId?: string;
5628
- /**
5629
- * Defines whether the {@link List.Props.onSearchTextChange} will be triggered on every keyboard press or with a delay for throttling the events.
5630
- * Recommended to set to `true` when using custom filtering logic with asynchronous operations (e.g. network requests).
5631
- * @defaultValue `false`
5632
- */
5633
- throttle?: boolean;
5634
- /**
5635
- * Callback triggered when the search bar text changes.
5636
- *
5637
- * @remarks
5638
- * Specifying this implicitly toggles `filtering` to false. To enable native filtering when using `onSearchTextChange`, explicitly set `filtering` to `true`.
5639
- */
5640
- onSearchTextChange?: (text: string) => void;
5641
5669
  /**
5642
5670
  * Whether the List should have an area on the right side of the items to show additional details about the selected item.
5643
5671
  *
@@ -6039,10 +6067,10 @@ export declare namespace OAuth {
6039
6067
  */
6040
6068
  providerName: string;
6041
6069
  /**
6042
- * An icon referenced from the assets folder, displayed in the OAuth overlay.
6070
+ * An icon displayed in the OAuth overlay.
6043
6071
  * Make sure to provide at least a size of 64x64 pixels.
6044
6072
  */
6045
- providerIcon: string;
6073
+ providerIcon?: Image.ImageLike;
6046
6074
  /**
6047
6075
  * An optional ID for associating the client with a provider.
6048
6076
  * Only set this if you use multiple different clients in your extension.
@@ -6074,7 +6102,7 @@ export declare namespace OAuth {
6074
6102
  export class PKCEClient {
6075
6103
  redirectMethod: RedirectMethod;
6076
6104
  providerName: string;
6077
- providerIcon: string;
6105
+ providerIcon?: Image.ImageLike;
6078
6106
  providerId?: string;
6079
6107
  description?: string;
6080
6108
  private resolvesOnRedirect?;
@@ -6541,12 +6569,12 @@ export declare interface PasteActionProps extends Action.Paste.Props {
6541
6569
  */
6542
6570
  declare interface PasteProps {
6543
6571
  /**
6544
- * The contents that will be written to the clipboard as string.
6572
+ * The contents that will be pasted to the frontmost application.
6545
6573
  */
6546
- content: string | number;
6574
+ content: string | number | Clipboard.Content;
6547
6575
  /**
6548
6576
  * An optional title for the action.
6549
- * @defaultValue `"Paste in Active app"`
6577
+ * @defaultValue `"Paste in Active App"`
6550
6578
  */
6551
6579
  title?: string;
6552
6580
  /**
@@ -6564,7 +6592,7 @@ declare interface PasteProps {
6564
6592
  * @remarks
6565
6593
  * This is handy when you want to act on the pasted content, e.g. up-rank recently pasted content.
6566
6594
  */
6567
- onPaste?: (content: string | number) => void;
6595
+ onPaste?: (content: string | number | Clipboard.Content) => void;
6568
6596
  }
6569
6597
 
6570
6598
  /**
@@ -6599,6 +6627,24 @@ export declare function popToRoot(options?: {
6599
6627
  clearSearchBar?: boolean;
6600
6628
  }): Promise<void>;
6601
6629
 
6630
+ /**
6631
+ * Defines the pop to root behavior when the main window is closed.
6632
+ */
6633
+ export declare enum PopToRootType {
6634
+ /**
6635
+ * Respects the user's "Pop to Root Search" preference in Raycast
6636
+ */
6637
+ Default = "default",
6638
+ /**
6639
+ * Immediately pops back to root
6640
+ */
6641
+ Immediate = "immediate",
6642
+ /**
6643
+ * Prevents Raycast from popping back to root
6644
+ */
6645
+ Suspended = "suspended"
6646
+ }
6647
+
6602
6648
  /**
6603
6649
  * @deprecated Use {@link getPreferenceValues} instead.
6604
6650
  */
@@ -6768,6 +6814,44 @@ export declare const removeLocalStorageItem: typeof LocalStorage.removeItem;
6768
6814
  */
6769
6815
  export declare const render: any;
6770
6816
 
6817
+ /**
6818
+ * Views that support a search bar.
6819
+ */
6820
+ declare interface SearchBarInterface {
6821
+ /**
6822
+ * Toggles Raycast filtering. When `true`, Raycast will use the query in the search bar to filter the
6823
+ * items. When `false`, the extension needs to take care of the filtering.
6824
+ *
6825
+ * You can further define how native filtering orders sections by setting an object with a `keepSectionOrder` property:
6826
+ * When `true`, ensures that Raycast filtering maintains the section order as defined in the extension.
6827
+ * When `false`, filtering may change the section order depending on the ranking values of items.
6828
+ *
6829
+ * @defaultValue `false` when `onSearchTextChange` is specified, `true` otherwise.
6830
+ */
6831
+ filtering?: boolean | {
6832
+ keepSectionOrder: boolean;
6833
+ };
6834
+ /**
6835
+ * Indicates whether a loading indicator should be shown or hidden next to the search bar
6836
+ *
6837
+ * @defaultValue `false`
6838
+ */
6839
+ isLoading?: boolean;
6840
+ /**
6841
+ * Defines whether the `onSearchTextChange` handler will be triggered on every keyboard press or with a delay for throttling the events.
6842
+ * Recommended to set to `true` when using custom filtering logic with asynchronous operations (e.g. network requests).
6843
+ * @defaultValue `false`
6844
+ */
6845
+ throttle?: boolean;
6846
+ /**
6847
+ * Callback triggered when the search bar text changes.
6848
+ *
6849
+ * @remarks
6850
+ * Specifying this implicitly toggles `filtering` to false. To enable native filtering when using `onSearchTextChange`, explicitly set `filtering` to true.
6851
+ */
6852
+ onSearchTextChange?: (text: string) => void;
6853
+ }
6854
+
6771
6855
  /**
6772
6856
  * See {@link ActionPanel.Section}
6773
6857
  */
@@ -7066,7 +7150,7 @@ declare type SubmenuChildren = ReactElement<SectionProps> | ReactElement<Section
7066
7150
  /**
7067
7151
  * See {@link ActionPanel.Submenu.Props}.
7068
7152
  */
7069
- declare interface SubmenuProps {
7153
+ declare interface SubmenuProps extends SearchBarInterface {
7070
7154
  /**
7071
7155
  * ID of the submenu.
7072
7156
  * @deprecated - This is an internal prop which should not have been exposed. You can safely remove it.
@@ -7156,7 +7240,7 @@ export declare const SubmitFormAction: {
7156
7240
  /**
7157
7241
  * @deprecated Use {@link Action.SunmitForm.Props} instead.
7158
7242
  */
7159
- export declare interface SubmitFormActionProps<T> extends Action.SubmitForm.Props<T> {
7243
+ export declare interface SubmitFormActionProps<T extends Form.Values> extends Action.SubmitForm.Props<T> {
7160
7244
  }
7161
7245
 
7162
7246
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raycast/api",
3
- "version": "1.43.2",
3
+ "version": "1.45.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",
package/types/index.d.ts CHANGED
@@ -550,13 +550,8 @@ declare interface Arguments {
550
550
  [item: string]: any;
551
551
  }
552
552
 
553
- /**
554
- * An interface describing top-level props for arguments
555
- */
553
+ /** @deprecated Use {@Link LaunchProps} directly */
556
554
  export declare interface ArgumentsLaunchProps {
557
- /**
558
- * Use these values to populate the initial state for your command.
559
- */
560
555
  arguments?: Arguments;
561
556
  }
562
557
 
@@ -732,7 +727,7 @@ export declare namespace Clipboard {
732
727
  * };
733
728
  * ```
734
729
  */
735
- export function copy(content: string | Content): Promise<void>;
730
+ export function copy(content: string | number | Content): Promise<void>;
736
731
  /**
737
732
  * Clears the current clipboard contents.
738
733
  *
@@ -763,7 +758,7 @@ export declare namespace Clipboard {
763
758
  * };
764
759
  * ```
765
760
  */
766
- export function paste(content: string | Content): Promise<void>;
761
+ export function paste(content: string | number | Content): Promise<void>;
767
762
  /**
768
763
  * Reads the clipboard as plain text.
769
764
  *
@@ -804,19 +799,26 @@ export declare namespace Clipboard {
804
799
  } | {
805
800
  /**
806
801
  * The file representation of the content.
807
- *
808
- * @remarks
809
- * At the moment only file paths represented as a string are supported.
810
802
  */
811
803
  file: PathLike;
804
+ } | {
805
+ /**
806
+ * The HTML representation of the content.
807
+ */
808
+ html: string;
809
+ /**
810
+ * The alternative text representation of the content.
811
+ */
812
+ text?: string;
812
813
  };
813
814
  }
814
815
 
815
816
  /**
816
817
  * Closes the main Raycast window.
817
818
  *
818
- * @param options - Can be used to clear the root search. Defaults to not clearing the root search after
819
- * the window was closed.
819
+ * @param options - A parameter object with the properties:
820
+ * `clearRootSearch`: clears the text in the root search bar and scrolls to the top; default is `false`
821
+ * `popToRootType`: defines the pop to root behavior ({@link PopToRootType}); the default is to to respect the user's "Pop to Root Search" preference in Raycast
820
822
  * @returns A Promise that resolves when the main window is closed.
821
823
  *
822
824
  * @example
@@ -832,6 +834,7 @@ export declare namespace Clipboard {
832
834
  */
833
835
  export declare function closeMainWindow(options?: {
834
836
  clearRootSearch?: boolean;
837
+ popToRootType?: PopToRootType;
835
838
  }): Promise<void>;
836
839
 
837
840
  /**
@@ -849,7 +852,6 @@ export declare function closeMainWindow(options?: {
849
852
  * <List>
850
853
  * <List.Item title="Blue" icon={{ source: Icon.Circle, tintColor: Color.Blue }} />
851
854
  * <List.Item title="Green" icon={{ source: Icon.Circle, tintColor: Color.Green }} />
852
- * <List.Item title="Brown" icon={{ source: Icon.Circle, tintColor: Color.Brown }} />
853
855
  * <List.Item title="Magenta" icon={{ source: Icon.Circle, tintColor: Color.Magenta }} />
854
856
  * <List.Item title="Orange" icon={{ source: Icon.Circle, tintColor: Color.Orange }} />
855
857
  * <List.Item title="Purple" icon={{ source: Icon.Circle, tintColor: Color.Purple }} />
@@ -864,7 +866,6 @@ export declare function closeMainWindow(options?: {
864
866
  */
865
867
  export declare enum Color {
866
868
  Blue = "raycast-blue",
867
- Brown = "raycast-brown",
868
869
  Green = "raycast-green",
869
870
  Magenta = "raycast-magenta",
870
871
  Orange = "raycast-orange",
@@ -949,6 +950,12 @@ export declare namespace Color {
949
950
  * - Keywords, e.g. `red`
950
951
  */
951
952
  export type Raw = string;
953
+ /** The standard colors. Use those colors for consistency.
954
+ *
955
+ * @remarks
956
+ * The colors automatically adapt to the Raycast theme (light or dark).
957
+ */
958
+ const Brown: Color.Dynamic;
952
959
  }
953
960
 
954
961
  /**
@@ -1313,9 +1320,9 @@ export declare interface CopyToClipboardActionProps extends Action.CopyToClipboa
1313
1320
  */
1314
1321
  declare interface CopyToClipboardProps {
1315
1322
  /**
1316
- * The contents that will be written to the clipboard as string.
1323
+ * The contents that will be copied to the clipboard.
1317
1324
  */
1318
- content: string | number;
1325
+ content: string | number | Clipboard.Content;
1319
1326
  /**
1320
1327
  * An optional title for the action.
1321
1328
  * @defaultValue `"Copy to Clipboard"`
@@ -1336,7 +1343,7 @@ declare interface CopyToClipboardProps {
1336
1343
  * @remarks
1337
1344
  * This is handy when you want to act on the copied content, e.g. up-rank recently copied content.
1338
1345
  */
1339
- onCopy?: (content: string | number) => void;
1346
+ onCopy?: (content: string | number | Clipboard.Content) => void;
1340
1347
  }
1341
1348
 
1342
1349
  /**
@@ -1878,14 +1885,20 @@ declare interface DropdownMembers_2 {
1878
1885
  /**
1879
1886
  * See {@link Form.Dropdown.Props}
1880
1887
  */
1881
- declare interface DropdownProps extends FormItemProps_2<string> {
1888
+ declare interface DropdownProps extends FormItemProps_2<string>, SearchBarInterface {
1889
+ /**
1890
+ * Placeholder text that will be shown in the dropdown search field.
1891
+ *
1892
+ * @defaultValue `"Search..."`
1893
+ */
1894
+ placeholder?: string;
1882
1895
  /**
1883
1896
  * Sections or items. If {@link Form.Dropdown.Item} elements are specified, a default section is automatically created.
1884
1897
  */
1885
1898
  children?: ReactNode;
1886
1899
  }
1887
1900
 
1888
- declare interface DropdownProps_2 {
1901
+ declare interface DropdownProps_2 extends SearchBarInterface {
1889
1902
  /**
1890
1903
  * ID of the dropdown.
1891
1904
  */
@@ -2032,12 +2045,16 @@ export declare interface Environment {
2032
2045
  * The theme used by the Raycast application.
2033
2046
  */
2034
2047
  theme: "light" | "dark";
2048
+ /**
2049
+ * The text size used by the Raycast application.
2050
+ */
2051
+ textSize: "medium" | "large";
2035
2052
  /**
2036
2053
  * The type of launch for the command (user initiated or background).
2037
2054
  */
2038
2055
  launchType: LaunchType;
2039
2056
  /**
2040
- * Any custom context values passed from a programmatic command launch via `launchCommand`.
2057
+ * @deprecated Use the top-level prop `launchContext` instead.
2041
2058
  */
2042
2059
  launchContext?: LaunchContext;
2043
2060
  }
@@ -3048,14 +3065,8 @@ declare interface FormItemRef {
3048
3065
  reset: () => void;
3049
3066
  }
3050
3067
 
3051
- /**
3052
- * An interface describing top-level props for Form drafts
3053
- */
3068
+ /** @deprecated Use {@Link LaunchProps} directly */
3054
3069
  export declare interface FormLaunchProps {
3055
- /**
3056
- * When a user enters the command via a draft, this object will contain the user inputs that were saved as a draft.
3057
- * Use its values to populate the initial state for your Form.
3058
- */
3059
3070
  draftValues?: Form.Values;
3060
3071
  }
3061
3072
 
@@ -3748,7 +3759,7 @@ export declare function getApplications(path?: PathLike): Promise<Application[]>
3748
3759
  * Returns the default application that the file would be opened with.
3749
3760
  *
3750
3761
  * @param path - The path of the file or folder to get the default application for.
3751
- * @returns The default {@link Application} that would open the file. Throws an error if no application was found.
3762
+ * @returns A Promise that resolves with the default {@link Application} that would open the file. If no application was found, the promise will be rejected.
3752
3763
  *
3753
3764
  * @example
3754
3765
  * ```typescript
@@ -3762,6 +3773,23 @@ export declare function getApplications(path?: PathLike): Promise<Application[]>
3762
3773
  */
3763
3774
  export declare function getDefaultApplication(path: PathLike): Promise<Application>;
3764
3775
 
3776
+ /**
3777
+ * Returns the frontmost application.
3778
+ *
3779
+ * @returns A Promise that resolves with the frontmost {@link Application}. If no application was found, the promise will be rejected.
3780
+ *
3781
+ * @example
3782
+ * ```typescript
3783
+ * import { getFrontmostApplication } from "@raycast/api";
3784
+ *
3785
+ * export default async () => {
3786
+ * const frontmostApplication = await getFrontmostApplication();
3787
+ * console.log(`The frontmost application is: ${frontmostApplication.name}`);
3788
+ * };
3789
+ * ```
3790
+ */
3791
+ export declare function getFrontmostApplication(): Promise<Application>;
3792
+
3765
3793
  /**
3766
3794
  * @deprecated Use {@link LocalStorage.getItem} instead
3767
3795
  */
@@ -3796,8 +3824,7 @@ export declare function getPreferenceValues<Values extends PreferenceValues = Pr
3796
3824
  /**
3797
3825
  * Gets the selected items from Finder.
3798
3826
  *
3799
- * @throws An error when Finder is not the frontmost application.
3800
- * @returns A Promise that resolves with the selected file system items.
3827
+ * @returns A Promise that resolves with the selected file system items. If Finder is not the frontmost application, the promise will be rejected.
3801
3828
  *
3802
3829
  * @example
3803
3830
  * ```typescript
@@ -3824,8 +3851,7 @@ export declare function getSelectedFinderItems(): Promise<FileSystemItem[]>;
3824
3851
  /**
3825
3852
  * Gets the selected text of the frontmost application.
3826
3853
  *
3827
- * @throws An error when no text is selected in the frontmost application.
3828
- * @returns A Promise that resolves with the selected text.
3854
+ * @returns A Promise that resolves with the selected text. If no text is selected in the frontmost application, the promise will be rejected.
3829
3855
  *
3830
3856
  * @example
3831
3857
  * ```typescript
@@ -4138,7 +4164,7 @@ declare interface GridMembers {
4138
4164
  Dropdown: typeof Dropdown_2;
4139
4165
  }
4140
4166
 
4141
- declare interface GridProps extends ActionsInterface, NavigationChildInterface {
4167
+ declare interface GridProps extends ActionsInterface, NavigationChildInterface, SearchBarInterface {
4142
4168
  /**
4143
4169
  * A reference to an {@link ActionPanel}. It will only be shown when there aren't any children.
4144
4170
  */
@@ -4198,19 +4224,6 @@ declare interface GridProps extends ActionsInterface, NavigationChildInterface {
4198
4224
  * @defaultValue `false` when `onSearchTextChange` is specified, `true` otherwise.
4199
4225
  */
4200
4226
  enableFiltering?: boolean;
4201
- /**
4202
- * Toggles Raycast filtering. When `true`, Raycast will use the query in the search bar to filter the
4203
- * items. When `false`, the extension needs to take care of the filtering.
4204
- *
4205
- * You can further define how native filtering orders grid sections by setting an object with a `keepSectionOrder` property:
4206
- * When `true`, ensures that Raycast filtering maintains the section order as defined in the extension.
4207
- * When `false`, filtering may change the section order depending on the ranking values of the items.
4208
- *
4209
- * @defaultValue `false` when `onSearchTextChange` is specified, `true` otherwise.
4210
- */
4211
- filtering?: boolean | {
4212
- keepSectionOrder: boolean;
4213
- };
4214
4227
  /**
4215
4228
  * Placeholder text that will be shown in the search bar.
4216
4229
  *
@@ -4221,19 +4234,6 @@ declare interface GridProps extends ActionsInterface, NavigationChildInterface {
4221
4234
  * Selects the item with the specified id.
4222
4235
  */
4223
4236
  selectedItemId?: string;
4224
- /**
4225
- * Defines whether the {@link Grid.Props.onSearchTextChange} will be triggered on every keyboard press or with a delay for throttling the events.
4226
- * Recommended to set to `true` when using custom filtering logic with asynchronous operations (e.g. network requests).
4227
- * @defaultValue `false`
4228
- */
4229
- throttle?: boolean;
4230
- /**
4231
- * Callback triggered when the search bar text changes.
4232
- *
4233
- * @remarks
4234
- * Specifying this implicitly toggles `filtering` to false. To enable native filtering when using `onSearchTextChange`, explicitly set `filtering` to true.
4235
- */
4236
- onSearchTextChange?: (text: string) => void;
4237
4237
  }
4238
4238
 
4239
4239
  /**
@@ -4883,14 +4883,34 @@ declare const Item_3: FunctionComponent<ItemProps_3>;
4883
4883
 
4884
4884
  declare type ItemAccessory = ({
4885
4885
  /**
4886
- * An optional text that will be used as the label.
4886
+ * An optional text that will be used as the label, optionally colored.
4887
+ * Color changes the text color to the provided color.
4888
+ * Defaults to {@link Color.SecondaryText}.
4889
+ */
4890
+ text?: string | undefined | null | {
4891
+ value: string | undefined | null;
4892
+ color?: Color;
4893
+ };
4894
+ } | {
4895
+ /**
4896
+ * An optional Date that will be used as the label, optionally colored. The date is formatted relatively to the current time (for example `new Date()` will be displayed as `"now"`, yesterday's Date will be displayed as "1d", etc.).
4897
+ * Color changes the text color to the provided color.
4898
+ * Defaults to {@link Color.SecondaryText}.
4887
4899
  */
4888
- text?: string | undefined | null;
4900
+ date?: Date | undefined | null | {
4901
+ value: Date | undefined | null;
4902
+ color?: Color;
4903
+ };
4889
4904
  } | {
4890
4905
  /**
4891
- * An optional Date that will be used as the label. The date is formatted relatively to the current time (for example `new Date()` will be displayed as `"now"`, yesterday's Date will be displayed as "1d", etc.).
4906
+ * A string or Date that will be used as the label, optionally colored. The date is formatted relatively to the current time (for example `new Date()` will be displayed as `"now"`, yesterday's Date will be displayed as "1d", etc.).
4907
+ * Color changes the text color to the provided color and sets a transparent background with the same color.
4908
+ * Defaults to {@link Color.SecondaryText}.
4892
4909
  */
4893
- date?: Date | undefined | null;
4910
+ tag: string | Date | undefined | null | {
4911
+ value: string | Date | undefined | null;
4912
+ color?: Color;
4913
+ };
4894
4914
  }) & {
4895
4915
  /**
4896
4916
  * An optional {@link Image.ImageLike} that will be used as the icon.
@@ -4967,14 +4987,14 @@ declare interface ItemProps extends ActionsInterface {
4967
4987
  */
4968
4988
  title: string | {
4969
4989
  value: string;
4970
- tooltip: string;
4990
+ tooltip?: string | null;
4971
4991
  };
4972
4992
  /**
4973
4993
  * An optional subtitle displayed next to the main title, optionally with a tooltip.
4974
4994
  */
4975
4995
  subtitle?: string | {
4976
- value: string | undefined | null;
4977
- tooltip: string;
4996
+ value?: string | null;
4997
+ tooltip?: string | null;
4978
4998
  };
4979
4999
  /**
4980
5000
  * An optional property used for providing additional indexable strings for search.
@@ -5072,7 +5092,7 @@ declare interface ItemProps_3 {
5072
5092
  */
5073
5093
  title: string;
5074
5094
  /**
5075
- * The subtitle displayed for this item in a slightly dimmed text color.
5095
+ * The subtitle displayed for this item.
5076
5096
  */
5077
5097
  subtitle?: string;
5078
5098
  /**
@@ -5184,8 +5204,12 @@ declare interface LabelProps {
5184
5204
  icon?: Image.ImageLike | undefined | null;
5185
5205
  /**
5186
5206
  * The text value of the item.
5207
+ * Specifying `color` will display the text in the provided color. Defaults to {@link Color.SecondaryText}.
5187
5208
  */
5188
- text?: string;
5209
+ text?: string | {
5210
+ value: string;
5211
+ color?: Color | null;
5212
+ };
5189
5213
  }
5190
5214
 
5191
5215
  /**
@@ -5226,7 +5250,37 @@ declare interface LaunchContext {
5226
5250
  /**
5227
5251
  * The top-level props that a Command receives on launch
5228
5252
  */
5229
- export declare type LaunchProps = ArgumentsLaunchProps | FormLaunchProps;
5253
+ export declare type LaunchProps<T extends {
5254
+ arguments?: Arguments;
5255
+ draftValues?: Form.Values;
5256
+ launchContext?: LaunchContext;
5257
+ } = {
5258
+ arguments: Arguments;
5259
+ draftValues: Form.Values;
5260
+ launchContext?: LaunchContext;
5261
+ }> = {
5262
+ /**
5263
+ * The type of launch for the command (user initiated or background).
5264
+ */
5265
+ launchType: LaunchType;
5266
+ /**
5267
+ * Use these values to populate the initial state for your command.
5268
+ */
5269
+ arguments: T["arguments"];
5270
+ /**
5271
+ * When a user enters the command via a draft, this object will contain the user inputs that were saved as a draft.
5272
+ * Use its values to populate the initial state for your Form.
5273
+ */
5274
+ draftValues?: T["draftValues"];
5275
+ /**
5276
+ * When the command is launched programmatically via `launchCommand`, this object contains the value passed to `context`.
5277
+ */
5278
+ launchContext?: T["launchContext"];
5279
+ /**
5280
+ * When the command is launched as a fallback command, this string contains the text of the root search.
5281
+ */
5282
+ fallbackText?: string;
5283
+ };
5230
5284
 
5231
5285
  export declare enum LaunchType {
5232
5286
  /**
@@ -5567,7 +5621,7 @@ declare interface ListMembers {
5567
5621
  export declare interface ListProps extends List.Props {
5568
5622
  }
5569
5623
 
5570
- declare interface ListProps_2 extends ActionsInterface, NavigationChildInterface {
5624
+ declare interface ListProps_2 extends ActionsInterface, NavigationChildInterface, SearchBarInterface {
5571
5625
  /**
5572
5626
  * A reference to an {@link ActionPanel}. It will only be shown when there aren't any children.
5573
5627
  */
@@ -5602,19 +5656,6 @@ declare interface ListProps_2 extends ActionsInterface, NavigationChildInterface
5602
5656
  * @defaultValue `false` when `onSearchTextChange` is specified, `true` otherwise.
5603
5657
  */
5604
5658
  enableFiltering?: boolean;
5605
- /**
5606
- * Toggles Raycast filtering. When `true`, Raycast will use the query in the search bar to filter the
5607
- * items. When `false`, the extension needs to take care of the filtering.
5608
- *
5609
- * You can further define how native filtering orders list sections by setting an object with a `keepSectionOrder` property:
5610
- * When `true`, ensures that Raycast filtering maintains the section order as defined in the extension.
5611
- * When `false`, filtering may change the section order depending on the ranking values of list items.
5612
- *
5613
- * @defaultValue `false` when `onSearchTextChange` is specified, `true` otherwise.
5614
- */
5615
- filtering?: boolean | {
5616
- keepSectionOrder: boolean;
5617
- };
5618
5659
  /**
5619
5660
  * Placeholder text that will be shown in the search bar.
5620
5661
  *
@@ -5625,19 +5666,6 @@ declare interface ListProps_2 extends ActionsInterface, NavigationChildInterface
5625
5666
  * Selects the item with the specified id.
5626
5667
  */
5627
5668
  selectedItemId?: string;
5628
- /**
5629
- * Defines whether the {@link List.Props.onSearchTextChange} will be triggered on every keyboard press or with a delay for throttling the events.
5630
- * Recommended to set to `true` when using custom filtering logic with asynchronous operations (e.g. network requests).
5631
- * @defaultValue `false`
5632
- */
5633
- throttle?: boolean;
5634
- /**
5635
- * Callback triggered when the search bar text changes.
5636
- *
5637
- * @remarks
5638
- * Specifying this implicitly toggles `filtering` to false. To enable native filtering when using `onSearchTextChange`, explicitly set `filtering` to `true`.
5639
- */
5640
- onSearchTextChange?: (text: string) => void;
5641
5669
  /**
5642
5670
  * Whether the List should have an area on the right side of the items to show additional details about the selected item.
5643
5671
  *
@@ -6039,10 +6067,10 @@ export declare namespace OAuth {
6039
6067
  */
6040
6068
  providerName: string;
6041
6069
  /**
6042
- * An icon referenced from the assets folder, displayed in the OAuth overlay.
6070
+ * An icon displayed in the OAuth overlay.
6043
6071
  * Make sure to provide at least a size of 64x64 pixels.
6044
6072
  */
6045
- providerIcon: string;
6073
+ providerIcon?: Image.ImageLike;
6046
6074
  /**
6047
6075
  * An optional ID for associating the client with a provider.
6048
6076
  * Only set this if you use multiple different clients in your extension.
@@ -6074,7 +6102,7 @@ export declare namespace OAuth {
6074
6102
  export class PKCEClient {
6075
6103
  redirectMethod: RedirectMethod;
6076
6104
  providerName: string;
6077
- providerIcon: string;
6105
+ providerIcon?: Image.ImageLike;
6078
6106
  providerId?: string;
6079
6107
  description?: string;
6080
6108
  private resolvesOnRedirect?;
@@ -6541,12 +6569,12 @@ export declare interface PasteActionProps extends Action.Paste.Props {
6541
6569
  */
6542
6570
  declare interface PasteProps {
6543
6571
  /**
6544
- * The contents that will be written to the clipboard as string.
6572
+ * The contents that will be pasted to the frontmost application.
6545
6573
  */
6546
- content: string | number;
6574
+ content: string | number | Clipboard.Content;
6547
6575
  /**
6548
6576
  * An optional title for the action.
6549
- * @defaultValue `"Paste in Active app"`
6577
+ * @defaultValue `"Paste in Active App"`
6550
6578
  */
6551
6579
  title?: string;
6552
6580
  /**
@@ -6564,7 +6592,7 @@ declare interface PasteProps {
6564
6592
  * @remarks
6565
6593
  * This is handy when you want to act on the pasted content, e.g. up-rank recently pasted content.
6566
6594
  */
6567
- onPaste?: (content: string | number) => void;
6595
+ onPaste?: (content: string | number | Clipboard.Content) => void;
6568
6596
  }
6569
6597
 
6570
6598
  /**
@@ -6599,6 +6627,24 @@ export declare function popToRoot(options?: {
6599
6627
  clearSearchBar?: boolean;
6600
6628
  }): Promise<void>;
6601
6629
 
6630
+ /**
6631
+ * Defines the pop to root behavior when the main window is closed.
6632
+ */
6633
+ export declare enum PopToRootType {
6634
+ /**
6635
+ * Respects the user's "Pop to Root Search" preference in Raycast
6636
+ */
6637
+ Default = "default",
6638
+ /**
6639
+ * Immediately pops back to root
6640
+ */
6641
+ Immediate = "immediate",
6642
+ /**
6643
+ * Prevents Raycast from popping back to root
6644
+ */
6645
+ Suspended = "suspended"
6646
+ }
6647
+
6602
6648
  /**
6603
6649
  * @deprecated Use {@link getPreferenceValues} instead.
6604
6650
  */
@@ -6768,6 +6814,44 @@ export declare const removeLocalStorageItem: typeof LocalStorage.removeItem;
6768
6814
  */
6769
6815
  export declare const render: any;
6770
6816
 
6817
+ /**
6818
+ * Views that support a search bar.
6819
+ */
6820
+ declare interface SearchBarInterface {
6821
+ /**
6822
+ * Toggles Raycast filtering. When `true`, Raycast will use the query in the search bar to filter the
6823
+ * items. When `false`, the extension needs to take care of the filtering.
6824
+ *
6825
+ * You can further define how native filtering orders sections by setting an object with a `keepSectionOrder` property:
6826
+ * When `true`, ensures that Raycast filtering maintains the section order as defined in the extension.
6827
+ * When `false`, filtering may change the section order depending on the ranking values of items.
6828
+ *
6829
+ * @defaultValue `false` when `onSearchTextChange` is specified, `true` otherwise.
6830
+ */
6831
+ filtering?: boolean | {
6832
+ keepSectionOrder: boolean;
6833
+ };
6834
+ /**
6835
+ * Indicates whether a loading indicator should be shown or hidden next to the search bar
6836
+ *
6837
+ * @defaultValue `false`
6838
+ */
6839
+ isLoading?: boolean;
6840
+ /**
6841
+ * Defines whether the `onSearchTextChange` handler will be triggered on every keyboard press or with a delay for throttling the events.
6842
+ * Recommended to set to `true` when using custom filtering logic with asynchronous operations (e.g. network requests).
6843
+ * @defaultValue `false`
6844
+ */
6845
+ throttle?: boolean;
6846
+ /**
6847
+ * Callback triggered when the search bar text changes.
6848
+ *
6849
+ * @remarks
6850
+ * Specifying this implicitly toggles `filtering` to false. To enable native filtering when using `onSearchTextChange`, explicitly set `filtering` to true.
6851
+ */
6852
+ onSearchTextChange?: (text: string) => void;
6853
+ }
6854
+
6771
6855
  /**
6772
6856
  * See {@link ActionPanel.Section}
6773
6857
  */
@@ -7066,7 +7150,7 @@ declare type SubmenuChildren = ReactElement<SectionProps> | ReactElement<Section
7066
7150
  /**
7067
7151
  * See {@link ActionPanel.Submenu.Props}.
7068
7152
  */
7069
- declare interface SubmenuProps {
7153
+ declare interface SubmenuProps extends SearchBarInterface {
7070
7154
  /**
7071
7155
  * ID of the submenu.
7072
7156
  * @deprecated - This is an internal prop which should not have been exposed. You can safely remove it.
@@ -7156,7 +7240,7 @@ export declare const SubmitFormAction: {
7156
7240
  /**
7157
7241
  * @deprecated Use {@link Action.SunmitForm.Props} instead.
7158
7242
  */
7159
- export declare interface SubmitFormActionProps<T> extends Action.SubmitForm.Props<T> {
7243
+ export declare interface SubmitFormActionProps<T extends Form.Values> extends Action.SubmitForm.Props<T> {
7160
7244
  }
7161
7245
 
7162
7246
  /**