forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.address.d.ts
179 lines (174 loc) · 6.43 KB
/
jquery.address.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
// Type definitions for jQuery.Address 1.5
// Project: https://github.com/asual/jquery-address
// Definitions by: Martin Duparc <https://github.com/martinduparc>, Tim Klingeleers <https://github.com/mardaneus86>
// Definitions: https://github.com/borisyankov/DefinitelyTyped/
/// <reference path="../jquery/jquery.d.ts" />
interface JQueryAddressStatic {
(): any;
/**
* Binds any supported event type to a function with support for an optional map of data.
*/
bind(type: any, data: any, callback: Function): JQueryAddressStatic;
/**
* Binds a function to be executed whenever the address is changed.
* The function receives a single event object parameter that contains the following properties:
* value, path, pathNames, parameterNames, parameters and queryString.
*/
change(callback: Function): JQueryAddressStatic;
/**
* Binds a function to be executed once when the address is initiated.
* The function receives a single event object parameter that contains the following properties:
* value, path, pathNames, parameterNames, parameters and queryString.
*/
init(callback: Function): JQueryAddressStatic;
/**
* Binds a function to be executed when the address is changed from inside the page that uses the plugin.
* The function receives a single event object parameter that contains the following properties:
* value, path, pathNames, parameterNames, parameters and queryString.
*/
internalChange(eventhandler: Function): JQueryAddressStatic;
/**
* Binds a function to be executed when the address is changed from the browser usually when entering the page or using the back and forward buttons.
* The function receives a single event object parameter that contains the following properties:
* value, path, pathNames, parameterNames, parameters and queryString.
*/
externalChange(eventhandler: Function): JQueryAddressStatic;
/**
* Provides the base address of the document.
*/
baseURL(): string;
/**
* Provides the state of the auto update mode. Enabled by default.
*/
autoUpdate(): boolean;
/**
* Enables or disables the auto update mode which can be turned off when multiple parameters values have to be changed at once.
*/
autoUpdate(value: boolean): JQueryAddressStatic;
/**
* Provides the state of the crawling mode. Disables by default.
*/
crawlable(): boolean;
/**
* Enables or disables the crawling mode which will automatically convert the values into a Google Ajax Crawling friendly format.
*/
crawlable(value: boolean): JQueryAddressStatic;
/**
* Provides the hash fragment part of the deep linking value.
*/
hash(): string;
/**
* Sets the hash fragment part of the deep linking value.
*/
hash(value: string): JQueryAddressStatic;
/**
* Provides the state of the history mode setting. Enabled by default.
*/
history(): boolean;
/**
* Enables or disables the history mode which generated entries in the browser history.
*/
history(value: boolean): void;
/**
* Provides the value of a specific query parameter.
*/
parameter(name: string): string;
/**
* Sets a query parameter value. Appending is disabled by default but can be enabled for array values.
*/
parameter(name: string, value: string, append: boolean): JQueryAddressStatic;
/**
* Provides a list of all the query parameter names.
*/
parameterNames(): Array<string>;
/**
* Provides the deep linking value without the query string and the hash fragment.
*/
path(): string;
/**
* Sets the deep linking value without the query string and the hash fragment.
*/
path(value: string): JQueryAddressStatic;
/**
* Provides a list of all the folders in the deep linking path.
*/
pathNames(): Array<string>;
/**
* Provides the query string part of the deep linking value.
*/
queryString(): string;
/**
* Sets the query string part of the deep linking value.
*/
queryString(value: string): JQueryAddressStatic;
/**
* Provides the value used as a base path for the HTML5 state management.
*/
state(): string;
/**
* Sets the base path of the website that is utilized in HTML5 state management.
*/
state(value: string): JQueryAddressStatic;
/**
* Provides the state of the strict mode setting. Enabled by default.
*/
strict(): boolean;
/**
* Enables or disables the strict mode which automatically appends a slash in the beginning of the deep linking value.
*/
strict(value: boolean): JQueryAddressStatic;
/**
* Provides the title of the HTML document.
*/
title(): string;
/**
* Sets the title of the HTML document.
*/
title(value: string): JQueryAddressStatic;
/**
* Provides the currently set page view tracking function.
*/
tracker(): any;
/**
* Sets a function for page view tracking. Google Analytics tracking is automatically invoked if it exists in the page.
*/
tracker(value: Function): JQueryAddressStatic;
/**
* Provides the current deep linking value.
*/
value(): string;
/**
* Sets the current deep linking value.
*/
value(url: string): JQueryAddressStatic;
/**
* Updates the value when auto updating is disabled.
*/
update(): JQueryAddressStatic;
/**
* Provides the state of the wrap mode. Disabled by default.
*/
wrap(): boolean;
/**
* Enables or disables the wrap mode which generates a DIV wrapper around the page content and fixes any scroll issues caused by the use of hash fragments.
*/
wrap(value: boolean): JQueryAddressStatic;
}
interface JQueryAddress {
/**
* Adds the plugin functionality to a DOM element and disables the default behavior. Designed primarily to support links and forms.
* Accepts an optional function parameter that allows custom processing of the deep link value.
*/
(): JQuery;
/**
* Adds the plugin functionality to a DOM element and disables the default behavior. Designed primarily to support links and forms.
* Accepts an optional function parameter that allows custom processing of the deep link value.
*/
(fn: Function): JQuery;
}
interface JQueryStatic {
address: JQueryAddressStatic;
}
interface JQuery {
address: JQueryAddress;
}