@gurezo/web-serial-rxjs 4.0.4 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +283 -211
- package/dist/index.mjs.map +4 -4
- package/dist/internal/newline-tokenizer.d.ts +1 -1
- package/dist/session/create-serial-session.d.ts.map +1 -1
- package/dist/session/internal/port-teardown.d.ts +53 -0
- package/dist/session/internal/port-teardown.d.ts.map +1 -1
- package/dist/session/internal/session-error-reporter.d.ts +4 -6
- package/dist/session/internal/session-error-reporter.d.ts.map +1 -1
- package/dist/session/internal/session-lifecycle.d.ts +4 -1
- package/dist/session/internal/session-lifecycle.d.ts.map +1 -1
- package/dist/session/read-pump.d.ts +4 -3
- package/dist/session/read-pump.d.ts.map +1 -1
- package/dist/session/send-queue.d.ts +2 -1
- package/dist/session/send-queue.d.ts.map +1 -1
- package/dist/session/serial-session-options.d.ts +0 -31
- package/dist/session/serial-session-options.d.ts.map +1 -1
- package/dist/session/session-runtime.d.ts +0 -6
- package/dist/session/session-runtime.d.ts.map +1 -1
- package/dist/terminal/create-terminal-buffer.d.ts +0 -38
- package/dist/terminal/create-terminal-buffer.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared CR/LF/CRLF scanner for {@link createLineBuffer} and
|
|
3
|
-
* {@link
|
|
3
|
+
* Used by {@link createTerminalParser} and line-buffer feeding. Mode controls intentional semantic differences
|
|
4
4
|
* between line-delimited output and terminal display redraw.
|
|
5
5
|
*
|
|
6
6
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-serial-session.d.ts","sourceRoot":"","sources":["../../src/session/create-serial-session.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAOlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,CAAC,EAAE,oBAAoB,GAC7B,aAAa,
|
|
1
|
+
{"version":3,"file":"create-serial-session.d.ts","sourceRoot":"","sources":["../../src/session/create-serial-session.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAOlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,CAAC,EAAE,oBAAoB,GAC7B,aAAa,CA2Ff"}
|
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
import type { ReadPump } from '../read-pump';
|
|
2
|
+
import type { SendQueue } from '../send-queue';
|
|
3
|
+
import { type SessionRuntime } from '../session-runtime';
|
|
2
4
|
import type { ReceivePipeline } from './receive-pipeline';
|
|
5
|
+
/**
|
|
6
|
+
* Snapshot of session-owned resources captured before a lifecycle transition.
|
|
7
|
+
*
|
|
8
|
+
* Transition targets such as `disconnecting` and `error` drop pump references,
|
|
9
|
+
* so callers must capture resources while the source runtime still holds them.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
* @see {@link https://github.com/gurezo/web-serial-rxjs/issues/588 | Issue #588}
|
|
13
|
+
*/
|
|
14
|
+
export interface SessionResources {
|
|
15
|
+
port: SerialPort | null;
|
|
16
|
+
pump: ReadPump | null;
|
|
17
|
+
cancelConnect?: () => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* How {@link teardownResources} handles `port.close()` rejections.
|
|
21
|
+
*
|
|
22
|
+
* - `safe` — swallow rejections (dispose, fatal error).
|
|
23
|
+
* - `report` — propagate via {@link TeardownResourcesOptions.onCloseError}.
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
export type TeardownCloseMode = 'safe' | 'report';
|
|
28
|
+
/**
|
|
29
|
+
* Options for {@link teardownResources}.
|
|
30
|
+
*
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export interface TeardownResourcesOptions {
|
|
34
|
+
closeMode?: TeardownCloseMode;
|
|
35
|
+
/**
|
|
36
|
+
* When `false`, skip {@link SessionResources.cancelConnect} even if captured.
|
|
37
|
+
* Fatal error teardown uses this to avoid reverting `error` back to `idle`.
|
|
38
|
+
*/
|
|
39
|
+
cancelInFlightConnect?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Called when `closeMode` is `report` and `port.close()` rejects.
|
|
42
|
+
* Should throw the normalised error to abort the teardown caller.
|
|
43
|
+
*/
|
|
44
|
+
onCloseError?: (error: unknown) => never;
|
|
45
|
+
}
|
|
3
46
|
/**
|
|
4
47
|
* Dependencies for {@link createPortTeardown}.
|
|
5
48
|
*
|
|
@@ -7,6 +50,7 @@ import type { ReceivePipeline } from './receive-pipeline';
|
|
|
7
50
|
*/
|
|
8
51
|
export interface PortTeardownDeps {
|
|
9
52
|
receivePipeline: ReceivePipeline;
|
|
53
|
+
sendQueue: SendQueue;
|
|
10
54
|
}
|
|
11
55
|
/**
|
|
12
56
|
* Port and pump teardown primitives for {@link createSerialSession}.
|
|
@@ -18,11 +62,20 @@ export interface PortTeardownDeps {
|
|
|
18
62
|
*
|
|
19
63
|
* @internal
|
|
20
64
|
* @see {@link https://github.com/gurezo/web-serial-rxjs/issues/476 | Issue #476}
|
|
65
|
+
* @see {@link https://github.com/gurezo/web-serial-rxjs/issues/588 | Issue #588}
|
|
21
66
|
*/
|
|
22
67
|
export interface PortTeardown {
|
|
23
68
|
teardownPump: (pump: ReadPump | null) => Promise<void>;
|
|
24
69
|
closePortSafely: (port: SerialPort | null) => Promise<void>;
|
|
70
|
+
captureResources: (runtime: SessionRuntime) => SessionResources;
|
|
71
|
+
teardownResources: (resources: SessionResources, options?: TeardownResourcesOptions) => Promise<void>;
|
|
25
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Capture port, pump, and in-flight connect cancellation from runtime.
|
|
75
|
+
*
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
|
+
export declare function captureResources(runtime: SessionRuntime): SessionResources;
|
|
26
79
|
/**
|
|
27
80
|
* @internal
|
|
28
81
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"port-teardown.d.ts","sourceRoot":"","sources":["../../../src/session/internal/port-teardown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"port-teardown.d.ts","sourceRoot":"","sources":["../../../src/session/internal/port-teardown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAElD;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,CAAC;CAC1C;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,eAAe,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,gBAAgB,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,gBAAgB,CAAC;IAChE,iBAAiB,EAAE,CACjB,SAAS,EAAE,gBAAgB,EAC3B,OAAO,CAAC,EAAE,wBAAwB,KAC/B,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,gBAAgB,CAW1E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,CAqEvE"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { Subject } from 'rxjs';
|
|
2
2
|
import { SerialError } from '../../errors/serial-error';
|
|
3
3
|
import { type NormalizeSerialErrorOptions } from '../normalize-serial-error';
|
|
4
|
-
import type
|
|
5
|
-
import type {
|
|
6
|
-
import { type SessionRuntimeController } from '../session-runtime';
|
|
4
|
+
import { type SessionRuntime, type SessionRuntimeController } from '../session-runtime';
|
|
5
|
+
import type { SessionResources, TeardownResourcesOptions } from './port-teardown';
|
|
7
6
|
/**
|
|
8
7
|
* Dependencies for {@link createSessionErrorReporter}.
|
|
9
8
|
*
|
|
@@ -12,10 +11,9 @@ import { type SessionRuntimeController } from '../session-runtime';
|
|
|
12
11
|
export interface SessionErrorReporterDeps {
|
|
13
12
|
controller: SessionRuntimeController;
|
|
14
13
|
errorsSubject: Subject<SerialError>;
|
|
15
|
-
sendQueue: SendQueue;
|
|
16
14
|
isDisposed: () => boolean;
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
captureResources: (runtime: SessionRuntime) => SessionResources;
|
|
16
|
+
teardownResources: (resources: SessionResources, options?: TeardownResourcesOptions) => Promise<void>;
|
|
19
17
|
}
|
|
20
18
|
/**
|
|
21
19
|
* Centralised error reporting for {@link createSerialSession}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-error-reporter.d.ts","sourceRoot":"","sources":["../../../src/session/internal/session-error-reporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"session-error-reporter.d.ts","sourceRoot":"","sources":["../../../src/session/internal/session-error-reporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC9B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AAEzB;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,wBAAwB,CAAC;IACrC,aAAa,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,gBAAgB,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,gBAAgB,CAAC;IAChE,iBAAiB,EAAE,CACjB,SAAS,EAAE,gBAAgB,EAC3B,OAAO,CAAC,EAAE,wBAAwB,KAC/B,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,wBAAwB,GAAG;IAC1E,WAAW,EAAE,CACX,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,2BAA2B,KACjC,WAAW,CAAC;IACjB,mBAAmB,EAAE,MAAM,WAAW,CAAC;CACxC,CAsDA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Observable, type Subject } from 'rxjs';
|
|
2
2
|
import { SerialError } from '../../errors/serial-error';
|
|
3
3
|
import type { ReceivePipeline } from './receive-pipeline';
|
|
4
|
+
import type { SessionResources, TeardownResourcesOptions } from './port-teardown';
|
|
4
5
|
import { type NormalizeSerialErrorOptions } from '../normalize-serial-error';
|
|
5
6
|
import { type ReadPump } from '../read-pump';
|
|
6
7
|
import type { SendQueue } from '../send-queue';
|
|
7
8
|
import type { ResolvedSerialSessionOptions } from '../serial-session-options';
|
|
8
|
-
import { type SessionRuntimeController } from '../session-runtime';
|
|
9
|
+
import { type SessionRuntime, type SessionRuntimeController } from '../session-runtime';
|
|
9
10
|
/**
|
|
10
11
|
* Dependencies for {@link createSessionLifecycle}.
|
|
11
12
|
*
|
|
@@ -20,6 +21,8 @@ export interface SessionLifecycleDeps {
|
|
|
20
21
|
isDisposed: () => boolean;
|
|
21
22
|
teardownPump: (pump: ReadPump | null) => Promise<void>;
|
|
22
23
|
closePortSafely: (port: SerialPort | null) => Promise<void>;
|
|
24
|
+
captureResources: (runtime: SessionRuntime) => SessionResources;
|
|
25
|
+
teardownResources: (resources: SessionResources, options?: TeardownResourcesOptions) => Promise<void>;
|
|
23
26
|
reportError: (error: unknown, options: NormalizeSerialErrorOptions) => SerialError;
|
|
24
27
|
createDisposedError: () => SerialError;
|
|
25
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-lifecycle.d.ts","sourceRoot":"","sources":["../../../src/session/internal/session-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAIxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAE9E,OAAO,
|
|
1
|
+
{"version":3,"file":"session-lifecycle.d.ts","sourceRoot":"","sources":["../../../src/session/internal/session-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAIxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAE9E,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC9B,MAAM,oBAAoB,CAAC;AAE5B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
11
|
+
type ReadPumpChunkHandler = (text: string) => void;
|
|
12
12
|
/**
|
|
13
13
|
* Callback invoked when the read pump cannot continue.
|
|
14
14
|
*
|
|
@@ -18,14 +18,14 @@ export type ReadPumpChunkHandler = (text: string) => void;
|
|
|
18
18
|
*
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
type ReadPumpErrorHandler = (error: SerialError) => void;
|
|
22
22
|
/**
|
|
23
23
|
* Callback invoked when the read loop ends naturally (`reader.read()`
|
|
24
24
|
* resolved with `done: true`) while the pump is still active.
|
|
25
25
|
*
|
|
26
26
|
* @internal
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
type ReadPumpDoneHandler = () => void;
|
|
29
29
|
/**
|
|
30
30
|
* Options accepted by {@link createReadPump}.
|
|
31
31
|
*
|
|
@@ -79,4 +79,5 @@ export interface ReadPump {
|
|
|
79
79
|
* @see {@link https://github.com/gurezo/web-serial-rxjs/issues/202 | Issue #202}
|
|
80
80
|
*/
|
|
81
81
|
export declare function createReadPump(port: SerialPort, { onChunk, onError, onDone }: ReadPumpOptions): ReadPump;
|
|
82
|
+
export {};
|
|
82
83
|
//# sourceMappingURL=read-pump.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-pump.d.ts","sourceRoot":"","sources":["../../src/session/read-pump.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD;;;;;;;;GAQG;AACH,
|
|
1
|
+
{"version":3,"file":"read-pump.d.ts","sourceRoot":"","sources":["../../src/session/read-pump.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD;;;;;;;;GAQG;AACH,KAAK,oBAAoB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;AAEnD;;;;;;;;GAQG;AACH,KAAK,oBAAoB,GAAG,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;AAEzD;;;;;GAKG;AACH,KAAK,mBAAmB,GAAG,MAAM,IAAI,CAAC;AAEtC;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;OAIG;IACH,KAAK,IAAI,IAAI,CAAC;IACd;;;;OAIG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,UAAU,EAChB,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,eAAe,GAC5C,QAAQ,CAiGV"}
|
|
@@ -6,7 +6,7 @@ import { Observable } from 'rxjs';
|
|
|
6
6
|
*
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
type SendQueueOperation<T> = () => Promise<T>;
|
|
10
10
|
/**
|
|
11
11
|
* Internal helper returned by {@link createSendQueue}.
|
|
12
12
|
*
|
|
@@ -55,4 +55,5 @@ export interface SendQueue {
|
|
|
55
55
|
* @see {@link https://github.com/gurezo/web-serial-rxjs/issues/203 | Issue #203}
|
|
56
56
|
*/
|
|
57
57
|
export declare function createSendQueue(): SendQueue;
|
|
58
|
+
export {};
|
|
58
59
|
//# sourceMappingURL=send-queue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-queue.d.ts","sourceRoot":"","sources":["../../src/session/send-queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAS,MAAM,MAAM,CAAC;AAEzC;;;;;;GAMG;AACH,
|
|
1
|
+
{"version":3,"file":"send-queue.d.ts","sourceRoot":"","sources":["../../src/session/send-queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAS,MAAM,MAAM,CAAC;AAEzC;;;;;;GAMG;AACH,KAAK,kBAAkB,CAAC,CAAC,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;AAE9C;;;;;;;;;;GAUG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;;OAOG;IACH,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IAC5D;;;;;OAKG;IACH,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,IAAI,SAAS,CAwC3C"}
|
|
@@ -120,37 +120,6 @@ export type ResolvedSerialSessionOptions = Required<Omit<SerialSessionOptions, '
|
|
|
120
120
|
terminalBuffer: ResolvedTerminalBufferOptions;
|
|
121
121
|
lineBuffer: ResolvedLineBufferOptions;
|
|
122
122
|
};
|
|
123
|
-
/**
|
|
124
|
-
* Default values applied to omitted {@link SerialSessionOptions} fields.
|
|
125
|
-
*
|
|
126
|
-
* Nested buffer defaults are owned by {@link resolveTerminalBufferOptions} and
|
|
127
|
-
* {@link resolveLineBufferOptions}; this object is the single session-level
|
|
128
|
-
* snapshot used by {@link resolveSerialSessionOptions}.
|
|
129
|
-
*
|
|
130
|
-
* @internal
|
|
131
|
-
*/
|
|
132
|
-
export declare const DEFAULT_SERIAL_SESSION_OPTIONS: {
|
|
133
|
-
baudRate: BaudRate;
|
|
134
|
-
dataBits: 8;
|
|
135
|
-
stopBits: 1;
|
|
136
|
-
parity: "none";
|
|
137
|
-
bufferSize: SerialPortBufferSize;
|
|
138
|
-
flowControl: "none";
|
|
139
|
-
terminalBuffer: ResolvedTerminalBufferOptions;
|
|
140
|
-
lineBuffer: ResolvedLineBufferOptions;
|
|
141
|
-
};
|
|
142
|
-
/** Resolved W3C connection fields for {@link ResolvedSerialSessionOptions}. */
|
|
143
|
-
export type ResolvedSerialSessionConnectionOptions = Required<Omit<SerialConnectionOptions, 'baudRate' | 'bufferSize'>> & {
|
|
144
|
-
baudRate: BaudRate;
|
|
145
|
-
bufferSize: SerialPortBufferSize;
|
|
146
|
-
};
|
|
147
|
-
/**
|
|
148
|
-
* Merge and validate W3C connection fields from {@link SerialSessionOptions}.
|
|
149
|
-
*
|
|
150
|
-
* @throws {@link SerialError} with {@link SerialErrorCode.INVALID_CONNECTION_OPTIONS}
|
|
151
|
-
* when `baudRate` or `bufferSize` are out of range.
|
|
152
|
-
*/
|
|
153
|
-
export declare function resolveConnectionOptions(options?: Partial<SerialConnectionOptions>): ResolvedSerialSessionConnectionOptions;
|
|
154
123
|
/**
|
|
155
124
|
* Merge and validate {@link SerialSessionOptions} into a fully resolved
|
|
156
125
|
* options object for internal session use.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serial-session-options.d.ts","sourceRoot":"","sources":["../../src/session/serial-session-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,EAC3B,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC/B,MAAM,wBAAwB,CAAC;AAGhC,YAAY,EACV,yBAAyB,EACzB,6BAA6B,GAC9B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAE7B;;;;;;;;;;;;OAYG;IACH,cAAc,CAAC,EAAE,qBAAqB,CAAC;IAEvC;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,WAAW,oBACf,SAAQ,OAAO,CAAC,uBAAuB,CAAC,EAAE,2BAA2B;CAAG;AAE1E;;;;GAIG;AACH,MAAM,MAAM,4BAA4B,GAAG,QAAQ,CACjD,IAAI,CACF,oBAAoB,EAClB,SAAS,GACT,gBAAgB,GAChB,YAAY,GACZ,UAAU,GACV,YAAY,CACf,CACF,GAAG;IACF,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,oBAAoB,CAAC;IACjC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B,cAAc,EAAE,6BAA6B,CAAC;IAC9C,UAAU,EAAE,yBAAyB,CAAC;CACvC,CAAC;
|
|
1
|
+
{"version":3,"file":"serial-session-options.d.ts","sourceRoot":"","sources":["../../src/session/serial-session-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,EAC3B,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC/B,MAAM,wBAAwB,CAAC;AAGhC,YAAY,EACV,yBAAyB,EACzB,6BAA6B,GAC9B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAE7B;;;;;;;;;;;;OAYG;IACH,cAAc,CAAC,EAAE,qBAAqB,CAAC;IAEvC;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,WAAW,oBACf,SAAQ,OAAO,CAAC,uBAAuB,CAAC,EAAE,2BAA2B;CAAG;AAE1E;;;;GAIG;AACH,MAAM,MAAM,4BAA4B,GAAG,QAAQ,CACjD,IAAI,CACF,oBAAoB,EAClB,SAAS,GACT,gBAAgB,GAChB,YAAY,GACZ,UAAU,GACV,YAAY,CACf,CACF,GAAG;IACF,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,oBAAoB,CAAC;IACjC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B,cAAc,EAAE,6BAA6B,CAAC;IAC9C,UAAU,EAAE,yBAAyB,CAAC;CACvC,CAAC;AA2FF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,CAAC,EAAE,oBAAoB,GAC7B,4BAA4B,CAU9B"}
|
|
@@ -131,10 +131,4 @@ export interface SessionRuntimeController {
|
|
|
131
131
|
* @internal
|
|
132
132
|
*/
|
|
133
133
|
export declare function createSessionRuntimeController(initial: SessionRuntime): SessionRuntimeController;
|
|
134
|
-
/**
|
|
135
|
-
* Exhaustiveness helper for switch statements over {@link SessionRuntime}.
|
|
136
|
-
*
|
|
137
|
-
* @internal
|
|
138
|
-
*/
|
|
139
|
-
export declare function assertNeverRuntime(value: never): never;
|
|
140
134
|
//# sourceMappingURL=session-runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-runtime.d.ts","sourceRoot":"","sources":["../../src/session/session-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,UAAU,EAAE,MAAM,MAAM,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,mBAAmB,EACnB,KAAK,kBAAkB,EACvB,KAAK,mBA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C,MAAM,EAAE,MAAM,IAAI,GAAG,iBAAiB,CAE7E;AAED,gBAAgB;AAChB,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,QAAQ,GACb,gBAAgB,CAElB;AAED,gBAAgB;AAChB,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,UAAU,GAAG,IAAI,GACtB,oBAAoB,CAEtB;AAED,gBAAgB;AAChB,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAEnE;AAED,gBAAgB;AAChB,wBAAgB,wBAAwB,IAAI,kBAAkB,CAE7D;AAED,gBAAgB;AAChB,wBAAgB,qBAAqB,IAAI,eAAe,CAEvD;AAED,gBAAgB;AAChB,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,OAAO,GAAG,cAAc,CAEvE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,UAAU,GAAG,IAAI,CASzE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,QAAQ,GAAG,IAAI,CAKvE;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,IAAI,OAAO,IAAI,cAAc,CAAC;IAC9B,IAAI,MAAM,IAAI,uBAAuB,CAAC;IACtC,IAAI,MAAM,IAAI,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAC7C,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC;IAC1C,QAAQ,IAAI,IAAI,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,cAAc,GACtB,wBAAwB,CA8C1B"}
|
|
@@ -1,43 +1,5 @@
|
|
|
1
1
|
import { type Observable } from 'rxjs';
|
|
2
2
|
import { type MaxChars, type MaxLines } from '../internal/branded-numbers';
|
|
3
|
-
/** @internal Folded state between {@link createTerminalBuffer} emissions. */
|
|
4
|
-
export interface TerminalBufferState {
|
|
5
|
-
completed: string;
|
|
6
|
-
currentLine: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Applies one raw decoder chunk to terminal display state.
|
|
10
|
-
* Handles `\r\n` and lone `\n` as line endings, and lone `\r` as
|
|
11
|
-
* carriage return (clear current line for redraw). When
|
|
12
|
-
* {@link TerminalBufferOptions.stripAnsi} is enabled (default), ANSI escape
|
|
13
|
-
* sequences are removed before line folding.
|
|
14
|
-
*
|
|
15
|
-
* @internal Exported for unit tests.
|
|
16
|
-
*/
|
|
17
|
-
export declare function applyTerminalChunk(state: TerminalBufferState, chunk: string): TerminalBufferState;
|
|
18
|
-
/** @internal */
|
|
19
|
-
export declare function terminalDisplayText(state: TerminalBufferState): string;
|
|
20
|
-
/** Resolved limits for {@link trimTerminalState}. `0` means unlimited. */
|
|
21
|
-
export interface TerminalBufferLimits {
|
|
22
|
-
maxLines: MaxLines;
|
|
23
|
-
maxChars: MaxChars;
|
|
24
|
-
}
|
|
25
|
-
/** @internal Count newline-terminated rows in `completed`. */
|
|
26
|
-
export declare function countCompletedLines(completed: string): number;
|
|
27
|
-
/**
|
|
28
|
-
* Drops oldest completed lines when `maxLines` is exceeded.
|
|
29
|
-
*
|
|
30
|
-
* @internal Exported for unit tests.
|
|
31
|
-
*/
|
|
32
|
-
export declare function trimCompletedByMaxLines(completed: string, maxLines: number): string;
|
|
33
|
-
/**
|
|
34
|
-
* Trims {@link TerminalBufferState} to respect memory limits. Oldest
|
|
35
|
-
* `completed` content is removed first; `currentLine` is trimmed only when
|
|
36
|
-
* the display text still exceeds `maxChars` after `completed` is empty.
|
|
37
|
-
*
|
|
38
|
-
* @internal Exported for unit tests.
|
|
39
|
-
*/
|
|
40
|
-
export declare function trimTerminalState(state: TerminalBufferState, limits: TerminalBufferLimits): TerminalBufferState;
|
|
41
3
|
export interface TerminalBuffer {
|
|
42
4
|
/**
|
|
43
5
|
* Cumulative text suitable for terminal-style display: completed lines plus
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-terminal-buffer.d.ts","sourceRoot":"","sources":["../../src/terminal/create-terminal-buffer.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"create-terminal-buffer.d.ts","sourceRoot":"","sources":["../../src/terminal/create-terminal-buffer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EAMhB,MAAM,MAAM,CAAC;AAGd,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,QAAQ,EACd,MAAM,6BAA6B,CAAC;AAsKrC,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;CACpC;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,uDAAuD;AACvD,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,qBAAqB,CAKzE,CAAC;AAEJ,8EAA8E;AAC9E,MAAM,MAAM,6BAA6B,GAAG;IAC1C,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,CAAC,EAAE,qBAAqB,GAC9B,6BAA6B,CAuC/B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,EAC5B,OAAO,CAAC,EAAE,qBAAqB,GAC9B,cAAc,CA0BhB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gurezo/web-serial-rxjs",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "RxJS-based utilities for the Web Serial API, usable from Angular, React, Svelte, and Vanilla JavaScript/TypeScript.",
|
|
5
5
|
"author": "Akihiko Kigure <akihiko.kigure@gmail.com>",
|
|
6
6
|
"license": "MIT",
|