import EventEmitter from "eventemitter3" ; import Credentials from "../credentials/Credentials" ; import Vault from "../core/Vault" ; import { EntryChange , EntryID , FormatAEntry , FormatAGroup , FormatAVault , FormatBEntry , FormatBGroup , FormatBVault , GroupID , History , PropertyKeyValueObject , VaultFormatID } from "../types" ; function notImplemented ( ) { throw new Error ( "Not implemented" ) ; } export default class VaultFormat extends EventEmitter { static encodeRaw ( rawContent , credentials ) { notImplemented ( ) ; } static extractSharesFromHistory ( history ) { notImplemented ( ) ; } static getFormatID ( ) { notImplemented ( ) ; return null ; } static historiesDiffer ( historyA , historyB ) { notImplemented ( ) ; return false ; } static isEncrypted ( contents ) { notImplemented ( ) ; } static parseEncrypted ( encryptedContent , credentials ) { notImplemented ( ) ; } static prepareHistoryForMerge ( history ) { notImplemented ( ) ; } static vaultFromMergedHistories ( local , incoming ) { notImplemented ( ) ; return null ; } _readOnly = false ; dirty = false ; source : FormatAVault | FormatBVault = null ; get history ( ) { return this . getHistory ( ) ; } get readOnly ( ) { return this . _readOnly ; } constructor ( source ) { super ( ) ; this . source = source ; } cloneEntry ( entry , targetGroupID ) { notImplemented ( ) ; } cloneGroup ( group , targetGroupID ) { notImplemented ( ) ; } createEntry ( groupID , entryID ) { notImplemented ( ) ; } createGroup ( parentID , groupID ) { notImplemented ( ) ; } deleteEntry ( entryID ) { notImplemented ( ) ; } deleteEntryAttribute ( entryID , attribute ) { notImplemented ( ) ; } deleteEntryProperty ( entryID , property ) { notImplemented ( ) ; } deleteGroup ( groupID ) { notImplemented ( ) ; } deleteGroupAttribute ( groupID , attribute ) { notImplemented ( ) ; } deleteVaultAttribute ( attribute ) { notImplemented ( ) ; } erase ( ) { Object . keys ( this . source ) . forEach ( sourceKey => { this . source [ sourceKey ] = undefined ; delete this . source [ sourceKey ] ; } ) ; this . history . splice ( 0 , Infinity ) ; } execute ( commandOrCommands ) { notImplemented ( ) ; } findEntryByID ( id ) { notImplemented ( ) ; return null ; } findGroupByID ( id ) { notImplemented ( ) ; return null ; } findGroupContainingEntryID ( id ) { notImplemented ( ) ; return null ; } findGroupContainingGroupID ( id ) { notImplemented ( ) ; return null ; } generateID ( ) { notImplemented ( ) ; } getAllEntries ( parentID = null ) { notImplemented ( ) ; return [ ] ; } getAllGroups ( parentID = null ) { notImplemented ( ) ; return [ ] ; } getEntryAttributes ( entrySource ) { notImplemented ( ) ; return { } ; } getEntryChanges ( entrySource ) { notImplemented ( ) ; return [ ] ; } getEntryProperties ( entrySource ) { notImplemented ( ) ; return { } ; } getFormat ( ) { return VaultFormat ; } getGroupAttributes ( groupSource ) { notImplemented ( ) ; return { } ; } getGroupTitle ( groupSource ) { notImplemented ( ) ; return "" ; } getHistory ( ) { notImplemented ( ) ; return [ ] ; } getItemID ( itemSource ) { notImplemented ( ) ; return "" ; } getItemParentID ( itemSource ) { notImplemented ( ) ; return "" ; } getVaultAttributes ( ) { notImplemented ( ) ; return { } ; } getVaultID ( ) { notImplemented ( ) ; } initialise ( ) { notImplemented ( ) ; } moveEntry ( entryID , groupID ) { notImplemented ( ) ; } moveGroup ( groupID , newParentID ) { notImplemented ( ) ; } optimise ( ) { notImplemented ( ) ; } setEntryAttribute ( entryID , attribute , value ) { notImplemented ( ) ; } setEntryProperty ( entryID , property , value ) { notImplemented ( ) ; } setGroupAttribute ( groupID , attribute , value ) { notImplemented ( ) ; } setGroupTitle ( groupID , title ) { notImplemented ( ) ; } setVaultAttribute ( key , value ) { notImplemented ( ) ; } }