Devel vor 3 Jahren
Ursprung
Commit
c9fd60f4c4
1 geänderte Dateien mit 12 neuen und 2 gelöschten Zeilen
  1. 12 2
      types/index.d.ts

+ 12 - 2
types/index.d.ts

@@ -56,6 +56,14 @@ interface DefinitionsStatic {
     FTDI: string,
     PL2303: string
   };
+  FLOW_CONTROL_RTS:{
+    FLOW_CONTROL_RTS_TRUE: boolean,
+    FLOW_CONTROL_RTS_FALSE: boolean,
+  };
+  FLOW_CONTROL_DTR:{
+    FLOW_CONTROL_DTR_TRUE: boolean,
+    FLOW_CONTROL_DTR_FALSE: boolean,
+  };
 }
 export var definitions: DefinitionsStatic;
 
@@ -77,6 +85,8 @@ type Parities = 0 | 1 | 2 | 3 | 4;
 type FlowControls = 0 | 1 | 2 | 3;
 type ReturnedDataTypes = 1 | 2;
 type Drivers = "AUTO" | "cdc" | "ch34x" | "cp210x" | "ftdi" | "pl2303";
+type FlowControlsRTS = 0 | 1;
+type FlowControlsDTR = 0 | 1;
 
 interface RNSerialportStatic {
   /**
@@ -169,11 +179,11 @@ interface RNSerialportStatic {
   /**
    *  Set RTS
    */
-  setRTS(FLOW_CONTROL_RTS: boolean): void;
+  setRTS(controlRTS: FlowControlsRTS): void;
   /**
    *  Set DTR
    */
-  setDTR(FLOW_CONTROL_DTR: boolean): void;
+  setDTR(controlDTR: FlowControlsDTR): void;
 
   /**
    * Set the auto connection baudrate