@vicinae/api 0.16.5 → 0.16.7
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/README.md +1 -1
- package/dist/api/ai.d.ts +4 -1
- package/dist/api/ai.js +3 -0
- package/dist/api/alert.d.ts +6 -0
- package/dist/api/alert.js +18 -11
- package/dist/api/bus.d.ts +6 -0
- package/dist/api/bus.js +2 -0
- package/dist/api/cache.d.ts +5 -0
- package/dist/api/cache.js +2 -0
- package/dist/api/clipboard.d.ts +6 -1
- package/dist/api/clipboard.js +6 -1
- package/dist/api/color.d.ts +9 -0
- package/dist/api/color.js +3 -0
- package/dist/api/components/action-pannel.d.ts +32 -20
- package/dist/api/components/action-pannel.js +3 -0
- package/dist/api/components/actions.d.ts +76 -47
- package/dist/api/components/actions.js +3 -0
- package/dist/api/components/detail.d.ts +33 -8
- package/dist/api/components/detail.js +3 -0
- package/dist/api/components/form.d.ts +33 -28
- package/dist/api/components/form.js +3 -0
- package/dist/api/components/grid.d.ts +55 -0
- package/dist/api/components/grid.js +12 -0
- package/dist/api/components/index.d.ts +1 -1
- package/dist/api/components/index.js +3 -1
- package/dist/api/components/list.d.ts +159 -16
- package/dist/api/components/list.js +5 -2
- package/dist/api/components/menu-bar.d.ts +3 -0
- package/dist/api/components/menu-bar.js +3 -0
- package/dist/api/components/metadata.d.ts +5 -1
- package/dist/api/components/metadata.js +13 -1
- package/dist/api/context/navigation-provider.d.ts +3 -0
- package/dist/api/context/navigation-provider.js +3 -0
- package/dist/api/controls.d.ts +14 -0
- package/dist/api/controls.js +14 -1
- package/dist/api/environment.d.ts +11 -0
- package/dist/api/environment.js +11 -0
- package/dist/api/file-search.d.ts +1 -0
- package/dist/api/file-search.js +1 -0
- package/dist/api/hooks/index.d.ts +0 -1
- package/dist/api/hooks/index.js +0 -1
- package/dist/api/hooks/use-imperative-form-handle.d.ts +3 -3
- package/dist/api/hooks/use-imperative-form-handle.js +2 -2
- package/dist/api/hooks/use-navigation.d.ts +6 -0
- package/dist/api/hooks/use-navigation.js +6 -0
- package/dist/api/icon.d.ts +3 -0
- package/dist/api/icon.js +3 -0
- package/dist/api/image.d.ts +11 -1
- package/dist/api/image.js +3 -0
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.js +5 -2
- package/dist/api/keyboard.d.ts +9 -0
- package/dist/api/keyboard.js +3 -0
- package/dist/api/local-storage.d.ts +8 -7
- package/dist/api/local-storage.js +17 -8
- package/dist/api/oauth.d.ts +11 -9
- package/dist/api/oauth.js +19 -0
- package/dist/api/preference.d.ts +8 -0
- package/dist/api/preference.js +8 -0
- package/dist/api/proto/wm.d.ts +11 -0
- package/dist/api/proto/wm.js +183 -19
- package/dist/api/toast.d.ts +8 -0
- package/dist/api/toast.js +8 -0
- package/dist/api/utils.d.ts +24 -2
- package/dist/api/utils.js +21 -2
- package/dist/api/window-management.d.ts +52 -4
- package/dist/api/window-management.js +34 -8
- package/package.json +3 -3
- package/types/jsx.d.ts +1 -1
- package/dist/api/hooks/use-applications.d.ts +0 -2
- package/dist/api/hooks/use-applications.js +0 -19
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useImperativeFormHandle = void 0;
|
|
4
|
-
const crypto_1 = require("crypto");
|
|
5
4
|
const react_1 = require("react");
|
|
6
5
|
const bus_1 = require("../bus");
|
|
6
|
+
const node_crypto_1 = require("node:crypto");
|
|
7
7
|
const useImperativeFormHandle = (ref) => {
|
|
8
|
-
const handleId = (0, react_1.useRef)((0,
|
|
8
|
+
const handleId = (0, react_1.useRef)((0, node_crypto_1.randomUUID)());
|
|
9
9
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
10
10
|
return {
|
|
11
11
|
focus: () => {
|
|
@@ -6,6 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.useNavigation = void 0;
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const navigation_context_1 = __importDefault(require("../context/navigation-context"));
|
|
9
|
+
/**
|
|
10
|
+
* A React hook that lets you access methods to push and pop views
|
|
11
|
+
* on the navigation stack.
|
|
12
|
+
*
|
|
13
|
+
* @category Navigation
|
|
14
|
+
*/
|
|
9
15
|
const useNavigation = () => {
|
|
10
16
|
const { push, pop } = (0, react_1.useContext)(navigation_context_1.default);
|
|
11
17
|
return { push, pop };
|
package/dist/api/icon.d.ts
CHANGED
package/dist/api/icon.js
CHANGED
package/dist/api/image.d.ts
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import { type ColorLike } from "./color";
|
|
2
2
|
import type { Icon } from "./icon";
|
|
3
3
|
import * as ui from "./proto/ui";
|
|
4
|
+
/**
|
|
5
|
+
* Representation of an image, renderable everywhere Vicine expects them.
|
|
6
|
+
* @category Image
|
|
7
|
+
*/
|
|
4
8
|
export type Image = {
|
|
5
9
|
source: Image.Source;
|
|
6
10
|
fallback?: Image.Fallback | undefined | null;
|
|
7
11
|
tintColor?: ColorLike | undefined | null;
|
|
8
12
|
mask?: Image.Mask | undefined | null;
|
|
9
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* @category Image
|
|
16
|
+
*/
|
|
10
17
|
export type ImageLike = Image.ImageLike;
|
|
11
18
|
export type SerializedImageLike = URL | Image.Asset | Icon | ui.Image | Image.ThemedImage;
|
|
19
|
+
/**
|
|
20
|
+
* @category Image
|
|
21
|
+
*/
|
|
12
22
|
export declare namespace Image {
|
|
13
23
|
type Asset = string;
|
|
14
24
|
type ThemedSource = {
|
|
@@ -17,11 +27,11 @@ export declare namespace Image {
|
|
|
17
27
|
};
|
|
18
28
|
type Fallback = Source;
|
|
19
29
|
type Source = URL | Asset | ThemedSource;
|
|
20
|
-
type ImageLike = URL | Image.Asset | Icon | Image | ThemedImage;
|
|
21
30
|
type ThemedImage = {
|
|
22
31
|
light: URL | Asset;
|
|
23
32
|
dark: URL | Asset;
|
|
24
33
|
};
|
|
34
|
+
type ImageLike = URL | Image.Asset | Icon | Image | Image.ThemedImage;
|
|
25
35
|
enum Mask {
|
|
26
36
|
Circle = "circle",
|
|
27
37
|
RoundedRectangle = "roundedRectangle"
|
package/dist/api/image.js
CHANGED
|
@@ -36,6 +36,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.serializeProtoImage = exports.Image = void 0;
|
|
37
37
|
const color_1 = require("./color");
|
|
38
38
|
const ui = __importStar(require("./proto/ui"));
|
|
39
|
+
/**
|
|
40
|
+
* @category Image
|
|
41
|
+
*/
|
|
39
42
|
var Image;
|
|
40
43
|
(function (Image) {
|
|
41
44
|
let Mask;
|
package/dist/api/index.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ export * from "./components/index.js";
|
|
|
3
3
|
export * from "./hooks/index.js";
|
|
4
4
|
export * from "./context/index.js";
|
|
5
5
|
export * from "./bus.js";
|
|
6
|
-
export
|
|
6
|
+
export { Color, ColorLike } from "./color.js";
|
|
7
7
|
export * from "./keyboard.js";
|
|
8
|
-
export
|
|
8
|
+
export { ImageLike, Image } from "./image.js";
|
|
9
9
|
export * from "./icon.js";
|
|
10
10
|
export * from "./environment.js";
|
|
11
11
|
export * from "./controls.js";
|
package/dist/api/index.js
CHANGED
|
@@ -14,14 +14,17 @@ 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
|
+
exports.Image = exports.Color = void 0;
|
|
17
18
|
__exportStar(require("./ai.js"), exports);
|
|
18
19
|
__exportStar(require("./components/index.js"), exports);
|
|
19
20
|
__exportStar(require("./hooks/index.js"), exports);
|
|
20
21
|
__exportStar(require("./context/index.js"), exports);
|
|
21
22
|
__exportStar(require("./bus.js"), exports);
|
|
22
|
-
|
|
23
|
+
var color_js_1 = require("./color.js");
|
|
24
|
+
Object.defineProperty(exports, "Color", { enumerable: true, get: function () { return color_js_1.Color; } });
|
|
23
25
|
__exportStar(require("./keyboard.js"), exports);
|
|
24
|
-
|
|
26
|
+
var image_js_1 = require("./image.js");
|
|
27
|
+
Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return image_js_1.Image; } });
|
|
25
28
|
__exportStar(require("./icon.js"), exports);
|
|
26
29
|
__exportStar(require("./environment.js"), exports);
|
|
27
30
|
__exportStar(require("./controls.js"), exports);
|
package/dist/api/keyboard.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @category Keyboard
|
|
3
|
+
*/
|
|
1
4
|
export type KeyEquivalent = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "." | "," | ";" | "=" | "+" | "-" | "[" | "]" | "{" | "}" | "«" | "»" | "(" | ")" | "/" | "\\" | "'" | "`" | "§" | "^" | "@" | "$" | "return" | "delete" | "deleteForward" | "tab" | "arrowUp" | "arrowDown" | "arrowLeft" | "arrowRight" | "pageUp" | "pageDown" | "home" | "end" | "space" | "escape" | "enter" | "backspace";
|
|
5
|
+
/**
|
|
6
|
+
* @category Keyboard
|
|
7
|
+
*/
|
|
2
8
|
export type KeyModifier = "cmd" | "ctrl" | "opt" | "shift";
|
|
9
|
+
/**
|
|
10
|
+
* @category Keyboard
|
|
11
|
+
*/
|
|
3
12
|
export declare namespace Keyboard {
|
|
4
13
|
namespace Shortcut {
|
|
5
14
|
type Common = "copy" | "copy-deeplink" | "copy-name" | "copy-path" | "save" | "duplicate" | "edit" | "move-down" | "move-up" | "new" | "open" | "open-with" | "pin" | "refresh" | "remove" | "remove-all";
|
package/dist/api/keyboard.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @category Local Storage
|
|
3
|
+
*/
|
|
1
4
|
export declare namespace LocalStorage {
|
|
2
5
|
type Value = string | number | boolean;
|
|
3
6
|
type Values = {
|
|
4
7
|
[key: string]: Value;
|
|
5
8
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
static allItems(): Promise<LocalStorage.Values>;
|
|
12
|
-
static clear(): Promise<void>;
|
|
9
|
+
function getItem<T extends LocalStorage.Value>(key: string): Promise<T | undefined>;
|
|
10
|
+
function setItem(key: string, value: LocalStorage.Value): Promise<void>;
|
|
11
|
+
function removeItem(key: string): Promise<void>;
|
|
12
|
+
function allItems(): Promise<LocalStorage.Values>;
|
|
13
|
+
function clear(): Promise<void>;
|
|
13
14
|
}
|
|
@@ -2,28 +2,37 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LocalStorage = void 0;
|
|
4
4
|
const bus_1 = require("./bus");
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
// Implementation of Raycast's storage API: https://developers.raycast.com/api-reference/storage
|
|
6
|
+
/**
|
|
7
|
+
* @category Local Storage
|
|
8
|
+
*/
|
|
9
|
+
var LocalStorage;
|
|
10
|
+
(function (LocalStorage) {
|
|
11
|
+
async function getItem(key) {
|
|
7
12
|
const res = await bus_1.bus.turboRequest("storage.get", { key });
|
|
8
13
|
if (!res.ok || res.value.value === null) {
|
|
9
14
|
return undefined;
|
|
10
15
|
}
|
|
11
16
|
return res.value.value;
|
|
12
17
|
}
|
|
13
|
-
|
|
18
|
+
LocalStorage.getItem = getItem;
|
|
19
|
+
async function setItem(key, value) {
|
|
14
20
|
await bus_1.bus.turboRequest("storage.set", { key, value });
|
|
15
21
|
}
|
|
16
|
-
|
|
22
|
+
LocalStorage.setItem = setItem;
|
|
23
|
+
async function removeItem(key) {
|
|
17
24
|
await bus_1.bus.turboRequest("storage.remove", { key });
|
|
18
25
|
}
|
|
19
|
-
|
|
26
|
+
LocalStorage.removeItem = removeItem;
|
|
27
|
+
async function allItems() {
|
|
20
28
|
const res = await bus_1.bus.turboRequest("storage.list", {});
|
|
21
29
|
if (!res.ok)
|
|
22
30
|
return {};
|
|
23
31
|
return res.value.values;
|
|
24
32
|
}
|
|
25
|
-
|
|
33
|
+
LocalStorage.allItems = allItems;
|
|
34
|
+
async function clear() {
|
|
26
35
|
await bus_1.bus.turboRequest("storage.clear", {});
|
|
27
36
|
}
|
|
28
|
-
|
|
29
|
-
exports.LocalStorage = LocalStorage;
|
|
37
|
+
LocalStorage.clear = clear;
|
|
38
|
+
})(LocalStorage || (exports.LocalStorage = LocalStorage = {}));
|
package/dist/api/oauth.d.ts
CHANGED
|
@@ -21,6 +21,9 @@ declare enum OauthRedirectMethod {
|
|
|
21
21
|
*/
|
|
22
22
|
AppURI = "appURI"
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* @category OAuth
|
|
26
|
+
*/
|
|
24
27
|
export declare namespace OAuth {
|
|
25
28
|
namespace PKCEClient {
|
|
26
29
|
/**
|
|
@@ -243,6 +246,9 @@ export declare namespace OAuth {
|
|
|
243
246
|
scope?: string;
|
|
244
247
|
}
|
|
245
248
|
}
|
|
249
|
+
/**
|
|
250
|
+
* @category OAuth
|
|
251
|
+
*/
|
|
246
252
|
export declare class PKCEClient {
|
|
247
253
|
redirectMethod: OAuth.RedirectMethod;
|
|
248
254
|
providerName: string;
|
|
@@ -298,15 +304,11 @@ export declare class PKCEClient {
|
|
|
298
304
|
*/
|
|
299
305
|
removeTokens(): Promise<void>;
|
|
300
306
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
scope?: string;
|
|
307
|
-
updatedAt: Date;
|
|
308
|
-
isExpired: () => boolean;
|
|
309
|
-
};
|
|
307
|
+
/**
|
|
308
|
+
* Main OAuth object exporting all OAuth utilities
|
|
309
|
+
*
|
|
310
|
+
* @category OAuth
|
|
311
|
+
*/
|
|
310
312
|
export declare const OAuth: {
|
|
311
313
|
PKCEClient: typeof PKCEClient;
|
|
312
314
|
RedirectMethod: typeof OauthRedirectMethod;
|
package/dist/api/oauth.js
CHANGED
|
@@ -27,6 +27,9 @@ var OauthRedirectMethod;
|
|
|
27
27
|
*/
|
|
28
28
|
OauthRedirectMethod["AppURI"] = "appURI";
|
|
29
29
|
})(OauthRedirectMethod || (OauthRedirectMethod = {}));
|
|
30
|
+
/**
|
|
31
|
+
* @category OAuth
|
|
32
|
+
*/
|
|
30
33
|
class PKCEClient {
|
|
31
34
|
redirectMethod;
|
|
32
35
|
providerName;
|
|
@@ -193,6 +196,22 @@ class PKCEClient {
|
|
|
193
196
|
}
|
|
194
197
|
}
|
|
195
198
|
exports.PKCEClient = PKCEClient;
|
|
199
|
+
/*
|
|
200
|
+
export type TokenSet = {
|
|
201
|
+
accessToken: string;
|
|
202
|
+
refreshToken?: string;
|
|
203
|
+
idToken?: string;
|
|
204
|
+
expiresIn?: number;
|
|
205
|
+
scope?: string;
|
|
206
|
+
updatedAt: Date;
|
|
207
|
+
isExpired: () => boolean;
|
|
208
|
+
};
|
|
209
|
+
*/
|
|
210
|
+
/**
|
|
211
|
+
* Main OAuth object exporting all OAuth utilities
|
|
212
|
+
*
|
|
213
|
+
* @category OAuth
|
|
214
|
+
*/
|
|
196
215
|
exports.OAuth = {
|
|
197
216
|
PKCEClient,
|
|
198
217
|
RedirectMethod: OauthRedirectMethod,
|
package/dist/api/preference.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
export declare const getPreferenceValues: <T = {
|
|
2
2
|
[preferenceName: string]: any;
|
|
3
3
|
}>() => T;
|
|
4
|
+
/**
|
|
5
|
+
* TODO: implement
|
|
6
|
+
* @ignore
|
|
7
|
+
*/
|
|
4
8
|
export declare const openExtensionPreferences: () => Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* TODO: implement
|
|
11
|
+
* @ignore
|
|
12
|
+
*/
|
|
5
13
|
export declare const openCommandPreferences: () => Promise<void>;
|
package/dist/api/preference.js
CHANGED
|
@@ -7,10 +7,18 @@ const getPreferenceValues = () => {
|
|
|
7
7
|
return preferenceValues;
|
|
8
8
|
};
|
|
9
9
|
exports.getPreferenceValues = getPreferenceValues;
|
|
10
|
+
/**
|
|
11
|
+
* TODO: implement
|
|
12
|
+
* @ignore
|
|
13
|
+
*/
|
|
10
14
|
const openExtensionPreferences = async () => {
|
|
11
15
|
console.error("openExtensionPreferences is not implemented");
|
|
12
16
|
};
|
|
13
17
|
exports.openExtensionPreferences = openExtensionPreferences;
|
|
18
|
+
/**
|
|
19
|
+
* TODO: implement
|
|
20
|
+
* @ignore
|
|
21
|
+
*/
|
|
14
22
|
const openCommandPreferences = async () => {
|
|
15
23
|
console.error("openCommandPreferences is not implemented");
|
|
16
24
|
};
|
package/dist/api/proto/wm.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Application } from "./application";
|
|
|
3
3
|
export declare const protobufPackage = "proto.ext.wm";
|
|
4
4
|
export interface Window {
|
|
5
5
|
id: string;
|
|
6
|
+
title: string;
|
|
6
7
|
workspaceId: string;
|
|
7
8
|
active: boolean;
|
|
8
9
|
fullscreen: boolean;
|
|
@@ -34,6 +35,12 @@ export interface PingRequest {
|
|
|
34
35
|
export interface PingResponse {
|
|
35
36
|
ok: boolean;
|
|
36
37
|
}
|
|
38
|
+
export interface FocusWindowRequest {
|
|
39
|
+
id: string;
|
|
40
|
+
}
|
|
41
|
+
export interface FocusWindowResponse {
|
|
42
|
+
ok: boolean;
|
|
43
|
+
}
|
|
37
44
|
export interface GetActiveWindowRequest {
|
|
38
45
|
}
|
|
39
46
|
export interface GetActiveWindowResponse {
|
|
@@ -79,6 +86,7 @@ export interface Request {
|
|
|
79
86
|
getScreens?: GetScreensRequest | undefined;
|
|
80
87
|
getWorkspaces?: GetWorkspacesRequest | undefined;
|
|
81
88
|
setWindowBounds?: SetWindowBoundsRequest | undefined;
|
|
89
|
+
focusWindow?: FocusWindowRequest | undefined;
|
|
82
90
|
}
|
|
83
91
|
export interface Response {
|
|
84
92
|
ping?: PingResponse | undefined;
|
|
@@ -88,12 +96,15 @@ export interface Response {
|
|
|
88
96
|
getScreens?: GetScreensResponse | undefined;
|
|
89
97
|
getWorkspaces?: GetWorkspacesResponse | undefined;
|
|
90
98
|
setWindowBounds?: SetWindowBoundsResponse | undefined;
|
|
99
|
+
focusWindow?: FocusWindowResponse | undefined;
|
|
91
100
|
}
|
|
92
101
|
export declare const Window: MessageFns<Window>;
|
|
93
102
|
export declare const Screen: MessageFns<Screen>;
|
|
94
103
|
export declare const Workspace: MessageFns<Workspace>;
|
|
95
104
|
export declare const PingRequest: MessageFns<PingRequest>;
|
|
96
105
|
export declare const PingResponse: MessageFns<PingResponse>;
|
|
106
|
+
export declare const FocusWindowRequest: MessageFns<FocusWindowRequest>;
|
|
107
|
+
export declare const FocusWindowResponse: MessageFns<FocusWindowResponse>;
|
|
97
108
|
export declare const GetActiveWindowRequest: MessageFns<GetActiveWindowRequest>;
|
|
98
109
|
export declare const GetActiveWindowResponse: MessageFns<GetActiveWindowResponse>;
|
|
99
110
|
export declare const GetWorkspacesRequest: MessageFns<GetWorkspacesRequest>;
|