Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

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. }