import { Injectable } from 'angular-ts-decorators' ; import autobind from 'autobind-decorator' ; import { Bookmark , BookmarkService } from '../../../shared/bookmark/bookmark.interface' ; import { BookmarkHelperService } from '../../../shared/bookmark/bookmark-helper/bookmark-helper.service' ; import { UtilityService } from '../../../shared/utility/utility.service' ; @ autobind @ Injectable ( 'BookmarkService' ) export class AndroidBookmarkService implements BookmarkService { $q : ng . IQService ; bookmarkHelperSvc : BookmarkHelperService ; utilitySvc : UtilityService ; static $inject = [ '$q' , 'BookmarkHelperService' , 'UtilityService' ] ; constructor ( $q , BookmarkHelperSvc , UtilitySvc ) { this . $q = $q ; this . bookmarkHelperSvc = BookmarkHelperSvc ; this . utilitySvc = UtilitySvc ; } buildIdMappings ( ) { return this . methodNotApplicable ( ) ; } clearNativeBookmarks ( ) { return this . methodNotApplicable ( ) ; } createNativeBookmarksFromBookmarks ( ) { return this . methodNotApplicable ( ) ; } ensureContainersExist ( bookmarks ) { return bookmarks ; } getBookmarksForExport ( ) { return this . utilitySvc . isSyncEnabled ( ) . then ( ( syncEnabled ) => { if ( ! syncEnabled ) { return ; } return this . bookmarkHelperSvc . getCachedBookmarks ( ) . then ( ( bookmarks ) => { return this . bookmarkHelperSvc . cleanAllBookmarks ( this . bookmarkHelperSvc . removeEmptyContainers ( bookmarks ) ) ; } ) ; } ) ; } methodNotApplicable ( ) { return this . $q . resolve ( ) ; } processNativeChangeOnBookmarks ( ) { return this . methodNotApplicable ( ) ; } processChangeOnNativeBookmarks ( ) { return this . methodNotApplicable ( ) ; } }