docs/libs/typescript.js
function getAutomaticTypeDirectiveNames(options, host) {
        // Use explicit type list from tsconfig.json
        if (options.types) {
            return options.types;
        }
        // Walk the primary type lookup locations
        var result = [];
        if (host.directoryExists && host.getDirectories) {
            var typeRoots = getEffectiveTypeRoots(options, host);
            if (typeRoots) {
                for (var _i = 0, typeRoots_1 = typeRoots; _i < typeRoots_1.length; _i++) {
                    var root = typeRoots_1[_i];
                    if (host.directoryExists(root)) {
                        for (var _a = 0, _b = host.getDirectories(root); _a < _b.length; _a++) {
                            var typeDirectivePath = _b[_a];
                            var normalized = ts.normalizePath(typeDirectivePath);
                            var packageJsonPath = ts.pathToPackageJson(ts.combinePaths(root, normalized));
                            // tslint:disable-next-line:no-null-keyword
                            var isNotNeededPackage = host.fileExists(packageJsonPath) && ts.readJson(packageJsonPath, host).typings === null;
                            if (!isNotNeededPackage) {
                                // Return just the type directive names
                                result.push(ts.getBaseFileName(normalized));
                            }
                        }
                    }
                }
            }
        }
        return result;
    }
function getAutomaticTypeDirectiveNames(options, host) {
        // Use explicit type list from tsconfig.json
        if (options.types) {
            return options.types;
        }
        // Walk the primary type lookup locations
        var result = [];
        if (host.directoryExists && host.getDirectories) {
            var typeRoots = getEffectiveTypeRoots(options, host);
            if (typeRoots) {
                for (var _i = 0, typeRoots_1 = typeRoots; _i < typeRoots_1.length; _i++) {
                    var root = typeRoots_1[_i];
                    if (host.directoryExists(root)) {
                        for (var _a = 0, _b = host.getDirectories(root); _a < _b.length; _a++) {
                            var typeDirectivePath = _b[_a];
                            var normalized = ts.normalizePath(typeDirectivePath);
                            var packageJsonPath = ts.pathToPackageJson(ts.combinePaths(root, normalized));
                            // tslint:disable-next-line:no-null-keyword
                            var isNotNeededPackage = host.fileExists(packageJsonPath) && ts.readJson(packageJsonPath, host).typings === null;
                            if (!isNotNeededPackage) {
                                // Return just the type directive names
                                result.push(ts.getBaseFileName(normalized));
                            }
                        }
                    }
                }
            }
        }
        return result;
    }
function getAutomaticTypeDirectiveNames ( options , host ) { // Use explicit type list from tsconfig.json if ( options . types ) { return options . types ; } // Walk the primary type lookup locations var result = [ ] ; if ( host . directoryExists && host . getDirectories ) { var typeRoots = getEffectiveTypeRoots ( options , host ) ; if ( typeRoots ) { for ( var _i = 0 , typeRoots_1 = typeRoots ; _i < typeRoots_1 . length ; _i ++ ) { var root = typeRoots_1 [ _i ] ; if ( host . directoryExists ( root ) ) { for ( var _a = 0 , _b = host . getDirectories ( root ) ; _a < _b . length ; _a ++ ) { var typeDirectivePath = _b [ _a ] ; var normalized = ts . normalizePath ( typeDirectivePath ) ; var packageJsonPath = ts . pathToPackageJson ( ts . combinePaths ( root , normalized ) ) ; // tslint:disable-next-line:no-null-keyword var isNotNeededPackage = host . fileExists ( packageJsonPath ) && ts . readJson ( packageJsonPath , host ) . typings === null ; if ( ! isNotNeededPackage ) { // Return just the type directive names result . push ( ts . getBaseFileName ( normalized ) ) ; } } } } } } return result ; }
Given a set of options, returns the set of type directive names
that should be included for this program automatically.
This list could either come from the config file,
or from enumerating the types root + initial secondary types lookup location.
More type directives might appear in the program later as a result of loading actual source files;
this list is only the set of defaults that are implicitly included.
Given a set of options returns the set of type directive names that should be included for this program automatically . This list could either come from the config file or from enumerating the types root + initial secondary types lookup location . More type directives might appear in the program later as a result of loading actual source files ; this list is only the set of defaults that are implicitly included .