1
- // WICG Spec: https://github.com/WICG/navigation-api
2
1
3
- /** @see https://wicg.github.io/navigation-api/ #navigation */
2
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html #navigation */
4
3
interface Navigation extends EventTarget {
5
4
entries ( ) : NavigationHistoryEntry [ ] ;
6
5
readonly currentEntry ?: NavigationHistoryEntry ;
@@ -35,17 +34,15 @@ interface NavigationEventMap {
35
34
currententrychange : NavigationCurrentEntryChangeEvent ;
36
35
}
37
36
38
- // https://wicg.github.io/navigation-api/#global
39
37
declare const navigation : Navigation | undefined ;
40
38
41
39
declare interface Window extends WindowNavigation { }
42
40
43
- // https://wicg.github.io/navigation-api/#global
44
41
declare interface WindowNavigation {
45
42
readonly navigation ?: Navigation ;
46
43
}
47
44
48
- /** @see https://wicg.github.io/navigation-api/ #navigateevent */
45
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html #navigateevent */
49
46
interface NavigateEvent extends Event {
50
47
readonly navigationType : NavigationApiNavigationType ;
51
48
readonly destination : NavigationDestination ;
@@ -57,6 +54,7 @@ interface NavigateEvent extends Event {
57
54
readonly downloadRequest : string | null ;
58
55
readonly info : any ;
59
56
readonly hasUAVisualTransition : boolean ;
57
+ /** @see https://github.com/WICG/navigation-api/pull/264 */
60
58
readonly sourceElement : Element | null ;
61
59
62
60
intercept ( options ?: NavigationInterceptOptions ) : void ;
@@ -68,7 +66,7 @@ declare var NavigateEvent: {
68
66
new ( type : string , eventInit : NavigateEventInit ) : Event ;
69
67
} ;
70
68
71
- /** @see https://wicg.github.io/navigation-api/#dictdef- navigateeventinit */
69
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html# navigateeventinit */
72
70
interface NavigateEventInit extends EventInit {
73
71
navigationType ?: NavigationApiNavigationType ;
74
72
destination : NavigationDestination ;
@@ -82,7 +80,7 @@ interface NavigateEventInit extends EventInit {
82
80
hasUAVisualTransition ?: boolean ;
83
81
}
84
82
85
- /** @see https://wicg.github.io/navigation-api/# navigationcurrententrychangeevent */
83
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html#the- navigationcurrententrychangeevent-interface */
86
84
interface NavigationCurrentEntryChangeEvent extends Event {
87
85
readonly navigationType ?: NavigationApiNavigationType ;
88
86
readonly from : NavigationHistoryEntry ;
@@ -93,13 +91,13 @@ declare var NavigationCurrentEntryChangeEvent: {
93
91
new ( type : string , eventInit : NavigationCurrentEntryChangeEventInit ) : Event ;
94
92
} ;
95
93
96
- /** @see https://wicg.github.io/navigation-api/#dictdef- navigationcurrententrychangeeventinit */
94
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html# navigationcurrententrychangeeventinit */
97
95
interface NavigationCurrentEntryChangeEventInit extends EventInit {
98
96
navigationType ?: NavigationApiNavigationType ;
99
97
destination : NavigationHistoryEntry ;
100
98
}
101
99
102
- /** @see https://wicg.github.io/navigation-api/ #navigationhistoryentry */
100
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html #navigationhistoryentry */
103
101
interface NavigationHistoryEntry extends EventTarget {
104
102
readonly url : string | null ;
105
103
readonly key : string ;
@@ -117,7 +115,7 @@ interface NavigationHistoryEntry extends EventTarget {
117
115
removeEventListener ( type : string , callback : EventListenerOrEventListenerObject , options ?: boolean | EventListenerOptions ) : void ;
118
116
}
119
117
120
- /** @see https://wicg.github.io/navigation-api/ #navigationdestination */
118
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html #navigationdestination */
121
119
interface NavigationDestination {
122
120
readonly url : string ;
123
121
readonly key : string | null ;
@@ -128,59 +126,59 @@ interface NavigationDestination {
128
126
getState ( ) : any ;
129
127
}
130
128
131
- /** @see https://wicg.github.io/navigation-api/#dictdef- navigationupdatecurrententryoptions */
129
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html# navigationupdatecurrententryoptions */
132
130
interface NavigationUpdateCurrentEntryOptions {
133
131
state : any ;
134
132
}
135
133
136
- /** @see https://wicg.github.io/navigation-api/#dictdef- navigationoptions */
134
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html# navigationoptions */
137
135
interface NavigationOptions {
138
136
info ?: any ;
139
137
}
140
138
141
- /** @see https://wicg.github.io/navigation-api/#dictdef- navigationnavigateoptions */
139
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html# navigationnavigateoptions */
142
140
interface NavigationNavigateOptions extends NavigationOptions {
143
141
state ?: any ;
144
142
// Defaults to "auto"
145
143
history ?: NavigationHistoryBehavior ;
146
144
}
147
145
148
- /** @see https://wicg.github.io/navigation-api/#dictdef- navigationreloadoptions */
146
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html# navigationreloadoptions */
149
147
interface NavigationReloadOptions extends NavigationOptions {
150
148
state ?: any ;
151
149
}
152
150
153
- /** @see https://wicg.github.io/navigation-api/ #navigationtransition */
151
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html #navigationtransition */
154
152
interface NavigationTransition {
155
153
readonly navigationType : NavigationApiNavigationType ;
156
154
readonly from : NavigationHistoryEntry ;
157
155
readonly finished : Promise < void > ;
158
156
}
159
157
160
- /** @see https://wicg.github.io/navigation-api/#dictdef- navigationresult */
158
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html# navigationresult */
161
159
interface NavigationResult {
162
160
committed : Promise < NavigationHistoryEntry > ;
163
161
finished : Promise < NavigationHistoryEntry > ;
164
162
}
165
163
166
- /** @see https://wicg.github.io/navigation-api/#dictdef- navigationinterceptoptions */
164
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html# navigationinterceptoptions */
167
165
interface NavigationInterceptOptions {
168
166
handler ?: NavigationInterceptHandler ;
169
167
focusReset ?: NavigationFocusReset ;
170
168
scroll ?: NavigationScrollBehavior ;
171
169
}
172
170
173
- /** @see https://wicg.github.io/navigation-api/#enumdef- navigationtype */
171
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html# navigationtype */
174
172
type NavigationApiNavigationType = "reload" | "push" | "replace" | "traverse" ;
175
173
176
- /** @see https://wicg.github.io/navigation-api/#enumdef- navigationhistorybehavior */
174
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html# navigationhistorybehavior */
177
175
type NavigationHistoryBehavior = "auto" | "push" | "replace" ;
178
176
179
- /** @see https://wicg.github.io/navigation-api/#enumdef- navigationintercepthandler */
177
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html# navigationintercepthandler */
180
178
type NavigationInterceptHandler = ( ) => Promise < void > ;
181
179
182
- /** @see https://wicg.github.io/navigation-api/#enumdef- navigationfocusreset */
180
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html# navigationfocusreset */
183
181
type NavigationFocusReset = "after-transition" | "manual" ;
184
182
185
- /** @see https://wicg.github.io/navigation-api/#enumdef- navigationscrollbehavior */
183
+ /** @see https://html.spec.whatwg.org/multipage/nav-history-apis.html# navigationscrollbehavior */
186
184
type NavigationScrollBehavior = "after-transition" | "manual" ;
0 commit comments