| 62 | } |
| 63 | |
| 64 | function validateNativeBinding(binding: NativeWsV2Binding): NativeWsV2Binding | null { |
| 65 | if (binding.wsV2NativeAvailable?.() !== true) { |
| 66 | return null |
| 67 | } |
| 68 | if ( |
| 69 | typeof binding.wsV2Connect !== 'function' || |
| 70 | typeof binding.wsV2Start !== 'function' || |
| 71 | typeof binding.wsV2Next !== 'function' || |
| 72 | typeof binding.wsV2Cancel !== 'function' || |
| 73 | typeof binding.wsV2Close !== 'function' |
| 74 | ) { |
| 75 | return null |
| 76 | } |
| 77 | return binding |
| 78 | } |
| 79 | |
| 80 | function loadNativeBinding(): NativeWsV2Binding | null { |
| 81 | for (const moduleId of candidateNativeBindingModuleIds()) { |