@wox-launcher/wox-plugin 0.0.25 → 0.0.27

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/package.json CHANGED
@@ -1,18 +1,20 @@
1
1
  {
2
2
  "name": "@wox-launcher/wox-plugin",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "description": "All nodejs plugin for Wox should use types in this package",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/Wox-launcher/Wox.git"
8
8
  },
9
9
  "type": "module",
10
- "main": "./dist/index.js",
11
- "types": "./dist/index.d.ts",
10
+ "exports": [
11
+ "./src/index.ts"
12
+ ],
12
13
  "files": [
13
- "dist"
14
+ "src"
14
15
  ],
15
16
  "devDependencies": {
17
+ "@tsconfig/node-lts": "^18.12.5",
16
18
  "@typescript-eslint/eslint-plugin": "^6.6.0",
17
19
  "@typescript-eslint/parser": "^6.6.0",
18
20
  "eslint": "^8.49.0",
@@ -20,7 +22,6 @@
20
22
  "prettier": "3.0.2",
21
23
  "typescript": "^5.2.2"
22
24
  },
23
- "dependencies": {},
24
25
  "scripts": {
25
26
  "build": "pnpm clean && tsc",
26
27
  "clean": "node -e \"var { rmdirSync, existsSync } = require('fs'), path = require('path'); ['./dist'].forEach(fPath => {if (existsSync(path.join(__dirname, fPath))) rmdirSync(path.join(__dirname, fPath), { recursive: true })}); process.exit(0);\"",
package/src/index.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/src/index.ts ADDED
@@ -0,0 +1,76 @@
1
+ export interface Plugin {
2
+ init: (context: PluginInitContext) => Promise<void>;
3
+ query: (query: Query) => Promise<Result[]>;
4
+ }
5
+
6
+ export interface Query {
7
+ /**
8
+ * Raw query, this includes trigger keyword if it has
9
+ * We didn't recommend use this property directly. You should always use Search property.
10
+ */
11
+ RawQuery: string;
12
+ /**
13
+ * Trigger keyword of a query. It can be empty if user is using global trigger keyword.
14
+ */
15
+ TriggerKeyword?: string;
16
+ /**
17
+ * Command part of a query.
18
+ */
19
+ Command?: string;
20
+ /**
21
+ * Search part of a query.
22
+ */
23
+ Search: string;
24
+ }
25
+
26
+ export interface Result {
27
+ Id?: string;
28
+ Title: string;
29
+ SubTitle?: string;
30
+ Icon: WoxImage;
31
+ Score?: number;
32
+ Action: () => Promise<boolean>;
33
+ }
34
+
35
+ export interface PluginInitContext {
36
+ API: PublicAPI;
37
+ }
38
+
39
+ export interface PublicAPI {
40
+ /**
41
+ * Change Wox query
42
+ */
43
+ ChangeQuery: (query: string) => Promise<void>;
44
+
45
+ /**
46
+ * Hide Wox
47
+ */
48
+ HideApp: () => Promise<void>;
49
+
50
+ /**
51
+ * Show Wox
52
+ */
53
+ ShowApp: () => Promise<void>;
54
+
55
+ /**
56
+ * Show message box
57
+ */
58
+ ShowMsg: (title: string, description?: string, iconPath?: string) => Promise<void>;
59
+
60
+ /**
61
+ * Write log
62
+ */
63
+ Log: (msg: string) => Promise<void>;
64
+
65
+ /**
66
+ * Get translation of current language
67
+ */
68
+ GetTranslation: (key: string) => Promise<string>;
69
+ }
70
+
71
+ export type WoxImageType = "AbsolutePath" | "RelativeToPluginPath" | "Svg" | "Base64" | "Remote"
72
+
73
+ export interface WoxImage {
74
+ ImageType: WoxImageType;
75
+ ImageData: string;
76
+ }
package/dist/index.d.ts DELETED
@@ -1,65 +0,0 @@
1
- export interface Plugin {
2
- init: (context: PluginInitContext) => Promise<void>;
3
- query: (query: Query) => Promise<Result[]>;
4
- }
5
- export interface Query {
6
- /**
7
- * Raw query, this includes trigger keyword if it has
8
- * We didn't recommend use this property directly. You should always use Search property.
9
- */
10
- RawQuery: string;
11
- /**
12
- * Trigger keyword of a query. It can be empty if user is using global trigger keyword.
13
- */
14
- TriggerKeyword?: string;
15
- /**
16
- * Command part of a query.
17
- */
18
- Command?: string;
19
- /**
20
- * Search part of a query.
21
- */
22
- Search: string;
23
- }
24
- export interface Result {
25
- Id?: string;
26
- Title: string;
27
- SubTitle?: string;
28
- Icon: WoxImage;
29
- Score?: number;
30
- Action: () => Promise<boolean>;
31
- }
32
- export interface PluginInitContext {
33
- API: PublicAPI;
34
- }
35
- export interface PublicAPI {
36
- /**
37
- * Change Wox query
38
- */
39
- ChangeQuery: (query: string) => Promise<void>;
40
- /**
41
- * Hide Wox
42
- */
43
- HideApp: () => Promise<void>;
44
- /**
45
- * Show Wox
46
- */
47
- ShowApp: () => Promise<void>;
48
- /**
49
- * Show message box
50
- */
51
- ShowMsg: (title: string, description?: string, iconPath?: string) => Promise<void>;
52
- /**
53
- * Write log
54
- */
55
- Log: (msg: string) => Promise<void>;
56
- /**
57
- * Get translation of current language
58
- */
59
- GetTranslation: (key: string) => Promise<string>;
60
- }
61
- export type WoxImageType = "AbsolutePath" | "RelativeToPluginPath" | "Svg" | "Base64" | "Remote";
62
- export interface WoxImage {
63
- ImageType: WoxImageType;
64
- ImageData: string;
65
- }
package/dist/index.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });