import simpleValidator = require('./simpleValidator');

const types = simpleValidator.types;
const compilerOptionsValidation: simpleValidator.ValidationInfo = {
    allowJs: { type: types.boolean },
    allowNonTsExtensions: { type: types.boolean },
    allowSyntheticDefaultImports: { type: types.boolean },
    allowUnreachableCode: { type: types.boolean },
    allowUnusedLabels: { type: types.boolean },
    alwaysStrict: { type: types.boolean },
    baseUrl: { type: types.string },
    charset: { type: types.string },
    checkJs: { type: types.boolean },
    codepage: { type: types.number },
    declaration: { type: types.boolean },
    declarationDir: { type: types.string },
    diagnostics: { type: types.boolean },
    emitBOM: { type: types.boolean },
    experimentalAsyncFunctions: { type: types.boolean },
    experimentalDecorators: { type: types.boolean },
    emitDecoratorMetadata: { type: types.boolean },
    forceConsistentCasingInFileNames: { type: types.boolean },
    help: { type: types.boolean },
    importHelpers: { type: types.boolean },
    init: { type: types.boolean },
    inlineSourceMap: { type: types.boolean },
    inlineSources: { type: types.boolean },
    isolatedModules: { type: types.boolean },
    jsx: { type: types.string, validStringValues: ['none', 'preserve', 'react', 'react-native'] },
    jsxFactory: { type: types.string },
    locals: { type: types.string },
    lib: { type: types.array, sub: { type: types.string } },
    list: { type: types.array, sub: { type: types.string } },
    listEmittedFiles: { type: types.boolean },
    listFiles: { type: types.boolean },
    mapRoot: { type: types.string },
    maxNodeModuleJsDepth: { type: types.number },
    module: { type: types.string, validStringValues: ["commonjs", "amd", "umd", "system", "es6", "es2015", "esnext", "none"] },
    moduleResolution: { type: types.string, validStringValues: ['classic', 'node'] },
    newLine: { type: types.string },
    noEmit: { type: types.boolean },
    noEmitHelpers: { type: types.boolean },
    noEmitOnError: { type: types.boolean },
    noErrorTruncation: { type: types.boolean },
    noFallthroughCasesInSwitch: { type: types.boolean },
    noImplicitAny: { type: types.boolean },
    noImplicitReturns: { type: types.boolean },
    noImplicitThis: { type: types.boolean },
    noImplicitUseStrict: { type: types.boolean },
    noLib: { type: types.boolean },
    noLibCheck: { type: types.boolean },
    noResolve: { type: types.boolean },
    noUnusedParameters: { type: types.boolean },
    noUnusedLocals: { type: types.boolean },
    out: { type: types.string },
    outFile: { type: types.string },
    outDir: { type: types.string },
    paths: { type: types.object },
    preserveConstEnums: { type: types.boolean },
    pretty: { type: types.boolean },
    reactNamespace: { type: types.string },
    removeComments: { type: types.boolean },
    rootDir: { type: types.string },
    rootDirs: { type: types.array, sub: { type: types.string } },
    strict: { type: types.boolean },
    skipDefaultLibCheck: { type: types.boolean },
    skipLibCheck: { type: types.boolean },
    sourceMap: { type: types.boolean },
    sourceRoot: { type: types.string },
    strictNullChecks: { type: types.boolean },
    stripInternal: { type: types.boolean },
    suppressExcessPropertyErrors: { type: types.boolean },
    suppressImplicitAnyIndexErrors: { type: types.boolean },
    suppressOutputPathCheck: { type: types.boolean },
    target: { type: types.string, validStringValues: ['es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'esnext', 'next', 'latest'] },
    traceResolution: { type: types.boolean },
    types: { type: types.array, sub: { type: types.string } },
    typeRoots: { type: types.array, sub: { type: types.string } },
    typesSearchPaths: { type: types.array, sub: { type: types.string } },
    version: { type: types.boolean },
    watch: { type: types.boolean },
}
const validator = new simpleValidator.SimpleValidator(compilerOptionsValidation);
export const validate = validator.validate;
