import { getItem , setItem , clearAsyncStorage , getItemAsBoolean , getItemAsArray , setStoragePrefix , } from '@frogpond/storage' ; export { clearAsyncStorage } ; setStoragePrefix ( 'aao:' ) ; const homescreenOrderKey = 'homescreen:view-order' ; export function setHomescreenOrder ( order ) { return setItem ( homescreenOrderKey , order ) ; } export function getHomescreenOrder ( ) { return getItemAsArray ( homescreenOrderKey ) ; } const homescreenViewsKey = 'homescreen:disabled-views' ; export function setDisabledViews ( disabledViews ) { return setItem ( homescreenViewsKey , disabledViews ) ; } export function getDisabledViews ( ) { return getItemAsArray ( homescreenViewsKey ) ; } const acknowledgementStatusKey = 'settings:ackd' ; export function setAcknowledgementStatus ( status ) { return setItem ( acknowledgementStatusKey , status ) ; } export function getAcknowledgementStatus ( ) { return getItemAsBoolean ( acknowledgementStatusKey ) ; } const serverAddressKey = 'settings:server-address' ; export function setServerAddress ( address ) { return setItem ( serverAddressKey , address ) ; } export function getServerAddress ( ) { return getItem ( serverAddressKey ) ; } const favoriteBuildingsKey = 'buildings:favorited' ; export function setFavoriteBuildings ( buildings ) { return setItem ( favoriteBuildingsKey , buildings ) ; } export function getFavoriteBuildings ( ) { return getItemAsArray ( favoriteBuildingsKey ) ; } import type { FilterComboType } from '../views/sis/course-search/lib/format-filter-combo' ; import type { CourseType , TermType } from './course-search/types' ; const courseDataKey = 'sis:course-data' ; export function setTermCourseData ( term , courseData ) { const key = courseDataKey + `:${ term }:courses` ; return setItem ( key , courseData ) ; } export function getTermCourseData ( term ) { const key = courseDataKey + `:${ term }:courses` ; return getItemAsArray ( key ) ; } const termInfoKey = courseDataKey + ':term-info' ; export function setTermInfo ( termData ) { return setItem ( termInfoKey , termData ) ; } export function getTermInfo ( ) { return getItemAsArray ( termInfoKey ) ; } const filterDataKey = courseDataKey + ':filter-data' ; export function setCourseFilterOption ( name , data ) { const key = filterDataKey + `:${ name }` ; return setItem ( key , data ) ; } export function getCourseFilterOption ( name ) { const key = filterDataKey + `:${ name }` ; return getItemAsArray ( key ) ; } const recentSearchesKey = 'courses:recent-searches' ; export function setRecentSearches ( searches ) { return setItem ( recentSearchesKey , searches ) ; } export function getRecentSearches ( ) { return getItemAsArray ( recentSearchesKey ) ; } const recentFiltersKey = 'courses:recent-filters' ; export function setRecentFilters ( combos ) { return setItem ( recentFiltersKey , combos ) ; } export function getRecentFilters ( ) { return getItemAsArray ( recentFiltersKey ) ; }