ILocationService interface

Service for external content to get locations

Methods

getResourceAreaLocation(string)

Gets the URL for the given REST resource area

getServiceLocation(string, TeamFoundationHostType)

Gets the location of a remote service at a given host type.

routeUrl(string, {[key: string]: string}, string)

Attemps to create a url for the specified route template and paramaters. The url will include host path. For example, if the page url is https://dev.azure.com/foo and you try to create admin settings url for project "bar", the output will be /foo/bar/_admin.

This will asynchronously fetch a route contribution if it has not been included in page data.

Method Details

getResourceAreaLocation(string)

Gets the URL for the given REST resource area

function getResourceAreaLocation(resourceAreaId: string): Promise<string>

Parameters

resourceAreaId

string

Id of the resource area

Returns

Promise<string>

getServiceLocation(string, TeamFoundationHostType)

Gets the location of a remote service at a given host type.

function getServiceLocation(serviceInstanceType?: string, hostType?: TeamFoundationHostType): Promise<string>

Parameters

serviceInstanceType

string

The GUID of the service instance type to lookup

hostType
TeamFoundationHostType

The host type to lookup (defaults to the host type of the current page data)

Returns

Promise<string>

routeUrl(string, {[key: string]: string}, string)

Attemps to create a url for the specified route template and paramaters. The url will include host path. For example, if the page url is https://dev.azure.com/foo and you try to create admin settings url for project "bar", the output will be /foo/bar/_admin.

This will asynchronously fetch a route contribution if it has not been included in page data.

function routeUrl(routeId: string, routeValues?: {[key: string]: string}, hostPath?: string): Promise<string>

Parameters

routeId

string

Id of the route contribution

routeValues

{[key: string]: string}

Route value replacements

hostPath

string

Optional host path to use rather than the default host path for the page.

Returns

Promise<string>