pw_hdlc: Add a TypeScript decoder implementation
Tests are automatically generated using `decode_test.py
--generate-ts-test [FILE]`
Change-Id: I22016c749078b74f1f0e57583d49428130bfa6e5
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55042
Pigweed-Auto-Submit: Jared Weinstein <jaredweinstein@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
diff --git a/pw_hdlc/docs.rst b/pw_hdlc/docs.rst
index 25bae08..8e361ab 100644
--- a/pw_hdlc/docs.rst
+++ b/pw_hdlc/docs.rst
@@ -214,6 +214,22 @@
for frame in decoder.process_valid_frames(ser.read()):
# Handle the decoded frame
+Typescript
+^^^^^^^^^^
+
+Decodes one or more HDLC frames from a stream of data.
+
+.. js:method:: process(data)
+
+ :param Uint8Array data: bytes to be decoded.
+ :yields: HDLC frames, including corrupt frames.
+ The Frame.ok() method whether the frame is valid.
+
+.. js:method:: processValidFrames(data)
+
+ :param Uint8Array data: bytes to be decoded.
+ :yields: Valid HDLC frames, logging any errors.
+
Additional features
===================