-
Notifications
You must be signed in to change notification settings - Fork 395
Expand file tree
/
Copy pathStubSearchProvider.ts
More file actions
43 lines (37 loc) · 1.31 KB
/
StubSearchProvider.ts
File metadata and controls
43 lines (37 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { makeObservable } from "mobx";
import SearchProviderMixin from "../../ModelMixins/SearchProviders/SearchProviderMixin";
import primitiveTrait from "../../Traits/Decorators/primitiveTrait";
import LocationSearchProviderTraits from "../../Traits/SearchProviders/LocationSearchProviderTraits";
import CreateModel from "../Definition/CreateModel";
import { ModelConstructorParameters } from "../Definition/Model";
import SearchProviderResult from "./SearchProviderResults";
export class StubSearchProviderTraits extends LocationSearchProviderTraits {
@primitiveTrait({
type: "boolean",
name: "Is experiencing issues",
description:
"Whether the search provider is experiencing issues which may cause search results to be unavailable"
})
isExperiencingIssues: boolean = true;
}
export default class StubSearchProvider extends SearchProviderMixin(
CreateModel(StubSearchProviderTraits)
) {
static readonly type = "stub-search-provider";
constructor(...args: ModelConstructorParameters) {
super(...args);
makeObservable(this);
}
get type(): string {
return StubSearchProvider.type;
}
protected logEvent(_searchText: string) {
return;
}
protected doSearch(
_searchText: string,
_results: SearchProviderResult
): Promise<void> {
return Promise.resolve();
}
}