dualsense-ts 2.0.0 → 2.0.3

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.
Files changed (46) hide show
  1. package/dist/dualsense.js +21 -21
  2. package/dist/dualsense.js.map +1 -1
  3. package/dist/hid/dualsense_hid.js +82 -82
  4. package/dist/hid/dualsense_hid.js.map +1 -1
  5. package/dist/input.d.ts +2 -1
  6. package/dist/input.d.ts.map +1 -1
  7. package/dist/input.js +5 -5
  8. package/dist/input.js.map +1 -1
  9. package/docs/.nojekyll +1 -0
  10. package/docs/Accelerometer.md +13 -0
  11. package/docs/Analog.md +1712 -0
  12. package/docs/AnalogParams.md +105 -0
  13. package/docs/Axis.md +1577 -0
  14. package/docs/Brightness.md +39 -0
  15. package/docs/CommandScopeA.md +83 -0
  16. package/docs/CommandScopeB.md +72 -0
  17. package/docs/Dpad.md +1591 -0
  18. package/docs/DpadParams.md +116 -0
  19. package/docs/DualSenseCommand.md +1448 -0
  20. package/docs/Dualsense.md +1690 -0
  21. package/docs/DualsenseHID.md +1158 -0
  22. package/docs/DualsenseHIDState.md +457 -0
  23. package/docs/DualsenseParams.md +215 -0
  24. package/docs/Exports.md +214 -0
  25. package/docs/Gyroscope.md +13 -0
  26. package/docs/Haptic.md +27 -0
  27. package/docs/Home.md +105 -0
  28. package/docs/Indicator.md +52 -0
  29. package/docs/Input.md +1382 -0
  30. package/docs/InputId.md +457 -0
  31. package/docs/InputParams.md +62 -0
  32. package/docs/LedOptions.md +50 -0
  33. package/docs/Momentary.md +1549 -0
  34. package/docs/Motion.md +38 -0
  35. package/docs/Mute.md +1558 -0
  36. package/docs/PlayerID.md +61 -0
  37. package/docs/PulseOptions.md +39 -0
  38. package/docs/Touchpad.md +1613 -0
  39. package/docs/Trigger.md +1620 -0
  40. package/docs/TriggerMode.md +116 -0
  41. package/docs/Unisense.md +1591 -0
  42. package/docs/UnisenseParams.md +105 -0
  43. package/docs/_Sidebar.md +4 -0
  44. package/package.json +7 -2
  45. package/src/input.ts +6 -6
  46. package/tsconfig.json +10 -1
@@ -0,0 +1,105 @@
1
+ # Interface: UnisenseParams
2
+
3
+ ## Hierarchy
4
+
5
+ - [`InputParams`](../wiki/InputParams)
6
+
7
+ ↳ **`UnisenseParams`**
8
+
9
+ ## Table of contents
10
+
11
+ ### Properties
12
+
13
+ - [analog](../wiki/UnisenseParams#analog)
14
+ - [bumper](../wiki/UnisenseParams#bumper)
15
+ - [icon](../wiki/UnisenseParams#icon)
16
+ - [name](../wiki/UnisenseParams#name)
17
+ - [parent](../wiki/UnisenseParams#parent)
18
+ - [threshold](../wiki/UnisenseParams#threshold)
19
+ - [trigger](../wiki/UnisenseParams#trigger)
20
+
21
+ ## Properties
22
+
23
+ ### analog
24
+
25
+ • `Optional` **analog**: [`InputParams`](../wiki/InputParams)
26
+
27
+ #### Defined in
28
+
29
+ [src/elements/unisense.ts:10](https://github.com/nsfm/dualsense-ts/blob/6dc1604/src/elements/unisense.ts#L10)
30
+
31
+ ___
32
+
33
+ ### bumper
34
+
35
+ • `Optional` **bumper**: [`InputParams`](../wiki/InputParams)
36
+
37
+ #### Defined in
38
+
39
+ [src/elements/unisense.ts:9](https://github.com/nsfm/dualsense-ts/blob/6dc1604/src/elements/unisense.ts#L9)
40
+
41
+ ___
42
+
43
+ ### icon
44
+
45
+ • `Optional` **icon**: `string`
46
+
47
+ #### Inherited from
48
+
49
+ [InputParams](../wiki/InputParams).[icon](../wiki/InputParams#icon)
50
+
51
+ #### Defined in
52
+
53
+ [src/input.ts:6](https://github.com/nsfm/dualsense-ts/blob/6dc1604/src/input.ts#L6)
54
+
55
+ ___
56
+
57
+ ### name
58
+
59
+ • `Optional` **name**: `string`
60
+
61
+ #### Inherited from
62
+
63
+ [InputParams](../wiki/InputParams).[name](../wiki/InputParams#name)
64
+
65
+ #### Defined in
66
+
67
+ [src/input.ts:5](https://github.com/nsfm/dualsense-ts/blob/6dc1604/src/input.ts#L5)
68
+
69
+ ___
70
+
71
+ ### parent
72
+
73
+ • `Optional` **parent**: [`Input`](../wiki/Input)<`unknown`\>
74
+
75
+ #### Inherited from
76
+
77
+ [InputParams](../wiki/InputParams).[parent](../wiki/InputParams#parent)
78
+
79
+ #### Defined in
80
+
81
+ [src/input.ts:8](https://github.com/nsfm/dualsense-ts/blob/6dc1604/src/input.ts#L8)
82
+
83
+ ___
84
+
85
+ ### threshold
86
+
87
+ • `Optional` **threshold**: `number`
88
+
89
+ #### Inherited from
90
+
91
+ [InputParams](../wiki/InputParams).[threshold](../wiki/InputParams#threshold)
92
+
93
+ #### Defined in
94
+
95
+ [src/input.ts:7](https://github.com/nsfm/dualsense-ts/blob/6dc1604/src/input.ts#L7)
96
+
97
+ ___
98
+
99
+ ### trigger
100
+
101
+ • `Optional` **trigger**: [`InputParams`](../wiki/InputParams)
102
+
103
+ #### Defined in
104
+
105
+ [src/elements/unisense.ts:8](https://github.com/nsfm/dualsense-ts/blob/6dc1604/src/elements/unisense.ts#L8)
@@ -0,0 +1,4 @@
1
+ ## dualsense-ts
2
+
3
+ - [Home](../wiki/Home)
4
+ - [Exports](../wiki/Exports)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dualsense-ts",
3
- "version": "2.0.0",
3
+ "version": "2.0.3",
4
4
  "description": "A natural interface for your DualSense controller, with Typescript",
5
5
  "keywords": [
6
6
  "dualsense",
@@ -31,7 +31,7 @@
31
31
  "main": "dist/index.js",
32
32
  "types": "dist/index.d.ts",
33
33
  "scripts": {
34
- "prebuild": "yarn barrels",
34
+ "prebuild": "yarn barrels && yarn docs",
35
35
  "build": "tsc --project tsconfig.build.json",
36
36
  "build:watch": "tsc --project tsconfig.build.json --pretty --watch",
37
37
  "lint": "eslint src",
@@ -42,6 +42,8 @@
42
42
  "coverage:watch": "jest src --coverage --verbose --watch",
43
43
  "barrels": "barrelsby -d src -D -l replace -e 'spec.ts$'",
44
44
  "barrels:watch": "nodemon yarn barrels",
45
+ "docs": "typedoc src/index.ts",
46
+ "docs:watch": "nodemon yarn docs",
45
47
  "debug": "nodemon -e ts,json --exec \"node --inspect --enable-source-maps --experimental-specifier-resolution=node --loader ts-node/esm ./util/debug.ts\""
46
48
  },
47
49
  "dependencies": {
@@ -62,6 +64,9 @@
62
64
  "prettier": "^2.3.2",
63
65
  "ts-jest": "^27.1.3",
64
66
  "ts-node": "^10.7.0",
67
+ "typedoc": "^0.22.15",
68
+ "typedoc-github-wiki-theme": "^1.0.1",
69
+ "typedoc-plugin-markdown": "^3.12.1",
65
70
  "typescript": "^4.6.4"
66
71
  },
67
72
  "eslintConfig": {
package/src/input.ts CHANGED
@@ -113,10 +113,10 @@ export abstract class Input<Type>
113
113
  this.threshold = threshold;
114
114
  this.id = Symbol(this[InputName]);
115
115
 
116
- this[InputSetComparison]();
116
+ this[InputChanged] = this[InputSetComparison]();
117
117
  setImmediate(() => {
118
118
  this[InputAdopt]();
119
- this[InputSetComparison]();
119
+ this[InputChanged] = this[InputSetComparison]();
120
120
  });
121
121
  }
122
122
 
@@ -192,16 +192,16 @@ export abstract class Input<Type>
192
192
  }
193
193
 
194
194
  // Sets a default comparison type for the Input based on the generic type.
195
- [InputSetComparison](): void {
195
+ [InputSetComparison](): (state: Type, newState: Type) => boolean {
196
196
  if (typeof this.state === "number") {
197
- this[InputChanged] = this[InputChangedThreshold] as unknown as (
197
+ return this[InputChangedThreshold] as unknown as (
198
198
  state: Type,
199
199
  newState: Type
200
200
  ) => boolean;
201
201
  } else if (this.state instanceof Input) {
202
- this[InputChanged] = this[InputChangedVirtual];
202
+ return this[InputChangedVirtual];
203
203
  } else {
204
- this[InputChanged] = this[InputChangedPrimitive];
204
+ return this[InputChangedPrimitive];
205
205
  }
206
206
  }
207
207
 
package/tsconfig.json CHANGED
@@ -27,5 +27,14 @@
27
27
  "transpileOnly": false,
28
28
  "files": true
29
29
  },
30
- "lib": ["esnext"]
30
+ "lib": ["esnext"],
31
+ "typedocOptions": {
32
+ "name": "dualsense-ts",
33
+ "entryPoints": ["src/index.ts"],
34
+ "exclude": "**/**.spec.ts",
35
+ "excludePrivate": true,
36
+ "excludeProtected": true,
37
+ "excludeInternal": true,
38
+ "theme": "github-wiki"
39
+ }
31
40
  }