@iotize/tap
Version:
IoTize Device client for Javascript
45 lines (44 loc) • 1.59 kB
TypeScript
/// <reference types="node" />
import { BodyEncoder } from '@iotize/tap/client/api';
import { TranscodeEncoding } from 'buffer';
export declare class StringConverter implements BodyEncoder<string>, BodyEncoder<string> {
encoding: TranscodeEncoding;
options: {
/**
* Returns string without content after the end of string character '\0'
* 'Hello World!\u0001\u0001\u0001' will returns 'Hello World!'
*/
stripEndOfStringCharacter?: boolean;
/**
* Replace empty string with '\0'
*/
replaceEmptyStringWithEndOfLineChar?: boolean;
/**
* true if end of string character should be added when encoding value
*/
addEndOfStringCharacter?: boolean;
};
private static _ascii?;
constructor(encoding?: TranscodeEncoding, options?: {
/**
* Returns string without content after the end of string character '\0'
* 'Hello World!\u0001\u0001\u0001' will returns 'Hello World!'
*/
stripEndOfStringCharacter?: boolean;
/**
* Replace empty string with '\0'
*/
replaceEmptyStringWithEndOfLineChar?: boolean;
/**
* true if end of string character should be added when encoding value
*/
addEndOfStringCharacter?: boolean;
});
encode(value: string): Uint8Array;
decode(value: Uint8Array): string;
/**
* Get ascii instance
* @deprecated use constructor instead
*/
static ascii(): StringConverter;
}