@leofcoin/codec-format-interface 1.7.10 → 1.7.11

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.
@@ -3,10 +3,12 @@ import Hash from './codec-hash.js';
3
3
  export default class FormatInterface extends BasicInterface implements FormatInterface {
4
4
  #private;
5
5
  hashFormat: string;
6
+ get encoded(): any;
7
+ set encoded(value: any);
6
8
  init(buffer: Uint8Array | ArrayBuffer | FormatInterface | string): FormatInterface;
7
9
  hasCodec(): boolean;
8
10
  decode(encoded?: Uint8Array): object;
9
- encode(decoded?: object): Uint8Array;
11
+ encode(decoded?: object): any;
10
12
  /**
11
13
  * @param {Buffer|String|Object} buffer - data - The data needed to create the desired message
12
14
  * @param {Object} proto - {protoObject}
@@ -12,6 +12,13 @@ import '@leofcoin/codecs';
12
12
  class FormatInterface extends BasicInterface {
13
13
  hashFormat;
14
14
  #hash;
15
+ #encoded;
16
+ get encoded() {
17
+ return this.#encoded || this.encode();
18
+ }
19
+ set encoded(value) {
20
+ this.#encoded = value;
21
+ }
15
22
  init(buffer) {
16
23
  if (buffer instanceof FormatInterface && buffer?.name === this.name)
17
24
  return buffer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/codec-format-interface",
3
- "version": "1.7.10",
3
+ "version": "1.7.11",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {