summaryrefslogtreecommitdiffstats
path: root/comm/third_party/asn1js/src/internals/LocalStringValueBlock.ts
diff options
context:
space:
mode:
Diffstat (limited to 'comm/third_party/asn1js/src/internals/LocalStringValueBlock.ts')
-rw-r--r--comm/third_party/asn1js/src/internals/LocalStringValueBlock.ts52
1 files changed, 52 insertions, 0 deletions
diff --git a/comm/third_party/asn1js/src/internals/LocalStringValueBlock.ts b/comm/third_party/asn1js/src/internals/LocalStringValueBlock.ts
new file mode 100644
index 0000000000..dfd0ee19e3
--- /dev/null
+++ b/comm/third_party/asn1js/src/internals/LocalStringValueBlock.ts
@@ -0,0 +1,52 @@
+/* eslint-disable @typescript-eslint/ban-ts-comment */
+import { HexBlockJson, HexBlockParams, HexBlock } from "../HexBlock";
+import { ValueBlock, ValueBlockJson, ValueBlockParams } from "../ValueBlock";
+import { EMPTY_STRING } from "./constants";
+import { LocalUtf8StringValueBlockParams, LocalUtf8StringValueBlockJson } from "./LocalUtf8StringValueBlock";
+
+export interface ILocalStringValueBlock {
+ value: string;
+}
+
+export interface LocalStringValueBlockParams extends Omit<HexBlockParams, "isHexOnly">, ValueBlockParams, Partial<ILocalStringValueBlock> { }
+
+export interface LocalStringValueBlockJson extends HexBlockJson, ValueBlockJson, ILocalStringValueBlock { }
+
+export abstract class LocalStringValueBlock extends HexBlock(ValueBlock) implements ILocalStringValueBlock {
+
+ public static override NAME = "StringValueBlock";
+
+ public value: string;
+
+ constructor({
+ ...parameters
+ }: LocalUtf8StringValueBlockParams = {}) {
+ super(parameters);
+
+ this.isHexOnly = true;
+ this.value = EMPTY_STRING; // String representation of decoded ArrayBuffer
+ }
+
+ public override toJSON(): LocalUtf8StringValueBlockJson {
+ return {
+ ...super.toJSON(),
+ value: this.value,
+ };
+ }
+
+}
+
+export interface LocalStringValueBlock {
+ /**
+ * @deprecated since version 3.0.0
+ */
+ // @ts-ignore
+ valueBeforeDecode: ArrayBuffer;
+ /**
+ * Binary data in ArrayBuffer representation
+ *
+ * @deprecated since version 3.0.0
+ */
+ // @ts-ignore
+ valueHex: ArrayBuffer;
+}