A fork of https://github.com/ueokande/vim-vixen
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
498 B
28 lines
498 B
6 years ago
|
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;
|
||
|
}
|
||
|
}
|