@sensslen/node-gamepad 1.0.5 → 1.0.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.
package/IConfig.d.ts CHANGED
@@ -1,34 +1,34 @@
1
- import { IDeviceSpec } from './IDeviceSpec';
2
- export interface IJoyStickConfig {
3
- name: string;
4
- x: {
5
- pin: number;
6
- };
7
- y: {
8
- pin: number;
9
- };
10
- }
11
- export interface IButtonConfig {
12
- value: string;
13
- pin: number;
14
- name: string;
15
- }
16
- export interface IStatusConfig {
17
- name: string;
18
- pin: number;
19
- states: IStateMappingConfig[];
20
- }
21
- export interface IStateMappingConfig {
22
- value: number;
23
- state: string;
24
- }
25
- export interface IScaleConfig {
26
- pin: number;
27
- name: string;
28
- }
29
- export interface IConfig extends IDeviceSpec {
30
- joysticks?: IJoyStickConfig[];
31
- buttons?: IButtonConfig[];
32
- status?: IStatusConfig[];
33
- scales?: IScaleConfig[];
34
- }
1
+ import { IDeviceSpec } from './IDeviceSpec';
2
+ export interface IJoyStickConfig {
3
+ name: string;
4
+ x: {
5
+ pin: number;
6
+ };
7
+ y: {
8
+ pin: number;
9
+ };
10
+ }
11
+ export interface IButtonConfig {
12
+ value: string;
13
+ pin: number;
14
+ name: string;
15
+ }
16
+ export interface IStatusConfig {
17
+ name: string;
18
+ pin: number;
19
+ states: IStateMappingConfig[];
20
+ }
21
+ export interface IStateMappingConfig {
22
+ value: number;
23
+ state: string;
24
+ }
25
+ export interface IScaleConfig {
26
+ pin: number;
27
+ name: string;
28
+ }
29
+ export interface IConfig extends IDeviceSpec {
30
+ joysticks?: IJoyStickConfig[];
31
+ buttons?: IButtonConfig[];
32
+ status?: IStatusConfig[];
33
+ scales?: IScaleConfig[];
34
+ }
package/IConfig.js CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=IConfig.js.map
package/IDeviceSpec.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export interface IDeviceSpec {
2
- vendorID: number;
3
- productID: number;
4
- serialNumber?: string;
5
- }
1
+ export interface IDeviceSpec {
2
+ vendorID: number;
3
+ productID: number;
4
+ serialNumber?: string;
5
+ }
package/IDeviceSpec.js CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=IDeviceSpec.js.map
package/ILogger.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export interface ILogger {
2
- debug?: (toLog: string) => void;
3
- info(toLog: string): void;
4
- }
1
+ export interface ILogger {
2
+ debug?: (toLog: string) => void;
3
+ info(toLog: string): void;
4
+ }
package/ILogger.js CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=ILogger.js.map
@@ -1,4 +1,4 @@
1
- export interface JoyStickValue {
2
- x: number;
3
- y: number;
4
- }
1
+ export interface JoyStickValue {
2
+ x: number;
3
+ y: number;
4
+ }
package/JoyStickValue.js CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=JoyStickValue.js.map
package/NodeGamepad.d.ts CHANGED
@@ -1,38 +1,38 @@
1
- /// <reference types="node" />
2
- import { HID } from 'node-hid';
3
- import { IConfig } from './IConfig';
4
- import { EventEmitter } from 'events';
5
- import { ILogger } from './ILogger';
6
- export declare class NodeGamepad extends EventEmitter {
7
- private config;
8
- private logger?;
9
- protected _usb?: HID;
10
- private _running;
11
- private _joystickStates;
12
- private _buttonStates;
13
- private _statusStates;
14
- private _scaleStates;
15
- private _connectRetryTimeout?;
16
- private readonly _connectionRetryTimeoutInMs;
17
- constructor(config: IConfig, logger?: ILogger | undefined);
18
- start(): void;
19
- stop(): void;
20
- rumble(_intensity: number, _duration: number): void;
21
- private logDebug;
22
- private log;
23
- private connect;
24
- private stopConnectionProcess;
25
- private registerProgramExitEvents;
26
- private closeUsbDevice;
27
- private toIDeviceSpec;
28
- private onControllerFrame;
29
- private processJoysticks;
30
- private processJoystick;
31
- private processButtons;
32
- private processButton;
33
- private processScales;
34
- private processScale;
35
- private processStates;
36
- private processState;
37
- private getStateName;
38
- }
1
+ /// <reference types="node" />
2
+ import { HID } from 'node-hid';
3
+ import { IConfig } from './IConfig';
4
+ import { EventEmitter } from 'events';
5
+ import { ILogger } from './ILogger';
6
+ export declare class NodeGamepad extends EventEmitter {
7
+ private config;
8
+ private logger?;
9
+ protected _usb?: HID;
10
+ private _running;
11
+ private _joystickStates;
12
+ private _buttonStates;
13
+ private _statusStates;
14
+ private _scaleStates;
15
+ private _connectRetryTimeout?;
16
+ private readonly _connectionRetryTimeoutInMs;
17
+ constructor(config: IConfig, logger?: ILogger | undefined);
18
+ start(): void;
19
+ stop(): void;
20
+ rumble(_intensity: number, _duration: number): void;
21
+ private logDebug;
22
+ private log;
23
+ private connect;
24
+ private stopConnectionProcess;
25
+ private registerProgramExitEvents;
26
+ private closeUsbDevice;
27
+ private toIDeviceSpec;
28
+ private onControllerFrame;
29
+ private processJoysticks;
30
+ private processJoystick;
31
+ private processButtons;
32
+ private processButton;
33
+ private processScales;
34
+ private processScale;
35
+ private processStates;
36
+ private processState;
37
+ private getStateName;
38
+ }