node-karin 0.3.5 → 0.3.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.
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/ws" />
1
2
  /// <reference types="node" />
2
3
  import WebSocket from 'ws';
3
4
  import { IncomingMessage } from 'http';
package/lib/index.d.ts CHANGED
@@ -35,7 +35,7 @@ export declare const Cfg: {
35
35
  change: Map<string, any>;
36
36
  watcher: Map<string, any>;
37
37
  review: boolean;
38
- loggger: import("log4js").Logger;
38
+ logger: import("log4js").Logger;
39
39
  initCfg(): Promise<void>;
40
40
  getPlugins(): string[];
41
41
  dirPath(name: string, plugins: string[]): Promise<void>;
package/lib/index.js CHANGED
@@ -1,3 +1,8 @@
1
+ /// <reference types="@types/express" />
2
+ /// <reference types="@types/lodash" />
3
+ /// <reference types="@types/node" />
4
+ /// <reference types="@types/node-schedule" />
5
+ /// <reference types="@types/ws" />
1
6
  // 基本模块
2
7
  export * from 'kritor-proto';
3
8
  export * from './core/index.js';
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/ws" />
1
2
  import WebSocket from 'ws';
2
3
  import { RenderBase } from './base.js';
3
4
  import { KarinRenderType } from '../types/render.js';
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/ws" />
1
2
  /// <reference types="node" />
2
3
  import WebSocket from 'ws';
3
4
  import { RenderBase } from './base.js';
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/ws" />
1
2
  /// <reference types="node" />
2
3
  import { WebSocket } from 'ws';
3
4
  import { IncomingMessage } from 'http';
@@ -50,7 +50,7 @@ export interface KarinRenderType {
50
50
  /**
51
51
  * - 设备像素比
52
52
  */
53
- deviceScaleFactor?: string;
53
+ deviceScaleFactor?: number;
54
54
  };
55
55
  /**
56
56
  * - 分页截图 传递数字则视为视窗高度 返回数组
@@ -10,7 +10,7 @@ export declare const config: {
10
10
  change: Map<string, any>;
11
11
  watcher: Map<string, any>;
12
12
  review: boolean;
13
- loggger: Logger;
13
+ logger: Logger;
14
14
  /** 初始化配置 */
15
15
  initCfg(): Promise<void>;
16
16
  getPlugins(): string[];
@@ -10,7 +10,7 @@ export const config = new (class Cfg {
10
10
  change
11
11
  watcher
12
12
  review
13
- loggger
13
+ logger
14
14
  constructor () {
15
15
  this.dir = karinDir
16
16
  this._path = process.cwd() + '/config'
@@ -43,7 +43,7 @@ export const config = new (class Cfg {
43
43
  this.dirPath('temp', plugins)
44
44
  this.dirPath('resources', plugins)
45
45
  this.dirPath('temp/html', plugins)
46
- this.loggger = (await import('./logger.js')).default
46
+ this.logger = (await import('./logger.js')).default
47
47
  }
48
48
 
49
49
  getPlugins () {
@@ -212,7 +212,7 @@ export const config = new (class Cfg {
212
212
  /** 监听文件变化 */
213
213
  watcher.on('change', () => {
214
214
  this.change.delete(key)
215
- this.loggger.mark(`[修改配置文件][${type}][${name}]`)
215
+ this.logger.mark(`[修改配置文件][${type}][${name}]`)
216
216
  /** 文件修改后调用对应的方法 */
217
217
  switch (`change_${name}`) {
218
218
  case 'change_App':
@@ -236,7 +236,7 @@ export const config = new (class Cfg {
236
236
 
237
237
  async change_config () {
238
238
  /** 修改日志等级 */
239
- this.loggger.level = this.Config.log4jsCfg.level
239
+ this.logger.level = this.Config.log4jsCfg.level
240
240
  await this.#review()
241
241
  if (this.Server.HotUpdate) {
242
242
  const { Bot } = await import('../index.js')
@@ -0,0 +1 @@
1
+ declare module 'kritor-proto'
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "node-karin",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "private": false,
5
5
  "description": "基于 Kritor 进行开发的nodejs机器人框架",
6
6
  "homepage": "https://github.com/KarinJS/Karin",
7
+ "types": "./lib/index.d.ts",
7
8
  "bugs": {
8
9
  "url": "https://github.com/KarinJS/Karin/issues"
9
10
  },
@@ -38,7 +39,7 @@
38
39
  "scripts": {
39
40
  "app": "node .",
40
41
  "build": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json && npm run fix && npm run cp",
41
- "cp": "cp ./lib/modules.d.ts ./modules.d.ts && cp ./lib/modules.js ./modules.js",
42
+ "cp": "cp ./lib/modules.d.ts ./modules.d.ts && cp ./lib/modules.js ./modules.js && cp ./src/utils/kritor-proto.d.ts ./lib/utils/kritor-proto.d.ts",
42
43
  "delete": "pm2 delete ./config/config/pm2.yaml",
43
44
  "fix": "eslint lib/**/*.js --fix",
44
45
  "fix:all": "eslint lib/**/*.js --fix && eslint src/**/*.ts --fix",