
// #ifdef MP-QQ
// @ts-ignore
import TIM_MP from 'tim-wx-sdk';
// #endif

// #ifdef MP-WEIXIN
import { getMpWxTIM } from './tim-mp-wx';
// #endif


// #ifdef H5
import { getWebTIM } from './tim-web';
// #endif


import type { TimType } from '../types';


export async function getTIM(): Promise<TimType> {
  let result;

  // #ifdef H5
  result = await getWebTIM();
  // #endif

  // #ifdef MP-WEIXIN
  result = await getMpWxTIM();
  // #endif

  // #ifdef MP-QQ
  result = Promise.resolve(TIM_MP);
  // #endif

  return result;
}
