mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
Merge pull request #33569 from cinderblock/master
serialport - Add includeDelimiter option to readline parser
This commit is contained in:
Vendored
+2
-1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/EmergingTechnologyAdvisors/node-serialport
|
||||
// Definitions by: Jeremy Foster <https://github.com/codefoster>
|
||||
// Andrew Pearson <https://github.com/apearson>
|
||||
// Cameron Tacklind <https://github.com/cinderblock>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -100,7 +101,7 @@ declare namespace SerialPort {
|
||||
constructor(options: {delimiter: string | Buffer | number[], includeDelimiter?: boolean});
|
||||
}
|
||||
class Readline extends Delimiter {
|
||||
constructor(options: {delimiter: string | Buffer | number[], encoding?: 'ascii'|'utf8'|'utf16le'|'ucs2'|'base64'|'binary'|'hex'});
|
||||
constructor(options: {delimiter: string | Buffer | number[], encoding?: 'ascii'|'utf8'|'utf16le'|'ucs2'|'base64'|'binary'|'hex', includeDelimiter?: boolean});
|
||||
}
|
||||
class Ready extends Stream.Transform {
|
||||
constructor(options: {delimiter: string | Buffer | number[]});
|
||||
|
||||
@@ -105,8 +105,8 @@ function test_parsers() {
|
||||
|
||||
const ByteLengthParser = new SerialPort.parsers.ByteLength({length: 8});
|
||||
const CCTalkParser = new SerialPort.parsers.CCTalk();
|
||||
const DelimiterParser = new SerialPort.parsers.Delimiter({ delimiter: Buffer.from('EOL') });
|
||||
const ReadlineParser = new SerialPort.parsers.Readline({ delimiter: '\r\n' });
|
||||
const DelimiterParser = new SerialPort.parsers.Delimiter({ delimiter: Buffer.from('EOL'), includeDelimiter: true });
|
||||
const ReadlineParser = new SerialPort.parsers.Readline({ delimiter: '\r\n', includeDelimiter: false });
|
||||
const ReadyParser = new SerialPort.parsers.Ready({ delimiter: 'READY' });
|
||||
const RegexParser = new SerialPort.parsers.Regex({regex: /.*/});
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -90,7 +90,7 @@ declare namespace SerialPort {
|
||||
constructor(options: {delimiter: string | Buffer | number[], includeDelimiter?: boolean});
|
||||
}
|
||||
class Readline extends Delimiter {
|
||||
constructor(options: {delimiter: string | Buffer | number[], encoding?: 'ascii'|'utf8'|'utf16le'|'ucs2'|'base64'|'binary'|'hex'});
|
||||
constructor(options: {delimiter: string | Buffer | number[], encoding?: 'ascii'|'utf8'|'utf16le'|'ucs2'|'base64'|'binary'|'hex', includeDelimiter?: boolean});
|
||||
}
|
||||
class Ready extends Stream.Transform {
|
||||
constructor(options: {data: string | Buffer | number[]});
|
||||
|
||||
Reference in New Issue
Block a user