-
Notifications
You must be signed in to change notification settings - Fork 34
/
coveo.d.ts
68 lines (62 loc) · 2.73 KB
/
coveo.d.ts
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import {
InsightEngine,
SearchEngine,
RecommendationEngine,
} from '@coveo/headless';
import {LightningElement} from 'lwc';
import * as BuenoTypes from './force-app/main/default/staticresources/coveobueno/definitions/index';
import {CoreEngine} from './force-app/main/default/staticresources/coveoheadless/definitions/app/engine';
import {ExternalEngineOptions} from './force-app/main/default/staticresources/coveoheadless/definitions/app/engine-configuration';
import * as HeadlessCaseAssistTypes from './force-app/main/default/staticresources/coveoheadless/definitions/case-assist.index';
import * as HeadlessTypes from './force-app/main/default/staticresources/coveoheadless/definitions/index';
import * as HeadlessInsightTypes from './force-app/main/default/staticresources/coveoheadless/definitions/insight.index';
import * as HeadlessRecommendationTypes from './force-app/main/default/staticresources/coveoheadless/definitions/recommendation.index';
export * from './force-app/main/default/staticresources/coveoheadless/definitions/index';
export * from './force-app/main/default/staticresources/coveoheadless/definitions/case-assist.index';
export * from './force-app/main/default/staticresources/coveoheadless/definitions/insight.index';
export * from './force-app/main/default/staticresources/coveoheadless/definitions/recommendation.index';
export * from './force-app/main/default/staticresources/coveobueno/definitions/index';
interface Bindings {
engine?:
| HeadlessTypes<CoreEngine>
| HeadlessCaseAssistTypes<CoreEngine>
| HeadlessInsightTypes<CoreEngine>
| HeadlessRecommendationTypes<CoreEngine>;
store?: Record<String, unknown>;
}
declare global {
const Bueno: typeof BuenoTypes;
const CoveoHeadless: typeof HeadlessTypes;
const CoveoHeadlessCaseAssist: typeof HeadlessCaseAssistTypes;
const CoveoHeadlessInsight: typeof HeadlessInsightTypes;
const CoveoHeadlessRecommendation: typeof HeadlessRecommendationTypes;
type AnyHeadless =
| CoveoHeadless
| CoveoHeadlessCaseAssist
| CoveoHeadlessInsight
| CoveoHeadlessRecommendation;
type AnyEngine = SearchEngine | InsightEngine | RecommendationEngine;
interface Window {
coveoHeadless: {
[engineId: string]: {
components: {
element: LightningElement;
initialized: boolean;
}[];
options: Deferred<ExternalEngineOptions>;
bindings: Bindings;
enginePromise: Promise;
engineConstructor?: (options: ExternalEngineOptions) => unknown;
initializedCallback?: Function;
bundle: AnyHeadless;
};
};
coveoQuanticVersion: string
}
}
class Deferred<T> {
promise: Promise<T>;
isResolved: boolean;
resolve: (value: T) => void;
reject: (reason?: unknown) => void;
}