mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
Updating to version 1.2.7
This commit is contained in:
+10
-6
@@ -1,8 +1,12 @@
|
||||
/// <reference path="jsurl.d.ts" />
|
||||
|
||||
var u = new Url; // curent document URL will be used
|
||||
interface U2Model {
|
||||
a: any;
|
||||
}
|
||||
|
||||
var u = new Url <any>(); // 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");
|
||||
var u2 = new Url<U2Model>("http://example.com/some/path?a=b&c=d#someAnchor");
|
||||
// it should support relative URLs also
|
||||
var u3 = new Url("/my/site/doc/path?foo=bar#baz");
|
||||
|
||||
@@ -55,13 +59,13 @@ var str = '<a href="' + u + '">My Cool Link</a>';
|
||||
|
||||
// or use in DOM context
|
||||
var a = document.createElement('a');
|
||||
a.href = u;
|
||||
a.href = u.toString();
|
||||
a.innerHTML = 'test';
|
||||
document.body.appendChild(a);
|
||||
|
||||
// Stringify
|
||||
u += '';
|
||||
String(u);
|
||||
u.toString();
|
||||
var su1 = u + '';
|
||||
var su2 = String(u);
|
||||
var su3 = u.toString();
|
||||
// NOTE, that usually it will be done automatically, so only in special
|
||||
// cases direct stringify is required
|
||||
Vendored
+6
-5
@@ -1,11 +1,12 @@
|
||||
// Type definitions for jsurl 1.2.2
|
||||
// Type definitions for jsurl 1.2.7
|
||||
// Project: https://github.com/Mikhus/jsurl
|
||||
// Definitions by: Alexey Gorshkov <https://github.com/agorshkov23>
|
||||
// Definitions: https://github.com/agorshkov23/DefinitelyTyped
|
||||
|
||||
declare class Url {
|
||||
constructor(url?: string);
|
||||
query: any;
|
||||
declare class Url<T> {
|
||||
constructor();
|
||||
constructor(url: string);
|
||||
query: T;
|
||||
protocol: string;
|
||||
user: string;
|
||||
pass: string;
|
||||
@@ -14,5 +15,5 @@ declare class Url {
|
||||
path: string;
|
||||
hash: string;
|
||||
href: string;
|
||||
toString(): string;
|
||||
toString: () => string;
|
||||
}
|
||||
Reference in New Issue
Block a user