import { GetProvider, GetProviderOptions, GetProviderSuccess } from '../interface.uts' const SupportedProviderServiceList = ['oauth', 'share', 'payment', 'push', 'location'] export const getProvider : GetProvider = (options: GetProviderOptions) : void => { if (!SupportedProviderServiceList.includes(options.service)) { if (options.fail != null) { const uniError = new UniError('uni-getProvider', -1, 'Parameter service invalid.'); options.fail?.(uniError); } } else { const providers = UTSAndroid.getProviders(options.service) // TODO // const providers: any[] = [] if (options.success != null) { const result = { service: options.service, provider: providers.map((provider): string => { return provider.id }), providers, errMsg: 'GetProvider:ok' } as GetProviderSuccess; options.success?.(result); } } options.complete?.({}); }