@vicinae/api 0.16.4 → 0.16.6

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 (69) hide show
  1. package/README.md +1 -1
  2. package/dist/api/ai.d.ts +4 -1
  3. package/dist/api/ai.js +3 -0
  4. package/dist/api/alert.d.ts +6 -0
  5. package/dist/api/alert.js +18 -11
  6. package/dist/api/bus.d.ts +5 -0
  7. package/dist/api/bus.js +2 -0
  8. package/dist/api/cache.d.ts +5 -0
  9. package/dist/api/cache.js +2 -0
  10. package/dist/api/clipboard.d.ts +5 -0
  11. package/dist/api/clipboard.js +5 -0
  12. package/dist/api/color.d.ts +9 -0
  13. package/dist/api/color.js +3 -0
  14. package/dist/api/components/action-pannel.d.ts +32 -20
  15. package/dist/api/components/action-pannel.js +3 -0
  16. package/dist/api/components/actions.d.ts +76 -47
  17. package/dist/api/components/actions.js +3 -0
  18. package/dist/api/components/detail.d.ts +33 -8
  19. package/dist/api/components/detail.js +3 -0
  20. package/dist/api/components/form.d.ts +33 -28
  21. package/dist/api/components/form.js +3 -0
  22. package/dist/api/components/grid.d.ts +55 -0
  23. package/dist/api/components/grid.js +12 -0
  24. package/dist/api/components/index.d.ts +1 -1
  25. package/dist/api/components/index.js +3 -1
  26. package/dist/api/components/list.d.ts +159 -16
  27. package/dist/api/components/list.js +5 -2
  28. package/dist/api/components/menu-bar.d.ts +3 -0
  29. package/dist/api/components/menu-bar.js +3 -0
  30. package/dist/api/components/metadata.d.ts +5 -1
  31. package/dist/api/components/metadata.js +13 -1
  32. package/dist/api/context/navigation-provider.d.ts +3 -0
  33. package/dist/api/context/navigation-provider.js +3 -0
  34. package/dist/api/controls.d.ts +14 -0
  35. package/dist/api/controls.js +14 -1
  36. package/dist/api/environment.d.ts +11 -0
  37. package/dist/api/environment.js +11 -0
  38. package/dist/api/file-search.d.ts +1 -0
  39. package/dist/api/file-search.js +1 -0
  40. package/dist/api/hooks/index.d.ts +0 -1
  41. package/dist/api/hooks/index.js +0 -1
  42. package/dist/api/hooks/use-imperative-form-handle.d.ts +3 -3
  43. package/dist/api/hooks/use-imperative-form-handle.js +2 -2
  44. package/dist/api/hooks/use-navigation.d.ts +6 -0
  45. package/dist/api/hooks/use-navigation.js +6 -0
  46. package/dist/api/icon.d.ts +3 -0
  47. package/dist/api/icon.js +3 -0
  48. package/dist/api/image.d.ts +11 -1
  49. package/dist/api/image.js +3 -0
  50. package/dist/api/index.d.ts +2 -2
  51. package/dist/api/index.js +5 -2
  52. package/dist/api/keyboard.d.ts +9 -0
  53. package/dist/api/keyboard.js +3 -0
  54. package/dist/api/local-storage.d.ts +8 -7
  55. package/dist/api/local-storage.js +17 -8
  56. package/dist/api/oauth.d.ts +11 -9
  57. package/dist/api/oauth.js +19 -0
  58. package/dist/api/preference.d.ts +8 -0
  59. package/dist/api/preference.js +8 -0
  60. package/dist/api/toast.d.ts +8 -0
  61. package/dist/api/toast.js +8 -0
  62. package/dist/api/utils.d.ts +24 -2
  63. package/dist/api/utils.js +21 -2
  64. package/dist/api/window-management.d.ts +1 -1
  65. package/dist/api/window-management.js +1 -1
  66. package/package.json +3 -3
  67. package/types/jsx.d.ts +1 -1
  68. package/dist/api/hooks/use-applications.d.ts +0 -2
  69. package/dist/api/hooks/use-applications.js +0 -19
@@ -16,19 +16,63 @@ declare enum GridItemSize {
16
16
  Medium = "medium",// Fits 5 items per row.
17
17
  Large = "large"
18
18
  }
19
+ /**
20
+ * Controls how the grid content should fit its allocated space.
21
+ */
19
22
  declare enum GridFit {
23
+ /**
24
+ * The content will be contained within the grid cell, with vertical/horizontal bars if its aspect ratio differs from the cell's
25
+ */
20
26
  Contain = "contain",
27
+ /**
28
+ * The content will be scaled proportionally so that it fill the entire cell; parts of the content could end up being cropped out.
29
+ */
21
30
  Fill = "fill"
22
31
  }
32
+ /**
33
+ * A grid component is very similar to the {@link List} component, but is optimized to render items
34
+ * that are primarily represented as an icon or an image.
35
+ *
36
+ * Grids are commonly used to implement wallpaper, icon or emoji pickers.
37
+ *
38
+ * Grid can be organized in sections and define an arbitrary number of columns and aspect ratio.
39
+ *
40
+ * Grid can also render cells filled with a single color, which can be useful in order to implement color pickers.
41
+ *
42
+ * ![](../../../assets/grid.png)
43
+ *
44
+ * @category UI Components
45
+ */
23
46
  export declare namespace Grid {
24
47
  type BaseSection = {
48
+ /**
49
+ * Amount of space to keep free around the edges of each item.
50
+ * The real amount of space this translates to depends on the selected on the aspect ratio
51
+ * and the number of columns.
52
+ */
25
53
  inset?: GridInset;
26
54
  itemSize?: GridItemSize;
55
+ /**
56
+ * How many items to fit in a single row.
57
+ */
27
58
  columns?: number;
28
59
  fit?: GridFit;
60
+ /**
61
+ * Specific aspect ratio to enforce for every cell.
62
+ */
29
63
  aspectRatio?: Grid.AspectRatio;
30
64
  };
31
65
  export type Props = BaseSection & {
66
+ /**
67
+ * Amount of space to keep free around the edges of each item.
68
+ * The real amount of space this translates to depends on the selected on the aspect ratio
69
+ * and the number of columns.
70
+ */
71
+ inset?: GridInset;
72
+ itemSize?: GridItemSize;
73
+ columns?: number;
74
+ fit?: GridFit;
75
+ aspectRatio?: Grid.AspectRatio;
32
76
  actions?: React.ReactNode;
33
77
  children?: React.ReactNode;
34
78
  filtering?: boolean;
@@ -44,10 +88,18 @@ export declare namespace Grid {
44
88
  onSearchTextChange?: (text: string) => void;
45
89
  onSelectionChange?: (id: string) => void;
46
90
  };
91
+ /**
92
+ * A specific subsection of the grid.
93
+ * Each subsection can specificy its own number of columns and aspect ratio.
94
+ */
47
95
  export namespace Section {
48
96
  type Props = BaseSection & {
49
97
  title?: string;
50
98
  subtitle?: string;
99
+ /**
100
+ * The grid items that are part of this section.
101
+ * @see {@link Grid.Item}
102
+ */
51
103
  children?: ReactNode;
52
104
  };
53
105
  }
@@ -81,6 +133,9 @@ export declare namespace Grid {
81
133
  }
82
134
  export {};
83
135
  }
136
+ /**
137
+ * @category UI Components
138
+ */
84
139
  export declare const Grid: React.FC<Grid.Props> & {
85
140
  Section: React.FC<Grid.Section.Props>;
86
141
  EmptyView: React.FC<import("./empty-view").EmptyViewProps>;
@@ -38,9 +38,18 @@ const aspectRatioMap = {
38
38
  "32/9": 32 / 9,
39
39
  "9/32": 9 / 32,
40
40
  };
41
+ /**
42
+ * Controls how the grid content should fit its allocated space.
43
+ */
41
44
  var GridFit;
42
45
  (function (GridFit) {
46
+ /**
47
+ * The content will be contained within the grid cell, with vertical/horizontal bars if its aspect ratio differs from the cell's
48
+ */
43
49
  GridFit["Contain"] = "contain";
50
+ /**
51
+ * The content will be scaled proportionally so that it fill the entire cell; parts of the content could end up being cropped out.
52
+ */
44
53
  GridFit["Fill"] = "fill";
45
54
  })(GridFit || (GridFit = {}));
46
55
  const GridRoot = ({ searchBarAccessory, children, actions, inset, itemSize, fit = GridFit.Contain, aspectRatio = "1", ...props }) => {
@@ -98,6 +107,9 @@ const GridSection = ({ fit, aspectRatio, inset, ...props }) => {
98
107
  };
99
108
  return (0, jsx_runtime_1.jsx)("grid-section", { ...nativeProps });
100
109
  };
110
+ /**
111
+ * @category UI Components
112
+ */
101
113
  exports.Grid = Object.assign(GridRoot, {
102
114
  Section: GridSection,
103
115
  EmptyView: empty_view_1.EmptyView,
@@ -1,4 +1,4 @@
1
- export * from "./list.js";
1
+ export { List } from "./list.js";
2
2
  export * from "./grid.js";
3
3
  export * from "./detail.js";
4
4
  export * from "./action-pannel.js";
@@ -14,7 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./list.js"), exports);
17
+ exports.List = void 0;
18
+ var list_js_1 = require("./list.js");
19
+ Object.defineProperty(exports, "List", { enumerable: true, get: function () { return list_js_1.List; } });
18
20
  __exportStar(require("./grid.js"), exports);
19
21
  __exportStar(require("./detail.js"), exports);
20
22
  __exportStar(require("./action-pannel.js"), exports);
@@ -1,24 +1,118 @@
1
- import React, { ReactNode } from "react";
1
+ import type { ReactNode } from "react";
2
2
  import { type Image, type ImageLike, type SerializedImageLike } from "../image";
3
3
  import { type Color, type ColorLike, type SerializedColorLike } from "../color";
4
+ /**
5
+ * A List component that can be used to render a list of items sharing a similar representation.
6
+ *
7
+ * This component comes with many quality of life features out of the box:
8
+ *
9
+ * - Items are fuzzy searched by default, without the need for explicit filtering logic
10
+ * - Items can be grouped in sections for clearer organization
11
+ * - Search can be throttled in order to provide typeahead experiences, ideal when dealing with remote data sources
12
+ * - Builtin loading indicator to show that something is loading
13
+ * - For a specific item, can render additonal markdown and metadata in a side panel
14
+ *
15
+ * ![](../../../assets/list.png)
16
+ *
17
+ * @category UI Components
18
+ */
4
19
  export declare namespace List {
5
20
  type Props = {
21
+ /**
22
+ * Action panel to use when no list item matches the current search query.
23
+ */
6
24
  actions?: React.ReactNode;
25
+ /**
26
+ * List items or sections to render inside this list.
27
+ */
7
28
  children?: React.ReactNode;
29
+ /**
30
+ * Whether to use Vicinae's builtin fuzzy filtering.
31
+ *
32
+ * This is turned on by default unless a `onSearchTextChange` handler is passed, indicating that
33
+ * custom filtering is desired.
34
+ */
8
35
  filtering?: boolean;
9
36
  /**
10
37
  * @deprecated use filtering
11
38
  */
12
39
  enableFiltering?: boolean;
40
+ /**
41
+ * If true, a loading indicator is shown right below the search bar to indicate loading activity.
42
+ */
13
43
  isLoading?: boolean;
44
+ /**
45
+ * Whether to show the current list item's detail, if any.
46
+ * If the current list item does not have a `detail`, this does nothing.
47
+ */
14
48
  isShowingDetail?: boolean;
49
+ /**
50
+ * Bind this prop to the value of the search text. This is used to turn the List into a [controlled component](https://react.dev/learn/sharing-state-between-components#controlled-and-uncontrolled-components).
51
+ */
15
52
  searchText?: string;
53
+ /**
54
+ * The placeholder to show in the search bar if there is no search query.
55
+ */
16
56
  searchBarPlaceholder?: string;
57
+ /**
58
+ * The navigation title to display on the bottom left of the status bar, next to the command icon.
59
+ * This defaults to the name of the command.
60
+ */
17
61
  navigationTitle?: string;
62
+ /**
63
+ * Accessory to show on the right of the search input.
64
+ * The list component only supports rendering a dropdown, in order to provide more filtering options.
65
+ *
66
+ * @see Dropdown
67
+ */
18
68
  searchBarAccessory?: ReactNode;
69
+ /**
70
+ * Throttle the search so that search text change events are sent after a short delay instead of instaneously.
71
+ * **Highly** recommended if you need to fetch data on every change.
72
+ * @default false
73
+ */
74
+ throttle?: boolean;
75
+ /**
76
+ * Called every time the user modifies the search text by typing or editing.
77
+ * This can be throttled using the `throttle` prop.
78
+ *
79
+ * @param text - The new search text
80
+ */
19
81
  onSearchTextChange?: (text: string) => void;
82
+ /**
83
+ * Called every time the currently selected item changes.
84
+ * Note that this does *not* fire when transitioning from having a selected item to none at all.
85
+ */
20
86
  onSelectionChange?: (id: string) => void;
21
87
  };
88
+ /**
89
+ * List items can be organized inside sections, in order to further categorize them.
90
+ *
91
+ * Note that item inside sections still benefit from automatic fuzzy filtering, but items remain grouped by
92
+ * section no matter their matching scores.
93
+ *
94
+ * A list can render sections and render items that are not inside any section.
95
+ * While this is generally considered bad design, it will work as list items placed outside sections
96
+ * will automatically be attached to an unnamed section.
97
+ *
98
+ * @example
99
+ * ```typescript
100
+ * export default MyCommand() {
101
+ * return (
102
+ * <List>
103
+ * <List.Section title="Section 1">
104
+ * <List.Item title="Item 1" />
105
+ * <List.Item title="Item 2" />
106
+ * </List.Section />
107
+ * <List.Section title="Section 2">
108
+ * <List.Item title="Item 1" />
109
+ * <List.Item title="Item 2" />
110
+ * </List.Section />
111
+ * </List>
112
+ * );
113
+ * }
114
+ * ```
115
+ */
22
116
  namespace Section {
23
117
  type Props = {
24
118
  title?: string;
@@ -26,24 +120,70 @@ export declare namespace List {
26
120
  children?: ReactNode;
27
121
  };
28
122
  }
123
+ /**
124
+ * An individual list item rendered in a fixed size row.
125
+ */
29
126
  namespace Item {
30
127
  type Props = {
31
128
  title: string;
129
+ /**
130
+ * Additional keywords the builtin filtering will consider when ranking items.
131
+ *
132
+ * Note that keywords match with a lower score than the title or subtitle fields.
133
+ *
134
+ * If builtin filtering is disabled, these are not used.
135
+ */
32
136
  keywords?: string[];
33
- detail?: React.ReactNode;
137
+ /**
138
+ * Icon to show to the left of the item.
139
+ * @see {@link ImageLike}
140
+ */
34
141
  icon?: ImageLike | {
35
142
  value: ImageLike | undefined | null;
36
143
  tooltip: string;
37
144
  };
145
+ /**
146
+ * Unique identifier for this item.
147
+ * If not explicitly specified, Vicinae will create one automatically.
148
+ */
38
149
  id?: string;
150
+ /**
151
+ * Subtitle to show next to the title, using a dampened color.
152
+ */
39
153
  subtitle?: string;
154
+ /**
155
+ * Action panel to show when this item is selected.
156
+ */
40
157
  actions?: ReactNode;
41
158
  accessories?: List.Item.Accessory[];
159
+ /**
160
+ * Additional information to display in a side panel if it is the currently selected item.
161
+ * @see {@link List.Item.Detail}
162
+ */
163
+ detail?: React.ReactNode;
42
164
  };
165
+ /**
166
+ * Side panel which can be used to render markdown text and an optional metadata section.
167
+ * In order for a detail to be shown, the List's `isShowingDetail` prop should be set to `true` and the
168
+ * currently selected item should have a valid `detail` prop.
169
+ *
170
+ * ![](../../../assets/list-detail.png)
171
+ */
43
172
  namespace Detail {
44
173
  type Props = {
174
+ /**
175
+ * Whether to show a loading indicator under the search bar.
176
+ */
45
177
  isLoading?: boolean;
178
+ /**
179
+ * Markdown content to render in the main view.
180
+ * @see {@link Detail}
181
+ */
46
182
  markdown?: string;
183
+ /**
184
+ * Additional metadata.
185
+ * @see Metadata
186
+ */
47
187
  metadata?: React.ReactNode;
48
188
  };
49
189
  }
@@ -82,10 +222,13 @@ export type SerializedAccessory = ({
82
222
  icon?: SerializedImageLike;
83
223
  tooltip?: string | null;
84
224
  };
85
- export declare const List: React.FC<List.Props> & {
86
- Section: React.FC<List.Section.Props>;
87
- EmptyView: React.FC<import("./empty-view").EmptyViewProps>;
88
- Dropdown: React.FC<{
225
+ /**
226
+ * @category UI Components
227
+ */
228
+ export declare const List: import("react").FC<List.Props> & {
229
+ Section: import("react").FC<List.Section.Props>;
230
+ EmptyView: import("react").FC<import("./empty-view").EmptyViewProps>;
231
+ Dropdown: import("react").FC<{
89
232
  tooltip?: string;
90
233
  children?: ReactNode;
91
234
  defaultValue?: string;
@@ -99,26 +242,26 @@ export declare const List: React.FC<List.Props> & {
99
242
  onChange?: (newValue: string) => void;
100
243
  onSearchTextChange?: (text: string) => void;
101
244
  }> & {
102
- Item: React.FC<{
245
+ Item: import("react").FC<{
103
246
  title: string;
104
247
  value: string;
105
248
  icon?: Image.ImageLike;
106
249
  keywords?: string[];
107
250
  }>;
108
- Section: React.FC<{
251
+ Section: import("react").FC<{
109
252
  title?: string;
110
253
  children?: ReactNode;
111
254
  }>;
112
255
  };
113
- Item: React.FC<List.Item.Props> & {
114
- Detail: React.FC<List.Item.Detail.Props> & {
115
- Metadata: React.FC<import("./metadata").MetadataProps> & {
116
- Label: React.FC<import("./metadata").ListItemDetailMetadataLabelProps>;
117
- Separator: React.FC<{}>;
118
- TagList: React.FC<import("./tag").TagListProps> & {
119
- Item: React.FC<import("./tag").TagItemProps>;
256
+ Item: import("react").FC<List.Item.Props> & {
257
+ Detail: import("react").FC<List.Item.Detail.Props> & {
258
+ Metadata: import("react").FC<import("./metadata").MetadataProps> & {
259
+ Label: import("react").FC<import("./metadata").ListItemDetailMetadataLabelProps>;
260
+ Separator: import("react").FC<{}>;
261
+ TagList: import("react").FC<import("./tag").TagListProps> & {
262
+ Item: import("react").FC<import("./tag").TagItemProps>;
120
263
  };
121
- Link: React.FC<{
264
+ Link: import("react").FC<{
122
265
  title: string;
123
266
  target: string;
124
267
  text: string;
@@ -4,7 +4,7 @@ exports.List = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const image_1 = require("../image");
7
- const crypto_1 = require("crypto");
7
+ const node_crypto_1 = require("node:crypto");
8
8
  const metadata_1 = require("./metadata");
9
9
  const empty_view_1 = require("./empty-view");
10
10
  const color_1 = require("../color");
@@ -49,7 +49,7 @@ const ListRoot = ({ searchBarAccessory, children, actions, ...props }) => {
49
49
  return ((0, jsx_runtime_1.jsxs)("list", { ...props, children: [searchBarAccessory, children, actions] }));
50
50
  };
51
51
  const ListItem = ({ detail, actions, icon, accessories, ...props }) => {
52
- const id = (0, react_1.useRef)(props.id ?? (0, crypto_1.randomUUID)());
52
+ const id = (0, react_1.useRef)(props.id ?? (0, node_crypto_1.randomUUID)());
53
53
  // Icon
54
54
  let serializedIcon;
55
55
  if (icon && typeof icon === "object" && "value" in icon) {
@@ -71,6 +71,9 @@ const ListItemDetail = ({ metadata, ...props }) => {
71
71
  const ListSection = (props) => {
72
72
  return (0, jsx_runtime_1.jsx)("list-section", { ...props });
73
73
  };
74
+ /**
75
+ * @category UI Components
76
+ */
74
77
  exports.List = Object.assign(ListRoot, {
75
78
  Section: ListSection,
76
79
  EmptyView: empty_view_1.EmptyView,
@@ -17,6 +17,9 @@ type MenuBarExtraItemProps = {
17
17
  tooltip?: string;
18
18
  onAction?: (event: any) => void;
19
19
  };
20
+ /**
21
+ * @ignore
22
+ */
20
23
  export declare const MenuBarExtra: import("react").FC<MenuBarExtraProps> & {
21
24
  Item: import("react").FC<MenuBarExtraItemProps>;
22
25
  Submenu: import("react").FC<any>;
@@ -17,6 +17,9 @@ const Section = () => {
17
17
  const Separator = () => {
18
18
  return (0, jsx_runtime_1.jsx)("separator", {});
19
19
  };
20
+ /**
21
+ * @ignore
22
+ */
20
23
  exports.MenuBarExtra = Object.assign(Root, {
21
24
  Item,
22
25
  Submenu,
@@ -1,11 +1,15 @@
1
1
  import React from "react";
2
2
  import { type ImageLike } from "../image";
3
+ import { type ColorLike } from "../color";
3
4
  export type MetadataProps = {
4
5
  children?: React.ReactNode;
5
6
  };
6
7
  export type ListItemDetailMetadataLabelProps = {
7
8
  title: string;
8
- text: string;
9
+ text: string | {
10
+ color?: ColorLike;
11
+ value: string;
12
+ };
9
13
  icon?: ImageLike;
10
14
  };
11
15
  export type ListItemDetailMetadataSeparator = {};
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Metadata = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const image_1 = require("../image");
6
+ const color_1 = require("../color");
6
7
  const tag_1 = require("./tag");
7
8
  const MetadataRoot = (props) => {
8
9
  return (0, jsx_runtime_1.jsx)("metadata", { ...props });
@@ -11,7 +12,18 @@ const MetadataLabel = (props) => {
11
12
  const serializedIcon = props.icon
12
13
  ? (0, image_1.serializeProtoImage)(props.icon)
13
14
  : props.icon;
14
- return (0, jsx_runtime_1.jsx)("metadata-label", { ...props, icon: serializedIcon });
15
+ let serializedText;
16
+ if (props.text && typeof props.text === "object") {
17
+ serializedText = {
18
+ color: props.text.color ? (0, color_1.serializeColorLike)(props.text.color) : undefined,
19
+ value: props.text.value,
20
+ };
21
+ }
22
+ else {
23
+ serializedText = props.text;
24
+ }
25
+ const { text, ...restProps } = props;
26
+ return (0, jsx_runtime_1.jsx)("metadata-label", { ...restProps, icon: serializedIcon, text: serializedText });
15
27
  };
16
28
  const MetadataSeparator = () => {
17
29
  return (0, jsx_runtime_1.jsx)("metadata-separator", {});
@@ -1,4 +1,7 @@
1
1
  import React, { ReactNode } from "react";
2
+ /**
3
+ * @ignore
4
+ */
2
5
  export declare const NavigationProvider: React.FC<{
3
6
  root: ReactNode;
4
7
  }>;
@@ -11,6 +11,9 @@ const bus_1 = require("../bus");
11
11
  const View = ({ children }) => {
12
12
  return (0, jsx_runtime_1.jsx)("view", { children: children });
13
13
  };
14
+ /**
15
+ * @ignore
16
+ */
14
17
  const NavigationProvider = ({ root }) => {
15
18
  const [navStack, setNavStack] = (0, react_1.useState)([root]);
16
19
  const pop = () => {
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @category Launcher Window
3
+ */
1
4
  export declare enum PopToRootType {
2
5
  /**
3
6
  * Translates to Immediate or Suspended depending on the
@@ -20,6 +23,8 @@ export declare enum PopToRootType {
20
23
  * by passing options to this function.
21
24
  *
22
25
  * @see closeWindow
26
+ *
27
+ * @category Launcher Window
23
28
  */
24
29
  export declare const showHUD: (title: string, options?: {
25
30
  clearRootSearch?: boolean;
@@ -28,20 +33,29 @@ export declare const showHUD: (title: string, options?: {
28
33
  /**
29
34
  * Close the vicinae launcher window immediately.
30
35
  * It is possible to override the `popToRoot` behavior defined in the settings using the options object.
36
+ *
37
+ * @category Launcher Window
31
38
  */
32
39
  export declare const closeMainWindow: (options?: {
33
40
  clearRootSearch?: boolean;
34
41
  popToRootType?: PopToRootType;
35
42
  }) => Promise<void>;
43
+ /**
44
+ * @category Launcher Window
45
+ */
36
46
  export declare const clearSearchBar: () => Promise<void>;
37
47
  /**
38
48
  * Get the text that is currently selected by the user.
39
49
  * How this is implemented depends on the environment but all it does is usually
40
50
  * read the clipboard's primary selection buffer.
51
+ *
52
+ * @category Launcher Window
41
53
  */
42
54
  export declare const getSelectedText: () => Promise<string>;
43
55
  /**
44
56
  * Pop to the root of the navigation stack, optionally clearing the search bar.
57
+ *
58
+ * @category Launcher Window
45
59
  */
46
60
  export declare const popToRoot: (options?: {
47
61
  clearSearchBar?: boolean;
@@ -36,7 +36,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.popToRoot = exports.getSelectedText = exports.clearSearchBar = exports.closeMainWindow = exports.showHUD = exports.PopToRootType = void 0;
37
37
  const bus_1 = require("./bus");
38
38
  const ui = __importStar(require("./proto/ui"));
39
- //e
39
+ /**
40
+ * @category Launcher Window
41
+ */
40
42
  var PopToRootType;
41
43
  (function (PopToRootType) {
42
44
  /**
@@ -65,6 +67,8 @@ const popToRootProtoMap = {
65
67
  * by passing options to this function.
66
68
  *
67
69
  * @see closeWindow
70
+ *
71
+ * @category Launcher Window
68
72
  */
69
73
  const showHUD = async (title, options) => {
70
74
  bus_1.bus.turboRequest("ui.showHud", {
@@ -77,6 +81,8 @@ exports.showHUD = showHUD;
77
81
  /**
78
82
  * Close the vicinae launcher window immediately.
79
83
  * It is possible to override the `popToRoot` behavior defined in the settings using the options object.
84
+ *
85
+ * @category Launcher Window
80
86
  */
81
87
  const closeMainWindow = async (options = {}) => {
82
88
  const { clearRootSearch = false, popToRootType = PopToRootType.Default } = options;
@@ -86,6 +92,9 @@ const closeMainWindow = async (options = {}) => {
86
92
  });
87
93
  };
88
94
  exports.closeMainWindow = closeMainWindow;
95
+ /**
96
+ * @category Launcher Window
97
+ */
89
98
  const clearSearchBar = async () => {
90
99
  await bus_1.bus.turboRequest("ui.setSearchText", { text: "" });
91
100
  };
@@ -94,6 +103,8 @@ exports.clearSearchBar = clearSearchBar;
94
103
  * Get the text that is currently selected by the user.
95
104
  * How this is implemented depends on the environment but all it does is usually
96
105
  * read the clipboard's primary selection buffer.
106
+ *
107
+ * @category Launcher Window
97
108
  */
98
109
  const getSelectedText = async () => {
99
110
  const response = await bus_1.bus.turboRequest("ui.getSelectedText", {});
@@ -105,6 +116,8 @@ const getSelectedText = async () => {
105
116
  exports.getSelectedText = getSelectedText;
106
117
  /**
107
118
  * Pop to the root of the navigation stack, optionally clearing the search bar.
119
+ *
120
+ * @category Launcher Window
108
121
  */
109
122
  const popToRoot = async (options) => {
110
123
  await bus_1.bus.turboRequest("ui.popToRoot", {
@@ -131,4 +131,15 @@ export interface Environment {
131
131
  */
132
132
  isRaycast: boolean;
133
133
  }
134
+ /**
135
+ * General information about the running extension command, the vicinae version, the capabilities of
136
+ * the system we are running on, etc...
137
+ *
138
+ * @example
139
+ * ```typescript
140
+ * import { environment } from '@vicinae/api';
141
+ *
142
+ * console.log({ environment });
143
+ * ```
144
+ */
134
145
  export declare const environment: Environment;
@@ -12,4 +12,15 @@ var LaunchType;
12
12
  */
13
13
  LaunchType["Background"] = "background";
14
14
  })(LaunchType || (exports.LaunchType = LaunchType = {}));
15
+ /**
16
+ * General information about the running extension command, the vicinae version, the capabilities of
17
+ * the system we are running on, etc...
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * import { environment } from '@vicinae/api';
22
+ *
23
+ * console.log({ environment });
24
+ * ```
25
+ */
15
26
  exports.environment = {};
@@ -15,6 +15,7 @@ import { FileInfo as ProtoFileInfo } from "./proto/file-search";
15
15
  * console.log(`Found ${results.length} files`);
16
16
  * ```
17
17
  *
18
+ * @category File Search
18
19
  * @public
19
20
  */
20
21
  export declare namespace FileSearch {
@@ -18,6 +18,7 @@ const bus_1 = require("./bus");
18
18
  * console.log(`Found ${results.length} files`);
19
19
  * ```
20
20
  *
21
+ * @category File Search
21
22
  * @public
22
23
  */
23
24
  var FileSearch;
@@ -1,2 +1 @@
1
- export * from "./use-applications";
2
1
  export * from "./use-navigation";
@@ -14,5 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./use-applications"), exports);
18
17
  __exportStar(require("./use-navigation"), exports);
@@ -1,3 +1,3 @@
1
- import { FormItemRef } from "../components/form";
2
- import { Ref } from "react";
3
- export declare const useImperativeFormHandle: (ref?: Ref<FormItemRef>) => [string];
1
+ import type { Form } from "../components/form";
2
+ import type { Ref } from "react";
3
+ export declare const useImperativeFormHandle: (ref?: Ref<Form.ItemReference>) => [string];