export type StateBase = object | null ; export type FrouteHistoryState < S extends StateBase = any > = { __froute ? : { sid : string | undefined | null ; scrollX : number ; scrollY : number ; } ; app : S ; } ; export const isFrouteState = ( state ) : state is FrouteHistoryState => { if ( state && typeof state . __froute === "object" ) return true ; return false ; } ; export const createFrouteHistoryState = ( sid , appState = null ) : FrouteHistoryState => ( { __froute : { sid , scrollX : 0 , scrollY : 0 } , app : appState , } ) ;