element-web/src/autocomplete/Autocompleter.js

23 lines
596 B
JavaScript
Raw Normal View History

2016-06-01 11:24:21 +00:00
import CommandProvider from './CommandProvider';
import DuckDuckGoProvider from './DuckDuckGoProvider';
import RoomProvider from './RoomProvider';
import UserProvider from './UserProvider';
import EmojiProvider from './EmojiProvider';
2016-06-01 11:24:21 +00:00
const PROVIDERS = [
CommandProvider,
DuckDuckGoProvider,
RoomProvider,
UserProvider,
EmojiProvider
].map(completer => new completer());
2016-06-01 11:24:21 +00:00
export function getCompletions(query: String) {
return PROVIDERS.map(provider => {
return {
completions: provider.getCompletions(query),
provider
};
});
2016-06-01 11:24:21 +00:00
}