@wox-launcher/wox-plugin 0.0.8 → 0.0.11

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.
@@ -0,0 +1,59 @@
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
+ Title: string;
26
+ Description?: string;
27
+ IcoPath: string;
28
+ Score?: number;
29
+ Action: () => boolean;
30
+ }
31
+ export interface PluginInitContext {
32
+ API: PublicAPI;
33
+ }
34
+ export interface PublicAPI {
35
+ /**
36
+ * Change Wox query
37
+ */
38
+ ChangeQuery: (query: string) => void;
39
+ /**
40
+ * Hide Wox
41
+ */
42
+ HideApp: () => void;
43
+ /**
44
+ * Show Wox
45
+ */
46
+ ShowApp: () => void;
47
+ /**
48
+ * Show message box
49
+ */
50
+ ShowMsg: (title: string, description?: string, iconPath?: string) => void;
51
+ /**
52
+ * Write log
53
+ */
54
+ Log: (msg: string) => void;
55
+ /**
56
+ * Get translation of current language
57
+ */
58
+ GetTranslation: (key: string) => string;
59
+ }
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wox-launcher/wox-plugin",
3
- "version": "0.0.8",
3
+ "version": "0.0.11",
4
4
  "description": "All nodejs plugin for Wox should use types in this package",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,6 +9,9 @@
9
9
  "type": "module",
10
10
  "main": "./dist/index.js",
11
11
  "types": "./dist/index.d.ts",
12
+ "files": [
13
+ "dist"
14
+ ],
12
15
  "devDependencies": {
13
16
  "@typescript-eslint/eslint-plugin": "^6.6.0",
14
17
  "@typescript-eslint/parser": "^6.6.0",
package/.eslintignore DELETED
@@ -1 +0,0 @@
1
- node_modules
package/.eslintrc DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "root": true,
3
- "parser": "@typescript-eslint/parser",
4
- "plugins": [
5
- "@typescript-eslint"
6
- ],
7
- "extends": [
8
- "eslint:recommended",
9
- "plugin:@typescript-eslint/eslint-recommended",
10
- "plugin:@typescript-eslint/recommended"
11
- ]
12
- }
package/.prettierrc.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "arrowParens": "avoid",
3
- "printWidth": 200,
4
- "semi": false,
5
- "trailingComma": "none"
6
- }
package/src/index.ts DELETED
@@ -1,68 +0,0 @@
1
- export interface Plugin {
2
- init: (context: PluginInitContext) => void
3
- query: (query: Query) => 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
- Title: string
28
- Description?: string
29
- IcoPath: string
30
- Score?: number
31
- Action: () => boolean
32
- }
33
-
34
- export interface PluginInitContext {
35
- API: PublicAPI
36
- }
37
-
38
- export interface PublicAPI {
39
- /**
40
- * Change Wox query
41
- */
42
- ChangeQuery: (query: string) => void
43
-
44
- /**
45
- * Hide Wox
46
- */
47
- HideApp: () => void
48
-
49
- /**
50
- * Show Wox
51
- */
52
- ShowApp: () => void
53
-
54
- /**
55
- * Show message box
56
- */
57
- ShowMsg: (title: string, description?: string, iconPath?: string) => void
58
-
59
- /**
60
- * Write log
61
- */
62
- Log: (msg: string) => void
63
-
64
- /**
65
- * Get translation of current language
66
- */
67
- GetTranslation: ( key: string)=> string;
68
- }
package/tsconfig.json DELETED
@@ -1,93 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- /* Added */
4
- "forceConsistentCasingInFileNames": true,
5
- /* Disallow inconsistently-cased references to the same file. */
6
- "preserveConstEnums": true,
7
- /* Do not erase const enum declarations in generated code. */
8
- "resolveJsonModule": true,
9
- /* Include modules imported with '.json' extension. Requires TypeScript version 2.9 or later. */
10
-
11
- /* Basic Options */
12
- "target": "es5",
13
- /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
14
- "module": "commonjs",
15
- /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
16
- "lib": [
17
- "es5",
18
- "es6"
19
- ],
20
- /* Specify library files to be included in the compilation. */
21
- // "allowJs": true, /* Allow javascript files to be compiled. */
22
- // "checkJs": true, /* Report errors in .js files. */
23
- // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
24
- "declaration": true,
25
- /* Generates corresponding '.d.ts' file. */
26
- // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
27
- "sourceMap": false,
28
- /* Generates corresponding '.map' file. */
29
- // "outFile": "./", /* Concatenate and emit output to single file. */
30
- "outDir": "dist",
31
- /* Redirect output structure to the directory. */
32
- "rootDir": "src",
33
- /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
34
- // "composite": true, /* Enable project compilation */
35
- // "removeComments": true, /* Do not emit comments to output. */
36
- // "noEmit": true, /* Do not emit outputs. */
37
- // "importHelpers": true, /* Import emit helpers from 'tslib'. */
38
- // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
39
- // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
40
-
41
- /* Strict Type-Checking Options */
42
- "strict": true,
43
- /* Enable all strict type-checking options. */
44
- "noImplicitAny": true,
45
- /* Raise error on expressions and declarations with an implied 'any' type. */
46
- "strictNullChecks": true,
47
- /* Enable strict null checks. */
48
- // "strictFunctionTypes": true, /* Enable strict checking of function types. */
49
- // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
50
- "noImplicitThis": true,
51
- /* Raise error on 'this' expressions with an implied 'any' type. */
52
- // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
53
-
54
- /* Additional Checks */
55
- "noUnusedLocals": true,
56
- /* Report errors on unused locals. */
57
- // "noUnusedParameters": true, /* Report errors on unused parameters. */
58
- "noImplicitReturns": true,
59
- /* Report error when not all code paths in function return a value. */
60
- // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
61
-
62
- /* Module Resolution Options */
63
- "moduleResolution": "node",
64
- /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
65
- // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
66
- // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
67
- // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
68
- "typeRoots": [
69
- "node_modules/@types",
70
- "types"
71
- ],
72
- /* List of folders to include type definitions from. */
73
- // "types": [], /* Type declaration files to be included in compilation. */
74
- // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
75
- "esModuleInterop": true
76
- /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
77
- // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
78
-
79
- /* Source Map Options */
80
- // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
81
- // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
82
- // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
83
- // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
84
-
85
- /* Experimental Options */
86
- // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
87
- // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
88
- },
89
- "exclude": [
90
- "node_modules",
91
- "types"
92
- ]
93
- }