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