diff options
Diffstat (limited to 'src/background/domains/completions.js')
-rw-r--r-- | src/background/domains/completions.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/background/domains/completions.js b/src/background/domains/completions.js new file mode 100644 index 0000000..4e4219f --- /dev/null +++ b/src/background/domains/completions.js @@ -0,0 +1,27 @@ +export default class Completions { + constructor(groups) { + this.g = groups; + } + + get groups() { + return this.g; + } + + serialize() { + return this.groups.map(group => ({ + name: group.name, + items: group.items.map(item => ({ + caption: item.caption, + content: item.content, + url: item.url, + icon: item.icon, + })), + })); + } + + static EMPTY_COMPLETIONS = new Completions([]); + + static empty() { + return Completions.EMPTY_COMPLETIONS; + } +} |