Giter Site home page Giter Site logo

haagenson / vss-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoft/vss-web-extension-sdk

0.0 1.0 0.0 321 KB

Visual Studio Services Client SDK. JavaScript library for Visual Studio Online extensions.

Home Page: https://www.visualstudio.com/integrate/extensions/overview

JavaScript 100.00%

vss-sdk's Introduction

Visual Studio Services Client SDK

This repo contains core client SDK file and TypeScript declare files needed for developing Visual Studio Online Extensions.

VSS.SDK.js enables an extension to communicate to host to perform operations like initializing, notifying extension is loaded or getting context about the current page on the host.

Getting started

  • Add this line: <script src="sdk/scripts/VSS.SDK.js"></script>
  • Using npm install vss-sdk
  • Using bower install vss-sdk

Usage

Next step is initializing the extension using two options below:

  1. Implicit handshake

      // Initialize
      VSS.init({
    	  usePlatformScripts: true, 
    	  usePlatformStyles: true
      });
      
      // Register callback to get called when initial handshake completed
      VSS.ready(function() {
    	  // Start using VSS
      });
  2. Explicit handshake

      // Initialize with explicitNotifyLoaded set to true 
      VSS.init({
          explicitNotifyLoaded: true,
    	  usePlatformScripts: true, 
    	  usePlatformStyles: true
      });
      
      // Perform some async operation here
      doSomeAsyncStuff().then(
          function(result) {
              // Succeeded
              VSS.notifyLoadSucceeded();
              
              // Start using VSS
          },
          function(error) {
              // Failed
              VSS.notifyLoadFailed(error);
          });

Full API reference of VSS.SDK.js can be found at Core Client SDK page.

Types

  • Types of VSS.SDK.js are available in typings/vss.d.ts.
  • REST Client types are available in typings/tfs.d.ts

Using tsd

Although TypeScript declare files do not exist at DefinitelyTyped repo, they can still be used through tsd.

  1. First, make sure that the dependencies are loaded using below command:
  • tsd install jquery knockout q --save
  1. Next, run below command to get vss-sdk types added to tsd.d.ts:
  • tsd link
  1. Finally, add only reference to typings/tsd.d.ts in your TypeScript files.

vss-sdk's People

Contributors

cschleiden avatar serkan-inci avatar willsmythe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.