當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。