@raycast/api 1.35.2 → 1.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/types/index.d.ts CHANGED
@@ -107,6 +107,12 @@ export declare namespace Action {
107
107
  */
108
108
  export type Props = TrashProps;
109
109
  }
110
+ export namespace ToggleQuickLook {
111
+ /**
112
+ * Props of the {@link Action.ToggleQuickLook} React component.
113
+ */
114
+ export type Props = ToggleQuickLookProps;
115
+ }
110
116
  }
111
117
 
112
118
  /**
@@ -343,7 +349,7 @@ export declare interface ActionPanelSubmenuProps extends ActionPanel.Submenu.Pro
343
349
  declare interface ActionProps {
344
350
  /**
345
351
  * ID of the item.
346
- * @deprecated - This is an internal prop which not not have been exposed. You can safely remove it.
352
+ * @deprecated - This is an internal prop which should not have been exposed. You can safely remove it.
347
353
  */
348
354
  id?: string;
349
355
  /**
@@ -500,6 +506,108 @@ export declare interface Application {
500
506
  bundleId?: string;
501
507
  }
502
508
 
509
+ /**
510
+ * Caching abstraction that stores data on disk and supports LRU (least recently used) access.
511
+ * Since extensions can only consume up to a max. heap memory size, the cache only maintains a lightweight index in memory
512
+ * and stores the actual data in separate files on disk in the extension's support directory.
513
+ *
514
+ * The Cache class provides CRUD-style methods (get, set, remove) to update and retrieve data synchronously based on a key.
515
+ * The data must be a string and it is up to the client to decide which serialization format to use.
516
+ * (A typical use case would be to use JSON.stringify and JSON.parse.)
517
+ *
518
+ * @remarks By default, the cache is shared between the commands of an extension. Use {@link Cache.Options} to configure
519
+ * a `namespace` per command if needed (for example, set it to `environment.commandName`).
520
+ *
521
+ * @example
522
+ * ```typescript
523
+ * import { Cache } from "@raycast/api";
524
+ *
525
+ * const cache = new Cache();
526
+ * cache.set("items", JSON.stringify([{ id: "1", title: "Item 1" }]));
527
+ * console.log(JSON.parse(cache.get("items")));
528
+ * ```
529
+ */
530
+ export declare class Cache {
531
+ static get STORAGE_DIRECTORY_NAME(): string;
532
+ static get DEFAULT_CAPACITY(): number;
533
+ private directory;
534
+ private namespace?;
535
+ private capacity;
536
+ private journal;
537
+ private storage;
538
+ private subscribers;
539
+ constructor(options?: Cache.Options);
540
+ /**
541
+ * @returns the full path to the directory where the data is stored on disk.
542
+ */
543
+ get storageDirectory(): string;
544
+ /**
545
+ * @returns the data for the given key. If there is no data for the key, `undefined` is returned.
546
+ * @remarks If you want to just check for the existence of a key, use {@link has}.
547
+ */
548
+ get(key: string): string | undefined;
549
+ /**
550
+ * @returns `true` if data for the key exists, `false` otherwise.
551
+ * @remarks You can use this method to check for entries without affecting the LRU access.
552
+ */
553
+ has(key: string): boolean;
554
+ /**
555
+ * @returns `true` if the cache is empty, `false` otherwise.
556
+ */
557
+ get isEmpty(): boolean;
558
+ /**
559
+ * Sets the data for the given key.
560
+ * If the data exceeds the configured `capacity`, the least recently used entries are removed.
561
+ * This also notifies registered subscribers (see {@link subscribe}).
562
+ */
563
+ set(key: string, data: string): void;
564
+ /**
565
+ * Removes the data for the given key.
566
+ * This also notifies registered subscribers (see {@link subscribe}).
567
+ * @returns `true` if data for the key was removed, `false` otherwise.
568
+ */
569
+ remove(key: string): boolean;
570
+ /**
571
+ * Clears all stored data.
572
+ * This also notifies registered subscribers (see {@link subscribe}) unless the `notifySubscribers` option is set to `false`.
573
+ */
574
+ clear(options?: {
575
+ notifySubscribers: boolean;
576
+ }): void;
577
+ /**
578
+ * Registers a new subscriber that gets notified when cache data is set or removed.
579
+ * @returns a function that can be used to remove the subscriber.
580
+ */
581
+ subscribe(subscription: Cache.Subscriber): Cache.Subscription;
582
+ private maintainCapacity;
583
+ private notifySubscribers;
584
+ }
585
+
586
+ export declare namespace Cache {
587
+ /**
588
+ * The options for creating a new {@link Cache}.
589
+ */
590
+ export interface Options {
591
+ /**
592
+ * If set, the Cache will be namespaced via a subdirectory.
593
+ * This can be useful to separate the caches for individual commands of an extension.
594
+ * By default, the cache is shared between the commands of an extension.
595
+ */
596
+ namespace?: string;
597
+ /**
598
+ * The parent directory for the cache data.
599
+ */
600
+ directory?: string;
601
+ /**
602
+ * The capacity in bytes. If the stored data exceeds the capacity, the least recently used data is removed.
603
+ * @default 10000000 (10 MB)
604
+ */
605
+ capacity?: number;
606
+ }
607
+ export type Subscriber = (key: string | undefined, data: string | undefined) => void;
608
+ export type Subscription = () => void;
609
+ }
610
+
503
611
  /**
504
612
  * See {@link Form.Checkbox}
505
613
  */
@@ -1055,6 +1163,34 @@ declare interface ConvenienceActions {
1055
1163
  * ```
1056
1164
  */
1057
1165
  CreateQuicklink: typeof CreateQuicklink;
1166
+ /**
1167
+ * Action that toggles the Quick Look to preview a file.
1168
+ *
1169
+ * @example
1170
+ * ```typescript
1171
+ * import { ActionPanel, List, Action } from "@raycast/api";
1172
+ *
1173
+ * export default function Command() {
1174
+ * return (
1175
+ * <List>
1176
+ * <List.Item
1177
+ * title="Preview me"
1178
+ * actions={
1179
+ * <ActionPanel>
1180
+ * <Action.ToggleQuickLook
1181
+ * name="Some file"
1182
+ * path="~/Downloads/Raycast.dmg"
1183
+ * shortcut={{ modifiers: ["cmd"], key: "y" }}
1184
+ * />
1185
+ * </ActionPanel>
1186
+ * }
1187
+ * />
1188
+ * </ List>
1189
+ * );
1190
+ * }
1191
+ * ```
1192
+ */
1193
+ ToggleQuickLook: typeof ToggleQuickLook;
1058
1194
  }
1059
1195
 
1060
1196
  /**
@@ -1468,6 +1604,11 @@ declare const Dropdown: ForwardRefExoticComponent<DropdownProps & RefAttributes<
1468
1604
  */
1469
1605
  declare const Dropdown_2: FunctionComponent<DropdownProps_2> & DropdownMembers_2;
1470
1606
 
1607
+ /**
1608
+ * See {@link Grid.Dropdown}
1609
+ */
1610
+ declare const Dropdown_3: FunctionComponent<DropdownProps_3> & DropdownMembers_3;
1611
+
1471
1612
  /**
1472
1613
  * See {@link Form.Dropdown.Item}
1473
1614
  */
@@ -1478,6 +1619,11 @@ declare const DropdownItem: FunctionComponent<DropdownItemProps>;
1478
1619
  */
1479
1620
  declare const DropdownItem_2: FunctionComponent<DropdownItemProps_2>;
1480
1621
 
1622
+ /**
1623
+ * See {@link Grid.Dropdown.Item}
1624
+ */
1625
+ declare const DropdownItem_3: FunctionComponent<DropdownItemProps_3>;
1626
+
1481
1627
  /**
1482
1628
  * See {@link Form.Dropdown.Item.Props}
1483
1629
  */
@@ -1513,6 +1659,22 @@ declare interface DropdownItemProps_2 {
1513
1659
  icon?: Image.ImageLike | undefined | null;
1514
1660
  }
1515
1661
 
1662
+ declare interface DropdownItemProps_3 {
1663
+ /**
1664
+ * Value of the dropdown item.
1665
+ * Make sure to assign each unique value for each item.
1666
+ */
1667
+ value: string;
1668
+ /**
1669
+ * The title displayed for the item.
1670
+ */
1671
+ title: string;
1672
+ /**
1673
+ * An optional icon displayed for the item.
1674
+ */
1675
+ icon?: Image.ImageLike | undefined | null;
1676
+ }
1677
+
1516
1678
  declare interface DropdownMembers {
1517
1679
  /**
1518
1680
  * Visually separated group of dropdown items.
@@ -1631,6 +1793,61 @@ declare interface DropdownMembers_2 {
1631
1793
  Item: typeof DropdownItem_2;
1632
1794
  }
1633
1795
 
1796
+ declare interface DropdownMembers_3 {
1797
+ /**
1798
+ * Visually separated group of dropdown items in a {@link Grid.Dropdown}.
1799
+ *
1800
+ * @remarks
1801
+ * Use sections to group related dropdown items together.
1802
+ *
1803
+ * @example
1804
+ * ```typescript
1805
+ * import { Grid } from "@raycast/api";
1806
+ *
1807
+ * export default function Command() {
1808
+ * return (
1809
+ * <Grid searchBarAccessory={
1810
+ * <Grid.Dropdown tooltip="Dropdown With Sections">
1811
+ * <Grid.Dropdown.Section title="First Section">
1812
+ * <Grid.Dropdown.Item title="One" value="one" />
1813
+ * </Grid.Dropdown.Section>
1814
+ * <Grid.Dropdown.Section title="Second Section">
1815
+ * <Grid.Dropdown.Item title="Two" value="two" />
1816
+ * </Grid.Dropdown.Section>
1817
+ * </Grid.Dropdown>
1818
+ * }>
1819
+ * <Grid.Item title="Item in the Main Grid">
1820
+ * </Grid>
1821
+ * );
1822
+ * }
1823
+ * ```
1824
+ */
1825
+ Section: typeof DropdownSection_3;
1826
+ /**
1827
+ * A dropdown item in a {@link Grid.Dropdown}
1828
+ *
1829
+ * @example
1830
+ * ```typescript
1831
+ * import { Grid } from "@raycast/api";
1832
+ *
1833
+ * export default function Command() {
1834
+ * return (
1835
+ * <Grid searchBarAccessory={
1836
+ * <Grid.Dropdown tooltip="Dropdown With Items">
1837
+ * <Grid.Dropdown.Item title="One" value="one" />
1838
+ * <Grid.Dropdown.Item title="Two" value="two" />
1839
+ * <Grid.Dropdown.Item title="Three" value="three" />
1840
+ * </Grid.Dropdown>
1841
+ * }>
1842
+ * <Grid.Item title="Item in the Main Grid">
1843
+ * </Grid>
1844
+ * );
1845
+ * }
1846
+ * ```
1847
+ */
1848
+ Item: typeof DropdownItem_3;
1849
+ }
1850
+
1634
1851
  /**
1635
1852
  * See {@link Form.Dropdown.Props}
1636
1853
  */
@@ -1683,6 +1900,48 @@ declare interface DropdownProps_2 {
1683
1900
  onChange?: (newValue: string) => void;
1684
1901
  }
1685
1902
 
1903
+ declare interface DropdownProps_3 {
1904
+ /**
1905
+ * ID of the dropdown.
1906
+ */
1907
+ id?: string;
1908
+ /**
1909
+ * Tooltip displayed when hovering the dropdown.
1910
+ */
1911
+ tooltip: string;
1912
+ /**
1913
+ * Placeholder text that will be shown in the dropdown search field.
1914
+ *
1915
+ * @defaultValue `"Search..."`
1916
+ */
1917
+ placeholder?: string;
1918
+ /**
1919
+ * Indicates whether the value of the dropdown should be persisted after selection, and restored next time the dropdown is rendered.
1920
+ */
1921
+ storeValue?: boolean | undefined;
1922
+ /**
1923
+ * The currently value of the dropdown.
1924
+ */
1925
+ value?: string;
1926
+ /**
1927
+ * The default value of the dropdown.
1928
+ * 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.
1929
+ *
1930
+ * **If you're using `storeValue` and configured it as `true` _and_ a {@link Grid.Dropdown.Item} with the same value exists, then it will be selected.**
1931
+ *
1932
+ * **If you configure `value` at the same time as `defaultValue`, the `value` will have precedence over `defaultValue`.**
1933
+ */
1934
+ defaultValue?: string;
1935
+ /**
1936
+ * Grid sections or items. If {@link Grid.Dropdown.Item} elements are specified, a default section is automatically created.
1937
+ */
1938
+ children?: ReactNode;
1939
+ /**
1940
+ * Callback triggered when the grid item selection changes.
1941
+ */
1942
+ onChange?: (newValue: string) => void;
1943
+ }
1944
+
1686
1945
  /**
1687
1946
  * Form.Dropdown Ref type.
1688
1947
  */
@@ -1698,6 +1957,11 @@ declare const DropdownSection: FunctionComponent<DropdownSectionProps>;
1698
1957
  */
1699
1958
  declare const DropdownSection_2: FunctionComponent<DropdownSectionProps_2>;
1700
1959
 
1960
+ /**
1961
+ * See {@link Grid.Dropdown.Section}
1962
+ */
1963
+ declare const DropdownSection_3: FunctionComponent<DropdownSectionProps_3>;
1964
+
1701
1965
  /**
1702
1966
  * See {@link Form.Dropdown.Section.Props}
1703
1967
  */
@@ -1723,6 +1987,17 @@ declare interface DropdownSectionProps_2 {
1723
1987
  title?: string;
1724
1988
  }
1725
1989
 
1990
+ declare interface DropdownSectionProps_3 {
1991
+ /**
1992
+ * The item elements of the section.
1993
+ */
1994
+ children?: ReactNode;
1995
+ /**
1996
+ * Title displayed above the section
1997
+ */
1998
+ title?: string;
1999
+ }
2000
+
1726
2001
  /**
1727
2002
  * @deprecated Use {@link Color.Dynamic} instead
1728
2003
  */
@@ -1730,6 +2005,8 @@ export declare type DynamicColor = Color.Dynamic;
1730
2005
 
1731
2006
  declare const EmptyView: FunctionComponent<EmptyViewProps>;
1732
2007
 
2008
+ declare const EmptyView_2: FunctionComponent<EmptyViewProps_2>;
2009
+
1733
2010
  declare interface EmptyViewProps extends ActionsInterface {
1734
2011
  /**
1735
2012
  * An icon displayed in the center of the EmptyView.
@@ -1749,6 +2026,25 @@ declare interface EmptyViewProps extends ActionsInterface {
1749
2026
  description?: string;
1750
2027
  }
1751
2028
 
2029
+ declare interface EmptyViewProps_2 extends ActionsInterface {
2030
+ /**
2031
+ * An icon displayed in the center of the EmptyView.
2032
+ *
2033
+ * @remarks
2034
+ * If an SVG is used, its longest side will be 128 pixels. Other images will be up/downscaled proportionally so that the longest side is between 64 and 256 pixels.
2035
+ * If not specified, Raycast's default `EmptyView` icon will be used.
2036
+ */
2037
+ icon?: Image.ImageLike | undefined | null;
2038
+ /**
2039
+ * The main title displayed for the Empty View.
2040
+ */
2041
+ title?: string;
2042
+ /**
2043
+ * An optional description for why the empty view is shown.
2044
+ */
2045
+ description?: string;
2046
+ }
2047
+
1752
2048
  /**
1753
2049
  * Holds data about the environment the command is running in. Use the global {@link environment} object to retrieve values.
1754
2050
  */
@@ -1847,6 +2143,18 @@ export declare namespace Form {
1847
2143
  export type Value = FormValue_2;
1848
2144
  export type Values = FormValues_2;
1849
2145
  export type Props = FormProps_2;
2146
+ /**
2147
+ * An interface describing event in callbacks {@link Form.Item.Props.onFocus} and {@link Form.Item.Props.onBlur}
2148
+ */
2149
+ export type Event<T extends FormValue_2> = FormEvent<T>;
2150
+ export namespace Event {
2151
+ /**
2152
+ * Types of Form event {@link Form.Event}
2153
+ * * `focus` - the type will be returned for the event of {@link Form.Item.Props.onFocus} callback
2154
+ * * `blur` - the type will be returned for the event of {@link Form.Item.Props.onBlur} callback
2155
+ */
2156
+ export type Type = FormEventType;
2157
+ }
1850
2158
  /**
1851
2159
  * A Ref Type for the {@link Form.TextField}.
1852
2160
  * Use refs to control your Form by calling `Form.TextField.focus()` or `Form.TextField.reset()` functions.
@@ -2475,6 +2783,65 @@ export declare const FormDropdownSection: typeof Form.Dropdown.Section;
2475
2783
  export declare interface FormDropdownSectionProps extends Form.Dropdown.Section.Props {
2476
2784
  }
2477
2785
 
2786
+ /**
2787
+ * An interface describing Form events in callbacks
2788
+ *
2789
+ * @example
2790
+ * ```typescript
2791
+ *import { Form } from "@raycast/api";
2792
+ *
2793
+ *export default function Main() {
2794
+ * return (
2795
+ * <Form>
2796
+ * <Form.TextField id="textField" title="Text Field" onBlur={logEvent} onFocus={logEvent} />
2797
+ * <Form.TextArea id="textArea" title="Text Area" onBlur={logEvent} onFocus={logEvent} />
2798
+ * <Form.Dropdown id="dropdown" title="Dropdown" onBlur={logEvent} onFocus={logEvent}>
2799
+ * {[1, 2, 3, 4, 5, 6, 7].map((num) => (
2800
+ * <Form.Dropdown.Item value={String(num)} title={String(num)} key={num} />
2801
+ * ))}
2802
+ * </Form.Dropdown>
2803
+ * <Form.TagPicker id="tagPicker" title="Tag Picker" onBlur={logEvent} onFocus={logEvent}>
2804
+ * {[1, 2, 3, 4, 5, 6, 7].map((num) => (
2805
+ * <Form.TagPicker.Item value={String(num)} title={String(num)} key={num} />
2806
+ * ))}
2807
+ * </Form.TagPicker>
2808
+ * </Form>
2809
+ * );
2810
+ *}
2811
+ *
2812
+ *function logEvent(event: Form.Event) {
2813
+ * console.log(`Event '${event.type}' has happened for '${event.target.id}'. Current 'value': '${event.target.value}'`);
2814
+ *}
2815
+ *
2816
+ * ```
2817
+ */
2818
+ declare type FormEvent<T extends FormValue_2> = {
2819
+ /**
2820
+ * An interface containing target data related to the event
2821
+ */
2822
+ target: {
2823
+ /**
2824
+ * The {@link FormItemProps.id} of Form item where the event has happened
2825
+ */
2826
+ id: string;
2827
+ /**
2828
+ * The current {@link FormItemProps.value} of Form item where the event has happened
2829
+ */
2830
+ value?: T;
2831
+ };
2832
+ /**
2833
+ * A type of event
2834
+ */
2835
+ type: FormEventType;
2836
+ };
2837
+
2838
+ /**
2839
+ * Types of Form event ({@link Form.Event}).
2840
+ * * `focus` will be returned for the event of {@link Form.Item.Props.onFocus} callback
2841
+ * * `blur` will be returned for the event of {@link Form.Item.Props.onBlur} callback
2842
+ */
2843
+ declare type FormEventType = "focus" | "blur";
2844
+
2478
2845
  /**
2479
2846
  * @deprecated Use {@link Form.ItemProps} instead.
2480
2847
  */
@@ -2498,6 +2865,11 @@ declare interface FormItemProps_2<T extends FormValue_2> {
2498
2865
  * 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.
2499
2866
  */
2500
2867
  info?: string;
2868
+ /**
2869
+ * An optional error message to show the form item validation issues.
2870
+ * If the `error` is present, the Form Item will be highlighted with red border and will show an error message on the right.
2871
+ */
2872
+ error?: string;
2501
2873
  /**
2502
2874
  * Indicates whether the value of the item should be persisted after submitting, and restored next time the form is rendered.
2503
2875
  */
@@ -2523,6 +2895,14 @@ declare interface FormItemProps_2<T extends FormValue_2> {
2523
2895
  * The callback which will be triggered when the `value` of the item changes.
2524
2896
  */
2525
2897
  onChange?: (newValue: T) => void;
2898
+ /**
2899
+ * The callback that will be triggered when the item loses its focus.
2900
+ */
2901
+ onBlur?: (event: FormEvent<T>) => void;
2902
+ /**
2903
+ * The callback which will be triggered should be called when the item is focused.
2904
+ */
2905
+ onFocus?: (event: FormEvent<T>) => void;
2526
2906
  }
2527
2907
 
2528
2908
  /**
@@ -2600,6 +2980,17 @@ declare interface FormItemRef {
2600
2980
  reset: () => void;
2601
2981
  }
2602
2982
 
2983
+ /**
2984
+ * An interface describing top-level props for Form drafts
2985
+ */
2986
+ export declare interface FormLaunchProps {
2987
+ /**
2988
+ * When a user enters the command via a draft, this object will contain the user inputs that were saved as a draft.
2989
+ * Use its values to populate the initial state for your Form.
2990
+ */
2991
+ draftValues?: Form.Values;
2992
+ }
2993
+
2603
2994
  declare interface FormMembers {
2604
2995
  /**
2605
2996
  * A form item with a checkbox.
@@ -3041,6 +3432,11 @@ export declare interface FormProps extends Form.Props {
3041
3432
  * Props of the {@link Form} React component.
3042
3433
  */
3043
3434
  declare interface FormProps_2 extends ActionsInterface, NavigationChildInterface {
3435
+ /**
3436
+ * Defines whether the Form.Items values will be preserved when user exits the screen.
3437
+ * @defaultValue `false`
3438
+ */
3439
+ enableDrafts?: boolean;
3044
3440
  /**
3045
3441
  * The Form.Item elements of the form.
3046
3442
  */
@@ -3285,23 +3681,347 @@ export declare function getSelectedFinderItems(): Promise<FileSystemItem[]>;
3285
3681
  export declare function getSelectedText(): Promise<string>;
3286
3682
 
3287
3683
  /**
3288
- * List of built-in icons that can be used for actions or list items.
3684
+ * Displays {@link Grid.Section} or {@link Grid.Item}, optionally {@link Grid.Dropdown}.
3685
+ *
3686
+ * @remarks
3687
+ * The grid uses built-in filtering by indexing the title of grid items and additionally keywords.
3289
3688
  *
3290
3689
  * @example
3291
3690
  * ```typescript
3292
- * import { Icon, List } from "@raycast/api";
3691
+ * import { Grid } from "@raycast/api";
3692
+ *
3693
+ * function DrinkDropdown(props: DrinkDropdownProps) {
3694
+ * const { isLoading = false, drinkTypes, onDrinkTypeChange } = props;
3695
+ * return (
3696
+ * <Grid.Dropdown
3697
+ * tooltip="Select Drink Type"
3698
+ * storeValue={true}
3699
+ * onChange={(newValue) => {
3700
+ * onDrinkTypeChange(newValue);
3701
+ * }}
3702
+ * >
3703
+ * <Grid.Dropdown.Section title="Alcoholic Beverages">
3704
+ * {drinkTypes.map((drinkType) => (
3705
+ * <Grid.Dropdown.Item key={drinkType.id} title={{ value: drinkType.name, tooltip: drinkType.definition }} value={drinkType.id} />
3706
+ * ))}
3707
+ * </Grid.Dropdown.Section>
3708
+ * </Grid.Dropdown>
3709
+ * );
3710
+ * }
3293
3711
  *
3294
3712
  * export default function Command() {
3713
+ * const drinkTypes = [
3714
+ * { id: 1, name: 'Beer', definition: "an alcoholic drink made from yeast-fermented malt flavoured with hops" },
3715
+ * { id: 2, name: 'Wine', definition: "an alcoholic drink made from fermented grape juice" }];
3716
+ * const onDrinkTypeChange = (newValue) => {
3717
+ * console.log(newValue);
3718
+ * }
3295
3719
  * return (
3296
- * <List>
3297
- * <List.Item title="Icon" icon={Icon.Circle} />
3298
- * </List>
3720
+ * <Grid
3721
+ * navigationTitle="Search Beers"
3722
+ * searchBarPlaceholder="Search your favorite drink"
3723
+ * searchBarAccessory={<DrinkDropdown drinkTypes={drinkTypes} onDrinkTypeChange={onDrinkTypeChange} />}
3724
+ * >
3725
+ * <Grid.Item title="Augustiner Helles" />
3726
+ * <Grid.Item title="Camden Hells" />
3727
+ * <Grid.Item title="Leffe Blonde" />
3728
+ * <Grid.Item title="Sierra Nevada IPA" />
3729
+ * </Grid>
3299
3730
  * );
3300
- * };
3731
+ * }
3301
3732
  * ```
3302
3733
  */
3303
- export declare enum Icon {
3304
- ArrowClockwise = "arrow-clockwise-16",
3734
+ export declare const Grid: FunctionComponent<GridProps> & GridMembers;
3735
+
3736
+ export declare namespace Grid {
3737
+ /**
3738
+ * Props of the {@link Grid} React component.
3739
+ */
3740
+ export type Props = GridProps;
3741
+ /**
3742
+ * Enum representing the amount of space there should be between a {@link Grid.Item}'s content and its borders.
3743
+ */
3744
+ export type Inset = GridInset;
3745
+ /**
3746
+ * Enum representing the number of items that should be displayed on a single row.
3747
+ */
3748
+ export type ItemSize = GridItemSize;
3749
+ export namespace EmptyView {
3750
+ export type Props = EmptyViewProps_2;
3751
+ }
3752
+ export namespace Dropdown {
3753
+ /**
3754
+ * Props of the {@link Grid.Dropdown} React component.
3755
+ */
3756
+ export type Props = DropdownProps_3;
3757
+ export namespace Item {
3758
+ /**
3759
+ * Props of the {@link Grid.Dropdown.Item} React component.
3760
+ */
3761
+ export type Props = DropdownItemProps_3;
3762
+ }
3763
+ export namespace Section {
3764
+ /**
3765
+ * Props of the {@link Grid.Dropdown.Section} React component.
3766
+ */
3767
+ export type Props = DropdownSectionProps_3;
3768
+ }
3769
+ }
3770
+ export namespace Item {
3771
+ /**
3772
+ * Props of the {@link Grid.Item} React component.
3773
+ */
3774
+ export type Props = ItemProps_2;
3775
+ }
3776
+ export namespace Section {
3777
+ /**
3778
+ * Props of the {@link Grid.Section} React component.
3779
+ */
3780
+ export type Props = SectionProps_3;
3781
+ }
3782
+ }
3783
+
3784
+ declare enum GridInset {
3785
+ Small = "sm",
3786
+ Medium = "md",
3787
+ Large = "lg"
3788
+ }
3789
+
3790
+ declare enum GridItemSize {
3791
+ Small = "small",
3792
+ Medium = "medium",
3793
+ Large = "large"
3794
+ }
3795
+
3796
+ declare interface GridMembers {
3797
+ /**
3798
+ * Enum representing the amount of space there should be between a {@link Grid.Item}'s content and its borders.
3799
+ */
3800
+ Inset: typeof GridInset;
3801
+ /**
3802
+ * Enum representing the size of the Grid's child {@link Grid.Item}s.
3803
+ */
3804
+ ItemSize: typeof GridItemSize;
3805
+ /**
3806
+ * A view to display when there aren't any items available. Use to greet users with a friendly message if the
3807
+ * extension requires user input before it can show any grid items e.g. when searching for a package, an article etc.
3808
+ *
3809
+ * @remarks
3810
+ * Raycast provides a default `EmptyView` that will be displayed if the {@link Grid} component either has no children,
3811
+ * or if it has children, but none of them match the query in the search bar. This too can be overridden by passing
3812
+ * an empty view alongside the other `Grid.Item`s.
3813
+ *
3814
+ * @example
3815
+ * ```typescript
3816
+ * import { useState } from "react";
3817
+ * import { Grid } from "@raycast/api";
3818
+ *
3819
+ * export default function CommandWithCustomEmptyState() {
3820
+ * const [state, setState] = useState({ searchText: "", items: [] });
3821
+ *
3822
+ * useEffect(() => {
3823
+ * // perform an API call that eventually populates `items`.
3824
+ * }, [state.searchText])
3825
+ *
3826
+ * return (
3827
+ * <Grid
3828
+ * onSearchTextChange={(newValue) =>
3829
+ * setState((previous) => ({ ...previous, searchText: newValue }))
3830
+ * }
3831
+ * >
3832
+ * {state.searchText === "" && state.items.length === 0 ? (
3833
+ * <Grid.EmptyView
3834
+ * icon={{ source: "https://placekitten.com/500/500" }}
3835
+ * title="Type something to get started"
3836
+ * />
3837
+ * ) : (
3838
+ * state.items.map((item) => <Grid.Item key={item} title={item} />)
3839
+ * )}
3840
+ * </Grid>
3841
+ * );
3842
+ * }
3843
+ * ```
3844
+ */
3845
+ EmptyView: typeof EmptyView_2;
3846
+ /**
3847
+ * A item in the {@link Grid}.
3848
+ *
3849
+ * @remarks
3850
+ * This is one of the foundational UI components of Raycast. A grid item represents a single entity. It can be a
3851
+ * GitHub pull request, a file, or anything else. You most likely want to perform actions on this item, so make it clear
3852
+ * to the user what this grid item is about.
3853
+ *
3854
+ * @example
3855
+ * ```typescript
3856
+ * import { Icon, Grid } from "@raycast/api";
3857
+ *
3858
+ * export default function Command() {
3859
+ * return (
3860
+ * <Grid>
3861
+ * <Grid.Item icon={Icon.Star} title="Augustiner Helles" subtitle="0,5 Liter" />
3862
+ * </Grid>
3863
+ * );
3864
+ * }
3865
+ * ```
3866
+ */
3867
+ Item: typeof Item_2;
3868
+ /**
3869
+ * A group of related {@link Grid.Item}.
3870
+ *
3871
+ * @remarks
3872
+ * Sections are a great way to structure your grid. For example, group GitHub issues with the same status and order them by priority.
3873
+ * This way, users can quickly access what is most relevant.
3874
+ *
3875
+ * @example
3876
+ * ```typescript
3877
+ * import { Grid } from "@raycast/api";
3878
+ *
3879
+ * export default function Command() {
3880
+ * return (
3881
+ * <Grid>
3882
+ * <Grid.Section title="Lager">
3883
+ * <Grid.Item title="Camden Hells" />
3884
+ * </Grid.Section>
3885
+ * <Grid.Section title="IPA">
3886
+ * <Grid.Item title="Sierra Nevada IPA" />
3887
+ * </Grid.Section>
3888
+ * </Grid>
3889
+ * );
3890
+ * }
3891
+ * ```
3892
+ */
3893
+ Section: typeof Section_3;
3894
+ /**
3895
+ * A dropdown menu that will be shown in the right-hand-side of the search bar.
3896
+ *
3897
+ * @example
3898
+ * ```typescript
3899
+ * import { Grid } from "@raycast/api";
3900
+ *
3901
+ * function DrinkDropdown(props: DrinkDropdownProps) {
3902
+ * const { isLoading = false, drinkTypes, onDrinkTypeChange } = props;
3903
+ * return (
3904
+ * <Grid.Dropdown
3905
+ * tooltip="Select Drink Type"
3906
+ * disabled={isLoading}
3907
+ * storeValue={true}
3908
+ * onChange={(newValue) => {
3909
+ * onDrinkTypeChange(newValue);
3910
+ * }}
3911
+ * >
3912
+ * <Grid.Dropdown.Section title="Alcoholic Beverages">
3913
+ * {drinkTypes.map((drinkType) => (
3914
+ * <Grid.Dropdown.Item key={drinkType.id} title={drinkType.name} value={drinkType.id} />
3915
+ * ))}
3916
+ * </Grid.Dropdown.Section>
3917
+ * </Grid.Dropdown>
3918
+ * );
3919
+ * }
3920
+ *
3921
+ * export default function Command() {
3922
+ * const drinkTypes = [{ id: 1, name: 'Beer' }, { id: 2, name: 'Wine' }];
3923
+ * const onDrinkTypeChange = (newValue) => {
3924
+ * console.log(newValue);
3925
+ * }
3926
+ * return (
3927
+ * <Grid
3928
+ * navigationTitle="Search Beers"
3929
+ * searchBarPlaceholder="Search your favorite drink"
3930
+ * searchBarAccessory={<DrinkDropdown drinkTypes={drinkTypes} onDrinkTypeChange={onDrinkTypeChange} />}
3931
+ * >
3932
+ * <Grid.Item title="Augustiner Helles" />
3933
+ * <Grid.Item title="Camden Hells" />
3934
+ * <Grid.Item title="Leffe Blonde" />
3935
+ * <Grid.Item title="Sierra Nevada IPA" />
3936
+ * </Grid>
3937
+ * );
3938
+ * }
3939
+ * ```
3940
+ */
3941
+ Dropdown: typeof Dropdown_3;
3942
+ }
3943
+
3944
+ declare interface GridProps extends ActionsInterface, NavigationChildInterface {
3945
+ /**
3946
+ * Grid sections or items. If {@link Grid.Item} elements are specified, a default section is automatically created.
3947
+ */
3948
+ children?: ReactNode;
3949
+ /**
3950
+ * The number of items that should be displayed on a single row.
3951
+ *
3952
+ * @defaultValue {@link Grid.ItemSize.Medium}
3953
+ */
3954
+ itemSize?: Grid.ItemSize;
3955
+ /**
3956
+ * Indicates how much space there should be between a {@link Grid.Item}s' content and its borders.
3957
+ * The absolute value depends on the value of the `itemSize` prop.
3958
+ */
3959
+ inset?: Grid.Inset;
3960
+ /**
3961
+ * Callback triggered when the item selection in the grid changes.
3962
+ */
3963
+ onSelectionChange?: (id?: string) => void;
3964
+ /**
3965
+ * {@link Grid.Dropdown} that will be shown in the right-hand-side of the search bar.
3966
+ */
3967
+ searchBarAccessory?: ReactElement<DropdownProps_3> | undefined | null;
3968
+ /**
3969
+ * The text that will be displayed in the search bar.
3970
+ */
3971
+ searchText?: string;
3972
+ /**
3973
+ * Toggles Raycast filtering. When `true`, Raycast will use the query in the search bar to filter grid
3974
+ * items. When `false`, the extension needs to take care of the filtering.
3975
+ *
3976
+ * @remarks
3977
+ * Having this enabled when filtering items in the extension is unspecified behaviour.
3978
+ *
3979
+ * @defaultValue `false` when `onSearchTextChange` is specified, `true` otherwise.
3980
+ */
3981
+ enableFiltering?: boolean;
3982
+ /**
3983
+ * Placeholder text that will be shown in the search bar.
3984
+ *
3985
+ * @defaultValue `"Search value..."`
3986
+ */
3987
+ searchBarPlaceholder?: string;
3988
+ /**
3989
+ * Selects the item with the specified id.
3990
+ */
3991
+ selectedItemId?: string;
3992
+ /**
3993
+ * Defines whether the {@link Grid.Props.onSearchTextChange} will be triggered on every keyboard press or with a delay for throttling the events.
3994
+ * Recommended to set to `true` when using custom filtering logic with asynchronous operations (e.g. network requests).
3995
+ * @defaultValue `false`
3996
+ */
3997
+ throttle?: boolean;
3998
+ /**
3999
+ * Callback triggered when the search bar text changes.
4000
+ *
4001
+ * @remarks
4002
+ * Specifying this implicitly toggles `enableFiltering` to false. To enable native filtering when using `onSearchTextChange`, explicitly set `enableFiltering` to true.
4003
+ */
4004
+ onSearchTextChange?: (text: string) => void;
4005
+ }
4006
+
4007
+ /**
4008
+ * List of built-in icons that can be used for actions or list items.
4009
+ *
4010
+ * @example
4011
+ * ```typescript
4012
+ * import { Icon, List } from "@raycast/api";
4013
+ *
4014
+ * export default function Command() {
4015
+ * return (
4016
+ * <List>
4017
+ * <List.Item title="Icon" icon={Icon.Circle} />
4018
+ * </List>
4019
+ * );
4020
+ * };
4021
+ * ```
4022
+ */
4023
+ export declare enum Icon {
4024
+ ArrowClockwise = "arrow-clockwise-16",
3305
4025
  TwoArrowsClockwise = "arrow-2-clockwise-16",
3306
4026
  ArrowRight = "arrow-right-16",
3307
4027
  Binoculars = "binoculars-16",
@@ -3538,11 +4258,22 @@ export declare type ImageSource = Image.Source;
3538
4258
  */
3539
4259
  declare const Item: FunctionComponent<ItemProps> & ItemMembers;
3540
4260
 
3541
- declare interface ItemAccessory {
4261
+ /**
4262
+ * See {@link Grid.Item}
4263
+ */
4264
+ declare const Item_2: FunctionComponent<ItemProps_2>;
4265
+
4266
+ declare type ItemAccessory = ({
3542
4267
  /**
3543
4268
  * An optional text that will be used as the label.
3544
4269
  */
3545
4270
  text?: string | undefined | null;
4271
+ } | {
4272
+ /**
4273
+ * 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.).
4274
+ */
4275
+ date?: Date | undefined | null;
4276
+ }) & {
3546
4277
  /**
3547
4278
  * An optional {@link Image.ImageLike} that will be used as the icon.
3548
4279
  * @remarks
@@ -3553,7 +4284,7 @@ declare interface ItemAccessory {
3553
4284
  * An optional tooltip shown when the accessory is hovered.
3554
4285
  */
3555
4286
  tooltip?: string | undefined | null;
3556
- }
4287
+ };
3557
4288
 
3558
4289
  declare interface ItemMembers {
3559
4290
  /**
@@ -3631,6 +4362,62 @@ declare interface ItemProps extends ActionsInterface {
3631
4362
  * The `List.Item.Detail` to be rendered in the right side area when the parent List is showing details and the item is selected.
3632
4363
  */
3633
4364
  detail?: ReactNode;
4365
+ /**
4366
+ * Optional information to preview files with Quick Look. Toggle the preview ith {@link Action.ToggleQuickLook}.
4367
+ *
4368
+ * @remarks
4369
+ * If no `name` is specified, the file name of the given path is used.
4370
+ */
4371
+ quickLook?: {
4372
+ name?: string | null;
4373
+ path: string;
4374
+ };
4375
+ }
4376
+
4377
+ declare interface ItemProps_2 extends ActionsInterface {
4378
+ /**
4379
+ * ID of the item. This string is passed to the `onSelectionChange` handler of the {@link Grid} when the item is selected.
4380
+ * Make sure to assign each item a unique ID or a UUID will be auto generated.
4381
+ */
4382
+ id?: string;
4383
+ /**
4384
+ * An image or color, optionally with a tooltip, representing the content of the grid item.
4385
+ */
4386
+ content: Image.ImageLike | {
4387
+ color: Color.ColorLike;
4388
+ } | {
4389
+ value: Image.ImageLike | {
4390
+ color: Color.ColorLike;
4391
+ };
4392
+ tooltip: string;
4393
+ };
4394
+ /**
4395
+ * An optional title displayed below the content.
4396
+ */
4397
+ title?: string;
4398
+ /**
4399
+ * An optional subtitle displayed below the title.
4400
+ */
4401
+ subtitle?: string;
4402
+ /**
4403
+ * An optional property used for providing additional indexable strings for search.
4404
+ * When filtering the list in Raycast through the search bar, the keywords will be searched in addition to the title.
4405
+ */
4406
+ keywords?: string[];
4407
+ /**
4408
+ * Optional information to preview files with Quick Look. Toggle the preview ith {@link Action.ToggleQuickLook}.
4409
+ *
4410
+ * @remarks
4411
+ * If no `name` is specified, the file name of the given path is used.
4412
+ */
4413
+ quickLook?: {
4414
+ name?: string | null;
4415
+ path: string;
4416
+ };
4417
+ /**
4418
+ * An {@link ActionPanel} that will be updated for the selected grid item.
4419
+ */
4420
+ actions?: ReactNode | null;
3634
4421
  }
3635
4422
 
3636
4423
  export declare namespace Keyboard {
@@ -3748,6 +4535,11 @@ declare interface LabelProps_2 {
3748
4535
  text?: string;
3749
4536
  }
3750
4537
 
4538
+ /**
4539
+ * The top-level props that a Command receives on launch
4540
+ */
4541
+ export declare type LaunchProps = FormLaunchProps;
4542
+
3751
4543
  /**
3752
4544
  * See {@link Detail.Metadata.Link}
3753
4545
  */
@@ -4383,12 +5175,12 @@ declare interface NavigationChildInterface {
4383
5175
  export declare namespace OAuth {
4384
5176
  export namespace PKCEClient {
4385
5177
  /**
4386
- * The options for creating a new {@link PKCEClient}.
5178
+ * The options for creating a new {@link OAuth.PKCEClient}.
4387
5179
  */
4388
5180
  export interface Options {
4389
5181
  /**
4390
5182
  * The redirect method for the OAuth flow.
4391
- * Make sure to set this to the correct method for the provider, see {@link RedirectMethod} for more information.
5183
+ * Make sure to set this to the correct method for the provider, see {@link OAuth.RedirectMethod} for more information.
4392
5184
  */
4393
5185
  redirectMethod: RedirectMethod;
4394
5186
  /**
@@ -4438,37 +5230,37 @@ export declare namespace OAuth {
4438
5230
  constructor(options: PKCEClient.Options);
4439
5231
  /**
4440
5232
  * Creates an authorization request for the provided authorization endpoint, client ID, and scopes.
4441
- * You need to first create the authorization request before calling {@link authorize}.
5233
+ * You need to first create the authorization request before calling {@link OAuth.PKCEClient.authorize}.
4442
5234
  *
4443
5235
  * @remarks The generated code challenge for the PKCE request uses the S256 method.
4444
5236
  *
4445
- * @returns A promise for an {@link AuthorizationRequest} that you can use as input for {@link authorize}.
5237
+ * @returns A promise for an {@link OAuth.AuthorizationRequest} that you can use as input for {@link OAuth.PKCEClient.authorize}.
4446
5238
  */
4447
5239
  authorizationRequest(options: AuthorizationRequestOptions): Promise<AuthorizationRequest>;
4448
5240
  /**
4449
5241
  * Starts the authorization and shows the OAuth overlay in Raycast.
4450
- * As parameter you can either directly use the returned request from {@link authorizationRequest},
4451
- * or customize the URL by extracting parameters from {@link AuthorizationRequest} and providing your own URL via {@link AuthorizationOptions}.
5242
+ * As parameter you can either directly use the returned request from {@link OAuth.PKCEClient.authorizationRequest},
5243
+ * or customize the URL by extracting parameters from {@link OAuth.AuthorizationRequest} and providing your own URL via {@link AuthorizationOptions}.
4452
5244
  * Eventually the URL will be used to open the authorization page of the provider in the web browser.
4453
5245
  *
4454
- * @returns A promise for an {@link AuthorizationResponse}, which contains the authorization code needed for the token exchange.
5246
+ * @returns A promise for an {@link OAuth.AuthorizationResponse}, which contains the authorization code needed for the token exchange.
4455
5247
  * The promise is resolved when the user was redirected back from the provider's authorization page to the Raycast extension.
4456
5248
  */
4457
5249
  authorize(options: AuthorizationRequest | AuthorizationOptions): Promise<AuthorizationResponse>;
4458
5250
  private authorizationURL;
4459
5251
  /**
4460
- * Securely stores a {@link TokenSet} for the provider. Use this after fetching the access token from the provider.
4461
- * If the provider returns a a standard OAuth JSON token response, you can directly pass the {@link TokenResponse}.
4462
- * At a minimum, you need to set the {@link TokenSet.accessToken}, and typically you also set {@link TokenSet.refreshToken} and {@link TokenSet.isExpired}.
5252
+ * Securely stores a {@link OAuth.TokenSet} for the provider. Use this after fetching the access token from the provider.
5253
+ * If the provider returns a a standard OAuth JSON token response, you can directly pass the {@link OAuth.TokenResponse}.
5254
+ * At a minimum, you need to set the {@link OAuth.TokenSet.accessToken}, and typically you also set {@link OAuth.TokenSet.refreshToken} and {@link OAuth.TokenSet.isExpired}.
4463
5255
  * Raycast automatically shows a logout preference for the extension when a token set was saved.
4464
5256
  *
4465
- * @remarks If you want to make use of the convenience {@link TokenSet.isExpired} method, the property {@link TokenSet.expiresIn} must be configured.
5257
+ * @remarks If you want to make use of the convenience {@link OAuth.TokenSet.isExpired} method, the property {@link OAuth.TokenSet.expiresIn} must be configured.
4466
5258
  *
4467
5259
  * @returns A promise that resolves when the token set has been stored.
4468
5260
  */
4469
5261
  setTokens(options: TokenSetOptions | TokenResponse): Promise<void>;
4470
5262
  /**
4471
- * Retrieves the stored {@link TokenSet} for the client.
5263
+ * Retrieves the stored {@link OAuth.TokenSet} for the client.
4472
5264
  * You can use this to initially check whether the authorization flow should be initiated or
4473
5265
  * the user is already logged in and you might have to refresh the access token.
4474
5266
  *
@@ -4476,7 +5268,7 @@ export declare namespace OAuth {
4476
5268
  */
4477
5269
  getTokens(): Promise<TokenSet | undefined>;
4478
5270
  /**
4479
- * Removes the stored {@link TokenSet} for the client.
5271
+ * Removes the stored {@link OAuth.TokenSet} for the client.
4480
5272
  *
4481
5273
  * @remarks Raycast automatically shows a logout preference that removes the token set.
4482
5274
  * 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.
@@ -4509,7 +5301,7 @@ export declare namespace OAuth {
4509
5301
  AppURI = "appURI"
4510
5302
  }
4511
5303
  /**
4512
- * The options for an authorization request via {@link PKCEClient.authorizationRequest}.
5304
+ * The options for an authorization request via {@link OAuth.PKCEClient.authorizationRequest}.
4513
5305
  */
4514
5306
  export interface AuthorizationRequestOptions {
4515
5307
  /**
@@ -4533,8 +5325,8 @@ export declare namespace OAuth {
4533
5325
  extraParameters?: Record<string, string>;
4534
5326
  }
4535
5327
  /**
4536
- * Values of {@link AuthorizationRequest}.
4537
- * The PKCE client automatically generates the values for you and returns them for {@link PKCEClient.authorizationRequest}.
5328
+ * Values of {@link OAuth.AuthorizationRequest}.
5329
+ * The PKCE client automatically generates the values for you and returns them for {@link OAuth.PKCEClient.authorizationRequest}.
4538
5330
  */
4539
5331
  export interface AuthorizationRequestURLParams {
4540
5332
  /**
@@ -4555,9 +5347,9 @@ export declare namespace OAuth {
4555
5347
  redirectURI: string;
4556
5348
  }
4557
5349
  /**
4558
- * The request returned by {@link PKCEClient.authorizationRequest}.
4559
- * Can be used as direct input to {@link PKCEClient.authorize}, or
4560
- * to extract parameters for constructing a custom URL in {@link AuthorizationOptions}.
5350
+ * The request returned by {@link OAuth.PKCEClient.authorizationRequest}.
5351
+ * Can be used as direct input to {@link OAuth.PKCEClient.authorize}, or
5352
+ * to extract parameters for constructing a custom URL in {@link OAuth.AuthorizationOptions}.
4561
5353
  */
4562
5354
  export interface AuthorizationRequest extends AuthorizationRequestURLParams {
4563
5355
  /**
@@ -4566,8 +5358,8 @@ export declare namespace OAuth {
4566
5358
  toURL(): string;
4567
5359
  }
4568
5360
  /**
4569
- * Options for customizing {@link PKCEClient.authorize}.
4570
- * You can use values from {@link AuthorizationRequest} to build your own URL.
5361
+ * Options for customizing {@link OAuth.PKCEClient.authorize}.
5362
+ * You can use values from {@link OAuth.AuthorizationRequest} to build your own URL.
4571
5363
  */
4572
5364
  export interface AuthorizationOptions {
4573
5365
  /**
@@ -4576,7 +5368,7 @@ export declare namespace OAuth {
4576
5368
  url: string;
4577
5369
  }
4578
5370
  /**
4579
- * The response returned by {@link PKCEClient.authorize}, containing the authorization code after the provider redirect.
5371
+ * The response returned by {@link OAuth.PKCEClient.authorize}, containing the authorization code after the provider redirect.
4580
5372
  * You can then exchange the authorization code for an access token using the provider's token endpoint.
4581
5373
  */
4582
5374
  export interface AuthorizationResponse {
@@ -4588,7 +5380,7 @@ export declare namespace OAuth {
4588
5380
  /**
4589
5381
  * Describes the TokenSet created from an OAuth provider's token response.
4590
5382
  * The `accessToken` is the only required parameter but typically OAuth providers also return a refresh token, an expires value, and the scope.
4591
- * Securely store a token set via {@link PKCEClient.setTokens} and retrieve it via {@link PKCEClient.getTokens}.
5383
+ * Securely store a token set via {@link OAuth.PKCEClient.setTokens} and retrieve it via {@link OAuth.PKCEClient.getTokens}.
4592
5384
  */
4593
5385
  export interface TokenSet {
4594
5386
  /**
@@ -4614,7 +5406,7 @@ export declare namespace OAuth {
4614
5406
  */
4615
5407
  scope?: string;
4616
5408
  /**
4617
- * The date when the token set was stored via {@link PKCEClient.setTokens}.
5409
+ * The date when the token set was stored via {@link OAuth.PKCEClient.setTokens}.
4618
5410
  */
4619
5411
  updatedAt: Date;
4620
5412
  /**
@@ -4625,7 +5417,7 @@ export declare namespace OAuth {
4625
5417
  isExpired(): boolean;
4626
5418
  }
4627
5419
  /**
4628
- * Options for a {@link TokenSet} to store via {@link PKCEClient.setTokens}.
5420
+ * Options for a {@link OAuth.TokenSet} to store via {@link OAuth.PKCEClient.setTokens}.
4629
5421
  */
4630
5422
  export interface TokenSetOptions {
4631
5423
  /**
@@ -4651,7 +5443,7 @@ export declare namespace OAuth {
4651
5443
  }
4652
5444
  /**
4653
5445
  * Defines the standard JSON response for an OAuth token request.
4654
- * The response can be directly used to store a {@link TokenSet} via {@link PKCEClient.setTokens}.
5446
+ * The response can be directly used to store a {@link OAuth.TokenSet} via {@link OAuth.PKCEClient.setTokens}.
4655
5447
  */
4656
5448
  export interface TokenResponse {
4657
5449
  /**
@@ -5132,6 +5924,11 @@ declare const Section: FunctionComponent<SectionProps>;
5132
5924
  */
5133
5925
  declare const Section_2: FunctionComponent<SectionProps_2>;
5134
5926
 
5927
+ /**
5928
+ * See {@link Grid.Section}
5929
+ */
5930
+ declare const Section_3: FunctionComponent<SectionProps_3>;
5931
+
5135
5932
  declare type SectionChildren = ReactElement<ActionProps> | ReactElement<ActionProps>[] | ReactElement<SubmenuProps> | Array<ReactElement<SubmenuProps>> | Array<ReactElement<SubmenuProps> | ReactElement<ActionProps>> | null;
5136
5933
 
5137
5934
  /**
@@ -5155,7 +5952,7 @@ declare interface SectionProps_2 {
5155
5952
  children?: ReactNode;
5156
5953
  /**
5157
5954
  * ID of the section.
5158
- * @deprecated - This is an internal prop which not not have been exposed. You can safely remove it.
5955
+ * @deprecated - This is an internal prop which should not have been exposed. You can safely remove it.
5159
5956
  */
5160
5957
  id?: string;
5161
5958
  /**
@@ -5168,6 +5965,21 @@ declare interface SectionProps_2 {
5168
5965
  subtitle?: string;
5169
5966
  }
5170
5967
 
5968
+ declare interface SectionProps_3 {
5969
+ /**
5970
+ * The {@link Grid.Item} elements of the section.
5971
+ */
5972
+ children?: ReactNode;
5973
+ /**
5974
+ * Title displayed above the section.
5975
+ */
5976
+ title?: string;
5977
+ /**
5978
+ * An optional subtitle displayed next to the title of the section.
5979
+ */
5980
+ subtitle?: string;
5981
+ }
5982
+
5171
5983
  /**
5172
5984
  * See {@link Form.Separator}
5173
5985
  */
@@ -5364,7 +6176,7 @@ declare type SubmenuChildren = ReactElement<SectionProps> | ReactElement<Section
5364
6176
  declare interface SubmenuProps {
5365
6177
  /**
5366
6178
  * ID of the submenu.
5367
- * @deprecated - This is an internal prop which not not have been exposed. You can safely remove it.
6179
+ * @deprecated - This is an internal prop which should not have been exposed. You can safely remove it.
5368
6180
  */
5369
6181
  id?: string;
5370
6182
  /**
@@ -5394,6 +6206,23 @@ declare interface SubmenuProps {
5394
6206
  * Use {@link ActionPanel.Submenu} as parent when specifying sub-menu's children to make code is more readable.
5395
6207
  */
5396
6208
  children?: ReactNode;
6209
+ /**
6210
+ * Callback that is triggered when the Submenu is opened.
6211
+ *
6212
+ * This callback can be used to fetch its content lazily:
6213
+ * ```js
6214
+ * function LazySubmenu() {
6215
+ * const [content, setContent] = useState(null)
6216
+ *
6217
+ * return (
6218
+ * <ActionPanel.Submenu onOpen={() => fetchSubmenuContent().then(setContent)}>
6219
+ * {content}
6220
+ * </ActionPanel.Submenu>
6221
+ * )
6222
+ * }
6223
+ * ```
6224
+ */
6225
+ onOpen?: () => void;
5397
6226
  }
5398
6227
 
5399
6228
  /**
@@ -5577,6 +6406,12 @@ declare interface TextAreaProps extends FormItemProps_2<string> {
5577
6406
  * Placeholder text shown in the text area.
5578
6407
  */
5579
6408
  placeholder?: string;
6409
+ /**
6410
+ * Whether markdown will be highlighted in the TextArea or not.
6411
+ * When enabled, markdown shortcuts starts to work for the TextArea (pressing `⌘ + B` will add `**bold**` around the selected text, `⌘ + I` will make the selected text italic, etc.)
6412
+ * @defaultValue `false`
6413
+ */
6414
+ enableMarkdown?: boolean;
5580
6415
  }
5581
6416
 
5582
6417
  /**
@@ -5762,6 +6597,34 @@ export declare interface ToastOptions extends Toast.Options {
5762
6597
  */
5763
6598
  export declare const ToastStyle: typeof Toast.Style;
5764
6599
 
6600
+ /**
6601
+ * See {@link Action.ToggleQuickLook}
6602
+ */
6603
+ declare const ToggleQuickLook: FunctionComponent<ToggleQuickLookProps>;
6604
+
6605
+ /**
6606
+ * See {@link Action.Open.Props}
6607
+ */
6608
+ declare interface ToggleQuickLookProps {
6609
+ /**
6610
+ * The title for the action.
6611
+ * @defaultValue `"Quick Look"`
6612
+ */
6613
+ title?: string;
6614
+ /**
6615
+ * The icon displayed for the action.
6616
+ * @defaultValue {@link Icon.Eye}
6617
+ */
6618
+ icon?: Image.ImageLike;
6619
+ /**
6620
+ * The keyboard shortcut for the action.
6621
+ *
6622
+ * @remarks
6623
+ * The recommended system-wide keyboard shortcut is "⌘ + Y".
6624
+ */
6625
+ shortcut?: Keyboard.Shortcut;
6626
+ }
6627
+
5765
6628
  /**
5766
6629
  * See {@link Action.Trash}
5767
6630
  */