@liminal-hq/plugin-gamepad-haptics 0.0.0-stage → 0.1.0
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/README.md +134 -2
- package/api-iife.js +790 -0
- package/dist-js/identity.d.ts +31 -0
- package/dist-js/identity.d.ts.map +1 -0
- package/dist-js/index.cjs +787 -0
- package/dist-js/index.cjs.map +1 -0
- package/dist-js/index.d.ts +56 -0
- package/dist-js/index.d.ts.map +1 -0
- package/dist-js/index.js +771 -0
- package/dist-js/index.js.map +1 -0
- package/dist-js/pattern/pad-compile.d.ts +49 -0
- package/dist-js/pattern/pad-compile.d.ts.map +1 -0
- package/dist-js/pattern/schedule.d.ts +46 -0
- package/dist-js/pattern/schedule.d.ts.map +1 -0
- package/dist-js/pattern/types.d.ts +48 -0
- package/dist-js/pattern/types.d.ts.map +1 -0
- package/dist-js/pattern/validate.d.ts +18 -0
- package/dist-js/pattern/validate.d.ts.map +1 -0
- package/dist-js/types.d.ts +42 -0
- package/dist-js/types.d.ts.map +1 -0
- package/dist-js/web-backend.d.ts +24 -0
- package/dist-js/web-backend.d.ts.map +1 -0
- package/package.json +44 -5
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { PadInfo } from './types';
|
|
2
|
+
export type PadHint = {
|
|
3
|
+
gamepad: {
|
|
4
|
+
id: string;
|
|
5
|
+
index?: number;
|
|
6
|
+
};
|
|
7
|
+
} | {
|
|
8
|
+
guid: string;
|
|
9
|
+
} | {
|
|
10
|
+
vendorId: number;
|
|
11
|
+
productId: number;
|
|
12
|
+
serial?: string;
|
|
13
|
+
};
|
|
14
|
+
export type Resolved = {
|
|
15
|
+
/** Pads that fit the hint, best first. */
|
|
16
|
+
matches: PadInfo[];
|
|
17
|
+
/** True when more than one pad fits equally well, so the caller should ask the player. */
|
|
18
|
+
ambiguous: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Reads the vendor and product ids out of a Web Gamepad `id`. Chromium writes
|
|
22
|
+
* `Name (STANDARD GAMEPAD Vendor: 054c Product: 0268)`, Firefox `054c-0268-Name`; Safari writes
|
|
23
|
+
* neither, so it returns undefined and the caller falls back to the name.
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseWebGamepadId(id: string): {
|
|
26
|
+
vendorId: number;
|
|
27
|
+
productId: number;
|
|
28
|
+
} | undefined;
|
|
29
|
+
/** The pads that fit `hint`, never guessing between identical ones. */
|
|
30
|
+
export declare function resolvePad(pads: PadInfo[], hint: PadHint): Resolved;
|
|
31
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../guest-js/identity.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,MAAM,OAAO,GAChB;IAAE,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5D,MAAM,MAAM,QAAQ,GAAG;IACtB,0CAA0C;IAC1C,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,0FAA0F;IAC1F,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAIF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAMjG;AAQD,uEAAuE;AACvE,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,GAAG,QAAQ,CAuBnE"}
|