/* @flow */
const Api = require('./api-telegram');
const { jsonStdin, readConfig } = require('./utils.js');

import type { Configuration, ReadConfiguration } from './types';

module.exports = {
  readConfig: async function(): Promise<Configuration> {
    return await readConfig(jsonStdin(), Api);
  }
};

/* @flow */
const Api = require('./api-telegram');
const { jsonStdin, readConfig: _readConfig } = require('./utils.js');

import type { Configuration, ReadConfiguration } from './types';

const readConfig: ReadConfiguration = async function(): Promise<Configuration> {
  return await _readConfig(jsonStdin(), Api);
};

module.exports = {
  readConfig
};

add type to readConfig