File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ function scrollToHash(hash: string, fallbackTop?: boolean) {
3232 }
3333}
3434
35+ /**
36+ * Store location history in a local variable.
37+ *
38+ * (other router integrations "store" state as urls in browser history)
39+ */
3540export function createMemoryHistory ( ) {
3641 const entries = [ "/" ] ;
3742 let index = 0 ;
@@ -75,10 +80,16 @@ export function createMemoryHistory() {
7580 } ;
7681}
7782
83+ type NotifyLocationChange = ( value ?: string | LocationChange ) => void ;
84+
85+ type CreateLocationChangeNotifier = (
86+ notify : NotifyLocationChange
87+ ) => /* LocationChangeNotifier: */ ( ) => void ;
88+
7889export function createIntegration (
7990 get : ( ) => string | LocationChange ,
8091 set : ( next : LocationChange ) => void ,
81- init ?: ( notify : ( value ?: string | LocationChange ) => void ) => ( ) => void ,
92+ init ?: CreateLocationChangeNotifier ,
8293 utils ?: Partial < RouterUtils >
8394) : RouterIntegration {
8495 let ignore = false ;
Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ export interface RouteContext {
132132}
133133
134134export interface RouterUtils {
135+ /** This produces the `href` attribute shown in the browser. */
135136 renderPath ( path : string ) : string ;
136137 parsePath ( str : string ) : string ;
137138 go ( delta : number ) : void ;
You can’t perform that action at this time.
0 commit comments