@gurezo/web-serial-rxjs 0.2.0 → 2.0.1

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 (57) hide show
  1. package/README.ja.md +21 -107
  2. package/README.md +23 -127
  3. package/dist/errors/serial-error-code.d.ts +7 -0
  4. package/dist/errors/serial-error-code.d.ts.map +1 -1
  5. package/dist/index.d.ts +31 -32
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +459 -673
  8. package/dist/index.mjs +459 -673
  9. package/dist/index.mjs.map +4 -4
  10. package/dist/session/create-serial-session.d.ts +49 -0
  11. package/dist/session/create-serial-session.d.ts.map +1 -0
  12. package/dist/session/index.d.ts +5 -0
  13. package/dist/session/index.d.ts.map +1 -0
  14. package/dist/session/internal/build-request-options.d.ts +18 -0
  15. package/dist/session/internal/build-request-options.d.ts.map +1 -0
  16. package/dist/session/internal/has-web-serial-support.d.ts +12 -0
  17. package/dist/session/internal/has-web-serial-support.d.ts.map +1 -0
  18. package/dist/session/internal/line-buffer.d.ts +14 -0
  19. package/dist/session/internal/line-buffer.d.ts.map +1 -0
  20. package/dist/session/normalize-serial-error.d.ts +55 -0
  21. package/dist/session/normalize-serial-error.d.ts.map +1 -0
  22. package/dist/session/read-pump.d.ts +74 -0
  23. package/dist/session/read-pump.d.ts.map +1 -0
  24. package/dist/session/send-queue.d.ts +58 -0
  25. package/dist/session/send-queue.d.ts.map +1 -0
  26. package/dist/session/serial-session-options.d.ts +80 -0
  27. package/dist/session/serial-session-options.d.ts.map +1 -0
  28. package/dist/session/serial-session-state.d.ts +35 -0
  29. package/dist/session/serial-session-state.d.ts.map +1 -0
  30. package/dist/session/serial-session.d.ts +143 -0
  31. package/dist/session/serial-session.d.ts.map +1 -0
  32. package/dist/session/session-state-machine.d.ts +39 -0
  33. package/dist/session/session-state-machine.d.ts.map +1 -0
  34. package/package.json +1 -5
  35. package/web-serial-rxjs-icon.png +0 -0
  36. package/dist/browser/browser-detection.d.ts +0 -104
  37. package/dist/browser/browser-detection.d.ts.map +0 -1
  38. package/dist/browser/browser-support.d.ts +0 -57
  39. package/dist/browser/browser-support.d.ts.map +0 -1
  40. package/dist/client/index.d.ts +0 -283
  41. package/dist/client/index.d.ts.map +0 -1
  42. package/dist/client/serial-client.d.ts +0 -137
  43. package/dist/client/serial-client.d.ts.map +0 -1
  44. package/dist/filters/build-request-options.d.ts +0 -42
  45. package/dist/filters/build-request-options.d.ts.map +0 -1
  46. package/dist/io/observable-to-writable.d.ts +0 -65
  47. package/dist/io/observable-to-writable.d.ts.map +0 -1
  48. package/dist/io/readable-to-observable.d.ts +0 -44
  49. package/dist/io/readable-to-observable.d.ts.map +0 -1
  50. package/dist/lib/web-serial-rxjs.d.ts +0 -7
  51. package/dist/lib/web-serial-rxjs.d.ts.map +0 -1
  52. package/dist/shell/create-shell-client.d.ts +0 -17
  53. package/dist/shell/create-shell-client.d.ts.map +0 -1
  54. package/dist/shell/index.d.ts +0 -2
  55. package/dist/shell/index.d.ts.map +0 -1
  56. package/dist/types/options.d.ts +0 -107
  57. package/dist/types/options.d.ts.map +0 -1
@@ -1,107 +0,0 @@
1
- /**
2
- * Options for creating a SerialClient instance.
3
- *
4
- * These options configure the serial port connection parameters. All properties are optional
5
- * and will use default values if not specified. See {@link DEFAULT_SERIAL_CLIENT_OPTIONS} for
6
- * the default values used.
7
- *
8
- * @example
9
- * ```typescript
10
- * const client = createSerialClient({
11
- * baudRate: 115200,
12
- * dataBits: 8,
13
- * stopBits: 1,
14
- * parity: 'none',
15
- * flowControl: 'none',
16
- * filters: [{ usbVendorId: 0x1234, usbProductId: 0x5678 }],
17
- * });
18
- * ```
19
- */
20
- export interface SerialClientOptions {
21
- /**
22
- * Baud rate for the serial port connection (bits per second).
23
- *
24
- * Common values include 9600, 19200, 38400, 57600, 115200, etc.
25
- * Must match the baud rate configured on the connected device.
26
- *
27
- * @default 9600
28
- */
29
- baudRate?: number;
30
- /**
31
- * Number of data bits per character (7 or 8).
32
- *
33
- * - `7`: Seven data bits (used with parity)
34
- * - `8`: Eight data bits (most common, used without parity)
35
- *
36
- * @default 8
37
- */
38
- dataBits?: 7 | 8;
39
- /**
40
- * Number of stop bits (1 or 2).
41
- *
42
- * - `1`: One stop bit (most common)
43
- * - `2`: Two stop bits (less common, used for slower devices)
44
- *
45
- * @default 1
46
- */
47
- stopBits?: 1 | 2;
48
- /**
49
- * Parity checking mode.
50
- *
51
- * - `'none'`: No parity checking (most common)
52
- * - `'even'`: Even parity
53
- * - `'odd'`: Odd parity
54
- *
55
- * @default 'none'
56
- */
57
- parity?: 'none' | 'even' | 'odd';
58
- /**
59
- * Buffer size for reading data from the serial port, in bytes.
60
- *
61
- * This determines how much data can be buffered before it needs to be read.
62
- * Larger buffers can improve performance but use more memory.
63
- *
64
- * @default 255
65
- */
66
- bufferSize?: number;
67
- /**
68
- * Flow control mode.
69
- *
70
- * - `'none'`: No flow control (most common)
71
- * - `'hardware'`: Hardware flow control (RTS/CTS)
72
- *
73
- * @default 'none'
74
- */
75
- flowControl?: 'none' | 'hardware';
76
- /**
77
- * Filters for port selection when requesting a port.
78
- *
79
- * When specified, the port selection dialog will only show devices matching
80
- * these filters. Each filter can specify `usbVendorId` and/or `usbProductId`
81
- * to filter by USB device identifiers.
82
- *
83
- * @example
84
- * ```typescript
85
- * filters: [
86
- * { usbVendorId: 0x1234 },
87
- * { usbVendorId: 0x1234, usbProductId: 0x5678 },
88
- * ]
89
- * ```
90
- *
91
- * @see {@link SerialPortFilter} for the filter structure
92
- */
93
- filters?: SerialPortFilter[];
94
- }
95
- /**
96
- * Default options for SerialClient instances.
97
- *
98
- * These are the default values used when creating a SerialClient if no options
99
- * are provided or if specific options are omitted. The values are chosen to work
100
- * with most common serial devices.
101
- *
102
- * @see {@link SerialClientOptions} for details on each option
103
- */
104
- export declare const DEFAULT_SERIAL_CLIENT_OPTIONS: Required<Omit<SerialClientOptions, 'filters'>> & {
105
- filters?: SerialPortFilter[];
106
- };
107
- //# sourceMappingURL=options.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/types/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAEjB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAEjB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;IAEjC;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAElC;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAClD,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC,CACrC,GAAG;IAAE,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAA;CAQjC,CAAC"}