diff --git a/urijs/URIjs-tests.ts b/urijs/URIjs-tests.ts index 2dfd15618..3501a6efc 100644 --- a/urijs/URIjs-tests.ts +++ b/urijs/URIjs-tests.ts @@ -34,3 +34,7 @@ URI('').setSearch('foo', 'bar'); URI('').setSearch({ foo: 'bar' }); var uri: uri.URI = $('a').uri(); + +URI('http://example.org/foo/hello.html').segment('bar'); +URI('http://example.org/foo/hello.html').segment(0, 'bar'); +URI('http://example.org/foo/hello.html').segment(['foo', 'bar', 'foobar.html']); \ No newline at end of file diff --git a/urijs/URIjs.d.ts b/urijs/URIjs.d.ts index 7bab32074..a41e06cbf 100644 --- a/urijs/URIjs.d.ts +++ b/urijs/URIjs.d.ts @@ -95,10 +95,10 @@ declare module uri { search(qry: boolean): any; search(qry: Object): URI; segment(): string[]; - segment(segments: string[]): string; + segment(segments: string[]): URI; segment(position: number): string; - segment(position: number, level: string): string; - segment(level: string): string; + segment(position: number, level: string): URI; + segment(segment: string): URI; setQuery(key: string, value: string): URI; setQuery(qry: Object): URI; setSearch(key: string, value: string): URI;