From bf45415511dba471e6ac824b90c9411e9f196b7f Mon Sep 17 00:00:00 2001 From: Chris Charabaruk Date: Tue, 5 May 2015 14:12:22 -0400 Subject: [PATCH] Update jsUri definitions to pass tests --- jsuri/jsuri.d.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/jsuri/jsuri.d.ts b/jsuri/jsuri.d.ts index 16f300952..b843abf61 100644 --- a/jsuri/jsuri.d.ts +++ b/jsuri/jsuri.d.ts @@ -4,13 +4,15 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module jsuri { - class Uri { + type Primitive = string | number | boolean; + + export class Uri { /** * Creates a new Uri object * @constructor * @param {string} str */ - constructor(str: string); + constructor(str?: string); /** * Define getter/setter methods @@ -67,7 +69,7 @@ declare module jsuri { * @param {integer} [index] specific index to add the value at * @return {Uri} returns self for fluent chaining */ - addQueryParam(key: string, val: string, index?: number): Uri; + addQueryParam(key: string, val: Primitive, index?: number): Uri; /** * test for the existence of a query parameter @@ -83,7 +85,7 @@ declare module jsuri { * @param {string} [oldVal] replace only one specific value (otherwise replaces all) * @return {Uri} returns self for fluent chaining */ - replaceQueryParam(key: string, newVal: string, oldVal?:string): Uri; + replaceQueryParam(key: string, newVal: Primitive, oldVal?: Primitive): Uri; /** * Define fluent setter methods (setProtocol, setHasAuthorityPrefix, etc)