From 4de193b13625dce7b03abc9db54b69f7e4d44be3 Mon Sep 17 00:00:00 2001 From: Alexey Gorshkov Date: Sun, 3 Jan 2016 02:13:24 +0300 Subject: [PATCH] fixed jsurl/jsurl-tests.ts(16,7): error TS7017: Index signature of object type implicitly has an 'any' type. --- jsurl/jsurl-tests.ts | 11 ++++++++--- jsurl/jsurl.d.ts | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/jsurl/jsurl-tests.ts b/jsurl/jsurl-tests.ts index 177399d346..b0297bda0e 100644 --- a/jsurl/jsurl-tests.ts +++ b/jsurl/jsurl-tests.ts @@ -1,10 +1,15 @@ /// -interface U2Model { +interface UModel extends UrlQuery { + a: any; + b: string; +} + +interface U2Model extends UrlQuery { a: any; } -var u = new Url (); // curent document URL will be used +var u = new Url(); // curent document URL will be used // or we can instantiate as var u2 = new Url("http://example.com/some/path?a=b&c=d#someAnchor"); // it should support relative URLs also @@ -48,7 +53,7 @@ alert( 'path = ' + u.path + '\n' + 'query = ' + u.query + '\n' + 'hash = ' + u.hash - ); +); // Manipulating URL parts u.path = '/some/new/path'; // the way to change URL path diff --git a/jsurl/jsurl.d.ts b/jsurl/jsurl.d.ts index 2dbac988f7..cbe9858518 100644 --- a/jsurl/jsurl.d.ts +++ b/jsurl/jsurl.d.ts @@ -3,6 +3,10 @@ // Definitions by: Alexey Gorshkov // Definitions: https://github.com/agorshkov23/DefinitelyTyped +interface UrlQuery { + clear: () => void; +} + declare class Url { constructor(); constructor(url: string);