Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

bytes.d.ts 957B

1234567891011121314151617181920212223242526
  1. import { BytesList, BinaryParser } from '../binary';
  2. import { Buffer } from 'buffer/';
  3. export declare class Bytes {
  4. readonly name: string;
  5. readonly ordinal: number;
  6. readonly ordinalWidth: number;
  7. readonly bytes: Buffer;
  8. constructor(name: string, ordinal: number, ordinalWidth: number);
  9. toJSON(): string;
  10. toBytesSink(sink: BytesList): void;
  11. toBytes(): Uint8Array;
  12. }
  13. export declare class BytesLookup {
  14. readonly ordinalWidth: number;
  15. constructor(types: Record<string, number>, ordinalWidth: number);
  16. /**
  17. * Add a new name value pair to the BytesLookup.
  18. *
  19. * @param name - A human readable name for the field.
  20. * @param value - The numeric value for the field.
  21. * @throws if the name or value already exist in the lookup because it's unclear how to decode.
  22. */
  23. add(name: string, value: number): void;
  24. from(value: Bytes | string): Bytes;
  25. fromParser(parser: BinaryParser): Bytes;
  26. }