mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Update reference paths
This commit is contained in:
@@ -1,37 +1,37 @@
|
||||
///<reference path="../jquery/jquery-1.9.d.ts" />
|
||||
///<reference path="jquery.cookie.d.ts" />
|
||||
|
||||
class TestObject {
|
||||
text: string;
|
||||
value: number;
|
||||
|
||||
constructor (text: string, value: number) {
|
||||
this.text = text;
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
class CookieOptions implements JQueryCookieOptions {
|
||||
expires: number;
|
||||
path: string;
|
||||
domain: string;
|
||||
secure: bool;
|
||||
}
|
||||
|
||||
$.cookie("the_cookie", "the_value");
|
||||
|
||||
console.log($.cookie("the_cookie"));
|
||||
|
||||
var testObject = new TestObject("Hello World", 5);
|
||||
|
||||
var cookieOptions = new CookieOptions();
|
||||
cookieOptions.path = "/";
|
||||
cookieOptions.domain = "jquery.com";
|
||||
|
||||
$.cookie.json = true;
|
||||
|
||||
$.cookie("test", testObject, cookieOptions);
|
||||
|
||||
var result = <TestObject>$.cookie("test");
|
||||
|
||||
console.log(result.text);
|
||||
///<reference path="../jquery/jquery.d.ts" />
|
||||
///<reference path="jquery.cookie.d.ts" />
|
||||
|
||||
class TestObject {
|
||||
text: string;
|
||||
value: number;
|
||||
|
||||
constructor (text: string, value: number) {
|
||||
this.text = text;
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
class CookieOptions implements JQueryCookieOptions {
|
||||
expires: number;
|
||||
path: string;
|
||||
domain: string;
|
||||
secure: bool;
|
||||
}
|
||||
|
||||
$.cookie("the_cookie", "the_value");
|
||||
|
||||
console.log($.cookie("the_cookie"));
|
||||
|
||||
var testObject = new TestObject("Hello World", 5);
|
||||
|
||||
var cookieOptions = new CookieOptions();
|
||||
cookieOptions.path = "/";
|
||||
cookieOptions.domain = "jquery.com";
|
||||
|
||||
$.cookie.json = true;
|
||||
|
||||
$.cookie("test", testObject, cookieOptions);
|
||||
|
||||
var result = <TestObject>$.cookie("test");
|
||||
|
||||
console.log(result.text);
|
||||
|
||||
Vendored
+31
-31
@@ -1,32 +1,32 @@
|
||||
// Type definitions for jQuery Cookie Plugin 1.3
|
||||
// Project: https://github.com/carhartl/jquery-cookie
|
||||
// Definitions by: Roy Goode <https://github.com/RoyGoode/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
///<reference path="../jquery/jquery-1.9.d.ts" />
|
||||
|
||||
|
||||
interface JQueryCookieOptions {
|
||||
expires?: any;
|
||||
path?: string;
|
||||
domain?: string;
|
||||
secure?: bool;
|
||||
}
|
||||
|
||||
interface JQueryCookieStatic {
|
||||
raw?: bool;
|
||||
json?: bool;
|
||||
|
||||
(name: string): any;
|
||||
(name: string, value: string): void;
|
||||
(name: string, value: string, options: JQueryCookieOptions): void;
|
||||
(name: string, value: any): void;
|
||||
(name: string, value: any, options: JQueryCookieOptions): void;
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
cookie?: JQueryCookieStatic;
|
||||
|
||||
removeCookie(name: string): bool;
|
||||
removeCookie(name: string, options: JQueryCookieOptions): bool;
|
||||
// Type definitions for jQuery Cookie Plugin 1.3
|
||||
// Project: https://github.com/carhartl/jquery-cookie
|
||||
// Definitions by: Roy Goode <https://github.com/RoyGoode/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
///<reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
|
||||
interface JQueryCookieOptions {
|
||||
expires?: any;
|
||||
path?: string;
|
||||
domain?: string;
|
||||
secure?: bool;
|
||||
}
|
||||
|
||||
interface JQueryCookieStatic {
|
||||
raw?: bool;
|
||||
json?: bool;
|
||||
|
||||
(name: string): any;
|
||||
(name: string, value: string): void;
|
||||
(name: string, value: string, options: JQueryCookieOptions): void;
|
||||
(name: string, value: any): void;
|
||||
(name: string, value: any, options: JQueryCookieOptions): void;
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
cookie?: JQueryCookieStatic;
|
||||
|
||||
removeCookie(name: string): bool;
|
||||
removeCookie(name: string, options: JQueryCookieOptions): bool;
|
||||
}
|
||||
Reference in New Issue
Block a user