How to use the tsd.getAPI function in tsd

To help you get started, we’ve selected a few tsd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github angular-in-action / hello-world / gulpfile.js View on Github external
gulp.task('tsd', function() {
  var tsdAPI = tsd.getAPI('tsd.json');
  return tsdAPI.readConfig({}, true).then(function() {
    return tsdAPI.reinstall(
      tsd.Options.fromJSON({}) // https://github.com/DefinitelyTyped/tsd/blob/bb2dc91ad64f159298657805154259f9e68ea8a6/src/tsd/Options.ts
    ).then(function() {
      return tsdAPI.updateBundle(tsdAPI.context.config.bundle, true);
    });
  });
});
github FlexSearch / FlexSearch / srcjs / gulp / tsd.js View on Github external
'use strict';

var gulp = require('gulp');
var gutil = require('gulp-util');

var path = require('path');
var tsd = require('tsd');

var tsdJson = 'tsd.json';
var tsdApi = new tsd.getAPI(tsdJson);

module.exports = function() {
  gulp.task('tsd:install', function () {
    var bower = require(path.join(process.cwd(), 'bower.json'));

    var dependencies = [].concat(
      Object.keys(bower.dependencies),
      Object.keys(bower.devDependencies)
    );

    var query = new tsd.Query();
    dependencies.forEach(function (dependency) {
      query.addNamePattern(dependency);
    });

    var options = new tsd.Options();
github Swiip / generator-gulp-angular / app / templates / gulp / tsd.js View on Github external
'use strict';

var gulp = require('gulp');
var gutil = require('gulp-util');

var path = require('path');
var tsd = require('tsd');

var tsdJson = 'tsd.json';
var tsdApi = new tsd.getAPI(tsdJson);

gulp.task('tsd:install', function () {
  var bower = require(path.join(process.cwd(), 'bower.json'));

  var dependencies = [].concat(
    Object.keys(bower.dependencies),
    Object.keys(bower.devDependencies)
  );

  var query = new tsd.Query();
  dependencies.forEach(function (dependency) {
    query.addNamePattern(dependency);
  });
  query.addNamePattern('karma-jasmine');

  var options = new tsd.Options();
github angular-starter-kit / starter-kit / gulp / typings.js View on Github external
'use strict';

var gulp = require('gulp');
var conf = require('../gulpfile.config');
var gutil = require('gulp-util');

var path = require('path');
var tsd = require('tsd');

var tsdJson = 'tsd.json';
var tsdApi = new tsd.getAPI(tsdJson);

gulp.task('tsd', function() {
  var bower = require(path.join(process.cwd(), 'bower.json'));

  var dependencies = [].concat(
    Object.keys(bower.dependencies),
    Object.keys(bower.devDependencies)
  );

  var query = new tsd.Query();
  dependencies.forEach(function(dependency) {
    query.addNamePattern(dependency);
  });

  var options = new tsd.Options();
  options.resolveDependencies = true;
github DefinitelyTyped / grunt-tsd / lib / runner.js View on Github external
function getAPI(options) {
		grunt.log.writeln('-> config: ' + options.config);
		var api = tsd.getAPI(options.config, grunt.option('verbose'));
		if (options.cacheDir) {
			grunt.log.writeln('cacheDir: ' + options.cacheDir);
			api.context.paths.cacheDir = path.resolve(options.cacheDir);
		}
		return api;
	}
github moznion / gulp-tsd / lib / tsd.js View on Github external
function getAPI(setting) {
        logger.log('config:', setting.config);
        var api = tsd.getAPI(setting.config);
        if (setting.cacheDir) {
            logger.log('cacheDir:', setting.cacheDir);
            api.context.paths.cacheDir = path.resolve(setting.cacheDir);
        }
        return api;
    }

tsd

Check TypeScript type definitions

MIT
Latest version published 1 month ago

Package Health Score

89 / 100
Full package analysis