当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript open.default函数代码示例

本文整理汇总了TypeScript中open.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了default函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: openUrl

export default function openUrl(url: string) {
  try {
    open(url);
  }
  catch (error) {
    vscode.window.showErrorMessage('Couldn\'t open URL. ' + url);
    console.error(error.stack);
  }
}
开发者ID:jvandyke,项目名称:vscode-circleci,代码行数:9,代码来源:open-url.ts

示例2: run

    run(parsers:IParser[]){
        if(_.isUndefined(parsers)){
            parsers = [];
        }

        parsers.push(new Haskell.HaskellParser());

        var config = new Config.Config().getConfig();

        var server = new Server.Server(process.env.PORT || config.port, config);

        var watchPaths = [config.projectSource + "/dist/test/"];

        var fileWatcher = new FileWatcher.FileWatcher(watchPaths, path => {
            try{
                for(var i = 0; i< parsers.length; i++){
                    var contents = parsers[i].parseFile(path);

                    server.notifyConnections(contents);

                    console.log((path + " changed").cyan);

                    return;
                }
            }
            catch(e){

            }
        });

        server.start();

        open("http://localhost:" + server.port);
    }
开发者ID:devshorts,项目名称:htf-viewer,代码行数:34,代码来源:app.ts

示例3: open

 .then(function(res) {
   let page = res.body.html_url
   if (!page) {
     return vscode.window.showErrorMessage(res.body && res.body.message ? res.body.message : "Could not create gist");
   }
   open(page);
 })
开发者ID:satokaz,项目名称:vscode-gist,代码行数:7,代码来源:index.ts

示例4: require

const server = app.listen(PORT, HOST, (error: Error) => {

  if (error) {
    return console.error(error);
  }

  const open = require('open');

  open(`http://${HOST}:${PORT}`, { app: 'chrome' }).then((c: { pid: string; }) => {
    console.log('Chrome PID ' + c.pid);
  }).catch((e: Error) => {
    console.error('Could not open Chrome Browser.', e);
  })

  console.log(`\n\nDev server listening on port ${PORT} at ${HOST}: \n\n`);

  spawn('npm', ['run', 'watch'], {
    shell: true,
    env: process.env,
    stdio: 'inherit'
  })
    .on('close', code => process.exit(code))
    .on('error', spawnError => console.error(spawnError));
  

})
开发者ID:tobiasbu,项目名称:tobiJS,代码行数:26,代码来源:dev_server.ts

示例5: serve

    serve(log).then((url) => {
      console.log(url);

      // Open the program in the browser.
      let query = querystring.stringify({ code });
      open_url(url + '/#' + query);
    });
开发者ID:kleopatra999,项目名称:staticstaging,代码行数:7,代码来源:harness.ts

示例6: function

export const server = app.listen(ARGS.port, function () {
    const port = server.address().port;
    console.log("Server started on port " + port);
    if (ARGS.open) {
        open('http://0.0.0.0:' + port);
    }
});
开发者ID:RealOrangeOne,项目名称:host-container,代码行数:7,代码来源:index.ts

示例7: openGistInBrowser

export function openGistInBrowser() {
  var curr_gist = getGistDetails();
  if (!curr_gist) {
    return vscode.window.showErrorMessage("First open a personal gist");
  }
  open("https://gist.github.com/" + curr_gist.id);
}
开发者ID:satokaz,项目名称:vscode-gist,代码行数:7,代码来源:index.ts

示例8: Init

        async function Init() {

            vscode.window.setStatusBarMessage("Checking for Github Token and GIST.", 2000);
            var syncSetting: Setting = await common.InitSettings();
            if (syncSetting.Token == null || syncSetting.Token == "") {
                openurl("https://github.com/settings/tokens");
                await common.GetTokenAndSave(syncSetting).then(function(saved: boolean) {
                    if (saved) {
                        Init();
                        return;
                    }
                    else {
                        vscode.window.showErrorMessage("TOKEN NOT SAVED");
                        return;
                    }
                }, function(err: any) {
                    console.error(err);
                    vscode.window.showErrorMessage(common.ERROR_MESSAGE);
                    return;
                });
            }
            else {
                myGi = new myGit.GithubService(syncSetting.Token);
                vscode.window.setStatusBarMessage("Uploading / Updating Your Settings In Github.", 3000);
                await startGitProcess(syncSetting);
                return;
            }
        }
开发者ID:searKing,项目名称:code-settings-sync,代码行数:28,代码来源:extension.ts

示例9: map

    map(buildEvent => {
      if (first && options.open) {
        first = false;
        open(openAddress);
      }

      return { ...buildEvent, baseUrl: openAddress } as DevServerBuilderOutput;
    }),
开发者ID:angular,项目名称:angular-cli,代码行数:8,代码来源:index.ts

示例10: require

 goToSettingsMessage, getDotNetMessage).then(value => {
     if (value === getDotNetMessage) {
         let open = require('open');
         open('https://www.microsoft.com/net/core');
     } else if (value === goToSettingsMessage) {
         vscode.commands.executeCommand('workbench.action.openGlobalSettings');
     }
 });
开发者ID:rlugojr,项目名称:omnisharp-vscode,代码行数:8,代码来源:activate.ts


注:本文中的open.default函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。