@raycast/api 1.40.3 → 1.41.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/api.d.ts +178 -36
- package/package.json +1 -1
- package/types/index.d.ts +178 -36
package/api.d.ts
CHANGED
|
@@ -102,7 +102,7 @@ export declare namespace Action {
|
|
|
102
102
|
/**
|
|
103
103
|
* Props of the {@link Action.SubmitForm} React component.
|
|
104
104
|
*/
|
|
105
|
-
export type Props<T> = SubmitFormProps<T>;
|
|
105
|
+
export type Props<T extends Form.Values> = SubmitFormProps<T>;
|
|
106
106
|
}
|
|
107
107
|
export namespace Trash {
|
|
108
108
|
/**
|
|
@@ -702,10 +702,10 @@ export declare function clearSearchBar(options?: {
|
|
|
702
702
|
|
|
703
703
|
export declare namespace Clipboard {
|
|
704
704
|
/**
|
|
705
|
-
* Copies
|
|
705
|
+
* Copies content to the clipboard.
|
|
706
706
|
*
|
|
707
|
-
* @param
|
|
708
|
-
* @returns A Promise that resolves when the
|
|
707
|
+
* @param content - The content to copy to the clipboard.
|
|
708
|
+
* @returns A Promise that resolves when the content is copied to the clipboard.
|
|
709
709
|
*
|
|
710
710
|
* @example
|
|
711
711
|
* ```typescript
|
|
@@ -713,10 +713,22 @@ export declare namespace Clipboard {
|
|
|
713
713
|
*
|
|
714
714
|
* export default async () => {
|
|
715
715
|
* await Clipboard.copy("https://raycast.com");
|
|
716
|
+
*
|
|
717
|
+
* const textContent: Clipboard.Content = {
|
|
718
|
+
* text: "https://raycast.com",
|
|
719
|
+
* }
|
|
720
|
+
*
|
|
721
|
+
* await Clipboard.copy(textContent);
|
|
722
|
+
*
|
|
723
|
+
* const fileContent: Clipboard.Content = {
|
|
724
|
+
* file: "/path/to/file.pdf",
|
|
725
|
+
* }
|
|
726
|
+
*
|
|
727
|
+
* await Clipboard.copy(fileContent);
|
|
716
728
|
* };
|
|
717
729
|
* ```
|
|
718
730
|
*/
|
|
719
|
-
export function copy(
|
|
731
|
+
export function copy(content: string | Content): Promise<void>;
|
|
720
732
|
/**
|
|
721
733
|
* Clears the current clipboard contents.
|
|
722
734
|
*
|
|
@@ -733,10 +745,10 @@ export declare namespace Clipboard {
|
|
|
733
745
|
*/
|
|
734
746
|
export function clear(): Promise<void>;
|
|
735
747
|
/**
|
|
736
|
-
* Pastes
|
|
748
|
+
* Pastes content to the current selection of the frontmost application.
|
|
737
749
|
*
|
|
738
|
-
* @param
|
|
739
|
-
* @returns A Promise that resolves when the
|
|
750
|
+
* @param content - The content to insert at the cursor.
|
|
751
|
+
* @returns A Promise that resolves when the content is pasted.
|
|
740
752
|
*
|
|
741
753
|
* @example
|
|
742
754
|
* ```typescript
|
|
@@ -747,7 +759,7 @@ export declare namespace Clipboard {
|
|
|
747
759
|
* };
|
|
748
760
|
* ```
|
|
749
761
|
*/
|
|
750
|
-
export function paste(
|
|
762
|
+
export function paste(content: string | Content): Promise<void>;
|
|
751
763
|
/**
|
|
752
764
|
* Reads the clipboard as plain text.
|
|
753
765
|
*
|
|
@@ -764,6 +776,36 @@ export declare namespace Clipboard {
|
|
|
764
776
|
* ```
|
|
765
777
|
*/
|
|
766
778
|
export function readText(): Promise<string | undefined>;
|
|
779
|
+
/**
|
|
780
|
+
* Type of the content copied and pasted to and from the {@link Clipboard}.
|
|
781
|
+
*
|
|
782
|
+
* @example
|
|
783
|
+
* ```typescript
|
|
784
|
+
* import { Clipboard } from "@raycast/api";
|
|
785
|
+
*
|
|
786
|
+
* const textContent: Clipboard.Content = {
|
|
787
|
+
* text: "text to copy",
|
|
788
|
+
* }
|
|
789
|
+
*
|
|
790
|
+
* const fileContent: Clipboard.Content = {
|
|
791
|
+
* file: "/path/to/file.pdf",
|
|
792
|
+
* }
|
|
793
|
+
* ```
|
|
794
|
+
*/
|
|
795
|
+
export type Content = {
|
|
796
|
+
/**
|
|
797
|
+
* The text representation of the content.
|
|
798
|
+
*/
|
|
799
|
+
text: string;
|
|
800
|
+
} | {
|
|
801
|
+
/**
|
|
802
|
+
* The file representation of the content.
|
|
803
|
+
*
|
|
804
|
+
* @remarks
|
|
805
|
+
* At the moment only file paths represented as a string are supported.
|
|
806
|
+
*/
|
|
807
|
+
file: PathLike;
|
|
808
|
+
};
|
|
767
809
|
}
|
|
768
810
|
|
|
769
811
|
/**
|
|
@@ -3807,10 +3849,18 @@ export declare namespace Grid {
|
|
|
3807
3849
|
* Props of the {@link Grid} React component.
|
|
3808
3850
|
*/
|
|
3809
3851
|
export type Props = GridProps;
|
|
3852
|
+
/**
|
|
3853
|
+
* Allowed `aspectRatio` values.
|
|
3854
|
+
*/
|
|
3855
|
+
export type AspectRatio = `${GridAspectRatio}`;
|
|
3810
3856
|
/**
|
|
3811
3857
|
* Enum representing the amount of space there should be between a {@link Grid.Item}'s content and its borders.
|
|
3812
3858
|
*/
|
|
3813
3859
|
export type Inset = GridInset;
|
|
3860
|
+
/**
|
|
3861
|
+
* Enum representing the a {@link Grid.Items}'s fit.
|
|
3862
|
+
*/
|
|
3863
|
+
export type Fit = GridFit;
|
|
3814
3864
|
/**
|
|
3815
3865
|
* Enum representing the number of items that should be displayed on a single row.
|
|
3816
3866
|
*/
|
|
@@ -3850,7 +3900,21 @@ export declare namespace Grid {
|
|
|
3850
3900
|
}
|
|
3851
3901
|
}
|
|
3852
3902
|
|
|
3903
|
+
declare enum GridAspectRatio {
|
|
3904
|
+
One = "1",
|
|
3905
|
+
ThreeToTwo = "3/2",
|
|
3906
|
+
TwoToThree = "2/3",
|
|
3907
|
+
SixteenToNine = "16/9",
|
|
3908
|
+
NineToSixteen = "9/16"
|
|
3909
|
+
}
|
|
3910
|
+
|
|
3911
|
+
declare enum GridFit {
|
|
3912
|
+
Contain = "contain",
|
|
3913
|
+
Fill = "fill"
|
|
3914
|
+
}
|
|
3915
|
+
|
|
3853
3916
|
declare enum GridInset {
|
|
3917
|
+
Zero = "zero",
|
|
3854
3918
|
Small = "sm",
|
|
3855
3919
|
Medium = "md",
|
|
3856
3920
|
Large = "lg"
|
|
@@ -3869,8 +3933,14 @@ declare interface GridMembers {
|
|
|
3869
3933
|
Inset: typeof GridInset;
|
|
3870
3934
|
/**
|
|
3871
3935
|
* Enum representing the size of the Grid's child {@link Grid.Item}s.
|
|
3936
|
+
*
|
|
3937
|
+
* @deprecated Use the `columns` number prop instead.
|
|
3872
3938
|
*/
|
|
3873
3939
|
ItemSize: typeof GridItemSize;
|
|
3940
|
+
/**
|
|
3941
|
+
* Enum representing the a {@link Grid.Items}'s fit.
|
|
3942
|
+
*/
|
|
3943
|
+
Fit: typeof GridFit;
|
|
3874
3944
|
/**
|
|
3875
3945
|
* A view to display when there aren't any items available. Use to greet users with a friendly message if the
|
|
3876
3946
|
* extension requires user input before it can show any grid items e.g. when searching for a package, an article etc.
|
|
@@ -4018,12 +4088,26 @@ declare interface GridProps extends ActionsInterface, NavigationChildInterface {
|
|
|
4018
4088
|
* Grid sections or items. If {@link Grid.Item} elements are specified, a default section is automatically created.
|
|
4019
4089
|
*/
|
|
4020
4090
|
children?: ReactNode;
|
|
4091
|
+
/**
|
|
4092
|
+
* Column count for the grid's sections. Minimum value is 1, maximum value is 8.
|
|
4093
|
+
*
|
|
4094
|
+
* @defaultValue 5
|
|
4095
|
+
*/
|
|
4096
|
+
columns?: number;
|
|
4021
4097
|
/**
|
|
4022
4098
|
* The number of items that should be displayed on a single row.
|
|
4023
4099
|
*
|
|
4024
|
-
* @
|
|
4100
|
+
* @deprecated use `columns` instead.
|
|
4025
4101
|
*/
|
|
4026
4102
|
itemSize?: Grid.ItemSize;
|
|
4103
|
+
/**
|
|
4104
|
+
* Aspect ratio for the {@link Grid.Item} elements. Defaults to 1.
|
|
4105
|
+
*/
|
|
4106
|
+
aspectRatio?: Grid.AspectRatio;
|
|
4107
|
+
/**
|
|
4108
|
+
* Fit for the {@link Grid.Item} element content. Defaults to "contain"
|
|
4109
|
+
*/
|
|
4110
|
+
fit?: Grid.Fit;
|
|
4027
4111
|
/**
|
|
4028
4112
|
* Indicates how much space there should be between a {@link Grid.Item}s' content and its borders.
|
|
4029
4113
|
* The absolute value depends on the value of the `itemSize` prop.
|
|
@@ -4031,8 +4115,11 @@ declare interface GridProps extends ActionsInterface, NavigationChildInterface {
|
|
|
4031
4115
|
inset?: Grid.Inset;
|
|
4032
4116
|
/**
|
|
4033
4117
|
* Callback triggered when the item selection in the grid changes.
|
|
4118
|
+
*
|
|
4119
|
+
* When the received id is `null`, it means that all items have been filtered out
|
|
4120
|
+
* and that there are no item selected
|
|
4034
4121
|
*/
|
|
4035
|
-
onSelectionChange?: (id
|
|
4122
|
+
onSelectionChange?: (id: string | null) => void;
|
|
4036
4123
|
/**
|
|
4037
4124
|
* {@link Grid.Dropdown} that will be shown in the right-hand-side of the search bar.
|
|
4038
4125
|
*/
|
|
@@ -4405,6 +4492,7 @@ export declare enum Icon {
|
|
|
4405
4492
|
Pencil = "pencil-16",
|
|
4406
4493
|
Person = "person-16",
|
|
4407
4494
|
PersonCircle = "person-circle-16",
|
|
4495
|
+
PersonLines = "person-lines-16",
|
|
4408
4496
|
Phone = "phone-16",
|
|
4409
4497
|
PhoneRinging = "phone-ringing-16",
|
|
4410
4498
|
PieChart = "pie-chart-16",
|
|
@@ -4905,6 +4993,10 @@ declare interface ItemProps_3 {
|
|
|
4905
4993
|
* The main title displayed for this item.
|
|
4906
4994
|
*/
|
|
4907
4995
|
title: string;
|
|
4996
|
+
/**
|
|
4997
|
+
* The subtitle displayed for this item in a slightly dimmed text color.
|
|
4998
|
+
*/
|
|
4999
|
+
subtitle?: string;
|
|
4908
5000
|
/**
|
|
4909
5001
|
* An optional icon for this item.
|
|
4910
5002
|
*/
|
|
@@ -5377,8 +5469,11 @@ declare interface ListProps_2 extends ActionsInterface, NavigationChildInterface
|
|
|
5377
5469
|
children?: ReactNode;
|
|
5378
5470
|
/**
|
|
5379
5471
|
* Callback triggered when the item selection in the list changes.
|
|
5472
|
+
*
|
|
5473
|
+
* When the received id is `null`, it means that all items have been filtered out
|
|
5474
|
+
* and that there are no item selected
|
|
5380
5475
|
*/
|
|
5381
|
-
onSelectionChange?: (id
|
|
5476
|
+
onSelectionChange?: (id: string | null) => void;
|
|
5382
5477
|
/**
|
|
5383
5478
|
* {@link List.Dropdown} that will be shown in the right-hand-side of the search bar.
|
|
5384
5479
|
*/
|
|
@@ -5388,6 +5483,7 @@ declare interface ListProps_2 extends ActionsInterface, NavigationChildInterface
|
|
|
5388
5483
|
*/
|
|
5389
5484
|
searchText?: string;
|
|
5390
5485
|
/**
|
|
5486
|
+
* @deprecated Use {@link List.filtering} instead.
|
|
5391
5487
|
* Toggles Raycast filtering. When `true`, Raycast will use the query in the search bar to filter list
|
|
5392
5488
|
* items. When `false`, the extension needs to take care of the filtering.
|
|
5393
5489
|
*
|
|
@@ -5397,6 +5493,19 @@ declare interface ListProps_2 extends ActionsInterface, NavigationChildInterface
|
|
|
5397
5493
|
* @defaultValue `false` when `onSearchTextChange` is specified, `true` otherwise.
|
|
5398
5494
|
*/
|
|
5399
5495
|
enableFiltering?: boolean;
|
|
5496
|
+
/**
|
|
5497
|
+
* Toggles Raycast filtering. When `true`, Raycast will use the query in the search bar to filter list
|
|
5498
|
+
* items. When `false`, the extension needs to take care of the filtering.
|
|
5499
|
+
*
|
|
5500
|
+
* You can further define how native filtering orders list sections by setting an object with a `keepSectionOrder` property:
|
|
5501
|
+
* When `true`, ensures that Raycast filtering maintains the section order as defined in the extension.
|
|
5502
|
+
* When `false`, filtering may change the section order depending on the ranking values of list items.
|
|
5503
|
+
*
|
|
5504
|
+
* @defaultValue `false` when `onSearchTextChange` is specified, `true` otherwise.
|
|
5505
|
+
*/
|
|
5506
|
+
filtering?: boolean | {
|
|
5507
|
+
keepSectionOrder: boolean;
|
|
5508
|
+
};
|
|
5400
5509
|
/**
|
|
5401
5510
|
* Placeholder text that will be shown in the search bar.
|
|
5402
5511
|
*
|
|
@@ -5658,30 +5767,7 @@ declare interface MenuBarExtraMembers {
|
|
|
5658
5767
|
*/
|
|
5659
5768
|
Item: typeof Item_3;
|
|
5660
5769
|
/**
|
|
5661
|
-
*
|
|
5662
|
-
*
|
|
5663
|
-
* @example
|
|
5664
|
-
* ```typescript
|
|
5665
|
-
* import { MenuBarExtra } from "@raycast/api";
|
|
5666
|
-
*
|
|
5667
|
-
* export default function Command() {
|
|
5668
|
-
* return (
|
|
5669
|
-
* <MenuBarExtra icon="https://github.githubassets.com/favicons/favicon.png" tooltip="Your Pull Requests">
|
|
5670
|
-
* <MenuBarExtra.Item title="Item 1" />
|
|
5671
|
-
* <MenuBarExtra.Separator />
|
|
5672
|
-
* <MenuBarExtra.Item title="Item 2" />
|
|
5673
|
-
* <MenuBarExtra.Separator />
|
|
5674
|
-
* <MenuBarExtra.Submenu title="Submenu 1">
|
|
5675
|
-
* <MenuBarExtra.Item title="Submenu 1 Item 1" />
|
|
5676
|
-
* </MenuBarExtra.Submenu>
|
|
5677
|
-
* <MenuBarExtra.Separator />
|
|
5678
|
-
* <MenuBarExtra.Submenu title="Submenu 2">
|
|
5679
|
-
* <MenuBarExtra.Item title="Submenu 2 Item 1" />
|
|
5680
|
-
* </MenuBarExtra.Submenu>
|
|
5681
|
-
* </MenuBarExtra>
|
|
5682
|
-
* );
|
|
5683
|
-
* }
|
|
5684
|
-
* ```
|
|
5770
|
+
* @deprecated Use {@link MenuBarExtra.Section} instead to wrap your items. A separator is added automatically.
|
|
5685
5771
|
*/
|
|
5686
5772
|
Separator: typeof Separator_4;
|
|
5687
5773
|
/**
|
|
@@ -5714,6 +5800,28 @@ declare interface MenuBarExtraMembers {
|
|
|
5714
5800
|
* ```
|
|
5715
5801
|
*/
|
|
5716
5802
|
Submenu: typeof Submenu_2;
|
|
5803
|
+
/**
|
|
5804
|
+
* A section of related {@link MenuBarExtra.Item} or {@link MenuBarExtra.Submenu} with an optional title.
|
|
5805
|
+
*
|
|
5806
|
+
* @example
|
|
5807
|
+
* ```typescript
|
|
5808
|
+
* import { MenuBarExtra } from "@raycast/api";
|
|
5809
|
+
*
|
|
5810
|
+
* export default function Command() {
|
|
5811
|
+
* return (
|
|
5812
|
+
* <MenuBarExtra icon="https://github.githubassets.com/favicons/favicon.png" tooltip="Your Pull Requests">
|
|
5813
|
+
* <MenuBarExtra.Section title="Open Pull Requests">
|
|
5814
|
+
* <MenuBarExtra.Item title="Add an amazing feature" subtitle="#1" />
|
|
5815
|
+
* </MenuBarExtra.Section>
|
|
5816
|
+
* <MenuBarExtra.Section title="Closed Pull Requests" />
|
|
5817
|
+
* <MenuBarExtra.Item title="Fixed gnarly bug" subtitle="#2" />
|
|
5818
|
+
* </MenuBarExtra.Section>
|
|
5819
|
+
* </MenuBarExtra>
|
|
5820
|
+
* );
|
|
5821
|
+
* }
|
|
5822
|
+
* ```
|
|
5823
|
+
*/
|
|
5824
|
+
Section: typeof Section_4;
|
|
5717
5825
|
}
|
|
5718
5826
|
|
|
5719
5827
|
declare interface MenuBarExtraProps {
|
|
@@ -6647,6 +6755,11 @@ declare const Section_2: FunctionComponent<SectionProps_2>;
|
|
|
6647
6755
|
*/
|
|
6648
6756
|
declare const Section_3: FunctionComponent<SectionProps_3>;
|
|
6649
6757
|
|
|
6758
|
+
/**
|
|
6759
|
+
* See {@link MenuBarExtra.Section}
|
|
6760
|
+
*/
|
|
6761
|
+
declare const Section_4: FunctionComponent<SectionProps_4>;
|
|
6762
|
+
|
|
6650
6763
|
declare type SectionChildren = ReactElement<ActionProps> | ReactElement<ActionProps>[] | ReactElement<SubmenuProps> | Array<ReactElement<SubmenuProps>> | Array<ReactElement<SubmenuProps> | ReactElement<ActionProps>> | null;
|
|
6651
6764
|
|
|
6652
6765
|
/**
|
|
@@ -6696,6 +6809,35 @@ declare interface SectionProps_3 {
|
|
|
6696
6809
|
* An optional subtitle displayed next to the title of the section.
|
|
6697
6810
|
*/
|
|
6698
6811
|
subtitle?: string;
|
|
6812
|
+
/**
|
|
6813
|
+
* Column count for the section. Minimum value is 1, maximum value is 8.
|
|
6814
|
+
*
|
|
6815
|
+
* @defaultValue 5
|
|
6816
|
+
*/
|
|
6817
|
+
columns?: number;
|
|
6818
|
+
/**
|
|
6819
|
+
* Aspect ratio for the {@link Grid.Item} elements. Defaults to 1.
|
|
6820
|
+
*/
|
|
6821
|
+
aspectRatio?: `${GridAspectRatio}`;
|
|
6822
|
+
/**
|
|
6823
|
+
* Fit for the {@link Grid.Item} element content. Defaults to "contain"
|
|
6824
|
+
*/
|
|
6825
|
+
fit?: GridFit;
|
|
6826
|
+
/**
|
|
6827
|
+
* Inset for the {@link Grid.Item} element content. Defaults to "none".
|
|
6828
|
+
*/
|
|
6829
|
+
inset?: GridInset;
|
|
6830
|
+
}
|
|
6831
|
+
|
|
6832
|
+
declare interface SectionProps_4 {
|
|
6833
|
+
/**
|
|
6834
|
+
* The item elements of the section.
|
|
6835
|
+
*/
|
|
6836
|
+
children?: ReactNode;
|
|
6837
|
+
/**
|
|
6838
|
+
* Title displayed above the section
|
|
6839
|
+
*/
|
|
6840
|
+
title?: string;
|
|
6699
6841
|
}
|
|
6700
6842
|
|
|
6701
6843
|
/**
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -102,7 +102,7 @@ export declare namespace Action {
|
|
|
102
102
|
/**
|
|
103
103
|
* Props of the {@link Action.SubmitForm} React component.
|
|
104
104
|
*/
|
|
105
|
-
export type Props<T> = SubmitFormProps<T>;
|
|
105
|
+
export type Props<T extends Form.Values> = SubmitFormProps<T>;
|
|
106
106
|
}
|
|
107
107
|
export namespace Trash {
|
|
108
108
|
/**
|
|
@@ -702,10 +702,10 @@ export declare function clearSearchBar(options?: {
|
|
|
702
702
|
|
|
703
703
|
export declare namespace Clipboard {
|
|
704
704
|
/**
|
|
705
|
-
* Copies
|
|
705
|
+
* Copies content to the clipboard.
|
|
706
706
|
*
|
|
707
|
-
* @param
|
|
708
|
-
* @returns A Promise that resolves when the
|
|
707
|
+
* @param content - The content to copy to the clipboard.
|
|
708
|
+
* @returns A Promise that resolves when the content is copied to the clipboard.
|
|
709
709
|
*
|
|
710
710
|
* @example
|
|
711
711
|
* ```typescript
|
|
@@ -713,10 +713,22 @@ export declare namespace Clipboard {
|
|
|
713
713
|
*
|
|
714
714
|
* export default async () => {
|
|
715
715
|
* await Clipboard.copy("https://raycast.com");
|
|
716
|
+
*
|
|
717
|
+
* const textContent: Clipboard.Content = {
|
|
718
|
+
* text: "https://raycast.com",
|
|
719
|
+
* }
|
|
720
|
+
*
|
|
721
|
+
* await Clipboard.copy(textContent);
|
|
722
|
+
*
|
|
723
|
+
* const fileContent: Clipboard.Content = {
|
|
724
|
+
* file: "/path/to/file.pdf",
|
|
725
|
+
* }
|
|
726
|
+
*
|
|
727
|
+
* await Clipboard.copy(fileContent);
|
|
716
728
|
* };
|
|
717
729
|
* ```
|
|
718
730
|
*/
|
|
719
|
-
export function copy(
|
|
731
|
+
export function copy(content: string | Content): Promise<void>;
|
|
720
732
|
/**
|
|
721
733
|
* Clears the current clipboard contents.
|
|
722
734
|
*
|
|
@@ -733,10 +745,10 @@ export declare namespace Clipboard {
|
|
|
733
745
|
*/
|
|
734
746
|
export function clear(): Promise<void>;
|
|
735
747
|
/**
|
|
736
|
-
* Pastes
|
|
748
|
+
* Pastes content to the current selection of the frontmost application.
|
|
737
749
|
*
|
|
738
|
-
* @param
|
|
739
|
-
* @returns A Promise that resolves when the
|
|
750
|
+
* @param content - The content to insert at the cursor.
|
|
751
|
+
* @returns A Promise that resolves when the content is pasted.
|
|
740
752
|
*
|
|
741
753
|
* @example
|
|
742
754
|
* ```typescript
|
|
@@ -747,7 +759,7 @@ export declare namespace Clipboard {
|
|
|
747
759
|
* };
|
|
748
760
|
* ```
|
|
749
761
|
*/
|
|
750
|
-
export function paste(
|
|
762
|
+
export function paste(content: string | Content): Promise<void>;
|
|
751
763
|
/**
|
|
752
764
|
* Reads the clipboard as plain text.
|
|
753
765
|
*
|
|
@@ -764,6 +776,36 @@ export declare namespace Clipboard {
|
|
|
764
776
|
* ```
|
|
765
777
|
*/
|
|
766
778
|
export function readText(): Promise<string | undefined>;
|
|
779
|
+
/**
|
|
780
|
+
* Type of the content copied and pasted to and from the {@link Clipboard}.
|
|
781
|
+
*
|
|
782
|
+
* @example
|
|
783
|
+
* ```typescript
|
|
784
|
+
* import { Clipboard } from "@raycast/api";
|
|
785
|
+
*
|
|
786
|
+
* const textContent: Clipboard.Content = {
|
|
787
|
+
* text: "text to copy",
|
|
788
|
+
* }
|
|
789
|
+
*
|
|
790
|
+
* const fileContent: Clipboard.Content = {
|
|
791
|
+
* file: "/path/to/file.pdf",
|
|
792
|
+
* }
|
|
793
|
+
* ```
|
|
794
|
+
*/
|
|
795
|
+
export type Content = {
|
|
796
|
+
/**
|
|
797
|
+
* The text representation of the content.
|
|
798
|
+
*/
|
|
799
|
+
text: string;
|
|
800
|
+
} | {
|
|
801
|
+
/**
|
|
802
|
+
* The file representation of the content.
|
|
803
|
+
*
|
|
804
|
+
* @remarks
|
|
805
|
+
* At the moment only file paths represented as a string are supported.
|
|
806
|
+
*/
|
|
807
|
+
file: PathLike;
|
|
808
|
+
};
|
|
767
809
|
}
|
|
768
810
|
|
|
769
811
|
/**
|
|
@@ -3807,10 +3849,18 @@ export declare namespace Grid {
|
|
|
3807
3849
|
* Props of the {@link Grid} React component.
|
|
3808
3850
|
*/
|
|
3809
3851
|
export type Props = GridProps;
|
|
3852
|
+
/**
|
|
3853
|
+
* Allowed `aspectRatio` values.
|
|
3854
|
+
*/
|
|
3855
|
+
export type AspectRatio = `${GridAspectRatio}`;
|
|
3810
3856
|
/**
|
|
3811
3857
|
* Enum representing the amount of space there should be between a {@link Grid.Item}'s content and its borders.
|
|
3812
3858
|
*/
|
|
3813
3859
|
export type Inset = GridInset;
|
|
3860
|
+
/**
|
|
3861
|
+
* Enum representing the a {@link Grid.Items}'s fit.
|
|
3862
|
+
*/
|
|
3863
|
+
export type Fit = GridFit;
|
|
3814
3864
|
/**
|
|
3815
3865
|
* Enum representing the number of items that should be displayed on a single row.
|
|
3816
3866
|
*/
|
|
@@ -3850,7 +3900,21 @@ export declare namespace Grid {
|
|
|
3850
3900
|
}
|
|
3851
3901
|
}
|
|
3852
3902
|
|
|
3903
|
+
declare enum GridAspectRatio {
|
|
3904
|
+
One = "1",
|
|
3905
|
+
ThreeToTwo = "3/2",
|
|
3906
|
+
TwoToThree = "2/3",
|
|
3907
|
+
SixteenToNine = "16/9",
|
|
3908
|
+
NineToSixteen = "9/16"
|
|
3909
|
+
}
|
|
3910
|
+
|
|
3911
|
+
declare enum GridFit {
|
|
3912
|
+
Contain = "contain",
|
|
3913
|
+
Fill = "fill"
|
|
3914
|
+
}
|
|
3915
|
+
|
|
3853
3916
|
declare enum GridInset {
|
|
3917
|
+
Zero = "zero",
|
|
3854
3918
|
Small = "sm",
|
|
3855
3919
|
Medium = "md",
|
|
3856
3920
|
Large = "lg"
|
|
@@ -3869,8 +3933,14 @@ declare interface GridMembers {
|
|
|
3869
3933
|
Inset: typeof GridInset;
|
|
3870
3934
|
/**
|
|
3871
3935
|
* Enum representing the size of the Grid's child {@link Grid.Item}s.
|
|
3936
|
+
*
|
|
3937
|
+
* @deprecated Use the `columns` number prop instead.
|
|
3872
3938
|
*/
|
|
3873
3939
|
ItemSize: typeof GridItemSize;
|
|
3940
|
+
/**
|
|
3941
|
+
* Enum representing the a {@link Grid.Items}'s fit.
|
|
3942
|
+
*/
|
|
3943
|
+
Fit: typeof GridFit;
|
|
3874
3944
|
/**
|
|
3875
3945
|
* A view to display when there aren't any items available. Use to greet users with a friendly message if the
|
|
3876
3946
|
* extension requires user input before it can show any grid items e.g. when searching for a package, an article etc.
|
|
@@ -4018,12 +4088,26 @@ declare interface GridProps extends ActionsInterface, NavigationChildInterface {
|
|
|
4018
4088
|
* Grid sections or items. If {@link Grid.Item} elements are specified, a default section is automatically created.
|
|
4019
4089
|
*/
|
|
4020
4090
|
children?: ReactNode;
|
|
4091
|
+
/**
|
|
4092
|
+
* Column count for the grid's sections. Minimum value is 1, maximum value is 8.
|
|
4093
|
+
*
|
|
4094
|
+
* @defaultValue 5
|
|
4095
|
+
*/
|
|
4096
|
+
columns?: number;
|
|
4021
4097
|
/**
|
|
4022
4098
|
* The number of items that should be displayed on a single row.
|
|
4023
4099
|
*
|
|
4024
|
-
* @
|
|
4100
|
+
* @deprecated use `columns` instead.
|
|
4025
4101
|
*/
|
|
4026
4102
|
itemSize?: Grid.ItemSize;
|
|
4103
|
+
/**
|
|
4104
|
+
* Aspect ratio for the {@link Grid.Item} elements. Defaults to 1.
|
|
4105
|
+
*/
|
|
4106
|
+
aspectRatio?: Grid.AspectRatio;
|
|
4107
|
+
/**
|
|
4108
|
+
* Fit for the {@link Grid.Item} element content. Defaults to "contain"
|
|
4109
|
+
*/
|
|
4110
|
+
fit?: Grid.Fit;
|
|
4027
4111
|
/**
|
|
4028
4112
|
* Indicates how much space there should be between a {@link Grid.Item}s' content and its borders.
|
|
4029
4113
|
* The absolute value depends on the value of the `itemSize` prop.
|
|
@@ -4031,8 +4115,11 @@ declare interface GridProps extends ActionsInterface, NavigationChildInterface {
|
|
|
4031
4115
|
inset?: Grid.Inset;
|
|
4032
4116
|
/**
|
|
4033
4117
|
* Callback triggered when the item selection in the grid changes.
|
|
4118
|
+
*
|
|
4119
|
+
* When the received id is `null`, it means that all items have been filtered out
|
|
4120
|
+
* and that there are no item selected
|
|
4034
4121
|
*/
|
|
4035
|
-
onSelectionChange?: (id
|
|
4122
|
+
onSelectionChange?: (id: string | null) => void;
|
|
4036
4123
|
/**
|
|
4037
4124
|
* {@link Grid.Dropdown} that will be shown in the right-hand-side of the search bar.
|
|
4038
4125
|
*/
|
|
@@ -4405,6 +4492,7 @@ export declare enum Icon {
|
|
|
4405
4492
|
Pencil = "pencil-16",
|
|
4406
4493
|
Person = "person-16",
|
|
4407
4494
|
PersonCircle = "person-circle-16",
|
|
4495
|
+
PersonLines = "person-lines-16",
|
|
4408
4496
|
Phone = "phone-16",
|
|
4409
4497
|
PhoneRinging = "phone-ringing-16",
|
|
4410
4498
|
PieChart = "pie-chart-16",
|
|
@@ -4905,6 +4993,10 @@ declare interface ItemProps_3 {
|
|
|
4905
4993
|
* The main title displayed for this item.
|
|
4906
4994
|
*/
|
|
4907
4995
|
title: string;
|
|
4996
|
+
/**
|
|
4997
|
+
* The subtitle displayed for this item in a slightly dimmed text color.
|
|
4998
|
+
*/
|
|
4999
|
+
subtitle?: string;
|
|
4908
5000
|
/**
|
|
4909
5001
|
* An optional icon for this item.
|
|
4910
5002
|
*/
|
|
@@ -5377,8 +5469,11 @@ declare interface ListProps_2 extends ActionsInterface, NavigationChildInterface
|
|
|
5377
5469
|
children?: ReactNode;
|
|
5378
5470
|
/**
|
|
5379
5471
|
* Callback triggered when the item selection in the list changes.
|
|
5472
|
+
*
|
|
5473
|
+
* When the received id is `null`, it means that all items have been filtered out
|
|
5474
|
+
* and that there are no item selected
|
|
5380
5475
|
*/
|
|
5381
|
-
onSelectionChange?: (id
|
|
5476
|
+
onSelectionChange?: (id: string | null) => void;
|
|
5382
5477
|
/**
|
|
5383
5478
|
* {@link List.Dropdown} that will be shown in the right-hand-side of the search bar.
|
|
5384
5479
|
*/
|
|
@@ -5388,6 +5483,7 @@ declare interface ListProps_2 extends ActionsInterface, NavigationChildInterface
|
|
|
5388
5483
|
*/
|
|
5389
5484
|
searchText?: string;
|
|
5390
5485
|
/**
|
|
5486
|
+
* @deprecated Use {@link List.filtering} instead.
|
|
5391
5487
|
* Toggles Raycast filtering. When `true`, Raycast will use the query in the search bar to filter list
|
|
5392
5488
|
* items. When `false`, the extension needs to take care of the filtering.
|
|
5393
5489
|
*
|
|
@@ -5397,6 +5493,19 @@ declare interface ListProps_2 extends ActionsInterface, NavigationChildInterface
|
|
|
5397
5493
|
* @defaultValue `false` when `onSearchTextChange` is specified, `true` otherwise.
|
|
5398
5494
|
*/
|
|
5399
5495
|
enableFiltering?: boolean;
|
|
5496
|
+
/**
|
|
5497
|
+
* Toggles Raycast filtering. When `true`, Raycast will use the query in the search bar to filter list
|
|
5498
|
+
* items. When `false`, the extension needs to take care of the filtering.
|
|
5499
|
+
*
|
|
5500
|
+
* You can further define how native filtering orders list sections by setting an object with a `keepSectionOrder` property:
|
|
5501
|
+
* When `true`, ensures that Raycast filtering maintains the section order as defined in the extension.
|
|
5502
|
+
* When `false`, filtering may change the section order depending on the ranking values of list items.
|
|
5503
|
+
*
|
|
5504
|
+
* @defaultValue `false` when `onSearchTextChange` is specified, `true` otherwise.
|
|
5505
|
+
*/
|
|
5506
|
+
filtering?: boolean | {
|
|
5507
|
+
keepSectionOrder: boolean;
|
|
5508
|
+
};
|
|
5400
5509
|
/**
|
|
5401
5510
|
* Placeholder text that will be shown in the search bar.
|
|
5402
5511
|
*
|
|
@@ -5658,30 +5767,7 @@ declare interface MenuBarExtraMembers {
|
|
|
5658
5767
|
*/
|
|
5659
5768
|
Item: typeof Item_3;
|
|
5660
5769
|
/**
|
|
5661
|
-
*
|
|
5662
|
-
*
|
|
5663
|
-
* @example
|
|
5664
|
-
* ```typescript
|
|
5665
|
-
* import { MenuBarExtra } from "@raycast/api";
|
|
5666
|
-
*
|
|
5667
|
-
* export default function Command() {
|
|
5668
|
-
* return (
|
|
5669
|
-
* <MenuBarExtra icon="https://github.githubassets.com/favicons/favicon.png" tooltip="Your Pull Requests">
|
|
5670
|
-
* <MenuBarExtra.Item title="Item 1" />
|
|
5671
|
-
* <MenuBarExtra.Separator />
|
|
5672
|
-
* <MenuBarExtra.Item title="Item 2" />
|
|
5673
|
-
* <MenuBarExtra.Separator />
|
|
5674
|
-
* <MenuBarExtra.Submenu title="Submenu 1">
|
|
5675
|
-
* <MenuBarExtra.Item title="Submenu 1 Item 1" />
|
|
5676
|
-
* </MenuBarExtra.Submenu>
|
|
5677
|
-
* <MenuBarExtra.Separator />
|
|
5678
|
-
* <MenuBarExtra.Submenu title="Submenu 2">
|
|
5679
|
-
* <MenuBarExtra.Item title="Submenu 2 Item 1" />
|
|
5680
|
-
* </MenuBarExtra.Submenu>
|
|
5681
|
-
* </MenuBarExtra>
|
|
5682
|
-
* );
|
|
5683
|
-
* }
|
|
5684
|
-
* ```
|
|
5770
|
+
* @deprecated Use {@link MenuBarExtra.Section} instead to wrap your items. A separator is added automatically.
|
|
5685
5771
|
*/
|
|
5686
5772
|
Separator: typeof Separator_4;
|
|
5687
5773
|
/**
|
|
@@ -5714,6 +5800,28 @@ declare interface MenuBarExtraMembers {
|
|
|
5714
5800
|
* ```
|
|
5715
5801
|
*/
|
|
5716
5802
|
Submenu: typeof Submenu_2;
|
|
5803
|
+
/**
|
|
5804
|
+
* A section of related {@link MenuBarExtra.Item} or {@link MenuBarExtra.Submenu} with an optional title.
|
|
5805
|
+
*
|
|
5806
|
+
* @example
|
|
5807
|
+
* ```typescript
|
|
5808
|
+
* import { MenuBarExtra } from "@raycast/api";
|
|
5809
|
+
*
|
|
5810
|
+
* export default function Command() {
|
|
5811
|
+
* return (
|
|
5812
|
+
* <MenuBarExtra icon="https://github.githubassets.com/favicons/favicon.png" tooltip="Your Pull Requests">
|
|
5813
|
+
* <MenuBarExtra.Section title="Open Pull Requests">
|
|
5814
|
+
* <MenuBarExtra.Item title="Add an amazing feature" subtitle="#1" />
|
|
5815
|
+
* </MenuBarExtra.Section>
|
|
5816
|
+
* <MenuBarExtra.Section title="Closed Pull Requests" />
|
|
5817
|
+
* <MenuBarExtra.Item title="Fixed gnarly bug" subtitle="#2" />
|
|
5818
|
+
* </MenuBarExtra.Section>
|
|
5819
|
+
* </MenuBarExtra>
|
|
5820
|
+
* );
|
|
5821
|
+
* }
|
|
5822
|
+
* ```
|
|
5823
|
+
*/
|
|
5824
|
+
Section: typeof Section_4;
|
|
5717
5825
|
}
|
|
5718
5826
|
|
|
5719
5827
|
declare interface MenuBarExtraProps {
|
|
@@ -6647,6 +6755,11 @@ declare const Section_2: FunctionComponent<SectionProps_2>;
|
|
|
6647
6755
|
*/
|
|
6648
6756
|
declare const Section_3: FunctionComponent<SectionProps_3>;
|
|
6649
6757
|
|
|
6758
|
+
/**
|
|
6759
|
+
* See {@link MenuBarExtra.Section}
|
|
6760
|
+
*/
|
|
6761
|
+
declare const Section_4: FunctionComponent<SectionProps_4>;
|
|
6762
|
+
|
|
6650
6763
|
declare type SectionChildren = ReactElement<ActionProps> | ReactElement<ActionProps>[] | ReactElement<SubmenuProps> | Array<ReactElement<SubmenuProps>> | Array<ReactElement<SubmenuProps> | ReactElement<ActionProps>> | null;
|
|
6651
6764
|
|
|
6652
6765
|
/**
|
|
@@ -6696,6 +6809,35 @@ declare interface SectionProps_3 {
|
|
|
6696
6809
|
* An optional subtitle displayed next to the title of the section.
|
|
6697
6810
|
*/
|
|
6698
6811
|
subtitle?: string;
|
|
6812
|
+
/**
|
|
6813
|
+
* Column count for the section. Minimum value is 1, maximum value is 8.
|
|
6814
|
+
*
|
|
6815
|
+
* @defaultValue 5
|
|
6816
|
+
*/
|
|
6817
|
+
columns?: number;
|
|
6818
|
+
/**
|
|
6819
|
+
* Aspect ratio for the {@link Grid.Item} elements. Defaults to 1.
|
|
6820
|
+
*/
|
|
6821
|
+
aspectRatio?: `${GridAspectRatio}`;
|
|
6822
|
+
/**
|
|
6823
|
+
* Fit for the {@link Grid.Item} element content. Defaults to "contain"
|
|
6824
|
+
*/
|
|
6825
|
+
fit?: GridFit;
|
|
6826
|
+
/**
|
|
6827
|
+
* Inset for the {@link Grid.Item} element content. Defaults to "none".
|
|
6828
|
+
*/
|
|
6829
|
+
inset?: GridInset;
|
|
6830
|
+
}
|
|
6831
|
+
|
|
6832
|
+
declare interface SectionProps_4 {
|
|
6833
|
+
/**
|
|
6834
|
+
* The item elements of the section.
|
|
6835
|
+
*/
|
|
6836
|
+
children?: ReactNode;
|
|
6837
|
+
/**
|
|
6838
|
+
* Title displayed above the section
|
|
6839
|
+
*/
|
|
6840
|
+
title?: string;
|
|
6699
6841
|
}
|
|
6700
6842
|
|
|
6701
6843
|
/**
|