diff --git a/lib/ops/entries-store-ops.js b/lib/ops/entries-store-ops.js new file mode 100644 --- /dev/null +++ b/lib/ops/entries-store-ops.js @@ -0,0 +1,40 @@ +// @flow + +import type { RawEntryInfo } from '../types/entry-types.js'; + +export type ReplaceEntryOperation = { + +type: 'replace_entry', + +payload: { + +id: string, + +entry: RawEntryInfo, + }, +}; + +export type RemoveEntriesOperation = { + +type: 'remove_entries', + +payload: { +ids: $ReadOnlyArray }, +}; + +export type RemoveAllEntriesOperation = { + +type: 'remove_all_entries', +}; + +export type EntryStoreOperation = + | ReplaceEntryOperation + | RemoveEntriesOperation + | RemoveAllEntriesOperation; + +export type ClientDBEntryInfo = { + +id: string, + +entryInfo: string, +}; + +export type ClientDBReplaceEntryOperation = { + +type: 'replace_entry', + +payload: ClientDBEntryInfo, +}; + +export type ClientDBEntryStoreOperation = + | ClientDBReplaceEntryOperation + | RemoveEntriesOperation + | RemoveAllEntriesOperation;