pub fn import_sync_state(state: JsValue) -> Result<SyncState, BadSyncState>