import { NativeModules } from 'react-native'; import { LINKING_ERROR } from './constant'; const { DJISDKAircraftWrapper } = NativeModules; if (!DJISDKAircraftWrapper) { throw new Error(LINKING_ERROR); } export class SDKAircraft { async getSerialNumber(): Promise { const serialNumber = await DJISDKAircraftWrapper.getSerialNumber(); return serialNumber; } async isConnected(): Promise { const isConnected = await DJISDKAircraftWrapper.isDroneConnected(); return isConnected; } async getModel(): Promise { const model = await DJISDKAircraftWrapper.getModel(); return model; } async startTakeOff(): Promise { await DJISDKAircraftWrapper.startTakeOff(); } async startLanding(): Promise { await DJISDKAircraftWrapper.startLanding(); } }