@types/serialport

  • Version 8.0.5
  • Published
  • 8.62 kB
  • 1 dependency
  • MIT license

Install

npm i @types/serialport
yarn add @types/serialport
pnpm add @types/serialport

Overview

TypeScript definitions for serialport

Index

Classes

class BaseBinding

class BaseBinding {}

    constructor

    constructor(options: any);

      method close

      close: () => Promise<any>;

        method drain

        drain: () => Promise<any>;

          method flush

          flush: () => Promise<any>;

            method get

            get: () => Promise<any>;

              method list

              static list: () => Promise<PortInfo[]>;

                method open

                open: (path: string, options: OpenOptions) => Promise<any>;

                  method read

                  read: (data: Buffer, offset: number, length: number) => Promise<any>;

                    method set

                    set: (options?: SetOptions) => Promise<any>;

                      method update

                      update: (options?: UpdateOptions) => Promise<any>;

                        method write

                        write: (data: Buffer) => Promise<any>;

                          class SerialPort

                          class SerialPort extends Stream.Duplex {}

                            constructor

                            constructor(path: string, callback?: SerialPort.ErrorCallback);

                              constructor

                              constructor(
                              path: string,
                              options?: SerialPort.OpenOptions,
                              callback?: SerialPort.ErrorCallback
                              );

                                property baudRate

                                readonly baudRate: number;

                                  property binding

                                  readonly binding: SerialPort.BaseBinding;

                                    property Binding

                                    static Binding: SerialPort.BaseBinding;

                                      property isOpen

                                      readonly isOpen: boolean;

                                        property path

                                        readonly path: string;

                                          method close

                                          close: (callback?: (error?: Error | null) => void) => void;

                                            method drain

                                            drain: (callback?: SerialPort.ErrorCallback) => void;

                                              method flush

                                              flush: (callback?: SerialPort.ErrorCallback) => void;

                                                method get

                                                get: (callback?: SerialPort.ModemBitsCallback) => void;

                                                  method list

                                                  static list: () => Promise<SerialPort.PortInfo[]>;

                                                    method on

                                                    on: (event: string, callback: (data?: any) => void) => this;

                                                      method open

                                                      open: (callback?: SerialPort.ErrorCallback) => void;

                                                        method pause

                                                        pause: () => this;

                                                          method read

                                                          read: (size?: number) => string | Buffer | null;

                                                            method resume

                                                            resume: () => this;

                                                              method set

                                                              set: (
                                                              options: SerialPort.SetOptions,
                                                              callback?: SerialPort.ErrorCallback
                                                              ) => void;

                                                                method update

                                                                update: (
                                                                options: SerialPort.UpdateOptions,
                                                                callback?: SerialPort.ErrorCallback
                                                                ) => void;

                                                                  method write

                                                                  write: {
                                                                  (
                                                                  data: string | number[] | Buffer,
                                                                  callback?: (
                                                                  error: Error | null | undefined,
                                                                  bytesWritten: number
                                                                  ) => void
                                                                  ): boolean;
                                                                  (
                                                                  buffer: any,
                                                                  encoding?:
                                                                  | 'ascii'
                                                                  | 'utf8'
                                                                  | 'utf16le'
                                                                  | 'ucs2'
                                                                  | 'base64'
                                                                  | 'binary'
                                                                  | 'hex',
                                                                  callback?: (error: Error, bytesWritten: number) => void
                                                                  ): boolean;
                                                                  };

                                                                    Interfaces

                                                                    interface OpenOptions

                                                                    interface OpenOptions {}

                                                                      property autoOpen

                                                                      autoOpen?: boolean | undefined;

                                                                        property baudRate

                                                                        baudRate?:
                                                                        | 115200
                                                                        | 57600
                                                                        | 38400
                                                                        | 19200
                                                                        | 9600
                                                                        | 4800
                                                                        | 2400
                                                                        | 1800
                                                                        | 1200
                                                                        | 600
                                                                        | 300
                                                                        | 200
                                                                        | 150
                                                                        | 134
                                                                        | 110
                                                                        | 75
                                                                        | 50
                                                                        | number
                                                                        | undefined;

                                                                          property binding

                                                                          binding?: BaseBinding | undefined;

                                                                            property bindingOptions

                                                                            bindingOptions?:
                                                                            | {
                                                                            vmin?: number | undefined;
                                                                            vtime?: number | undefined;
                                                                            }
                                                                            | undefined;

                                                                              property dataBits

                                                                              dataBits?: 8 | 7 | 6 | 5 | undefined;

                                                                                property highWaterMark

                                                                                highWaterMark?: number | undefined;

                                                                                  property lock

                                                                                  lock?: boolean | undefined;

                                                                                    property parity

                                                                                    parity?: 'none' | 'even' | 'mark' | 'odd' | 'space' | undefined;

                                                                                      property rtscts

                                                                                      rtscts?: boolean | undefined;

                                                                                        property stopBits

                                                                                        stopBits?: 1 | 2 | undefined;

                                                                                          property xany

                                                                                          xany?: boolean | undefined;

                                                                                            property xoff

                                                                                            xoff?: boolean | undefined;

                                                                                              property xon

                                                                                              xon?: boolean | undefined;

                                                                                                interface PortInfo

                                                                                                interface PortInfo {}

                                                                                                  property locationId

                                                                                                  locationId?: string | undefined;

                                                                                                    property manufacturer

                                                                                                    manufacturer?: string | undefined;

                                                                                                      property path

                                                                                                      path: string;

                                                                                                        property pnpId

                                                                                                        pnpId?: string | undefined;

                                                                                                          property productId

                                                                                                          productId?: string | undefined;

                                                                                                            property serialNumber

                                                                                                            serialNumber?: string | undefined;

                                                                                                              property vendorId

                                                                                                              vendorId?: string | undefined;

                                                                                                                interface SetOptions

                                                                                                                interface SetOptions {}

                                                                                                                  property brk

                                                                                                                  brk?: boolean | undefined;

                                                                                                                    property cts

                                                                                                                    cts?: boolean | undefined;

                                                                                                                      property dsr

                                                                                                                      dsr?: boolean | undefined;

                                                                                                                        property dtr

                                                                                                                        dtr?: boolean | undefined;

                                                                                                                          property rts

                                                                                                                          rts?: boolean | undefined;

                                                                                                                            interface UpdateOptions

                                                                                                                            interface UpdateOptions {}

                                                                                                                              property baudRate

                                                                                                                              baudRate?:
                                                                                                                              | 115200
                                                                                                                              | 57600
                                                                                                                              | 38400
                                                                                                                              | 19200
                                                                                                                              | 9600
                                                                                                                              | 4800
                                                                                                                              | 2400
                                                                                                                              | 1800
                                                                                                                              | 1200
                                                                                                                              | 600
                                                                                                                              | 300
                                                                                                                              | 200
                                                                                                                              | 150
                                                                                                                              | 134
                                                                                                                              | 110
                                                                                                                              | 75
                                                                                                                              | 50
                                                                                                                              | number
                                                                                                                              | undefined;

                                                                                                                                Type Aliases

                                                                                                                                type darwinBinding

                                                                                                                                type darwinBinding = BaseBinding;

                                                                                                                                  type ErrorCallback

                                                                                                                                  type ErrorCallback = (error?: Error | null) => void;

                                                                                                                                    type linuxBinding

                                                                                                                                    type linuxBinding = BaseBinding;

                                                                                                                                      type ModemBitsCallback

                                                                                                                                      type ModemBitsCallback = (
                                                                                                                                      error: Error | null | undefined,
                                                                                                                                      status: { cts: boolean; dsr: boolean; dcd: boolean }
                                                                                                                                      ) => void;

                                                                                                                                        type win32Binding

                                                                                                                                        type win32Binding = BaseBinding;

                                                                                                                                          Namespaces

                                                                                                                                          namespace parsers

                                                                                                                                          namespace parsers {}

                                                                                                                                            class ByteLength

                                                                                                                                            class ByteLength extends Stream.Transform {}

                                                                                                                                              constructor

                                                                                                                                              constructor(options: { length: number });

                                                                                                                                                class CCTalk

                                                                                                                                                class CCTalk extends Stream.Transform {}

                                                                                                                                                  constructor

                                                                                                                                                  constructor();

                                                                                                                                                    class Delimiter

                                                                                                                                                    class Delimiter extends Stream.Transform {}

                                                                                                                                                      constructor

                                                                                                                                                      constructor(options: {
                                                                                                                                                      delimiter: string | Buffer | number[];
                                                                                                                                                      includeDelimiter?: boolean | undefined;
                                                                                                                                                      });

                                                                                                                                                        class Readline

                                                                                                                                                        class Readline extends Delimiter {}

                                                                                                                                                          constructor

                                                                                                                                                          constructor(options: {
                                                                                                                                                          delimiter: string | Buffer | number[];
                                                                                                                                                          encoding?:
                                                                                                                                                          | 'ascii'
                                                                                                                                                          | 'utf8'
                                                                                                                                                          | 'utf16le'
                                                                                                                                                          | 'ucs2'
                                                                                                                                                          | 'base64'
                                                                                                                                                          | 'binary'
                                                                                                                                                          | 'hex'
                                                                                                                                                          | undefined;
                                                                                                                                                          includeDelimiter?: boolean | undefined;
                                                                                                                                                          });

                                                                                                                                                            class Ready

                                                                                                                                                            class Ready extends Stream.Transform {}

                                                                                                                                                              constructor

                                                                                                                                                              constructor(options: { delimiter: string | Buffer | number[] });

                                                                                                                                                                class Regex

                                                                                                                                                                class Regex extends Stream.Transform {}

                                                                                                                                                                  constructor

                                                                                                                                                                  constructor(options: { regex: RegExp });

                                                                                                                                                                    Package Files (1)

                                                                                                                                                                    Dependencies (1)

                                                                                                                                                                    Dev Dependencies (0)

                                                                                                                                                                    No dev dependencies.

                                                                                                                                                                    Peer Dependencies (0)

                                                                                                                                                                    No peer dependencies.

                                                                                                                                                                    Badge

                                                                                                                                                                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/serialport.

                                                                                                                                                                    • Markdown
                                                                                                                                                                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/serialport)
                                                                                                                                                                    • HTML
                                                                                                                                                                      <a href="https://www.jsdocs.io/package/@types/serialport"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>