{"version":3,"file":"SetCorrectionOnROELine_1.cjs","names":["Request"],"sources":["../../generated/api/SetCorrectionOnROELine_1.ts"],"sourcesContent":["import { ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\nimport { CorrectTypeEnum } from '../CorrectType';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    SetCorrectionOnROELine_1(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      bBroadcast: boolean,\n      isOpenCorrect: boolean,\n      type: CorrectTypeEnum,\n      retainClrInfo: boolean\n    ): Promise<void>;\n    trySetCorrectionOnROELine_1(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      isOpenCorrect: boolean,\n      type: CorrectTypeEnum,\n      retainClrInfo: boolean\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createSetCorrectionOnROELine_1<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: Broadcast,\n  isOpenCorrect: boolean,\n  type: CorrectTypeEnum,\n  retainClrInfo: boolean\n): Request<Broadcast> {\n  const req = new Request(\n    isOpenCorrect\n      ? [0 | 64]\n      : [0, 0 | (isOpenCorrect ? 1 : 0), 0 | (type << 1), 0 | (!retainClrInfo ? 4 : 0)],\n    bBroadcast,\n    'SetCorrectionOnROELine_1'\n  );\n  req.destination = addr;\n  req.deviceType = 1;\n  req.port = portAddr;\n  req.rcvIndex = scanBoardAddr;\n  req.address = AddressMapping.CorrectionOnAddr;\n  return req;\n}\nSession.prototype.SetCorrectionOnROELine_1 = async function SetCorrectionOnROELine_1(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: boolean,\n  isOpenCorrect: boolean,\n  type: CorrectTypeEnum,\n  retainClrInfo: boolean\n): Promise<void> {\n  const req = createSetCorrectionOnROELine_1(\n    addr,\n    portAddr,\n    scanBoardAddr,\n    bBroadcast,\n    isOpenCorrect,\n    type,\n    retainClrInfo\n  );\n  await this.connection.send(req);\n};\nSession.prototype.trySetCorrectionOnROELine_1 = async function trySetCorrectionOnROELine_1(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  isOpenCorrect: boolean,\n  type: CorrectTypeEnum,\n  retainClrInfo: boolean\n): Promise<ErrorType | null> {\n  const req = createSetCorrectionOnROELine_1(\n    addr,\n    portAddr,\n    scanBoardAddr,\n    false,\n    isOpenCorrect,\n    type,\n    retainClrInfo\n  );\n  return (await this.connection.trySend(req))?.ack ?? null;\n};\n"],"mappings":";;;;;AAyBA,SAAwB,+BACtB,MACA,UACA,eACA,YACA,eACA,MACA,eACoB;CACpB,MAAM,MAAM,IAAIA,wBACd,gBACI,CAAC,EAAM,IACP;EAAC;EAAG,KAAK,gBAAgB,IAAI;EAAI,IAAK,QAAQ;EAAI,KAAK,CAAC,gBAAgB,IAAI;CAAE,GAClF,YACA,0BACF;CACA,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,2BAA2B,eAAe,yBAE1D,MACA,UACA,eACA,YACA,eACA,MACA,eACe;CACf,MAAM,MAAM,+BACV,MACA,UACA,eACA,YACA,eACA,MACA,aACF;CACA,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,wBAAQ,UAAU,8BAA8B,eAAe,4BAE7D,MACA,UACA,eACA,eACA,MACA,eAC2B;CAC3B,MAAM,MAAM,+BACV,MACA,UACA,eACA,OACA,eACA,MACA,aACF;CACA,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}