@ledgerhq/speculos-device-controller 0.0.0-speculos-transport-and-device-controller-20251021081257 → 0.0.0-wrong-error-when-in-experimental-provider-20251021162636

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 (108) hide show
  1. package/README.md +2 -2
  2. package/lib/cjs/src/api/DeviceController.js.map +1 -1
  3. package/lib/cjs/src/internal/adapters/DefaultButtonController.js +2 -0
  4. package/lib/cjs/src/internal/adapters/DefaultButtonController.js.map +7 -0
  5. package/lib/cjs/src/internal/adapters/DefaultButtonController.test.js +2 -0
  6. package/lib/cjs/src/internal/adapters/DefaultButtonController.test.js.map +7 -0
  7. package/lib/cjs/src/internal/adapters/DefaultTouchController.js +2 -0
  8. package/lib/cjs/src/internal/adapters/DefaultTouchController.js.map +7 -0
  9. package/lib/cjs/src/internal/adapters/DefaultTouchController.test.js +2 -0
  10. package/lib/cjs/src/internal/adapters/DefaultTouchController.test.js.map +7 -0
  11. package/lib/cjs/src/internal/core/{IButtonController.js → ButtonController.js} +1 -1
  12. package/lib/cjs/src/internal/core/ButtonController.js.map +7 -0
  13. package/lib/cjs/src/internal/core/{ITouchController.js → TouchController.js} +1 -1
  14. package/lib/cjs/src/internal/core/TouchController.js.map +7 -0
  15. package/lib/cjs/src/internal/core/types.js.map +1 -1
  16. package/lib/cjs/src/internal/di.js +1 -1
  17. package/lib/cjs/src/internal/di.js.map +3 -3
  18. package/lib/cjs/src/internal/di.test.js +1 -1
  19. package/lib/cjs/src/internal/di.test.js.map +3 -3
  20. package/lib/cjs/src/internal/use-cases/buttonUseCases.js +1 -1
  21. package/lib/cjs/src/internal/use-cases/buttonUseCases.js.map +3 -3
  22. package/lib/cjs/src/internal/use-cases/buttonUseCases.test.js.map +1 -1
  23. package/lib/cjs/src/internal/use-cases/touchUseCases.js.map +2 -2
  24. package/lib/cjs/src/internal/use-cases/touchUseCases.test.js.map +1 -1
  25. package/lib/cjs/src/internal/utils/axisClamp.js +1 -1
  26. package/lib/cjs/src/internal/utils/axisClamp.js.map +3 -3
  27. package/lib/cjs/src/internal/utils/axisClamp.test.js +1 -1
  28. package/lib/cjs/src/internal/utils/axisClamp.test.js.map +3 -3
  29. package/lib/esm/src/api/DeviceController.js.map +1 -1
  30. package/lib/esm/src/internal/adapters/DefaultButtonController.js +2 -0
  31. package/lib/esm/src/internal/adapters/DefaultButtonController.js.map +7 -0
  32. package/lib/esm/src/internal/adapters/DefaultButtonController.test.js +2 -0
  33. package/lib/esm/src/internal/adapters/DefaultButtonController.test.js.map +7 -0
  34. package/lib/esm/src/internal/adapters/{AxiosTouchController.js → DefaultTouchController.js} +2 -2
  35. package/lib/esm/src/internal/adapters/DefaultTouchController.js.map +7 -0
  36. package/lib/esm/src/internal/adapters/DefaultTouchController.test.js +2 -0
  37. package/lib/esm/src/internal/adapters/DefaultTouchController.test.js.map +7 -0
  38. package/lib/esm/src/internal/core/ButtonController.js +1 -0
  39. package/lib/esm/src/internal/core/TouchController.js +1 -0
  40. package/lib/esm/src/internal/core/types.js.map +1 -1
  41. package/lib/esm/src/internal/di.js +1 -1
  42. package/lib/esm/src/internal/di.js.map +3 -3
  43. package/lib/esm/src/internal/di.test.js +1 -1
  44. package/lib/esm/src/internal/di.test.js.map +3 -3
  45. package/lib/esm/src/internal/use-cases/buttonUseCases.js +1 -1
  46. package/lib/esm/src/internal/use-cases/buttonUseCases.js.map +2 -2
  47. package/lib/esm/src/internal/use-cases/buttonUseCases.test.js.map +1 -1
  48. package/lib/esm/src/internal/use-cases/touchUseCases.js.map +2 -2
  49. package/lib/esm/src/internal/use-cases/touchUseCases.test.js.map +1 -1
  50. package/lib/esm/src/internal/utils/axisClamp.js +1 -1
  51. package/lib/esm/src/internal/utils/axisClamp.js.map +3 -3
  52. package/lib/esm/src/internal/utils/axisClamp.test.js +1 -1
  53. package/lib/esm/src/internal/utils/axisClamp.test.js.map +3 -3
  54. package/lib/types/src/api/DeviceController.d.ts +2 -2
  55. package/lib/types/src/api/DeviceController.d.ts.map +1 -1
  56. package/lib/types/src/internal/adapters/{AxiosButtonController.d.ts → DefaultButtonController.d.ts} +3 -3
  57. package/lib/types/src/internal/adapters/DefaultButtonController.d.ts.map +1 -0
  58. package/lib/types/src/internal/adapters/DefaultButtonController.test.d.ts +2 -0
  59. package/lib/types/src/internal/adapters/DefaultButtonController.test.d.ts.map +1 -0
  60. package/lib/types/src/internal/adapters/{AxiosTouchController.d.ts → DefaultTouchController.d.ts} +3 -3
  61. package/lib/types/src/internal/adapters/DefaultTouchController.d.ts.map +1 -0
  62. package/lib/types/src/internal/adapters/DefaultTouchController.test.d.ts +2 -0
  63. package/lib/types/src/internal/adapters/DefaultTouchController.test.d.ts.map +1 -0
  64. package/lib/types/src/internal/core/{IButtonController.d.ts → ButtonController.d.ts} +2 -2
  65. package/lib/types/src/internal/core/ButtonController.d.ts.map +1 -0
  66. package/lib/types/src/internal/core/{ITouchController.d.ts → TouchController.d.ts} +2 -2
  67. package/lib/types/src/internal/core/TouchController.d.ts.map +1 -0
  68. package/lib/types/src/internal/core/types.d.ts +1 -1
  69. package/lib/types/src/internal/core/types.d.ts.map +1 -1
  70. package/lib/types/src/internal/di.d.ts +4 -4
  71. package/lib/types/src/internal/di.d.ts.map +1 -1
  72. package/lib/types/src/internal/use-cases/buttonUseCases.d.ts +3 -3
  73. package/lib/types/src/internal/use-cases/buttonUseCases.d.ts.map +1 -1
  74. package/lib/types/src/internal/use-cases/touchUseCases.d.ts +3 -3
  75. package/lib/types/src/internal/use-cases/touchUseCases.d.ts.map +1 -1
  76. package/lib/types/src/internal/utils/axisClamp.d.ts +1 -2
  77. package/lib/types/src/internal/utils/axisClamp.d.ts.map +1 -1
  78. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  79. package/package.json +3 -3
  80. package/lib/cjs/src/internal/adapters/AxiosButtonController.js +0 -2
  81. package/lib/cjs/src/internal/adapters/AxiosButtonController.js.map +0 -7
  82. package/lib/cjs/src/internal/adapters/AxiosButtonController.test.js +0 -2
  83. package/lib/cjs/src/internal/adapters/AxiosButtonController.test.js.map +0 -7
  84. package/lib/cjs/src/internal/adapters/AxiosTouchController.js +0 -2
  85. package/lib/cjs/src/internal/adapters/AxiosTouchController.js.map +0 -7
  86. package/lib/cjs/src/internal/adapters/AxiosTouchController.test.js +0 -2
  87. package/lib/cjs/src/internal/adapters/AxiosTouchController.test.js.map +0 -7
  88. package/lib/cjs/src/internal/core/IButtonController.js.map +0 -7
  89. package/lib/cjs/src/internal/core/ITouchController.js.map +0 -7
  90. package/lib/esm/src/internal/adapters/AxiosButtonController.js +0 -2
  91. package/lib/esm/src/internal/adapters/AxiosButtonController.js.map +0 -7
  92. package/lib/esm/src/internal/adapters/AxiosButtonController.test.js +0 -2
  93. package/lib/esm/src/internal/adapters/AxiosButtonController.test.js.map +0 -7
  94. package/lib/esm/src/internal/adapters/AxiosTouchController.js.map +0 -7
  95. package/lib/esm/src/internal/adapters/AxiosTouchController.test.js +0 -2
  96. package/lib/esm/src/internal/adapters/AxiosTouchController.test.js.map +0 -7
  97. package/lib/esm/src/internal/core/IButtonController.js +0 -1
  98. package/lib/esm/src/internal/core/ITouchController.js +0 -1
  99. package/lib/types/src/internal/adapters/AxiosButtonController.d.ts.map +0 -1
  100. package/lib/types/src/internal/adapters/AxiosButtonController.test.d.ts +0 -2
  101. package/lib/types/src/internal/adapters/AxiosButtonController.test.d.ts.map +0 -1
  102. package/lib/types/src/internal/adapters/AxiosTouchController.d.ts.map +0 -1
  103. package/lib/types/src/internal/adapters/AxiosTouchController.test.d.ts +0 -2
  104. package/lib/types/src/internal/adapters/AxiosTouchController.test.d.ts.map +0 -1
  105. package/lib/types/src/internal/core/IButtonController.d.ts.map +0 -1
  106. package/lib/types/src/internal/core/ITouchController.d.ts.map +0 -1
  107. /package/lib/esm/src/internal/core/{IButtonController.js.map → ButtonController.js.map} +0 -0
  108. /package/lib/esm/src/internal/core/{ITouchController.js.map → TouchController.js.map} +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/internal/adapters/DefaultTouchController.test.ts"],
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport type { AxiosInstance } from \"axios\";\n\nimport type { PercentCoordinates } from \"../core/types\";\nimport { DefaultTouchController } from \"./DefaultTouchController\";\n\ndescribe(\"DefaultTouchController\", () => {\n let postMock: ReturnType<typeof vi.fn>;\n let axiosFake: AxiosInstance;\n\n const axisA = {\n xy: vi.fn((xPct: number, yPct: number) => ({\n x: Math.round(xPct * 10),\n y: Math.round(yPct * 20),\n })),\n };\n const axisB = {\n xy: vi.fn((xPct: number, yPct: number) => ({\n x: Math.round(100 + xPct),\n y: Math.round(200 + yPct),\n })),\n };\n let axesFake: Record<\n string,\n { xy: (x: number, y: number) => { x: number; y: number } }\n >;\n\n let controller: DefaultTouchController<string>;\n\n beforeEach(() => {\n postMock = vi.fn().mockResolvedValue({ status: 200, data: {} });\n axiosFake = { post: postMock } as unknown as AxiosInstance;\n\n axisA.xy.mockClear();\n axisB.xy.mockClear();\n\n axesFake = { devA: axisA, devB: axisB };\n controller = new DefaultTouchController(axiosFake, axesFake as any);\n });\n\n const point: PercentCoordinates = { x: 12, y: 45 };\n\n it(\"tapAndRelease: converts percent to absolute via axes and POSTs expected body\", async () => {\n await controller.tapAndRelease(\"devA\", point);\n\n expect(axisA.xy).toHaveBeenCalledTimes(1);\n expect(axisA.xy).toHaveBeenCalledWith(point.x, point.y);\n\n const expectedAbs = (axisA.xy.mock.results as any)[0].value;\n expect(postMock).toHaveBeenCalledTimes(1);\n expect(postMock).toHaveBeenCalledWith(\"/finger\", {\n action: \"press-and-release\",\n ...expectedAbs,\n });\n });\n\n it(\"tap: converts via axes and POSTs action 'press'\", async () => {\n await controller.tap(\"devB\", point);\n\n expect(axisB.xy).toHaveBeenCalledWith(point.x, point.y);\n const expectedAbs = axisB.xy.mock.results[0]?.value;\n\n expect(postMock).toHaveBeenCalledWith(\"/finger\", {\n action: \"press\",\n ...expectedAbs,\n });\n });\n\n it(\"release: converts via axes and POSTs action 'release'\", async () => {\n await controller.release(\"devA\", point);\n\n const expectedAbs = axisA.xy.mock.results[0]!.value;\n expect(postMock).toHaveBeenCalledWith(\"/finger\", {\n action: \"release\",\n ...expectedAbs,\n });\n });\n\n it(\"throws an error when device key is unknown\", async () => {\n await expect(controller.tap(\"unknownDevice\" as any, point)).rejects.toThrow(\n /\\[Touch] Unknown device key \"unknownDevice\".*Known keys: devA, devB/,\n );\n expect(postMock).not.toHaveBeenCalled();\n });\n\n it(\"propagates HTTP errors from axios client\", async () => {\n const boom = new Error(\"backend down\");\n postMock.mockRejectedValueOnce(boom);\n\n await expect(controller.tapAndRelease(\"devA\", point)).rejects.toBe(boom);\n });\n});\n\ndescribe(\"percent validation\", () => {\n let controller: DefaultTouchController<string>;\n let postMock: ReturnType<typeof vi.fn>;\n let axiosFake: AxiosInstance;\n\n const axis = {\n xy: vi.fn((xPct: number, yPct: number) => ({ x: xPct, y: yPct })),\n };\n const axesFake = { devA: axis };\n\n beforeEach(() => {\n postMock = vi.fn().mockResolvedValue({ status: 200, data: {} });\n axiosFake = { post: postMock } as unknown as AxiosInstance;\n axis.xy.mockClear();\n controller = new DefaultTouchController(axiosFake, axesFake as any);\n });\n\n it(\"accepts boundary values 0 and 100\", async () => {\n await controller.tapAndRelease(\"devA\", { x: 0, y: 100 });\n await controller.tap(\"devA\", { x: 100, y: 0 });\n await controller.release(\"devA\", { x: 50, y: 99 });\n\n // should have sent 3 HTTP calls if all accepted\n expect(postMock).toHaveBeenCalledTimes(3);\n });\n\n it(\"rejects values outside [0, 100], non-finite, negative and non-integer\", async () => {\n const badPoints = [\n { x: 140, y: 50 },\n { x: -1, y: 50 },\n { x: 50, y: 120 },\n { x: 50, y: -0.01 },\n ];\n\n for (const p of badPoints) {\n await expect(\n controller.tapAndRelease(\"devA\", p as any),\n ).rejects.toThrow();\n }\n\n // no HTTP calls should be made for invalid input\n expect(postMock).not.toHaveBeenCalled();\n });\n\n it(\"rejects NaN or non-finite values\", async () => {\n const badPoints = [\n { x: Number.NaN, y: 50 },\n { x: 50, y: Number.NaN },\n { x: Number.POSITIVE_INFINITY, y: 10 },\n { x: 10, y: Number.NEGATIVE_INFINITY },\n ];\n\n for (const p of badPoints) {\n await expect(controller.tap(\"devA\", p as any)).rejects.toThrow(\n /percent/i,\n );\n }\n expect(postMock).not.toHaveBeenCalled();\n });\n});\n"],
5
+ "mappings": "AAOA,OAAS,0BAAAA,MAA8B,2BAEvC,SAAS,yBAA0B,IAAM,CACvC,IAAIC,EACAC,EAEJ,MAAMC,EAAQ,CACZ,GAAI,GAAG,GAAG,CAACC,EAAcC,KAAkB,CACzC,EAAG,KAAK,MAAMD,EAAO,EAAE,EACvB,EAAG,KAAK,MAAMC,EAAO,EAAE,CACzB,EAAE,CACJ,EACMC,EAAQ,CACZ,GAAI,GAAG,GAAG,CAACF,EAAcC,KAAkB,CACzC,EAAG,KAAK,MAAM,IAAMD,CAAI,EACxB,EAAG,KAAK,MAAM,IAAMC,CAAI,CAC1B,EAAE,CACJ,EACA,IAAIE,EAKAC,EAEJ,WAAW,IAAM,CACfP,EAAW,GAAG,GAAG,EAAE,kBAAkB,CAAE,OAAQ,IAAK,KAAM,CAAC,CAAE,CAAC,EAC9DC,EAAY,CAAE,KAAMD,CAAS,EAE7BE,EAAM,GAAG,UAAU,EACnBG,EAAM,GAAG,UAAU,EAEnBC,EAAW,CAAE,KAAMJ,EAAO,KAAMG,CAAM,EACtCE,EAAa,IAAIR,EAAuBE,EAAWK,CAAe,CACpE,CAAC,EAED,MAAME,EAA4B,CAAE,EAAG,GAAI,EAAG,EAAG,EAEjD,GAAG,+EAAgF,SAAY,CAC7F,MAAMD,EAAW,cAAc,OAAQC,CAAK,EAE5C,OAAON,EAAM,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,QACrD,UACF,EAEF,OAAOb,CAAQ,EAAE,IAAI,iBAAiB,CACxC,CAAC,CACH,CAAC",
6
+ "names": ["DefaultTouchController", "postMock", "axiosFake", "axisA", "xPct", "yPct", "axisB", "axesFake", "controller", "point", "expectedAbs", "boom", "axis", "badPoints", "p"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=ButtonController.js.map
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=TouchController.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/core/types.ts"],
4
- "sourcesContent": ["export type ButtonKey = \"left\" | \"right\" | \"both\";\n\nexport type ScreenSpec = Readonly<{ width: number; height: number }>;\n\nexport type DeviceScreens<K extends string = string> = Readonly<\n Record<K, ScreenSpec>\n>;\n\nexport type Range<\n N extends number,\n Acc extends number[] = [],\n> = Acc[\"length\"] extends N ? Acc[number] : Range<N, [...Acc, Acc[\"length\"]]>;\nexport type Percent = Range<101>;\n\nexport type PercentCoordinates = { x: Percent; y: Percent };\n\nexport type DeviceControllerOptions<K extends string = string> = {\n timeoutMs?: number;\n clientHeader?: string;\n screens: DeviceScreens<K>;\n};\n\nexport enum SpeculosActions {\n PRESS = \"press\",\n RELEASE = \"release\",\n PRESS_AND_RELEASE = \"press-and-release\",\n}\n"],
4
+ "sourcesContent": ["export type ButtonKey = \"left\" | \"right\" | \"both\";\n\nexport type ScreenSpec = Readonly<{ width: number; height: number }>;\n\nexport type DeviceScreens<K extends string = string> = Readonly<\n Record<K, ScreenSpec>\n>;\n\nexport type Range<\n N extends number,\n Acc extends number[] = [],\n> = Acc[\"length\"] extends N ? Acc[number] : Range<N, [...Acc, Acc[\"length\"]]>;\nexport type Percent = Range<101>;\n\nexport type PercentCoordinates = { x: Percent; y: Percent };\n\nexport type DeviceControllerOptions<K extends string = string> = {\n screens: DeviceScreens<K>;\n timeoutMs?: number;\n clientHeader?: string;\n};\n\nexport enum SpeculosActions {\n PRESS = \"press\",\n RELEASE = \"release\",\n PRESS_AND_RELEASE = \"press-and-release\",\n}\n"],
5
5
  "mappings": "AAsBO,IAAKA,OACVA,EAAA,MAAQ,QACRA,EAAA,QAAU,UACVA,EAAA,kBAAoB,oBAHVA,OAAA",
6
6
  "names": ["SpeculosActions"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import i from"axios";import{AxiosButtonController as s}from"./adapters/AxiosButtonController";import{AxiosTouchController as c}from"./adapters/AxiosTouchController";import{createAxes as a}from"./utils/axisClamp";const p=o=>o.replace(/\/+$/,"");function f(o,t){const r=i.create({baseURL:p(o),timeout:t.timeoutMs??1500,headers:{"X-Ledger-Client-Version":t.clientHeader??"ldmk-transport-speculos"},transitional:{clarifyTimeoutError:!0}}),e=a(t.screens),n=new s(r),l=new c(r,e);return{buttons:n,touch:l}}export{f as createDefaultControllers};
1
+ import i from"axios";import{DefaultButtonController as s}from"./adapters/DefaultButtonController";import{DefaultTouchController as c}from"./adapters/DefaultTouchController";import{createAxes as a}from"./utils/axisClamp";function f(r,o){const t=i.create({baseURL:r,timeout:o.timeoutMs??1500,headers:{"X-Ledger-Client-Version":o.clientHeader??"ldmk-transport-speculos"},transitional:{clarifyTimeoutError:!0}}),e=a(o.screens),n=new s(t),l=new c(t,e);return{buttons:n,touch:l}}export{f as createDefaultControllers};
2
2
  //# sourceMappingURL=di.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/internal/di.ts"],
4
- "sourcesContent": ["import axios, { type AxiosInstance } from \"axios\";\n\nimport { AxiosButtonController } from \"@internal/adapters/AxiosButtonController\";\nimport { AxiosTouchController } from \"@internal/adapters/AxiosTouchController\";\nimport type { IButtonController } from \"@internal/core/IButtonController\";\nimport type { ITouchController } from \"@internal/core/ITouchController\";\nimport type { DeviceControllerOptions } from \"@internal/core/types\";\nimport { type AxisMap, createAxes } from \"@internal/utils/axisClamp\";\n\nconst removeTrailingSlashes = (url: string) => url.replace(/\\/+$/, \"\");\n\nexport type ControllersContainer = {\n buttons: IButtonController;\n touch: ITouchController;\n};\n\nexport function createDefaultControllers(\n baseURL: string,\n opts: DeviceControllerOptions,\n): ControllersContainer {\n const http: AxiosInstance = axios.create({\n baseURL: removeTrailingSlashes(baseURL),\n timeout: opts.timeoutMs ?? 1500,\n headers: {\n \"X-Ledger-Client-Version\": opts.clientHeader ?? \"ldmk-transport-speculos\",\n },\n transitional: { clarifyTimeoutError: true },\n });\n\n const axes: AxisMap = createAxes(opts.screens);\n\n const buttons: IButtonController = new AxiosButtonController(http);\n const touch: ITouchController = new AxiosTouchController(http, axes);\n\n return { buttons, touch };\n}\n"],
5
- "mappings": "AAAA,OAAOA,MAAmC,QAE1C,OAAS,yBAAAC,MAA6B,2CACtC,OAAS,wBAAAC,MAA4B,0CAIrC,OAAuB,cAAAC,MAAkB,4BAEzC,MAAMC,EAAyBC,GAAgBA,EAAI,QAAQ,OAAQ,EAAE,EAO9D,SAASC,EACdC,EACAC,EACsB,CACtB,MAAMC,EAAsBT,EAAM,OAAO,CACvC,QAASI,EAAsBG,CAAO,EACtC,QAASC,EAAK,WAAa,KAC3B,QAAS,CACP,0BAA2BA,EAAK,cAAgB,yBAClD,EACA,aAAc,CAAE,oBAAqB,EAAK,CAC5C,CAAC,EAEKE,EAAgBP,EAAWK,EAAK,OAAO,EAEvCG,EAA6B,IAAIV,EAAsBQ,CAAI,EAC3DG,EAA0B,IAAIV,EAAqBO,EAAMC,CAAI,EAEnE,MAAO,CAAE,QAAAC,EAAS,MAAAC,CAAM,CAC1B",
6
- "names": ["axios", "AxiosButtonController", "AxiosTouchController", "createAxes", "removeTrailingSlashes", "url", "createDefaultControllers", "baseURL", "opts", "http", "axes", "buttons", "touch"]
4
+ "sourcesContent": ["import axios, { type AxiosInstance } from \"axios\";\n\nimport { DefaultButtonController } from \"@internal/adapters/DefaultButtonController\";\nimport { DefaultTouchController } from \"@internal/adapters/DefaultTouchController\";\nimport type { ButtonController } from \"@internal/core/ButtonController\";\nimport type { DeviceControllerOptions } from \"@internal/core/types\";\nimport { type AxisMap, createAxes } from \"@internal/utils/axisClamp\";\nimport type { TouchController } from \"@root/src/internal/core/TouchController\";\n\nexport type ControllersContainer = {\n buttons: ButtonController;\n touch: TouchController;\n};\n\nexport function createDefaultControllers(\n baseURL: string,\n opts: DeviceControllerOptions,\n): ControllersContainer {\n const http: AxiosInstance = axios.create({\n baseURL: baseURL,\n timeout: opts.timeoutMs ?? 1500,\n headers: {\n \"X-Ledger-Client-Version\": opts.clientHeader ?? \"ldmk-transport-speculos\",\n },\n transitional: { clarifyTimeoutError: true },\n });\n\n const axes: AxisMap = createAxes(opts.screens);\n\n const buttons: ButtonController = new DefaultButtonController(http);\n const touch: TouchController = new DefaultTouchController(http, axes);\n\n return { buttons, touch };\n}\n"],
5
+ "mappings": "AAAA,OAAOA,MAAmC,QAE1C,OAAS,2BAAAC,MAA+B,6CACxC,OAAS,0BAAAC,MAA8B,4CAGvC,OAAuB,cAAAC,MAAkB,4BAQlC,SAASC,EACdC,EACAC,EACsB,CACtB,MAAMC,EAAsBP,EAAM,OAAO,CACvC,QAASK,EACT,QAASC,EAAK,WAAa,KAC3B,QAAS,CACP,0BAA2BA,EAAK,cAAgB,yBAClD,EACA,aAAc,CAAE,oBAAqB,EAAK,CAC5C,CAAC,EAEKE,EAAgBL,EAAWG,EAAK,OAAO,EAEvCG,EAA4B,IAAIR,EAAwBM,CAAI,EAC5DG,EAAyB,IAAIR,EAAuBK,EAAMC,CAAI,EAEpE,MAAO,CAAE,QAAAC,EAAS,MAAAC,CAAM,CAC1B",
6
+ "names": ["axios", "DefaultButtonController", "DefaultTouchController", "createAxes", "createDefaultControllers", "baseURL", "opts", "http", "axes", "buttons", "touch"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import r from"axios";import{afterEach as p,describe as i,expect as o,it as c,vi as s}from"vitest";import{AxiosButtonController as u}from"./adapters/AxiosButtonController";import{AxiosTouchController as m}from"./adapters/AxiosTouchController";import{createDefaultControllers as n}from"./di";const a={flex:{width:128,height:64},stax:{width:400,height:672}};p(()=>{s.restoreAllMocks()});i("createDefaultControllers - axios configuration",()=>{c("configures axios with normalised baseURL, custom timeout and header",()=>{const t=s.spyOn(r,"create").mockImplementation(l=>({post:s.fn(),defaults:{...l}}));n("http://example.com/api///",{screens:a,timeoutMs:2345,clientHeader:"test-client"}),o(t).toHaveBeenCalledTimes(1);const e=t.mock.calls[0][0];o(e.baseURL).toBe("http://example.com/api"),o(e.timeout).toBe(2345),o(e.headers?.["X-Ledger-Client-Version"]).toBe("test-client"),o(e.transitional?.clarifyTimeoutError).toBe(!0)}),c("applies default timeout and client header when not provided",()=>{const t=s.spyOn(r,"create").mockImplementation(l=>({post:s.fn(),defaults:{...l}}));n("http://localhost:1234////",{screens:a});const e=t.mock.calls[0][0];o(e.baseURL).toBe("http://localhost:1234"),o(e.timeout).toBe(1500),o(e.headers?.["X-Ledger-Client-Version"]).toBe("ldmk-transport-speculos")})});i("createDefaultControllers - wiring",()=>{c("returns axios implementations wired by the factory",()=>{const t={post:s.fn()};s.spyOn(r,"create").mockReturnValue(t);const{buttons:e,touch:l}=n("http://x",{screens:a});o(e).toBeInstanceOf(u),o(l).toBeInstanceOf(m),o(typeof e.press).toBe("function")}),c("creates fresh instances per invocation",()=>{s.spyOn(r,"create").mockReturnValueOnce({post:s.fn()}).mockReturnValueOnce({post:s.fn()});const t=n("http://x",{screens:a}),e=n("http://x",{screens:a});o(t.buttons).not.toBe(e.buttons),o(t.touch).not.toBe(e.touch)}),c("button.press posts the correct payload",async()=>{const t=s.fn().mockResolvedValue(void 0);s.spyOn(r,"create").mockReturnValue({post:t});const{buttons:e}=n("http://x",{screens:a});await e.press("left"),o(t).toHaveBeenCalledWith("/button/left",{action:"press-and-release"})}),c("touch.tapAndRelease maps percent to absolute coords",async()=>{const t=s.fn().mockResolvedValue(void 0);s.spyOn(r,"create").mockReturnValue({post:t});const{touch:e}=n("http://x",{screens:a});await e.tapAndRelease("flex",{x:50,y:50}),o(t).toHaveBeenCalledWith("/finger",{action:"press-and-release",x:64,y:32})})});
1
+ import r from"axios";import{afterEach as p,describe as i,expect as o,it as c,vi as n}from"vitest";import{DefaultButtonController as u}from"./adapters/DefaultButtonController";import{DefaultTouchController as m}from"./adapters/DefaultTouchController";import{createDefaultControllers as s}from"./di";const a={flex:{width:128,height:64},stax:{width:400,height:672}};p(()=>{n.restoreAllMocks()});i("createDefaultControllers - axios configuration",()=>{c("configures axios with normalised baseURL, custom timeout and header",()=>{const t=n.spyOn(r,"create").mockImplementation(l=>({post:n.fn(),defaults:{...l}}));s("http://example.com/api",{screens:a,timeoutMs:2345,clientHeader:"test-client"}),o(t).toHaveBeenCalledTimes(1);const e=t.mock.calls[0][0];o(e.baseURL).toBe("http://example.com/api"),o(e.timeout).toBe(2345),o(e.headers?.["X-Ledger-Client-Version"]).toBe("test-client"),o(e.transitional?.clarifyTimeoutError).toBe(!0)}),c("applies default timeout and client header when not provided",()=>{const t=n.spyOn(r,"create").mockImplementation(l=>({post:n.fn(),defaults:{...l}}));s("http://localhost:1234",{screens:a});const e=t.mock.calls[0][0];o(e.baseURL).toBe("http://localhost:1234"),o(e.timeout).toBe(1500),o(e.headers?.["X-Ledger-Client-Version"]).toBe("ldmk-transport-speculos")})});i("createDefaultControllers - wiring",()=>{c("returns axios implementations wired by the factory",()=>{const t={post:n.fn()};n.spyOn(r,"create").mockReturnValue(t);const{buttons:e,touch:l}=s("http://x",{screens:a});o(e).toBeInstanceOf(u),o(l).toBeInstanceOf(m),o(typeof e.press).toBe("function")}),c("creates fresh instances per invocation",()=>{n.spyOn(r,"create").mockReturnValueOnce({post:n.fn()}).mockReturnValueOnce({post:n.fn()});const t=s("http://x",{screens:a}),e=s("http://x",{screens:a});o(t.buttons).not.toBe(e.buttons),o(t.touch).not.toBe(e.touch)}),c("button.press posts the correct payload",async()=>{const t=n.fn().mockResolvedValue(void 0);n.spyOn(r,"create").mockReturnValue({post:t});const{buttons:e}=s("http://x",{screens:a});await e.press("left"),o(t).toHaveBeenCalledWith("/button/left",{action:"press-and-release"})}),c("touch.tapAndRelease maps percent to absolute coords",async()=>{const t=n.fn().mockResolvedValue(void 0);n.spyOn(r,"create").mockReturnValue({post:t});const{touch:e}=s("http://x",{screens:a});await e.tapAndRelease("flex",{x:50,y:50}),o(t).toHaveBeenCalledWith("/finger",{action:"press-and-release",x:64,y:32})})});
2
2
  //# sourceMappingURL=di.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/internal/di.test.ts"],
4
- "sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n\nimport axios from \"axios\";\nimport { afterEach, describe, expect, it, vi } from \"vitest\";\n\nimport { AxiosButtonController } from \"@internal/adapters/AxiosButtonController\";\nimport { AxiosTouchController } from \"@internal/adapters/AxiosTouchController\";\n\nimport { createDefaultControllers } from \"./di\";\n\nconst SCREENS = {\n flex: { width: 128, height: 64 },\n stax: { width: 400, height: 672 },\n} as const;\n\nafterEach(() => {\n vi.restoreAllMocks();\n});\n\ndescribe(\"createDefaultControllers - axios configuration\", () => {\n it(\"configures axios with normalised baseURL, custom timeout and header\", () => {\n const createSpy = vi\n .spyOn(axios, \"create\")\n .mockImplementation((cfg: any) => {\n return { post: vi.fn(), defaults: { ...cfg } } as any;\n });\n\n createDefaultControllers(\"http://example.com/api///\", {\n screens: SCREENS,\n timeoutMs: 2345,\n clientHeader: \"test-client\",\n });\n\n expect(createSpy).toHaveBeenCalledTimes(1);\n const cfg = createSpy.mock.calls[0]![0] as any;\n expect(cfg.baseURL).toBe(\"http://example.com/api\");\n expect(cfg.timeout).toBe(2345);\n expect(cfg.headers?.[\"X-Ledger-Client-Version\"]).toBe(\"test-client\");\n expect(cfg.transitional?.clarifyTimeoutError).toBe(true);\n });\n\n it(\"applies default timeout and client header when not provided\", () => {\n const createSpy = vi\n .spyOn(axios, \"create\")\n .mockImplementation((cfg: any) => {\n return { post: vi.fn(), defaults: { ...cfg } } as any;\n });\n\n createDefaultControllers(\"http://localhost:1234////\", { screens: SCREENS });\n\n const cfg = createSpy.mock.calls[0]![0] as any;\n expect(cfg.baseURL).toBe(\"http://localhost:1234\");\n expect(cfg.timeout).toBe(1500);\n expect(cfg.headers?.[\"X-Ledger-Client-Version\"]).toBe(\n \"ldmk-transport-speculos\",\n );\n });\n});\n\ndescribe(\"createDefaultControllers - wiring\", () => {\n it(\"returns axios implementations wired by the factory\", () => {\n const http = { post: vi.fn() } as any;\n vi.spyOn(axios, \"create\").mockReturnValue(http);\n\n const { buttons, touch } = createDefaultControllers(\"http://x\", {\n screens: SCREENS,\n });\n\n expect(buttons).toBeInstanceOf(AxiosButtonController);\n expect(touch).toBeInstanceOf(AxiosTouchController);\n expect(typeof (buttons as any).press).toBe(\"function\");\n });\n\n it(\"creates fresh instances per invocation\", () => {\n vi.spyOn(axios, \"create\")\n .mockReturnValueOnce({ post: vi.fn() } as any)\n .mockReturnValueOnce({ post: vi.fn() } as any);\n\n const a = createDefaultControllers(\"http://x\", { screens: SCREENS });\n const b = createDefaultControllers(\"http://x\", { screens: SCREENS });\n\n expect(a.buttons).not.toBe(b.buttons);\n expect(a.touch).not.toBe(b.touch);\n });\n\n it(\"button.press posts the correct payload\", async () => {\n const post = vi.fn().mockResolvedValue(undefined);\n vi.spyOn(axios, \"create\").mockReturnValue({ post } as any);\n\n const { buttons } = createDefaultControllers(\"http://x\", {\n screens: SCREENS,\n });\n\n await buttons.press(\"left\");\n expect(post).toHaveBeenCalledWith(\"/button/left\", {\n action: \"press-and-release\",\n });\n });\n\n it(\"touch.tapAndRelease maps percent to absolute coords\", async () => {\n const post = vi.fn().mockResolvedValue(undefined);\n vi.spyOn(axios, \"create\").mockReturnValue({ post } as any);\n\n const { touch } = createDefaultControllers(\"http://x\", {\n screens: SCREENS,\n });\n\n // 50% of 128x64 \u2192 (64, 32)\n await touch.tapAndRelease(\"flex\", { x: 50 as any, y: 50 as any });\n\n expect(post).toHaveBeenCalledWith(\"/finger\", {\n action: \"press-and-release\",\n x: 64,\n y: 32,\n });\n });\n});\n"],
5
- "mappings": "AAMA,OAAOA,MAAW,QAClB,OAAS,aAAAC,EAAW,YAAAC,EAAU,UAAAC,EAAQ,MAAAC,EAAI,MAAAC,MAAU,SAEpD,OAAS,yBAAAC,MAA6B,2CACtC,OAAS,wBAAAC,MAA4B,0CAErC,OAAS,4BAAAC,MAAgC,OAEzC,MAAMC,EAAU,CACd,KAAM,CAAE,MAAO,IAAK,OAAQ,EAAG,EAC/B,KAAM,CAAE,MAAO,IAAK,OAAQ,GAAI,CAClC,EAEAR,EAAU,IAAM,CACdI,EAAG,gBAAgB,CACrB,CAAC,EAEDH,EAAS,iDAAkD,IAAM,CAC/DE,EAAG,sEAAuE,IAAM,CAC9E,MAAMM,EAAYL,EACf,MAAML,EAAO,QAAQ,EACrB,mBAAoBW,IACZ,CAAE,KAAMN,EAAG,GAAG,EAAG,SAAU,CAAE,GAAGM,CAAI,CAAE,EAC9C,EAEHH,EAAyB,4BAA6B,CACpD,QAASC,EACT,UAAW,KACX,aAAc,aAChB,CAAC,EAEDN,EAAOO,CAAS,EAAE,sBAAsB,CAAC,EACzC,MAAMC,EAAMD,EAAU,KAAK,MAAM,CAAC,EAAG,CAAC,EACtCP,EAAOQ,EAAI,OAAO,EAAE,KAAK,wBAAwB,EACjDR,EAAOQ,EAAI,OAAO,EAAE,KAAK,IAAI,EAC7BR,EAAOQ,EAAI,UAAU,yBAAyB,CAAC,EAAE,KAAK,aAAa,EACnER,EAAOQ,EAAI,cAAc,mBAAmB,EAAE,KAAK,EAAI,CACzD,CAAC,EAEDP,EAAG,8DAA+D,IAAM,CACtE,MAAMM,EAAYL,EACf,MAAML,EAAO,QAAQ,EACrB,mBAAoBW,IACZ,CAAE,KAAMN,EAAG,GAA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AAG,MAAML,EAAO,QAAQ,EAAE,gBAAgB,CAAE,KAAAiB,CAAK,CAAQ,EAEzD,KAAM,CAAE,QAAAJ,CAAQ,EAAIL,EAAyB,WAAY,CACvD,QAASC,CACX,CAAC,EAED,MAAMI,EAAQ,MAAM,MAAM,EAC1BV,EAAOc,CAAI,EAAE,qBAAqB,eAAgB,CAChD,OAAQ,mBACV,CAAC,CACH,CAAC,EAEDb,EAAG,sDAAuD,SAAY,CACpE,MAAMa,EAAOZ,EAAG,GAAG,EAAE,kBAAkB,MAAS,EAChDA,EAAG,MAAML,EAAO,QAAQ,EAAE,gBAAgB,CAAE,KAAAiB,CAAK,CAAQ,EAEzD,KAAM,CAAE,MAAAH,CAAM,EAAIN,EAAyB,WAAY,CACrD,QAASC,CACX,CAAC,EAGD,MAAMK,EAAM,cAAc,OAAQ,CAAE,EAAG,GAAW,EAAG,EAAU,CAAC,EAEhEX,EAAOc,CAAI,EAAE,qBAAqB,UAAW,CAC3C,OAAQ,oBACR,EAAG,GACH,EAAG,EACL,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["axios", "afterEach", "describe", "expect", "it", "vi", "AxiosButtonController", "AxiosTouchController", "createDefaultControllers", "SCREENS", "createSpy", "cfg", "http", "buttons", "touch", "a", "b", "post"]
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n\nimport axios from \"axios\";\nimport { afterEach, describe, expect, it, vi } from \"vitest\";\n\nimport { DefaultButtonController } from \"@internal/adapters/DefaultButtonController\";\nimport { DefaultTouchController } from \"@internal/adapters/DefaultTouchController\";\n\nimport { createDefaultControllers } from \"./di\";\n\nconst SCREENS = {\n flex: { width: 128, height: 64 },\n stax: { width: 400, height: 672 },\n} as const;\n\nafterEach(() => {\n vi.restoreAllMocks();\n});\n\ndescribe(\"createDefaultControllers - axios configuration\", () => {\n it(\"configures axios with normalised baseURL, custom timeout and header\", () => {\n const createSpy = vi\n .spyOn(axios, \"create\")\n .mockImplementation((cfg: any) => {\n return { post: vi.fn(), defaults: { ...cfg } } as any;\n });\n\n createDefaultControllers(\"http://example.com/api\", {\n screens: SCREENS,\n timeoutMs: 2345,\n clientHeader: \"test-client\",\n });\n\n expect(createSpy).toHaveBeenCalledTimes(1);\n const cfg = createSpy.mock.calls[0]![0] as any;\n expect(cfg.baseURL).toBe(\"http://example.com/api\");\n expect(cfg.timeout).toBe(2345);\n expect(cfg.headers?.[\"X-Ledger-Client-Version\"]).toBe(\"test-client\");\n expect(cfg.transitional?.clarifyTimeoutError).toBe(true);\n });\n\n it(\"applies default timeout and client header when not provided\", () => {\n const createSpy = vi\n .spyOn(axios, \"create\")\n .mockImplementation((cfg: any) => {\n return { post: vi.fn(), defaults: { ...cfg } } as any;\n });\n\n createDefaultControllers(\"http://localhost:1234\", { screens: SCREENS });\n\n const cfg = createSpy.mock.calls[0]![0] as any;\n expect(cfg.baseURL).toBe(\"http://localhost:1234\");\n expect(cfg.timeout).toBe(1500);\n expect(cfg.headers?.[\"X-Ledger-Client-Version\"]).toBe(\n \"ldmk-transport-speculos\",\n );\n });\n});\n\ndescribe(\"createDefaultControllers - wiring\", () => {\n it(\"returns axios implementations wired by the factory\", () => {\n const http = { post: vi.fn() } as any;\n vi.spyOn(axios, \"create\").mockReturnValue(http);\n\n const { buttons, touch } = createDefaultControllers(\"http://x\", {\n screens: SCREENS,\n });\n\n expect(buttons).toBeInstanceOf(DefaultButtonController);\n expect(touch).toBeInstanceOf(DefaultTouchController);\n expect(typeof (buttons as any).press).toBe(\"function\");\n });\n\n it(\"creates fresh instances per invocation\", () => {\n vi.spyOn(axios, \"create\")\n .mockReturnValueOnce({ post: vi.fn() } as any)\n .mockReturnValueOnce({ post: vi.fn() } as any);\n\n const a = createDefaultControllers(\"http://x\", { screens: SCREENS });\n const b = createDefaultControllers(\"http://x\", { screens: SCREENS });\n\n expect(a.buttons).not.toBe(b.buttons);\n expect(a.touch).not.toBe(b.touch);\n });\n\n it(\"button.press posts the correct payload\", async () => {\n const post = vi.fn().mockResolvedValue(undefined);\n vi.spyOn(axios, \"create\").mockReturnValue({ post } as any);\n\n const { buttons } = createDefaultControllers(\"http://x\", {\n screens: SCREENS,\n });\n\n await buttons.press(\"left\");\n expect(post).toHaveBeenCalledWith(\"/button/left\", {\n action: \"press-and-release\",\n });\n });\n\n it(\"touch.tapAndRelease maps percent to absolute coords\", async () => {\n const post = vi.fn().mockResolvedValue(undefined);\n vi.spyOn(axios, \"create\").mockReturnValue({ post } as any);\n\n const { touch } = createDefaultControllers(\"http://x\", {\n screens: SCREENS,\n });\n\n // 50% of 128x64 \u2192 (64, 32)\n await touch.tapAndRelease(\"flex\", { x: 50 as any, y: 50 as any });\n\n expect(post).toHaveBeenCalledWith(\"/finger\", {\n action: \"press-and-release\",\n x: 64,\n y: 32,\n });\n });\n});\n"],
5
+ "mappings": "AAMA,OAAOA,MAAW,QAClB,OAAS,aAAAC,EAAW,YAAAC,EAAU,UAAAC,EAAQ,MAAAC,EAAI,MAAAC,MAAU,SAEpD,OAAS,2BAAAC,MAA+B,6CACxC,OAAS,0BAAAC,MAA8B,4CAEvC,OAAS,4BAAAC,MAAgC,OAEzC,MAAMC,EAAU,CACd,KAAM,CAAE,MAAO,IAAK,OAAQ,EAAG,EAC/B,KAAM,CAAE,MAAO,IAAK,OAAQ,GAAI,CAClC,EAEAR,EAAU,IAAM,CACdI,EAAG,gBAAgB,CACrB,CAAC,EAEDH,EAAS,iDAAkD,IAAM,CAC/DE,EAAG,sEAAuE,IAAM,CAC9E,MAAMM,EAAYL,EACf,MAAML,EAAO,QAAQ,EACrB,mBAAoBW,IACZ,CAAE,KAAMN,EAAG,GAAG,EAAG,SAAU,CAAE,GAAGM,CAAI,CAAE,EAC9C,EAEHH,EAAyB,yBAA0B,CACjD,QAASC,EACT,UAAW,KACX,aAAc,aAChB,C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rB,oBAAoB,CAAE,KAAMK,EAAG,GAAG,CAAE,CAAQ,EAC5C,oBAAoB,CAAE,KAAMA,EAAG,GAAG,CAAE,CAAQ,EAE/C,MAAMU,EAAIP,EAAyB,WAAY,CAAE,QAASC,CAAQ,CAAC,EAC7DO,EAAIR,EAAyB,WAAY,CAAE,QAASC,CAAQ,CAAC,EAEnEN,EAAOY,EAAE,OAAO,EAAE,IAAI,KAAKC,EAAE,OAAO,EACpCb,EAAOY,EAAE,KAAK,EAAE,IAAI,KAAKC,EAAE,KAAK,CAClC,CAAC,EAEDZ,EAAG,yCAA0C,SAAY,CACvD,MAAMa,EAAOZ,EAAG,GAAG,EAAE,kBAAkB,MAAS,EAChDA,EAAG,MAAML,EAAO,QAAQ,EAAE,gBAAgB,CAAE,KAAAiB,CAAK,CAAQ,EAEzD,KAAM,CAAE,QAAAJ,CAAQ,EAAIL,EAAyB,WAAY,CACvD,QAASC,CACX,CAAC,EAED,MAAMI,EAAQ,MAAM,MAAM,EAC1BV,EAAOc,CAAI,EAAE,qBAAqB,eAAgB,CAChD,OAAQ,mBACV,CAAC,CACH,CAAC,EAEDb,EAAG,sDAAuD,SAAY,CACpE,MAAMa,EAAOZ,EAAG,GAAG,EAAE,kBAAkB,MAAS,EAChDA,EAAG,MAAML,EAAO,QAAQ,EAAE,gBAAgB,CAAE,KAAAiB,CAAK,CAAQ,EAEzD,KAAM,CAAE,MAAAH,CAAM,EAAIN,EAAyB,WAAY,CACrD,QAASC,CACX,CAAC,EAGD,MAAMK,EAAM,cAAc,OAAQ,CAAE,EAAG,GAAW,EAAG,EAAU,CAAC,EAEhEX,EAAOc,CAAI,EAAE,qBAAqB,UAAW,CAC3C,OAAQ,oBACR,EAAG,GACH,EAAG,EACL,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["axios", "afterEach", "describe", "expect", "it", "vi", "DefaultButtonController", "DefaultTouchController", "createDefaultControllers", "SCREENS", "createSpy", "cfg", "http", "buttons", "touch", "a", "b", "post"]
7
7
  }
@@ -1,2 +1,2 @@
1
- async function n(t,e,o=200){for(const r of e)await t.press(r),o>0&&await new Promise(i=>setTimeout(i,o))}function s(t){return{left:async()=>await t.press("left"),right:async()=>await t.press("right"),both:async()=>await t.press("both")}}export{s as pressButtons,n as pressSequence};
1
+ async function i(t,e,o=200){for(const r of e)await t.press(r),o>0&&await new Promise(n=>setTimeout(n,o))}function s(t){return{left:async()=>await t.press("left"),right:async()=>await t.press("right"),both:async()=>await t.press("both")}}export{s as pressButtons,i as pressSequence};
2
2
  //# sourceMappingURL=buttonUseCases.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/use-cases/buttonUseCases.ts"],
4
- "sourcesContent": ["import type { IButtonController } from \"@internal/core/IButtonController\";\nimport type { ButtonKey } from \"@internal/core/types\";\n\nexport async function pressSequence(\n buttons: IButtonController,\n keys: ButtonKey[],\n delayMs = 200,\n): Promise<void> {\n for (const k of keys) {\n await buttons.press(k);\n if (delayMs > 0) {\n await new Promise((r) => setTimeout(r, delayMs));\n }\n }\n}\n\nexport function pressButtons(buttons: IButtonController): {\n left: () => Promise<void>;\n right: () => Promise<void>;\n both: () => Promise<void>;\n} {\n return {\n left: async () => await buttons.press(\"left\"),\n right: async () => await buttons.press(\"right\"),\n both: async () => await buttons.press(\"both\"),\n };\n}\n"],
5
- "mappings": "AAGA,eAAsBA,EACpBC,EACAC,EACAC,EAAU,IACK,CACf,UAAWC,KAAKF,EACd,MAAMD,EAAQ,MAAMG,CAAC,EACjBD,EAAU,GACZ,MAAM,IAAI,QAASE,GAAM,WAAWA,EAAGF,CAAO,CAAC,CAGrD,CAEO,SAASG,EAAaL,EAI3B,CACA,MAAO,CACL,KAAM,SAAY,MAAMA,EAAQ,MAAM,MAAM,EAC5C,MAAO,SAAY,MAAMA,EAAQ,MAAM,OAAO,EAC9C,KAAM,SAAY,MAAMA,EAAQ,MAAM,MAAM,CAC9C,CACF",
4
+ "sourcesContent": ["import type { ButtonController } from \"@internal/core/ButtonController\";\nimport type { ButtonKey } from \"@internal/core/types\";\n\nconst DEFAULT_DELAY_MS = 200;\n\nexport async function pressSequence(\n buttons: ButtonController,\n keys: ButtonKey[],\n delayMs = DEFAULT_DELAY_MS,\n): Promise<void> {\n for (const k of keys) {\n await buttons.press(k);\n if (delayMs > 0) {\n await new Promise((r) => setTimeout(r, delayMs));\n }\n }\n}\n\nexport function pressButtons(buttons: ButtonController): {\n left: () => Promise<void>;\n right: () => Promise<void>;\n both: () => Promise<void>;\n} {\n return {\n left: async () => await buttons.press(\"left\"),\n right: async () => await buttons.press(\"right\"),\n both: async () => await buttons.press(\"both\"),\n };\n}\n"],
5
+ "mappings": "AAKA,eAAsBA,EACpBC,EACAC,EACAC,EAAU,IACK,CACf,UAAWC,KAAKF,EACd,MAAMD,EAAQ,MAAMG,CAAC,EACjBD,EAAU,GACZ,MAAM,IAAI,QAASE,GAAM,WAAWA,EAAGF,CAAO,CAAC,CAGrD,CAEO,SAASG,EAAaL,EAI3B,CACA,MAAO,CACL,KAAM,SAAY,MAAMA,EAAQ,MAAM,MAAM,EAC5C,MAAO,SAAY,MAAMA,EAAQ,MAAM,OAAO,EAC9C,KAAM,SAAY,MAAMA,EAAQ,MAAM,MAAM,CAC9C,CACF",
6
6
  "names": ["pressSequence", "buttons", "keys", "delayMs", "k", "r", "pressButtons"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/use-cases/buttonUseCases.test.ts"],
4
- "sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport { pressButtons, pressSequence } from \"./buttonUseCases\";\n\ntype ButtonKey = \"left\" | \"right\" | \"both\";\ntype IButtonController = { press: (k: ButtonKey) => Promise<void> };\n\nconst tick = () => Promise.resolve();\n\ndescribe(\"buttonUsecases\", () => {\n let controller: IButtonController & { press: ReturnType<typeof vi.fn> };\n\n beforeEach(() => {\n controller = {\n press: vi.fn(() => Promise.resolve()),\n };\n });\n\n afterEach(() => {\n vi.useRealTimers();\n vi.restoreAllMocks();\n });\n\n describe(\"pressButtons\", () => {\n it(\"returns functions that call controller.press with the correct keys\", async () => {\n const api = pressButtons(controller);\n\n await api.left();\n await api.right();\n await api.both();\n\n expect(controller.press).toHaveBeenCalledTimes(3);\n expect(controller.press).toHaveBeenNthCalledWith(1, \"left\");\n expect(controller.press).toHaveBeenNthCalledWith(2, \"right\");\n expect(controller.press).toHaveBeenNthCalledWith(3, \"both\");\n });\n });\n\n describe(\"pressSequence\", () => {\n it(\"presses keys in order and waits the default 200ms after each key (including last)\", async () => {\n vi.useFakeTimers();\n const timeoutSpy = vi.spyOn(globalThis, \"setTimeout\");\n const keys: ButtonKey[] = [\"left\", \"right\", \"both\"];\n\n const promise = pressSequence(controller, keys); // delay = 200\n\n // first press happens immediately (sync call of controller.press)\n expect(controller.press).toHaveBeenCalledTimes(1);\n expect(controller.press).toHaveBeenNthCalledWith(1, \"left\");\n\n // timeout is scheduled after the awaited press resolves\n await tick();\n expect(timeoutSpy).toHaveBeenCalledTimes(1);\n expect(timeoutSpy).toHaveBeenLastCalledWith(expect.any(Function), 200);\n\n // first delay elapse -> second press\n await vi.advanceTimersByTimeAsync(200);\n await tick();\n expect(controller.press).toHaveBeenCalledTimes(2);\n expect(controller.press).toHaveBeenNthCalledWith(2, \"right\");\n\n // next delay -> third press\n await vi.advanceTimersByTimeAsync(200);\n await tick();\n expect(controller.press).toHaveBeenCalledTimes(3);\n expect(controller.press).toHaveBeenNthCalledWith(3, \"both\");\n\n // final post-press delay\n await vi.advanceTimersByTimeAsync(200);\n await expect(promise).resolves.toBeUndefined();\n });\n\n it(\"uses the provided custom delay\", async () => {\n vi.useFakeTimers();\n const timeoutSpy = vi.spyOn(globalThis, \"setTimeout\");\n const keys: ButtonKey[] = [\"left\", \"right\"];\n\n const promise = pressSequence(controller, keys, 75);\n\n await tick();\n expect(timeoutSpy).toHaveBeenCalledTimes(1);\n expect(timeoutSpy).toHaveBeenLastCalledWith(expect.any(Function), 75);\n\n await vi.advanceTimersByTimeAsync(75);\n await tick();\n expect(timeoutSpy).toHaveBeenCalledTimes(2);\n expect(timeoutSpy).toHaveBeenLastCalledWith(expect.any(Function), 75);\n\n await vi.advanceTimersByTimeAsync(75);\n await expect(promise).resolves.toBeUndefined();\n });\n\n it(\"rejects if a press fails and stops processing subsequent keys\", async () => {\n vi.useFakeTimers();\n\n const err = new Error(\"oups\");\n controller.press\n .mockResolvedValueOnce(undefined) // first ok\n .mockRejectedValueOnce(err); // second fails\n\n const keys: ButtonKey[] = [\"left\", \"right\", \"both\"];\n\n const p = pressSequence(controller, keys, 50);\n\n const assertion = expect(p).rejects.toThrow(\"oups\");\n\n await Promise.resolve(); // let first setTimeout schedule\n await vi.advanceTimersByTimeAsync(50);\n await Promise.resolve();\n\n await assertion;\n\n expect(controller.press).toHaveBeenCalledTimes(2);\n expect(controller.press).toHaveBeenNthCalledWith(1, \"left\");\n expect(controller.press).toHaveBeenNthCalledWith(2, \"right\");\n });\n });\n});\n"],
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport { pressButtons, pressSequence } from \"./buttonUseCases\";\n\ntype ButtonKey = \"left\" | \"right\" | \"both\";\ntype ButtonController = { press: (k: ButtonKey) => Promise<void> };\n\nconst tick = () => Promise.resolve();\n\ndescribe(\"buttonUsecases\", () => {\n let controller: ButtonController & { press: ReturnType<typeof vi.fn> };\n\n beforeEach(() => {\n controller = {\n press: vi.fn(() => Promise.resolve()),\n };\n });\n\n afterEach(() => {\n vi.useRealTimers();\n vi.restoreAllMocks();\n });\n\n describe(\"pressButtons\", () => {\n it(\"returns functions that call controller.press with the correct keys\", async () => {\n const api = pressButtons(controller);\n\n await api.left();\n await api.right();\n await api.both();\n\n expect(controller.press).toHaveBeenCalledTimes(3);\n expect(controller.press).toHaveBeenNthCalledWith(1, \"left\");\n expect(controller.press).toHaveBeenNthCalledWith(2, \"right\");\n expect(controller.press).toHaveBeenNthCalledWith(3, \"both\");\n });\n });\n\n describe(\"pressSequence\", () => {\n it(\"presses keys in order and waits the default 200ms after each key (including last)\", async () => {\n vi.useFakeTimers();\n const timeoutSpy = vi.spyOn(globalThis, \"setTimeout\");\n const keys: ButtonKey[] = [\"left\", \"right\", \"both\"];\n\n const promise = pressSequence(controller, keys); // delay = 200\n\n // first press happens immediately (sync call of controller.press)\n expect(controller.press).toHaveBeenCalledTimes(1);\n expect(controller.press).toHaveBeenNthCalledWith(1, \"left\");\n\n // timeout is scheduled after the awaited press resolves\n await tick();\n expect(timeoutSpy).toHaveBeenCalledTimes(1);\n expect(timeoutSpy).toHaveBeenLastCalledWith(expect.any(Function), 200);\n\n // first delay elapse -> second press\n await vi.advanceTimersByTimeAsync(200);\n await tick();\n expect(controller.press).toHaveBeenCalledTimes(2);\n expect(controller.press).toHaveBeenNthCalledWith(2, \"right\");\n\n // next delay -> third press\n await vi.advanceTimersByTimeAsync(200);\n await tick();\n expect(controller.press).toHaveBeenCalledTimes(3);\n expect(controller.press).toHaveBeenNthCalledWith(3, \"both\");\n\n // final post-press delay\n await vi.advanceTimersByTimeAsync(200);\n await expect(promise).resolves.toBeUndefined();\n });\n\n it(\"uses the provided custom delay\", async () => {\n vi.useFakeTimers();\n const timeoutSpy = vi.spyOn(globalThis, \"setTimeout\");\n const keys: ButtonKey[] = [\"left\", \"right\"];\n\n const promise = pressSequence(controller, keys, 75);\n\n await tick();\n expect(timeoutSpy).toHaveBeenCalledTimes(1);\n expect(timeoutSpy).toHaveBeenLastCalledWith(expect.any(Function), 75);\n\n await vi.advanceTimersByTimeAsync(75);\n await tick();\n expect(timeoutSpy).toHaveBeenCalledTimes(2);\n expect(timeoutSpy).toHaveBeenLastCalledWith(expect.any(Function), 75);\n\n await vi.advanceTimersByTimeAsync(75);\n await expect(promise).resolves.toBeUndefined();\n });\n\n it(\"rejects if a press fails and stops processing subsequent keys\", async () => {\n vi.useFakeTimers();\n\n const err = new Error(\"oups\");\n controller.press\n .mockResolvedValueOnce(undefined) // first ok\n .mockRejectedValueOnce(err); // second fails\n\n const keys: ButtonKey[] = [\"left\", \"right\", \"both\"];\n\n const p = pressSequence(controller, keys, 50);\n\n const assertion = expect(p).rejects.toThrow(\"oups\");\n\n await Promise.resolve(); // let first setTimeout schedule\n await vi.advanceTimersByTimeAsync(50);\n await Promise.resolve();\n\n await assertion;\n\n expect(controller.press).toHaveBeenCalledTimes(2);\n expect(controller.press).toHaveBeenNthCalledWith(1, \"left\");\n expect(controller.press).toHaveBeenNthCalledWith(2, \"right\");\n });\n });\n});\n"],
5
5
  "mappings": "AAGA,OAAS,gBAAAA,EAAc,iBAAAC,MAAqB,mBAK5C,MAAMC,EAAO,IAAM,QAAQ,QAAQ,EAEnC,SAAS,iBAAkB,IAAM,CAC/B,IAAIC,EAEJ,WAAW,IAAM,CACfA,EAAa,CACX,MAAO,GAAG,GAAG,IAAM,QAAQ,QAAQ,CAAC,CACtC,CACF,CAAC,EAED,UAAU,IAAM,CACd,GAAG,cAAc,EACjB,GAAG,gBAAgB,CACrB,CAAC,EAED,SAAS,eAAgB,IAAM,CAC7B,GAAG,qEAAsE,SAAY,CACnF,MAAMC,EAAMJ,EAAaG,CAAU,EAEnC,MAAMC,EAAI,KAAK,EACf,MAAMA,EAAI,MAAM,EAChB,MAAMA,EAAI,KAAK,EAEf,OAAOD,EAAW,KAAK,EAAE,sBAAsB,CAAC,EAChD,OAAOA,EAAW,KAAK,EAAE,wBAAwB,EAAG,MAAM,EAC1D,OAAOA,EAAW,KAAK,EAAE,wBAAwB,EAAG,OAAO,EAC3D,OAAOA,EAAW,KAAK,EAAE,wBAAwB,EAAG,MAAM,CAC5D,CAAC,CACH,CAAC,EAED,SAAS,gBAAiB,IAA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pC,MAAM,OAAOC,CAAO,EAAE,SAAS,cAAc,CAC/C,CAAC,EAED,GAAG,gEAAiE,SAAY,CAC9E,GAAG,cAAc,EAEjB,MAAMC,EAAM,IAAI,MAAM,MAAM,EAC5BJ,EAAW,MACR,sBAAsB,MAAS,EAC/B,sBAAsBI,CAAG,EAI5B,MAAMC,EAAIP,EAAcE,EAFE,CAAC,OAAQ,QAAS,MAAM,EAER,EAAE,EAEtCM,EAAY,OAAOD,CAAC,EAAE,QAAQ,QAAQ,MAAM,EAElD,MAAM,QAAQ,QAAQ,EACtB,MAAM,GAAG,yBAAyB,EAAE,EACpC,MAAM,QAAQ,QAAQ,EAEtB,MAAMC,EAEN,OAAON,EAAW,KAAK,EAAE,sBAAsB,CAAC,EAChD,OAAOA,EAAW,KAAK,EAAE,wBAAwB,EAAG,MAAM,EAC1D,OAAOA,EAAW,KAAK,EAAE,wBAAwB,EAAG,OAAO,CAC7D,CAAC,CACH,CAAC,CACH,CAAC",
6
6
  "names": ["pressButtons", "pressSequence", "tick", "controller", "api", "timeoutSpy", "promise", "err", "p", "assertion"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/use-cases/touchUseCases.ts"],
4
- "sourcesContent": ["import { type ITouchController } from \"@internal/core/ITouchController\";\nimport type { PercentCoordinates } from \"@internal/core/types\";\n\nconst TAP_LONG_TIME_MS = 5000;\n\nexport const tapLong =\n <K extends string>(touch: ITouchController<K>, deviceKey: K) =>\n async (point: PercentCoordinates, delayMs: number = TAP_LONG_TIME_MS) => {\n await touch.tap(deviceKey, point);\n await new Promise((r) => setTimeout(r, delayMs));\n await touch.release(deviceKey, point);\n };\n\nexport const tapQuick =\n <K extends string>(touch: ITouchController<K>, deviceKey: K) =>\n async (point: PercentCoordinates) =>\n await touch.tapAndRelease(deviceKey, point);\n"],
5
- "mappings": "AAGA,MAAMA,EAAmB,IAEZC,EACX,CAAmBC,EAA4BC,IAC/C,MAAOC,EAA2BC,EAAkBL,IAAqB,CACvE,MAAME,EAAM,IAAIC,EAAWC,CAAK,EAChC,MAAM,IAAI,QAASE,GAAM,WAAWA,EAAGD,CAAO,CAAC,EAC/C,MAAMH,EAAM,QAAQC,EAAWC,CAAK,CACtC,EAEWG,EACX,CAAmBL,EAA4BC,IAC/C,MAAOC,GACL,MAAMF,EAAM,cAAcC,EAAWC,CAAK",
4
+ "sourcesContent": ["import type { PercentCoordinates } from \"@internal/core/types\";\nimport { type TouchController } from \"@root/src/internal/core/TouchController\";\n\nconst TAP_LONG_TIME_MS = 5000;\n\nexport const tapLong =\n <K extends string>(touch: TouchController<K>, deviceKey: K) =>\n async (point: PercentCoordinates, delayMs: number = TAP_LONG_TIME_MS) => {\n await touch.tap(deviceKey, point);\n await new Promise((r) => setTimeout(r, delayMs));\n await touch.release(deviceKey, point);\n };\n\nexport const tapQuick =\n <K extends string>(touch: TouchController<K>, deviceKey: K) =>\n async (point: PercentCoordinates) =>\n await touch.tapAndRelease(deviceKey, point);\n"],
5
+ "mappings": "AAGA,MAAMA,EAAmB,IAEZC,EACX,CAAmBC,EAA2BC,IAC9C,MAAOC,EAA2BC,EAAkBL,IAAqB,CACvE,MAAME,EAAM,IAAIC,EAAWC,CAAK,EAChC,MAAM,IAAI,QAASE,GAAM,WAAWA,EAAGD,CAAO,CAAC,EAC/C,MAAMH,EAAM,QAAQC,EAAWC,CAAK,CACtC,EAEWG,EACX,CAAmBL,EAA2BC,IAC9C,MAAOC,GACL,MAAMF,EAAM,cAAcC,EAAWC,CAAK",
6
6
  "names": ["TAP_LONG_TIME_MS", "tapLong", "touch", "deviceKey", "point", "delayMs", "r", "tapQuick"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/use-cases/touchUseCases.test.ts"],
4
- "sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport type { ITouchController } from \"@internal/core/ITouchController\";\n\nimport { tapLong, tapQuick } from \"./touchUseCases\";\n\ndescribe(\"touchUsecases\", () => {\n const deviceKey = \"devA\";\n const point = { x: 50, y: 30 } as any;\n\n let controller: ITouchController;\n\n beforeEach(() => {\n controller = {\n tap: vi.fn().mockResolvedValue(undefined),\n release: vi.fn().mockResolvedValue(undefined),\n tapAndRelease: vi.fn().mockResolvedValue(undefined),\n } as unknown as ITouchController;\n vi.restoreAllMocks();\n vi.useRealTimers();\n });\n\n it(\"tapQuick calls tapAndRelease with the same deviceKey and point\", async () => {\n const quick = tapQuick(controller, deviceKey);\n await quick(point);\n\n expect(controller.tapAndRelease).toHaveBeenCalledTimes(1);\n expect(controller.tapAndRelease).toHaveBeenCalledWith(deviceKey, point);\n expect(controller.tap).not.toHaveBeenCalled();\n expect(controller.release).not.toHaveBeenCalled();\n });\n\n it(\"tapLong taps, waits default timeout, then releases\", async () => {\n vi.useFakeTimers();\n const timeoutSpy = vi.spyOn(globalThis, \"setTimeout\");\n\n const longTap = tapLong(controller, deviceKey);\n const run = longTap(point);\n\n await Promise.resolve();\n\n expect(controller.tap).toHaveBeenCalledTimes(1);\n expect(controller.tap).toHaveBeenCalledWith(deviceKey, point);\n expect(timeoutSpy).toHaveBeenCalledTimes(1);\n expect(timeoutSpy).toHaveBeenLastCalledWith(expect.any(Function), 5000);\n expect(controller.release).not.toHaveBeenCalled();\n\n // let the 5s timer elapse\n await vi.advanceTimersByTimeAsync(5000);\n await run;\n\n expect(controller.release).toHaveBeenCalledTimes(1);\n expect(controller.release).toHaveBeenCalledWith(deviceKey, point);\n });\n\n it(\"tapLong uses the provided delayMs value\", async () => {\n vi.useFakeTimers();\n const timeoutSpy = vi.spyOn(globalThis, \"setTimeout\");\n\n const customMs = 1234;\n const longTap = tapLong(controller, deviceKey);\n const run = longTap(point, customMs);\n\n await Promise.resolve();\n\n expect(controller.tap).toHaveBeenCalledTimes(1);\n expect(controller.tap).toHaveBeenCalledWith(deviceKey, point);\n expect(timeoutSpy).toHaveBeenCalledTimes(1);\n expect(timeoutSpy).toHaveBeenLastCalledWith(expect.any(Function), customMs);\n expect(controller.release).not.toHaveBeenCalled();\n\n // advance exactly customMs and ensure release happens then\n await vi.advanceTimersByTimeAsync(customMs);\n await run;\n\n expect(controller.release).toHaveBeenCalledTimes(1);\n expect(controller.release).toHaveBeenCalledWith(deviceKey, point);\n });\n\n it(\"tapLong propagates error if tap() rejects (no release)\", async () => {\n vi.useFakeTimers();\n\n const boom = new Error(\"tap failed\");\n (controller.tap as any).mockRejectedValueOnce(boom);\n\n const longTap = tapLong(controller, deviceKey);\n const p = longTap(point);\n\n // attach rejection handler immediately\n await expect(p).rejects.toThrow(\"tap failed\");\n expect(controller.release).not.toHaveBeenCalled();\n });\n\n it(\"tapLong propagates error if release() rejects\", async () => {\n vi.useFakeTimers();\n\n const boom = new Error(\"release failed\");\n (controller.release as any).mockRejectedValueOnce(boom);\n\n const p = tapLong(controller, deviceKey)(point);\n\n const assertion = expect(p).rejects.toThrow(\"release failed\");\n\n await Promise.resolve();\n await vi.advanceTimersByTimeAsync(5000);\n\n await assertion;\n\n expect(controller.tap).toHaveBeenCalledTimes(1);\n expect(controller.release).toHaveBeenCalledTimes(1);\n });\n});\n"],
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport type { TouchController } from \"@root/src/internal/core/TouchController\";\n\nimport { tapLong, tapQuick } from \"./touchUseCases\";\n\ndescribe(\"touchUsecases\", () => {\n const deviceKey = \"devA\";\n const point = { x: 50, y: 30 } as any;\n\n let controller: TouchController;\n\n beforeEach(() => {\n controller = {\n tap: vi.fn().mockResolvedValue(undefined),\n release: vi.fn().mockResolvedValue(undefined),\n tapAndRelease: vi.fn().mockResolvedValue(undefined),\n } as unknown as TouchController;\n vi.restoreAllMocks();\n vi.useRealTimers();\n });\n\n it(\"tapQuick calls tapAndRelease with the same deviceKey and point\", async () => {\n const quick = tapQuick(controller, deviceKey);\n await quick(point);\n\n expect(controller.tapAndRelease).toHaveBeenCalledTimes(1);\n expect(controller.tapAndRelease).toHaveBeenCalledWith(deviceKey, point);\n expect(controller.tap).not.toHaveBeenCalled();\n expect(controller.release).not.toHaveBeenCalled();\n });\n\n it(\"tapLong taps, waits default timeout, then releases\", async () => {\n vi.useFakeTimers();\n const timeoutSpy = vi.spyOn(globalThis, \"setTimeout\");\n\n const longTap = tapLong(controller, deviceKey);\n const run = longTap(point);\n\n await Promise.resolve();\n\n expect(controller.tap).toHaveBeenCalledTimes(1);\n expect(controller.tap).toHaveBeenCalledWith(deviceKey, point);\n expect(timeoutSpy).toHaveBeenCalledTimes(1);\n expect(timeoutSpy).toHaveBeenLastCalledWith(expect.any(Function), 5000);\n expect(controller.release).not.toHaveBeenCalled();\n\n // let the 5s timer elapse\n await vi.advanceTimersByTimeAsync(5000);\n await run;\n\n expect(controller.release).toHaveBeenCalledTimes(1);\n expect(controller.release).toHaveBeenCalledWith(deviceKey, point);\n });\n\n it(\"tapLong uses the provided delayMs value\", async () => {\n vi.useFakeTimers();\n const timeoutSpy = vi.spyOn(globalThis, \"setTimeout\");\n\n const customMs = 1234;\n const longTap = tapLong(controller, deviceKey);\n const run = longTap(point, customMs);\n\n await Promise.resolve();\n\n expect(controller.tap).toHaveBeenCalledTimes(1);\n expect(controller.tap).toHaveBeenCalledWith(deviceKey, point);\n expect(timeoutSpy).toHaveBeenCalledTimes(1);\n expect(timeoutSpy).toHaveBeenLastCalledWith(expect.any(Function), customMs);\n expect(controller.release).not.toHaveBeenCalled();\n\n // advance exactly customMs and ensure release happens then\n await vi.advanceTimersByTimeAsync(customMs);\n await run;\n\n expect(controller.release).toHaveBeenCalledTimes(1);\n expect(controller.release).toHaveBeenCalledWith(deviceKey, point);\n });\n\n it(\"tapLong propagates error if tap() rejects (no release)\", async () => {\n vi.useFakeTimers();\n\n const boom = new Error(\"tap failed\");\n (controller.tap as any).mockRejectedValueOnce(boom);\n\n const longTap = tapLong(controller, deviceKey);\n const p = longTap(point);\n\n // attach rejection handler immediately\n await expect(p).rejects.toThrow(\"tap failed\");\n expect(controller.release).not.toHaveBeenCalled();\n });\n\n it(\"tapLong propagates error if release() rejects\", async () => {\n vi.useFakeTimers();\n\n const boom = new Error(\"release failed\");\n (controller.release as any).mockRejectedValueOnce(boom);\n\n const p = tapLong(controller, deviceKey)(point);\n\n const assertion = expect(p).rejects.toThrow(\"release failed\");\n\n await Promise.resolve();\n await vi.advanceTimersByTimeAsync(5000);\n\n await assertion;\n\n expect(controller.tap).toHaveBeenCalledTimes(1);\n expect(controller.release).toHaveBeenCalledTimes(1);\n });\n});\n"],
5
5
  "mappings": "AAMA,OAAS,WAAAA,EAAS,YAAAC,MAAgB,kBAElC,SAAS,gBAAiB,IAAM,CAC9B,MAAMC,EAAY,OACZC,EAAQ,CAAE,EAAG,GAAI,EAAG,EAAG,EAE7B,IAAIC,EAEJ,WAAW,IAAM,CACfA,EAAa,CACX,IAAK,GAAG,GAAG,EAAE,kBAAkB,MAAS,EACxC,QAAS,GAAG,GAAG,EAAE,kBAAkB,MAAS,EAC5C,cAAe,GAAG,GAAG,EAAE,kBAAkB,MAAS,CACpD,EACA,GAAG,gBAAgB,EACnB,GAAG,cAAc,CACnB,CAAC,EAED,GAAG,iEAAkE,SAAY,CAE/E,MADcH,EAASG,EAAYF,CAAS,EAChCC,CAAK,EAEjB,OAAOC,EAAW,aAAa,EAAE,sBAAsB,CAAC,EACxD,OAAOA,EAAW,aAAa,EAAE,qBAAqBF,EAAWC,CAAK,EACtE,OAAOC,EAAW,GAAG,EAAE,IAAI,iBAAiB,EAC5C,OAAOA,EAAW,OAAO,EAAE,IAAI,iBAAiB,CAClD,CAAC,EAED,GAAG,qDAAsD,SA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,YAAY,EAClCJ,EAAW,IAAY,sBAAsBI,CAAI,EAGlD,MAAMC,EADUT,EAAQI,EAAYF,CAAS,EAC3BC,CAAK,EAGvB,MAAM,OAAOM,CAAC,EAAE,QAAQ,QAAQ,YAAY,EAC5C,OAAOL,EAAW,OAAO,EAAE,IAAI,iBAAiB,CAClD,CAAC,EAED,GAAG,gDAAiD,SAAY,CAC9D,GAAG,cAAc,EAEjB,MAAMI,EAAO,IAAI,MAAM,gBAAgB,EACtCJ,EAAW,QAAgB,sBAAsBI,CAAI,EAEtD,MAAMC,EAAIT,EAAQI,EAAYF,CAAS,EAAEC,CAAK,EAExCO,EAAY,OAAOD,CAAC,EAAE,QAAQ,QAAQ,gBAAgB,EAE5D,MAAM,QAAQ,QAAQ,EACtB,MAAM,GAAG,yBAAyB,GAAI,EAEtC,MAAMC,EAEN,OAAON,EAAW,GAAG,EAAE,sBAAsB,CAAC,EAC9C,OAAOA,EAAW,OAAO,EAAE,sBAAsB,CAAC,CACpD,CAAC,CACH,CAAC",
6
6
  "names": ["tapLong", "tapQuick", "deviceKey", "point", "controller", "timeoutSpy", "run", "customMs", "boom", "p", "assertion"]
7
7
  }
@@ -1,2 +1,2 @@
1
- const o=e=>Math.max(0,Math.min(100,e))/100,s=e=>t=>Math.floor(e*o(t)),c=e=>t=>Math.floor(e*o(t)),a=(e,t)=>({vw:s(e),vh:c(t),xy:(r,n)=>({x:Math.floor(e*o(r)),y:Math.floor(t*o(n))})}),x=e=>{const t={};for(const r of Object.keys(e)){const n=e[r];t[r]=a(n.width,n.height)}return t};export{x as createAxes,a as createAxis,c as createVH,s as createVW};
1
+ const c=e=>Math.max(0,Math.min(100,e))/100,s=e=>t=>Math.floor(e*c(t)),o=(e,t)=>({vw:s(e),vh:s(t),xy:(r,n)=>({x:s(e)(r),y:s(t)(n)})}),p=e=>{const t={};for(const r of Object.keys(e)){const n=e[r];t[r]=o(n.width,n.height)}return t};export{s as clampValue,p as createAxes,o as createAxis};
2
2
  //# sourceMappingURL=axisClamp.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/utils/axisClamp.ts"],
4
- "sourcesContent": ["import type { DeviceScreens, Percent } from \"@internal/core/types\";\n\nconst clamp = (pct: number) => Math.max(0, Math.min(100, pct)) / 100;\n\nexport const createVW = (width: number) => (pct: Percent) =>\n Math.floor(width * clamp(pct));\nexport const createVH = (height: number) => (pct: Percent) =>\n Math.floor(height * clamp(pct));\n\nexport const createAxis = (width: number, height: number) => ({\n vw: createVW(width),\n vh: createVH(height),\n xy: (xPct: Percent, yPct: Percent) => ({\n x: Math.floor(width * clamp(xPct)),\n y: Math.floor(height * clamp(yPct)),\n }),\n});\n\nexport type Axis = ReturnType<typeof createAxis>;\nexport type AxisMap<K extends string = string> = Record<K, Axis>;\n\nexport const createAxes = <K extends string>(\n screens: DeviceScreens<K>,\n): AxisMap<K> => {\n const mappedAxes = {} as AxisMap<K>;\n for (const key of Object.keys(screens) as K[]) {\n const screen = screens[key];\n mappedAxes[key] = createAxis(screen.width, screen.height);\n }\n return mappedAxes;\n};\n"],
5
- "mappings": "AAEA,MAAMA,EAASC,GAAgB,KAAK,IAAI,EAAG,KAAK,IAAI,IAAKA,CAAG,CAAC,EAAI,IAEpDC,EAAYC,GAAmBF,GAC1C,KAAK,MAAME,EAAQH,EAAMC,CAAG,CAAC,EAClBG,EAAYC,GAAoBJ,GAC3C,KAAK,MAAMI,EAASL,EAAMC,CAAG,CAAC,EAEnBK,EAAa,CAACH,EAAeE,KAAoB,CAC5D,GAAIH,EAASC,CAAK,EAClB,GAAIC,EAASC,CAAM,EACnB,GAAI,CAACE,EAAeC,KAAmB,CACrC,EAAG,KAAK,MAAML,EAAQH,EAAMO,CAAI,CAAC,EACjC,EAAG,KAAK,MAAMF,EAASL,EAAMQ,CAAI,CAAC,CACpC,EACF,GAKaC,EACXC,GACe,CACf,MAAMC,EAAa,CAAC,EACpB,UAAWC,KAAO,OAAO,KAAKF,CAAO,EAAU,CAC7C,MAAMG,EAASH,EAAQE,CAAG,EAC1BD,EAAWC,CAAG,EAAIN,EAAWO,EAAO,MAAOA,EAAO,MAAM,CAC1D,CACA,OAAOF,CACT",
6
- "names": ["clamp", "pct", "createVW", "width", "createVH", "height", "createAxis", "xPct", "yPct", "createAxes", "screens", "mappedAxes", "key", "screen"]
4
+ "sourcesContent": ["import type { DeviceScreens, Percent } from \"@internal/core/types\";\n\nconst clamp = (pct: number) => Math.max(0, Math.min(100, pct)) / 100;\n\nexport const clampValue = (value: number) => (pct: Percent) =>\n Math.floor(value * clamp(pct));\n\nexport const createAxis = (width: number, height: number) => ({\n vw: clampValue(width),\n vh: clampValue(height),\n xy: (xPct: Percent, yPct: Percent) => ({\n x: clampValue(width)(xPct),\n y: clampValue(height)(yPct),\n }),\n});\n\nexport type Axis = ReturnType<typeof createAxis>;\nexport type AxisMap<K extends string = string> = Record<K, Axis>;\n\nexport const createAxes = <K extends string>(\n screens: DeviceScreens<K>,\n): AxisMap<K> => {\n const mappedAxes = {} as AxisMap<K>;\n for (const key of Object.keys(screens) as K[]) {\n const screen = screens[key];\n mappedAxes[key] = createAxis(screen.width, screen.height);\n }\n return mappedAxes;\n};\n"],
5
+ "mappings": "AAEA,MAAMA,EAASC,GAAgB,KAAK,IAAI,EAAG,KAAK,IAAI,IAAKA,CAAG,CAAC,EAAI,IAEpDC,EAAcC,GAAmBF,GAC5C,KAAK,MAAME,EAAQH,EAAMC,CAAG,CAAC,EAElBG,EAAa,CAACC,EAAeC,KAAoB,CAC5D,GAAIJ,EAAWG,CAAK,EACpB,GAAIH,EAAWI,CAAM,EACrB,GAAI,CAACC,EAAeC,KAAmB,CACrC,EAAGN,EAAWG,CAAK,EAAEE,CAAI,EACzB,EAAGL,EAAWI,CAAM,EAAEE,CAAI,CAC5B,EACF,GAKaC,EACXC,GACe,CACf,MAAMC,EAAa,CAAC,EACpB,UAAWC,KAAO,OAAO,KAAKF,CAAO,EAAU,CAC7C,MAAMG,EAASH,EAAQE,CAAG,EAC1BD,EAAWC,CAAG,EAAIR,EAAWS,EAAO,MAAOA,EAAO,MAAM,CAC1D,CACA,OAAOF,CACT",
6
+ "names": ["clamp", "pct", "clampValue", "value", "createAxis", "width", "height", "xPct", "yPct", "createAxes", "screens", "mappedAxes", "key", "screen"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{createAxes as o,createAxis as s,createVH as x,createVW as a}from"./axisClamp";const e=t=>t;describe("axisClamp helpers",()=>{describe("createVW",()=>{it("floors and clamps to [0, width]",()=>{const t=a(200);expect(t(e(0))).toBe(0),expect(t(e(50))).toBe(100),expect(t(e(50.4))).toBe(100),expect(t(e(50.5))).toBe(101),expect(t(e(100))).toBe(200),expect(t(e(150))).toBe(200),expect(t(e(-10))).toBe(0)})}),describe("createVH",()=>{it("floors and clamps to [0, height]",()=>{const t=x(123);expect(t(e(0))).toBe(0),expect(t(e(33.3))).toBe(Math.floor(123*.333)),expect(t(e(100))).toBe(123),expect(t(e(999))).toBe(123),expect(t(e(-5))).toBe(0)})}),describe("createAxis",()=>{it("exposes vw, vh and xy with consistent flooring + clamping",()=>{const t=s(300,200);expect(t.vw(e(25))).toBe(75),expect(t.vh(e(75))).toBe(150),expect(t.xy(e(10),e(90))).toEqual({x:30,y:180}),expect(t.xy(e(150),e(-20))).toEqual({x:300,y:0});const c=t.xy(e(33.4),e(66.6));expect(c.x).toBe(Math.floor(300*.334)),expect(c.y).toBe(Math.floor(200*.666))})}),describe("createAxes",()=>{it("creates an AxisMap for all device keys with matching dimensions",()=>{const c=o({devA:{width:200,height:100},devB:{width:320,height:480}});expect(Object.keys(c).sort()).toEqual(["devA","devB"]),expect(c.devA.vw(e(100))).toBe(200),expect(c.devA.vh(e(100))).toBe(100),expect(c.devA.xy(e(120),e(-10))).toEqual({x:200,y:0}),expect(c.devB.vw(e(50))).toBe(160),expect(c.devB.vh(e(50))).toBe(240),expect(c.devB.xy(e(33.3),e(66.7))).toEqual({x:Math.floor(320*.333),y:Math.floor(480*.667)})})})});
1
+ import{clampValue as o,createAxes as s,createAxis as x}from"./axisClamp";const e=t=>t;describe("axisClamp helpers",()=>{describe("clampValue",()=>{it("floors and clamps to [0, width]",()=>{const t=o(200);expect(t(e(0))).toBe(0),expect(t(e(50))).toBe(100),expect(t(e(50.4))).toBe(100),expect(t(e(50.5))).toBe(101),expect(t(e(100))).toBe(200),expect(t(e(150))).toBe(200),expect(t(e(-10))).toBe(0)})}),describe("createAxis",()=>{it("exposes vw, vh and xy with consistent flooring + clamping",()=>{const t=x(300,200);expect(t.vw(e(25))).toBe(75),expect(t.vh(e(75))).toBe(150),expect(t.xy(e(10),e(90))).toEqual({x:30,y:180}),expect(t.xy(e(150),e(-20))).toEqual({x:300,y:0});const c=t.xy(e(33.4),e(66.6));expect(c.x).toBe(Math.floor(300*.334)),expect(c.y).toBe(Math.floor(200*.666))})}),describe("createAxes",()=>{it("creates an AxisMap for all device keys with matching dimensions",()=>{const c=s({devA:{width:200,height:100},devB:{width:320,height:480}});expect(Object.keys(c).sort()).toEqual(["devA","devB"]),expect(c.devA.vw(e(100))).toBe(200),expect(c.devA.vh(e(100))).toBe(100),expect(c.devA.xy(e(120),e(-10))).toEqual({x:200,y:0}),expect(c.devB.vw(e(50))).toBe(160),expect(c.devB.vh(e(50))).toBe(240),expect(c.devB.xy(e(33.3),e(66.7))).toEqual({x:Math.floor(320*.333),y:Math.floor(480*.667)})})})});
2
2
  //# sourceMappingURL=axisClamp.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/utils/axisClamp.test.ts"],
4
- "sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\nimport type { DeviceScreens, Percent } from \"@internal/core/types\";\n\nimport {\n type AxisMap,\n createAxes,\n createAxis,\n createVH,\n createVW,\n} from \"./axisClamp\";\n\nconst p = (n: number) => n as unknown as Percent;\n\ndescribe(\"axisClamp helpers\", () => {\n describe(\"createVW\", () => {\n it(\"floors and clamps to [0, width]\", () => {\n const vw = createVW(200);\n\n expect(vw(p(0))).toBe(0);\n expect(vw(p(50))).toBe(100); // 200 * 0.5 = 100\n expect(vw(p(50.4))).toBe(100); // floor(200 * 0.504) = 100\n expect(vw(p(50.5))).toBe(101); // floor(200 * 0.505) = 101\n expect(vw(p(100))).toBe(200);\n expect(vw(p(150))).toBe(200); // clamped\n expect(vw(p(-10))).toBe(0); // clamped\n });\n });\n\n describe(\"createVH\", () => {\n it(\"floors and clamps to [0, height]\", () => {\n const vh = createVH(123);\n\n expect(vh(p(0))).toBe(0);\n expect(vh(p(33.3))).toBe(Math.floor(123 * 0.333)); // flooring check\n expect(vh(p(100))).toBe(123);\n expect(vh(p(999))).toBe(123); // clamped\n expect(vh(p(-5))).toBe(0); // clamped\n });\n });\n\n describe(\"createAxis\", () => {\n it(\"exposes vw, vh and xy with consistent flooring + clamping\", () => {\n const axis = createAxis(300, 200);\n\n // vw / vh\n expect(axis.vw(p(25))).toBe(75); // 300 * 0.25\n expect(axis.vh(p(75))).toBe(150); // 200 * 0.75\n\n // xy nominal\n expect(axis.xy(p(10), p(90))).toEqual({ x: 30, y: 180 });\n\n // xy clamps both axes\n expect(axis.xy(p(150), p(-20))).toEqual({ x: 300, y: 0 });\n\n // flooring behavior with fractional percent\n const xy = axis.xy(p(33.4), p(66.6));\n expect(xy.x).toBe(Math.floor(300 * 0.334));\n expect(xy.y).toBe(Math.floor(200 * 0.666));\n });\n });\n\n describe(\"createAxes\", () => {\n it(\"creates an AxisMap for all device keys with matching dimensions\", () => {\n const screens: DeviceScreens<\"devA\" | \"devB\"> = {\n devA: { width: 200, height: 100 } as any,\n devB: { width: 320, height: 480 } as any,\n };\n\n const axes: AxisMap<\"devA\" | \"devB\"> = createAxes(screens);\n\n // contains both keys\n expect(Object.keys(axes).sort()).toEqual([\"devA\", \"devB\"]);\n\n // devA\n expect(axes.devA.vw(p(100))).toBe(200);\n expect(axes.devA.vh(p(100))).toBe(100);\n expect(axes.devA.xy(p(120), p(-10))).toEqual({ x: 200, y: 0 });\n\n // devB\n expect(axes.devB.vw(p(50))).toBe(160);\n expect(axes.devB.vh(p(50))).toBe(240);\n expect(axes.devB.xy(p(33.3), p(66.7))).toEqual({\n x: Math.floor(320 * 0.333),\n y: Math.floor(480 * 0.667),\n });\n });\n });\n});\n"],
5
- "mappings": "AAMA,OAEE,cAAAA,EACA,cAAAC,EACA,YAAAC,EACA,YAAAC,MACK,cAEP,MAAMC,EAAKC,GAAcA,EAEzB,SAAS,oBAAqB,IAAM,CAClC,SAAS,WAAY,IAAM,CACzB,GAAG,kCAAmC,IAAM,CAC1C,MAAMC,EAAKH,EAAS,GAAG,EAEvB,OAAOG,EAAGF,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EACvB,OAAOE,EAAGF,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,GAAG,EAC1B,OAAOE,EAAGF,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,GAAG,EAC5B,OAAOE,EAAGF,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,GAAG,EAC5B,OAAOE,EAAGF,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,EAC3B,OAAOE,EAAGF,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,EAC3B,OAAOE,EAAGF,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAC3B,CAAC,CACH,CAAC,EAED,SAAS,WAAY,IAAM,CACzB,GAAG,mCAAoC,IAAM,CAC3C,MAAMG,EAAKL,EAAS,GAAG,EAEvB,OAAOK,EAAGH,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EACvB,OAAOG,EAAGH,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,KAAK,MAAM,IAAM,IAAK,CAAC,EACh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AAC,CAAC,EAAE,KAAK,GAAG,EACrC,OAAOM,EAAK,KAAK,GAAGN,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,EACrC,OAAOM,EAAK,KAAK,GAAGN,EAAE,GAAG,EAAGA,EAAE,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAE,EAAG,IAAK,EAAG,CAAE,CAAC,EAG7D,OAAOM,EAAK,KAAK,GAAGN,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,GAAG,EACpC,OAAOM,EAAK,KAAK,GAAGN,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,GAAG,EACpC,OAAOM,EAAK,KAAK,GAAGN,EAAE,IAAI,EAAGA,EAAE,IAAI,CAAC,CAAC,EAAE,QAAQ,CAC7C,EAAG,KAAK,MAAM,IAAM,IAAK,EACzB,EAAG,KAAK,MAAM,IAAM,IAAK,CAC3B,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["createAxes", "createAxis", "createVH", "createVW", "p", "n", "vw", "vh", "axis", "xy", "axes"]
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\nimport type { DeviceScreens, Percent } from \"@internal/core/types\";\n\nimport { type AxisMap, clampValue, createAxes, createAxis } from \"./axisClamp\";\n\nconst p = (n: number) => n as unknown as Percent;\n\ndescribe(\"axisClamp helpers\", () => {\n describe(\"clampValue\", () => {\n it(\"floors and clamps to [0, width]\", () => {\n const clamp = clampValue(200);\n\n expect(clamp(p(0))).toBe(0);\n expect(clamp(p(50))).toBe(100); // 200 * 0.5 = 100\n expect(clamp(p(50.4))).toBe(100); // floor(200 * 0.504) = 100\n expect(clamp(p(50.5))).toBe(101); // floor(200 * 0.505) = 101\n expect(clamp(p(100))).toBe(200);\n expect(clamp(p(150))).toBe(200); // clamped\n expect(clamp(p(-10))).toBe(0); // clamped\n });\n });\n\n describe(\"createAxis\", () => {\n it(\"exposes vw, vh and xy with consistent flooring + clamping\", () => {\n const axis = createAxis(300, 200);\n\n // vw / vh\n expect(axis.vw(p(25))).toBe(75); // 300 * 0.25\n expect(axis.vh(p(75))).toBe(150); // 200 * 0.75\n\n // xy nominal\n expect(axis.xy(p(10), p(90))).toEqual({ x: 30, y: 180 });\n\n // xy clamps both axes\n expect(axis.xy(p(150), p(-20))).toEqual({ x: 300, y: 0 });\n\n // flooring behavior with fractional percent\n const xy = axis.xy(p(33.4), p(66.6));\n expect(xy.x).toBe(Math.floor(300 * 0.334));\n expect(xy.y).toBe(Math.floor(200 * 0.666));\n });\n });\n\n describe(\"createAxes\", () => {\n it(\"creates an AxisMap for all device keys with matching dimensions\", () => {\n const screens: DeviceScreens<\"devA\" | \"devB\"> = {\n devA: { width: 200, height: 100 } as any,\n devB: { width: 320, height: 480 } as any,\n };\n\n const axes: AxisMap<\"devA\" | \"devB\"> = createAxes(screens);\n\n // contains both keys\n expect(Object.keys(axes).sort()).toEqual([\"devA\", \"devB\"]);\n\n // devA\n expect(axes.devA.vw(p(100))).toBe(200);\n expect(axes.devA.vh(p(100))).toBe(100);\n expect(axes.devA.xy(p(120), p(-10))).toEqual({ x: 200, y: 0 });\n\n // devB\n expect(axes.devB.vw(p(50))).toBe(160);\n expect(axes.devB.vh(p(50))).toBe(240);\n expect(axes.devB.xy(p(33.3), p(66.7))).toEqual({\n x: Math.floor(320 * 0.333),\n y: Math.floor(480 * 0.667),\n });\n });\n });\n});\n"],
5
+ "mappings": "AAMA,OAAuB,cAAAA,EAAY,cAAAC,EAAY,cAAAC,MAAkB,cAEjE,MAAMC,EAAKC,GAAcA,EAEzB,SAAS,oBAAqB,IAAM,CAClC,SAAS,aAAc,IAAM,CAC3B,GAAG,kCAAmC,IAAM,CAC1C,MAAMC,EAAQL,EAAW,GAAG,EAE5B,OAAOK,EAAMF,EAAE,CAAC,CAAC,CAAC,EAA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OAAQ,GAAI,EAChC,KAAM,CAAE,MAAO,IAAK,OAAQ,GAAI,CAClC,CAEyD,EAGzD,OAAO,OAAO,KAAKO,CAAI,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,OAAQ,MAAM,CAAC,EAGzD,OAAOA,EAAK,KAAK,GAAGL,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,EACrC,OAAOK,EAAK,KAAK,GAAGL,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,EACrC,OAAOK,EAAK,KAAK,GAAGL,EAAE,GAAG,EAAGA,EAAE,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAE,EAAG,IAAK,EAAG,CAAE,CAAC,EAG7D,OAAOK,EAAK,KAAK,GAAGL,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,GAAG,EACpC,OAAOK,EAAK,KAAK,GAAGL,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,GAAG,EACpC,OAAOK,EAAK,KAAK,GAAGL,EAAE,IAAI,EAAGA,EAAE,IAAI,CAAC,CAAC,EAAE,QAAQ,CAC7C,EAAG,KAAK,MAAM,IAAM,IAAK,EACzB,EAAG,KAAK,MAAM,IAAM,IAAK,CAC3B,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["clampValue", "createAxes", "createAxis", "p", "n", "clamp", "axis", "xy", "axes"]
7
7
  }
@@ -1,6 +1,6 @@
1
- import type { IButtonController } from "../internal/core/IButtonController";
1
+ import type { ButtonController } from "../internal/core/ButtonController";
2
2
  import type { ButtonKey, DeviceControllerOptions, DeviceScreens, PercentCoordinates } from "../internal/core/types";
3
- export type ButtonFactory = () => IButtonController & {
3
+ export type ButtonFactory = () => ButtonController & {
4
4
  left(): Promise<void>;
5
5
  right(): Promise<void>;
6
6
  both(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"DeviceController.d.ts","sourceRoot":"","sources":["../../../../src/api/DeviceController.ts"],"names":[],"mappings":"AACA,OAAO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Controller } from "../core/IButtonController";
2
+ import type { ButtonController } from "../core/ButtonController";
3
3
  import { type ButtonKey } from "../core/types";
4
- export declare class AxiosButtonController implements IButtonController {
4
+ export declare class DefaultButtonController implements ButtonController {
5
5
  private readonly client;
6
6
  constructor(client: AxiosInstance);
7
7
  press(key: ButtonKey): Promise<void>;
8
8
  }
9
- //# sourceMappingURL=AxiosButtonController.d.ts.map
9
+ //# sourceMappingURL=DefaultButtonController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultButtonController.d.ts","sourceRoot":"","sources":["../../../../../src/internal/adapters/DefaultButtonController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,sBAAsB,CAAC;AAEvE,qBAAa,uBAAwB,YAAW,gBAAgB;IAClD,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAE5C,KAAK,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;CAK3C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DefaultButtonController.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultButtonController.test.d.ts","sourceRoot":"","sources":["../../../../../src/internal/adapters/DefaultButtonController.test.ts"],"names":[],"mappings":""}
@@ -1,8 +1,8 @@
1
1
  import type { AxiosInstance } from "axios";
2
- import type { ITouchController } from "../core/ITouchController";
3
2
  import { type PercentCoordinates } from "../core/types";
4
3
  import type { AxisMap } from "../utils/axisClamp";
5
- export declare class AxiosTouchController<K extends string> implements ITouchController<K> {
4
+ import type { TouchController } from "../../../src/internal/core/TouchController";
5
+ export declare class DefaultTouchController<K extends string> implements TouchController<K> {
6
6
  private readonly client;
7
7
  private readonly axes;
8
8
  constructor(client: AxiosInstance, axes: AxisMap<K>);
@@ -12,4 +12,4 @@ export declare class AxiosTouchController<K extends string> implements ITouchCon
12
12
  tap(deviceKey: K, point: PercentCoordinates): Promise<void>;
13
13
  release(deviceKey: K, point: PercentCoordinates): Promise<void>;
14
14
  }
15
- //# sourceMappingURL=AxiosTouchController.d.ts.map
15
+ //# sourceMappingURL=DefaultTouchController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultTouchController.d.ts","sourceRoot":"","sources":["../../../../../src/internal/adapters/DefaultTouchController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,KAAK,kBAAkB,EAAmB,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE/E,qBAAa,sBAAsB,CAAC,CAAC,SAAS,MAAM,CAClD,YAAW,eAAe,CAAC,CAAC,CAAC;IAG3B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBADJ,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAGnC,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,KAAK;IAYP,aAAa,CAAC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQrE,GAAG,CAAC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ3D,OAAO,CAAC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAOtE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DefaultTouchController.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultTouchController.test.d.ts","sourceRoot":"","sources":["../../../../../src/internal/adapters/DefaultTouchController.test.ts"],"names":[],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  import type { ButtonKey } from "./types";
2
- export interface IButtonController {
2
+ export interface ButtonController {
3
3
  press(key: ButtonKey): Promise<void>;
4
4
  }
5
- //# sourceMappingURL=IButtonController.d.ts.map
5
+ //# sourceMappingURL=ButtonController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonController.d.ts","sourceRoot":"","sources":["../../../../../src/internal/core/ButtonController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC"}
@@ -1,7 +1,7 @@
1
1
  import type { PercentCoordinates } from "./types";
2
- export interface ITouchController<K extends string = string> {
2
+ export interface TouchController<K extends string = string> {
3
3
  tapAndRelease: (deviceKey: K, point: PercentCoordinates) => Promise<void>;
4
4
  tap: (deviceKey: K, point: PercentCoordinates) => Promise<void>;
5
5
  release: (deviceKey: K, point: PercentCoordinates) => Promise<void>;
6
6
  }
7
- //# sourceMappingURL=ITouchController.d.ts.map
7
+ //# sourceMappingURL=TouchController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TouchController.d.ts","sourceRoot":"","sources":["../../../../../src/internal/core/TouchController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACxD,aAAa,EAAE,CAAC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,OAAO,EAAE,CAAC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrE"}
@@ -11,9 +11,9 @@ export type PercentCoordinates = {
11
11
  y: Percent;
12
12
  };
13
13
  export type DeviceControllerOptions<K extends string = string> = {
14
+ screens: DeviceScreens<K>;
14
15
  timeoutMs?: number;
15
16
  clientHeader?: string;
16
- screens: DeviceScreens<K>;
17
17
  };
18
18
  export declare enum SpeculosActions {
19
19
  PRESS = "press",
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/internal/core/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAElD,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAErE,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAC7D,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,CACtB,CAAC;AAEF,MAAM,MAAM,KAAK,CACf,CAAC,SAAS,MAAM,EAChB,GAAG,SAAS,MAAM,EAAE,GAAG,EAAE,IACvB,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC9E,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;AAEjC,MAAM,MAAM,kBAAkB,GAAG;IAAE,CAAC,EAAE,OAAO,CAAC;IAAC,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE5D,MAA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AAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,oBAAY,eAAe;IACzB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,iBAAiB,sBAAsB;CACxC"}
@@ -1,9 +1,9 @@
1
- import type { IButtonController } from "./core/IButtonController";
2
- import type { ITouchController } from "./core/ITouchController";
1
+ import type { ButtonController } from "./core/ButtonController";
3
2
  import type { DeviceControllerOptions } from "./core/types";
3
+ import type { TouchController } from "../../src/internal/core/TouchController";
4
4
  export type ControllersContainer = {
5
- buttons: IButtonController;
6
- touch: ITouchController;
5
+ buttons: ButtonController;
6
+ touch: TouchController;
7
7
  };
8
8
  export declare function createDefaultControllers(baseURL: string, opts: DeviceControllerOptions): ControllersContainer;
9
9
  //# sourceMappingURL=di.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"di.d.ts","sourceRoot":"","sources":["../../../../src/internal/di.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAKpE,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,uBAAuB,GAC5B,oBAAoB,CAgBtB"}
1
+ {"version":3,"file":"di.d.ts","sourceRoot":"","sources":["../../../../src/internal/di.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE/E,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,gBAAgB,CAAC;IAC1B,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AAEF,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,uBAAuB,GAC5B,oBAAoB,CAgBtB"}
@@ -1,7 +1,7 @@
1
- import type { IButtonController } from "../core/IButtonController";
1
+ import type { ButtonController } from "../core/ButtonController";
2
2
  import type { ButtonKey } from "../core/types";
3
- export declare function pressSequence(buttons: IButtonController, keys: ButtonKey[], delayMs?: number): Promise<void>;
4
- export declare function pressButtons(buttons: IButtonController): {
3
+ export declare function pressSequence(buttons: ButtonController, keys: ButtonKey[], delayMs?: number): Promise<void>;
4
+ export declare function pressButtons(buttons: ButtonController): {
5
5
  left: () => Promise<void>;
6
6
  right: () => Promise<void>;
7
7
  both: () => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"buttonUseCases.d.ts","sourceRoot":"","sources":["../../../../../src/internal/use-cases/buttonUseCases.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,wBAAsB,aAAa,CACjC,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,SAAS,EAAE,EACjB,OAAO,SAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,iBAAiB,GAAG;IACxD,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B,CAMA"}
1
+ {"version":3,"file":"buttonUseCases.d.ts","sourceRoot":"","sources":["../../../../../src/internal/use-cases/buttonUseCases.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD,wBAAsB,aAAa,CACjC,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,SAAS,EAAE,EACjB,OAAO,SAAmB,GACzB,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG;IACvD,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B,CAMA"}
@@ -1,5 +1,5 @@
1
- import { type ITouchController } from "../core/ITouchController";
2
1
  import type { PercentCoordinates } from "../core/types";
3
- export declare const tapLong: <K extends string>(touch: ITouchController<K>, deviceKey: K) => (point: PercentCoordinates, delayMs?: number) => Promise<void>;
4
- export declare const tapQuick: <K extends string>(touch: ITouchController<K>, deviceKey: K) => (point: PercentCoordinates) => Promise<void>;
2
+ import { type TouchController } from "../../../src/internal/core/TouchController";
3
+ export declare const tapLong: <K extends string>(touch: TouchController<K>, deviceKey: K) => (point: PercentCoordinates, delayMs?: number) => Promise<void>;
4
+ export declare const tapQuick: <K extends string>(touch: TouchController<K>, deviceKey: K) => (point: PercentCoordinates) => Promise<void>;
5
5
  //# sourceMappingURL=touchUseCases.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"touchUseCases.d.ts","sourceRoot":"","sources":["../../../../../src/internal/use-cases/touchUseCases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAI/D,eAAO,MAAM,OAAO,GACjB,CAAC,SAAS,MAAM,EAAE,OAAO,gBAAgB,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,MACpD,OAAO,kBAAkB,EAAE,UAAS,MAAyB,kBAInE,CAAC;AAEJ,eAAO,MAAM,QAAQ,GAClB,CAAC,SAAS,MAAM,EAAE,OAAO,gBAAgB,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,MACpD,OAAO,kBAAkB,kBACa,CAAC"}
1
+ {"version":3,"file":"touchUseCases.d.ts","sourceRoot":"","sources":["../../../../../src/internal/use-cases/touchUseCases.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAI/E,eAAO,MAAM,OAAO,GACjB,CAAC,SAAS,MAAM,EAAE,OAAO,eAAe,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,MACnD,OAAO,kBAAkB,EAAE,UAAS,MAAyB,kBAInE,CAAC;AAEJ,eAAO,MAAM,QAAQ,GAClB,CAAC,SAAS,MAAM,EAAE,OAAO,eAAe,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,MACnD,OAAO,kBAAkB,kBACa,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import type { DeviceScreens, Percent } from "../core/types";
2
- export declare const createVW: (width: number) => (pct: Percent) => number;
3
- export declare const createVH: (height: number) => (pct: Percent) => number;
2
+ export declare const clampValue: (value: number) => (pct: Percent) => number;
4
3
  export declare const createAxis: (width: number, height: number) => {
5
4
  vw: (pct: Percent) => number;
6
5
  vh: (pct: Percent) => number;
@@ -1 +1 @@
1
- {"version":3,"file":"axisClamp.d.ts","sourceRoot":"","sources":["../../../../../src/internal/utils/axisClamp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAInE,eAAO,MAAM,QAAQ,GAAI,OAAO,MAAM,MAAM,KAAK,OAAO,WACxB,CA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