| 60 | let jsImplementation: any; |
| 61 | |
| 62 | const loadPluginImplementation = async (): Promise<any> => { |
| 63 | if (!jsImplementation && platform in jsImplementations) { |
| 64 | jsImplementation = |
| 65 | typeof jsImplementations[platform] === 'function' |
| 66 | ? (jsImplementation = await jsImplementations[platform]()) |
| 67 | : (jsImplementation = jsImplementations[platform]); |
| 68 | } else if (capCustomPlatform !== null && !jsImplementation && 'web' in jsImplementations) { |
| 69 | jsImplementation = |
| 70 | typeof jsImplementations['web'] === 'function' |
| 71 | ? (jsImplementation = await jsImplementations['web']()) |
| 72 | : (jsImplementation = jsImplementations['web']); |
| 73 | } |
| 74 | |
| 75 | return jsImplementation; |
| 76 | }; |
| 77 | |
| 78 | const createPluginMethod = (impl: any, prop: PropertyKey): ((...args: any[]) => any) => { |
| 79 | if (pluginHeader) { |