Path: blob/master/node_modules/@tokenizer/token/index.d.ts
1129 views
/**1* Read-only token2* See https://github.com/Borewit/strtok3 for more information3*/4export interface IGetToken<Value, Array extends Uint8Array = Uint8Array> {56/**7* Length of encoded token in bytes8*/9len: number;1011/**12* Decode value from buffer at offset13* @param array - Uint8Array to read the decoded value from14* @param offset - Decode offset15* @return decoded value16*/17get(array: Array, offset: number): Value;18}1920export interface IToken<Value, Array extends Uint8Array = Uint8Array> extends IGetToken<Value, Array> {21/**22* Encode value to buffer23* @param array - Uint8Array to write the encoded value to24* @param offset - Buffer write offset25* @param value - Value to decode of type T26* @return offset plus number of bytes written27*/28put(array: Array, offset: number, value: Value): number29}303132