mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-28 12:43:06 +08:00
Merge pull request #2383 from mattyork/upstream
Add onCall(n) and friends to SinonStub definition
This commit is contained in:
@@ -13,6 +13,10 @@ myApp.config((
|
||||
$urlMatcherFactory: ng.ui.IUrlMatcherFactory) => {
|
||||
|
||||
var matcher: ng.ui.IUrlMatcher = $urlMatcherFactory.compile("/foo/:bar?param1");
|
||||
var obj: Object = matcher.exec('/user/bob', { x:'1', q:'hello' });
|
||||
var concat: ng.ui.IUrlMatcher = matcher.concat('/test');
|
||||
var str: string = matcher.format({ id:'bob', q:'yes' });
|
||||
var arr: string[] = matcher.parameters();
|
||||
|
||||
$urlRouterProvider
|
||||
.when('/test', '/list')
|
||||
|
||||
Vendored
+2
-2
@@ -33,13 +33,13 @@ declare module ng.ui {
|
||||
interface IUrlMatcher {
|
||||
concat(pattern: string): IUrlMatcher;
|
||||
exec(path: string, searchParams: {}): {};
|
||||
parameters(): string[];
|
||||
format(values: {}): string;
|
||||
}
|
||||
|
||||
interface IUrlMatcherFactory {
|
||||
compile(pattern: string): IUrlMatcher;
|
||||
isMatcher(o: any): boolean;
|
||||
parameters(): string[];
|
||||
format(values: {}): string;
|
||||
}
|
||||
|
||||
interface IUrlRouterProvider extends IServiceProvider {
|
||||
|
||||
Vendored
+4
@@ -101,6 +101,10 @@ interface SinonStub extends SinonSpy {
|
||||
callsArgOnAsync(index: number, context: any): SinonStub;
|
||||
callsArgWithAsync(index: number, ...args: any[]): SinonStub;
|
||||
callsArgOnWithAsync(index: number, context: any, ...args: any[]): SinonStub;
|
||||
onCall(n: number): SinonStub;
|
||||
onFirstCall(): SinonStub;
|
||||
onSecondCall(): SinonStub;
|
||||
onThirdCall(): SinonStub;
|
||||
yields(...args: any[]): SinonStub;
|
||||
yieldsOn(context: any, ...args: any[]): SinonStub;
|
||||
yieldsTo(property: string, ...args: any[]): SinonStub;
|
||||
|
||||
Reference in New Issue
Block a user