mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Tightened up the ILocationService typings a little
This commit is contained in:
Vendored
+55
-9
@@ -557,25 +557,71 @@ declare module ng {
|
||||
assign(context: any, value: any): any;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// LocationService
|
||||
// see http://docs.angularjs.org/api/ng.$location
|
||||
// see http://docs.angularjs.org/api/ng.$locationProvider
|
||||
// see http://docs.angularjs.org/guide/dev_guide.services.$location
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* $location - $locationProvider - service in module ng
|
||||
* see https://docs.angularjs.org/api/ng/service/$location
|
||||
*/
|
||||
interface ILocationService {
|
||||
absUrl(): string;
|
||||
hash(): string;
|
||||
hash(newHash: string): ILocationService;
|
||||
host(): string;
|
||||
|
||||
/**
|
||||
* Return path of current url
|
||||
*/
|
||||
path(): string;
|
||||
path(newPath: string): ILocationService;
|
||||
|
||||
/**
|
||||
* Change path when called with parameter and return $location.
|
||||
* Note: Path should always begin with forward slash (/), this method will add the forward slash if it is missing.
|
||||
*
|
||||
* @param path New path
|
||||
*/
|
||||
path(path: string): ILocationService;
|
||||
|
||||
port(): number;
|
||||
protocol(): string;
|
||||
replace(): ILocationService;
|
||||
|
||||
/**
|
||||
* Return search part (as object) of current url
|
||||
*/
|
||||
search(): any;
|
||||
search(parametersMap: any): ILocationService;
|
||||
search(parameter: string, parameterValue: any): ILocationService;
|
||||
|
||||
/**
|
||||
* Change search part when called with parameter and return $location.
|
||||
*
|
||||
* @param search When called with a single argument the method acts as a setter, setting the search component of $location to the specified value.
|
||||
*
|
||||
* If the argument is a hash object containing an array of values, these values will be encoded as duplicate search parameters in the url.
|
||||
*/
|
||||
search(search: any): ILocationService;
|
||||
|
||||
/**
|
||||
* Change search part when called with parameter and return $location.
|
||||
*
|
||||
* @param search New search params
|
||||
* @param paramValue If search is a string, then paramValue will override only a single search property. If paramValue is null, the property specified via the first argument will be deleted.
|
||||
*/
|
||||
search(search: string, paramValue: string): ILocationService;
|
||||
|
||||
/**
|
||||
* Change search part when called with parameter and return $location.
|
||||
*
|
||||
* @param search New search params
|
||||
* @param paramValue If paramValue is an array, it will override the property of the search component of $location specified via the first argument.
|
||||
*/
|
||||
search(search: string, paramValue: string[]): ILocationService;
|
||||
|
||||
/**
|
||||
* Change search part when called with parameter and return $location.
|
||||
*
|
||||
* @param search New search params
|
||||
* @param paramValue If paramValue is true, the property specified via the first argument will be added with no value nor trailing equal sign.
|
||||
*/
|
||||
search(search: string, paramValue: boolean): ILocationService;
|
||||
|
||||
url(): string;
|
||||
url(url: string): ILocationService;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user