@daffodil/search 0.94.1-rc.0 → 0.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/daffodil-search-driver-federated.mjs +131 -128
- package/fesm2022/daffodil-search-driver-federated.mjs.map +1 -1
- package/fesm2022/daffodil-search-driver-in-memory.mjs +170 -158
- package/fesm2022/daffodil-search-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-search-driver-testing.mjs +102 -69
- package/fesm2022/daffodil-search-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-search-driver.mjs +22 -47
- package/fesm2022/daffodil-search-driver.mjs.map +1 -1
- package/fesm2022/daffodil-search-routing.mjs +123 -112
- package/fesm2022/daffodil-search-routing.mjs.map +1 -1
- package/fesm2022/daffodil-search-state-testing.mjs +91 -54
- package/fesm2022/daffodil-search-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-search-state.mjs +470 -469
- package/fesm2022/daffodil-search-state.mjs.map +1 -1
- package/fesm2022/daffodil-search-testing.mjs +141 -113
- package/fesm2022/daffodil-search-testing.mjs.map +1 -1
- package/fesm2022/daffodil-search.mjs +4 -12
- package/fesm2022/daffodil-search.mjs.map +1 -1
- package/package.json +1 -1
- package/types/daffodil-search-driver-federated.d.ts +39 -35
- package/types/daffodil-search-driver-in-memory.d.ts +61 -65
- package/types/daffodil-search-driver-testing.d.ts +26 -24
- package/types/daffodil-search-driver.d.ts +59 -70
- package/types/daffodil-search-routing.d.ts +31 -30
- package/types/daffodil-search-state-testing.d.ts +25 -22
- package/types/daffodil-search-state.d.ts +207 -217
- package/types/daffodil-search-testing.d.ts +33 -34
- package/types/daffodil-search.d.ts +4 -10
|
@@ -1,51 +1,49 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Action,
|
|
3
|
-
import { DaffStateError, DaffStoreFacade, daffTransformErrorToStateError } from
|
|
4
|
-
import { DaffSearchResult, DaffSearchResultCollection } from
|
|
5
|
-
import { DaffSearchDriverOptions, DaffSearchDriverResponse } from
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import * as i1 from '@ngrx/effects';
|
|
11
|
-
|
|
1
|
+
import * as i1$1 from "@ngrx/store";
|
|
2
|
+
import { Action, ActionReducer, ActionReducerMap, MemoizedSelector, Store } from "@ngrx/store";
|
|
3
|
+
import { DaffStateError, DaffStoreFacade, daffTransformErrorToStateError } from "@daffodil/core/state";
|
|
4
|
+
import { DaffSearchResult, DaffSearchResultCollection } from "@daffodil/search";
|
|
5
|
+
import { DaffSearchDriverOptions, DaffSearchDriverResponse } from "@daffodil/search/driver";
|
|
6
|
+
import { Observable } from "rxjs";
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
|
|
9
|
+
import * as i1 from "@ngrx/effects";
|
|
12
10
|
/**
|
|
13
11
|
* The search action types enum.
|
|
14
12
|
*/
|
|
15
|
-
declare enum DaffSearchActionTypes {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
export declare enum DaffSearchActionTypes {
|
|
14
|
+
SearchLoadAction = "[@daffodil/search] Search Load Action",
|
|
15
|
+
SearchLoadSuccessAction = "[@daffodil/search] Search Load Success Action",
|
|
16
|
+
SearchLoadFailureAction = "[@daffodil/search] Search Load Failure Action",
|
|
17
|
+
SearchIncrementalAction = "[@daffodil/search] Search Incremental Action",
|
|
18
|
+
SearchIncrementalSuccessAction = "[@daffodil/search] Search Incremental Success Action",
|
|
19
|
+
SearchIncrementalFailureAction = "[@daffodil/search] Search Incremental Failure Action"
|
|
22
20
|
}
|
|
23
21
|
/**
|
|
24
22
|
* Searches for the specified phrase.
|
|
25
23
|
*
|
|
26
24
|
* @param query The search query.
|
|
27
25
|
*/
|
|
28
|
-
declare class DaffSearchLoad implements Action {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
export declare class DaffSearchLoad implements Action {
|
|
27
|
+
query: string;
|
|
28
|
+
options: DaffSearchDriverOptions;
|
|
29
|
+
readonly type = DaffSearchActionTypes.SearchLoadAction;
|
|
30
|
+
constructor(query: string, options?: DaffSearchDriverOptions);
|
|
33
31
|
}
|
|
34
32
|
/**
|
|
35
33
|
* A successful search with the dictionary of results.
|
|
36
34
|
*/
|
|
37
|
-
declare class DaffSearchLoadSuccess<T extends DaffSearchResult = DaffSearchResult> implements Action {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
export declare class DaffSearchLoadSuccess<T extends DaffSearchResult = DaffSearchResult> implements Action {
|
|
36
|
+
payload: DaffSearchDriverResponse<T>;
|
|
37
|
+
readonly type = DaffSearchActionTypes.SearchLoadSuccessAction;
|
|
38
|
+
constructor(payload: DaffSearchDriverResponse<T>);
|
|
41
39
|
}
|
|
42
40
|
/**
|
|
43
41
|
* A failed search with the error message.
|
|
44
42
|
*/
|
|
45
|
-
declare class DaffSearchLoadFailure implements Action {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
export declare class DaffSearchLoadFailure implements Action {
|
|
44
|
+
payload: DaffStateError;
|
|
45
|
+
readonly type = DaffSearchActionTypes.SearchLoadFailureAction;
|
|
46
|
+
constructor(payload: DaffStateError);
|
|
49
47
|
}
|
|
50
48
|
/**
|
|
51
49
|
* Searches for the specified phrase.
|
|
@@ -54,281 +52,273 @@ declare class DaffSearchLoadFailure implements Action {
|
|
|
54
52
|
*
|
|
55
53
|
* @param query The search query.
|
|
56
54
|
*/
|
|
57
|
-
declare class DaffSearchIncremental implements Action {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
export declare class DaffSearchIncremental implements Action {
|
|
56
|
+
query: string;
|
|
57
|
+
options: DaffSearchDriverOptions;
|
|
58
|
+
readonly type = DaffSearchActionTypes.SearchIncrementalAction;
|
|
59
|
+
constructor(query: string, options?: DaffSearchDriverOptions);
|
|
62
60
|
}
|
|
63
61
|
/**
|
|
64
62
|
* A successful search with the dictionary of results.
|
|
65
63
|
*/
|
|
66
|
-
declare class DaffSearchIncrementalSuccess<T extends DaffSearchResult = DaffSearchResult> implements Action {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
export declare class DaffSearchIncrementalSuccess<T extends DaffSearchResult = DaffSearchResult> implements Action {
|
|
65
|
+
payload: DaffSearchResultCollection<T>;
|
|
66
|
+
readonly type = DaffSearchActionTypes.SearchIncrementalSuccessAction;
|
|
67
|
+
constructor(payload: DaffSearchResultCollection<T>);
|
|
70
68
|
}
|
|
71
69
|
/**
|
|
72
70
|
* A failed search with the error message.
|
|
73
71
|
*/
|
|
74
|
-
declare class DaffSearchIncrementalFailure implements Action {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
export declare class DaffSearchIncrementalFailure implements Action {
|
|
73
|
+
payload: DaffStateError;
|
|
74
|
+
readonly type = DaffSearchActionTypes.SearchIncrementalFailureAction;
|
|
75
|
+
constructor(payload: DaffStateError);
|
|
78
76
|
}
|
|
79
77
|
/**
|
|
80
78
|
* A union of the search action types.
|
|
81
79
|
*/
|
|
82
|
-
type DaffSearchActions<T extends DaffSearchResult = DaffSearchResult> = DaffSearchLoad | DaffSearchLoadSuccess<T> | DaffSearchLoadFailure | DaffSearchIncremental | DaffSearchIncrementalSuccess<T> | DaffSearchIncrementalFailure;
|
|
83
|
-
|
|
80
|
+
export type DaffSearchActions<T extends DaffSearchResult = DaffSearchResult> = DaffSearchLoad | DaffSearchLoadSuccess<T> | DaffSearchLoadFailure | DaffSearchIncremental | DaffSearchIncrementalSuccess<T> | DaffSearchIncrementalFailure;
|
|
84
81
|
/**
|
|
85
82
|
* The main search state.
|
|
86
83
|
* Contains info about the current or most recent search operation.
|
|
87
84
|
*/
|
|
88
|
-
interface DaffSearchReducerState<T extends DaffSearchResult = DaffSearchResult> {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
85
|
+
export interface DaffSearchReducerState<T extends DaffSearchResult = DaffSearchResult> {
|
|
86
|
+
/**
|
|
87
|
+
* Whether there is a pending search operation.
|
|
88
|
+
*/
|
|
89
|
+
loading: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* A list of search errors, if any.
|
|
92
|
+
*/
|
|
93
|
+
errors: DaffStateError[];
|
|
94
|
+
/**
|
|
95
|
+
* The result IDs of the most recent search grouped by kind.
|
|
96
|
+
*/
|
|
97
|
+
results: Record<T['kind'], T['id'][]>;
|
|
98
|
+
/**
|
|
99
|
+
* A list of the most recently used search queries.
|
|
100
|
+
* Does not include incremental searches.
|
|
101
|
+
*/
|
|
102
|
+
recent: string[];
|
|
106
103
|
}
|
|
107
|
-
|
|
108
104
|
/**
|
|
109
105
|
* Manages {@link DaffSearchReducerState}.
|
|
110
106
|
*/
|
|
111
|
-
declare class DaffSearchStateReducerAdapter<T extends DaffSearchResult = DaffSearchResult> {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
107
|
+
export declare class DaffSearchStateReducerAdapter<T extends DaffSearchResult = DaffSearchResult> {
|
|
108
|
+
private state;
|
|
109
|
+
constructor(state: DaffSearchReducerState<T>);
|
|
110
|
+
/**
|
|
111
|
+
* Begins the search operation flow.
|
|
112
|
+
* Sets loading to true and stores the query in the list of recent searches.
|
|
113
|
+
* Resets the collection of results.
|
|
114
|
+
*/
|
|
115
|
+
search(query: string): DaffSearchReducerState<T>;
|
|
116
|
+
/**
|
|
117
|
+
* Stores the results of a completed search.
|
|
118
|
+
* Also sets loading to false and resets errors.
|
|
119
|
+
*/
|
|
120
|
+
storeResults(collection: DaffSearchResultCollection<T>): DaffSearchReducerState<T>;
|
|
121
|
+
/**
|
|
122
|
+
* Stores the from a failed search.
|
|
123
|
+
* Also sets loading to false.
|
|
124
|
+
*/
|
|
125
|
+
storeError(error: DaffStateError): DaffSearchReducerState<T>;
|
|
130
126
|
}
|
|
131
|
-
|
|
132
127
|
/**
|
|
133
128
|
* The initial state for the main search state, see {@link DaffSearchReducerState}.
|
|
134
129
|
*/
|
|
135
|
-
declare const daffSearchInitialState: DaffSearchReducerState;
|
|
136
|
-
|
|
130
|
+
export declare const daffSearchInitialState: DaffSearchReducerState;
|
|
137
131
|
/**
|
|
138
132
|
* The key under which the search feature state will be stored.
|
|
139
133
|
*/
|
|
140
|
-
declare const DAFF_SEARCH_STORE_FEATURE_KEY = "daffSearch";
|
|
141
|
-
|
|
134
|
+
export declare const DAFF_SEARCH_STORE_FEATURE_KEY = "daffSearch";
|
|
142
135
|
/**
|
|
143
136
|
* The feature state for search.
|
|
144
137
|
*/
|
|
145
|
-
interface DaffSearchReducersState<T extends DaffSearchResult = DaffSearchResult> {
|
|
146
|
-
|
|
147
|
-
|
|
138
|
+
export interface DaffSearchReducersState<T extends DaffSearchResult = DaffSearchResult> {
|
|
139
|
+
search: DaffSearchReducerState<T>;
|
|
140
|
+
incremental: DaffSearchReducerState;
|
|
148
141
|
}
|
|
149
142
|
/**
|
|
150
143
|
* The footprint of search feature state in the root application state.
|
|
151
144
|
*/
|
|
152
|
-
interface DaffSearchStateRootSlice<T extends DaffSearchResult = DaffSearchResult> {
|
|
153
|
-
|
|
145
|
+
export interface DaffSearchStateRootSlice<T extends DaffSearchResult = DaffSearchResult> {
|
|
146
|
+
[DAFF_SEARCH_STORE_FEATURE_KEY]: DaffSearchReducersState<T>;
|
|
154
147
|
}
|
|
155
|
-
|
|
156
148
|
/**
|
|
157
149
|
* The reducers for the entire search feature state.
|
|
158
150
|
*/
|
|
159
|
-
declare const daffSearchReducers: ActionReducerMap<DaffSearchReducersState>;
|
|
160
|
-
|
|
151
|
+
export declare const daffSearchReducers: ActionReducerMap<DaffSearchReducersState>;
|
|
161
152
|
/**
|
|
162
153
|
* The reducer for the search page state, see {@link DaffSearchReducerState}.
|
|
163
154
|
*/
|
|
164
|
-
declare function daffSearchPageReducer<T extends DaffSearchResult = DaffSearchResult>(state: DaffSearchReducerState<DaffSearchResult>, action: DaffSearchActions<T>): DaffSearchReducerState;
|
|
165
|
-
|
|
155
|
+
export declare function daffSearchPageReducer<T extends DaffSearchResult = DaffSearchResult>(state: DaffSearchReducerState<DaffSearchResult>, action: DaffSearchActions<T>): DaffSearchReducerState;
|
|
166
156
|
/**
|
|
167
157
|
* The reducer for the incremental part of search state, see {@link DaffSearchReducerState}.
|
|
168
158
|
*/
|
|
169
|
-
declare function daffSearchIncrementalReducer<T extends DaffSearchResult = DaffSearchResult>(state: DaffSearchReducerState<DaffSearchResult>, action: DaffSearchActions<T>): DaffSearchReducerState;
|
|
170
|
-
|
|
171
|
-
declare const DAFF_SEARCH_EXTRA_REDUCERS: i0.InjectionToken<ActionReducer<DaffSearchReducersState<_daffodil_search_types_daffodil_search.DaffSearchResult>, _ngrx_store.Action<string>>[]>;
|
|
172
|
-
declare const daffSearchProvideExtraReducers: <R extends ActionReducer<DaffSearchReducersState<_daffodil_search_types_daffodil_search.DaffSearchResult>, _ngrx_store.Action<string>> = ActionReducer<DaffSearchReducersState<_daffodil_search_types_daffodil_search.DaffSearchResult>, _ngrx_store.Action<string>>>(...values: R[]) => Array<i0.ValueProvider>;
|
|
173
|
-
|
|
159
|
+
export declare function daffSearchIncrementalReducer<T extends DaffSearchResult = DaffSearchResult>(state: DaffSearchReducerState<DaffSearchResult>, action: DaffSearchActions<T>): DaffSearchReducerState;
|
|
160
|
+
export declare const DAFF_SEARCH_EXTRA_REDUCERS: import("@angular/core").InjectionToken<ActionReducer<DaffSearchReducersState<import("@daffodil/search/types/daffodil-search").DaffSearchResult>, import("@ngrx/store").Action<string>>[]>, daffSearchProvideExtraReducers: <R extends ActionReducer<DaffSearchReducersState<import("@daffodil/search/types/daffodil-search").DaffSearchResult>, import("@ngrx/store").Action<string>> = ActionReducer<DaffSearchReducersState<import("@daffodil/search/types/daffodil-search").DaffSearchResult>, import("@ngrx/store").Action<string>>>(...values: R[]) => Array<import("@angular/core").ValueProvider>;
|
|
174
161
|
/**
|
|
175
162
|
* Selectors for the main part of search state.
|
|
176
163
|
*/
|
|
177
|
-
interface DaffSearchSelectors<T extends DaffSearchResult = DaffSearchResult, R extends DaffSearchStateRootSlice<T> = DaffSearchStateRootSlice<T>> {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
164
|
+
export interface DaffSearchSelectors<T extends DaffSearchResult = DaffSearchResult, R extends DaffSearchStateRootSlice<T> = DaffSearchStateRootSlice<T>> {
|
|
165
|
+
/**
|
|
166
|
+
* Selects whether there is a pending search operation.
|
|
167
|
+
*/
|
|
168
|
+
selectSearchLoading: MemoizedSelector<R, boolean>;
|
|
169
|
+
/**
|
|
170
|
+
* Selects the list of search errors, if any.
|
|
171
|
+
*/
|
|
172
|
+
selectSearchErrors: MemoizedSelector<R, DaffStateError[]>;
|
|
173
|
+
/**
|
|
174
|
+
* Selects the results of the most recent search grouped by kind.
|
|
175
|
+
*/
|
|
176
|
+
selectSearchResultIds: MemoizedSelector<R, Record<T['kind'], T['id'][]>>;
|
|
177
|
+
/**
|
|
178
|
+
* Selects the recent search queries.
|
|
179
|
+
*/
|
|
180
|
+
selectRecent: MemoizedSelector<R, string[]>;
|
|
181
|
+
/**
|
|
182
|
+
* Selects the number of results in the most recent search.
|
|
183
|
+
*/
|
|
184
|
+
selectResultCount: MemoizedSelector<R, number>;
|
|
198
185
|
}
|
|
199
186
|
/**
|
|
200
187
|
* Creates a group of selectors for {@link DaffSearchReducerState} that use the passed state selector as the basis.
|
|
201
188
|
*/
|
|
202
|
-
declare const daffSearchCreateSearchSelectors: <T extends DaffSearchResult = DaffSearchResult, R extends DaffSearchStateRootSlice<T> = DaffSearchStateRootSlice<T>>(stateSelector: MemoizedSelector<R, DaffSearchReducerState<T>>) => {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
189
|
+
export declare const daffSearchCreateSearchSelectors: <T extends DaffSearchResult = DaffSearchResult, R extends DaffSearchStateRootSlice<T> = DaffSearchStateRootSlice<T>>(stateSelector: MemoizedSelector<R, DaffSearchReducerState<T>>) => {
|
|
190
|
+
selectSearchLoading: MemoizedSelector<R, boolean, (s1: DaffSearchReducerState<T>) => boolean>;
|
|
191
|
+
selectSearchErrors: MemoizedSelector<R, DaffStateError[], (s1: DaffSearchReducerState<T>) => DaffStateError[]>;
|
|
192
|
+
selectSearchResultIds: MemoizedSelector<R, Record<T["kind"], T["id"][]>, (s1: DaffSearchReducerState<T>) => Record<T["kind"], T["id"][]>>;
|
|
193
|
+
selectRecent: MemoizedSelector<R, string[], (s1: DaffSearchReducerState<T>) => string[]>;
|
|
194
|
+
selectResultCount: MemoizedSelector<R, number, (s1: Record<T["kind"], T["id"][]>) => number>;
|
|
208
195
|
};
|
|
209
|
-
|
|
210
|
-
declare const
|
|
211
|
-
|
|
212
|
-
declare const daffSearchGetIncrementalSelectors: <T extends DaffSearchResult = DaffSearchResult>() => DaffSearchSelectors<T>;
|
|
213
|
-
|
|
196
|
+
export declare const daffSearchGetPageSelectors: <T extends DaffSearchResult = DaffSearchResult>() => DaffSearchSelectors<T>;
|
|
197
|
+
export declare const daffSearchGetIncrementalSelectors: <T extends DaffSearchResult = DaffSearchResult>() => DaffSearchSelectors<T>;
|
|
214
198
|
/**
|
|
215
199
|
* Selector for the search feature state.
|
|
216
200
|
*/
|
|
217
|
-
interface DaffSearchFeatureSelector<T extends DaffSearchResult = DaffSearchResult> {
|
|
218
|
-
|
|
201
|
+
export interface DaffSearchFeatureSelector<T extends DaffSearchResult = DaffSearchResult> {
|
|
202
|
+
selectSearchFeatureState: MemoizedSelector<DaffSearchStateRootSlice<T>, DaffSearchReducersState<T>>;
|
|
219
203
|
}
|
|
220
|
-
declare const getDaffSearchReducersStateSelector: <T extends DaffSearchResult = DaffSearchResult>() => DaffSearchFeatureSelector<T>;
|
|
221
|
-
|
|
204
|
+
export declare const getDaffSearchReducersStateSelector: <T extends DaffSearchResult = DaffSearchResult>() => DaffSearchFeatureSelector<T>;
|
|
222
205
|
/**
|
|
223
206
|
* Exposes the search state selectors.
|
|
224
207
|
*/
|
|
225
|
-
interface DaffSearchFacadeInterface<T extends DaffSearchResult = DaffSearchResult> extends DaffStoreFacade<Action> {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
208
|
+
export interface DaffSearchFacadeInterface<T extends DaffSearchResult = DaffSearchResult> extends DaffStoreFacade<Action> {
|
|
209
|
+
/**
|
|
210
|
+
* Whether there is a pending search operation.
|
|
211
|
+
*/
|
|
212
|
+
loading$: Observable<boolean>;
|
|
213
|
+
/**
|
|
214
|
+
* A list of search errors, if any.
|
|
215
|
+
*/
|
|
216
|
+
errors$: Observable<DaffStateError[]>;
|
|
217
|
+
/**
|
|
218
|
+
* The recent search queries.
|
|
219
|
+
*/
|
|
220
|
+
recent$: Observable<string[]>;
|
|
221
|
+
/**
|
|
222
|
+
* The result IDs of the most recent search.
|
|
223
|
+
*/
|
|
224
|
+
searchResultIds$: Observable<Record<T['kind'], T['id'][]>>;
|
|
225
|
+
/**
|
|
226
|
+
* The number of results in the most recent search.
|
|
227
|
+
*/
|
|
228
|
+
resultCount$: Observable<number>;
|
|
246
229
|
}
|
|
247
|
-
|
|
248
230
|
/**
|
|
249
231
|
* @inheritdoc
|
|
250
232
|
*
|
|
251
233
|
* Serves as the base for a search facade.
|
|
252
234
|
* Extend this class and pass in the selectors for the specific state you wish to target.
|
|
253
235
|
*/
|
|
254
|
-
declare abstract class DaffSearchFacadeBase<T extends DaffSearchResult = DaffSearchResult, R extends DaffSearchStateRootSlice<T> = DaffSearchStateRootSlice<T>> implements DaffSearchFacadeInterface<T> {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
236
|
+
export declare abstract class DaffSearchFacadeBase<T extends DaffSearchResult = DaffSearchResult, R extends DaffSearchStateRootSlice<T> = DaffSearchStateRootSlice<T>> implements DaffSearchFacadeInterface<T> {
|
|
237
|
+
private store;
|
|
238
|
+
loading$: Observable<boolean>;
|
|
239
|
+
errors$: Observable<DaffStateError[]>;
|
|
240
|
+
searchResultIds$: Observable<Record<T['kind'], T['id'][]>>;
|
|
241
|
+
recent$: Observable<string[]>;
|
|
242
|
+
resultCount$: Observable<number>;
|
|
243
|
+
constructor(store: Store<R>, selectors: DaffSearchSelectors<T, R>);
|
|
244
|
+
dispatch(action: Action): void;
|
|
263
245
|
}
|
|
264
|
-
|
|
265
246
|
/**
|
|
266
247
|
* @inheritdoc
|
|
267
248
|
*
|
|
268
249
|
* A facade for the incremental search state.
|
|
269
250
|
*/
|
|
270
|
-
declare class DaffSearchIncrementalFacade<T extends DaffSearchResult = DaffSearchResult, R extends DaffSearchStateRootSlice<T> = DaffSearchStateRootSlice<T>> extends DaffSearchFacadeBase<T, R> implements DaffSearchFacadeInterface<T> {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
251
|
+
export declare class DaffSearchIncrementalFacade<T extends DaffSearchResult = DaffSearchResult, R extends DaffSearchStateRootSlice<T> = DaffSearchStateRootSlice<T>> extends DaffSearchFacadeBase<T, R> implements DaffSearchFacadeInterface<T> {
|
|
252
|
+
constructor(store: Store<R>);
|
|
253
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchIncrementalFacade<any, any>, never>;
|
|
254
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
274
255
|
}
|
|
275
|
-
|
|
276
256
|
/**
|
|
277
257
|
* @inheritdoc
|
|
278
258
|
*
|
|
279
259
|
* A facade for the search page state.
|
|
280
260
|
*/
|
|
281
|
-
declare class DaffSearchPageFacade<T extends DaffSearchResult = DaffSearchResult, R extends DaffSearchStateRootSlice<T> = DaffSearchStateRootSlice<T>> extends DaffSearchFacadeBase<T, R> implements DaffSearchFacadeInterface<T> {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
261
|
+
export declare class DaffSearchPageFacade<T extends DaffSearchResult = DaffSearchResult, R extends DaffSearchStateRootSlice<T> = DaffSearchStateRootSlice<T>> extends DaffSearchFacadeBase<T, R> implements DaffSearchFacadeInterface<T> {
|
|
262
|
+
constructor(store: Store<R>);
|
|
263
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchPageFacade<any, any>, never>;
|
|
264
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
285
265
|
}
|
|
286
|
-
|
|
287
266
|
/**
|
|
288
267
|
* An interface for providing @daffodil/search/state with necessary config values.
|
|
289
268
|
*/
|
|
290
|
-
interface DaffSearchStateConfig {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
269
|
+
export interface DaffSearchStateConfig {
|
|
270
|
+
/**
|
|
271
|
+
* The result limit to pass to the driver during an incremental search.
|
|
272
|
+
* See {@link DaffSearchDriverOptions#limit}
|
|
273
|
+
*
|
|
274
|
+
* Defaults to 5.
|
|
275
|
+
*/
|
|
276
|
+
incrementalResultLimit?: number;
|
|
298
277
|
}
|
|
299
|
-
|
|
300
278
|
/**
|
|
301
279
|
* The default configuration for the {@link DaffSearchStateConfig}.
|
|
302
280
|
*/
|
|
303
|
-
declare const DAFF_SEARCH_STATE_CONFIG_DEFAULT: DaffSearchStateConfig;
|
|
304
|
-
|
|
305
|
-
declare const
|
|
306
|
-
declare const provideDaffSearchStateConfig: <R extends DaffSearchStateConfig = DaffSearchStateConfig>(config: Partial<R> | i0.InjectionToken<Partial<R>>) => i0.FactoryProvider;
|
|
307
|
-
|
|
308
|
-
declare const DAFF_SEARCH_ERROR_MATCHER: i0.InjectionToken<typeof daffTransformErrorToStateError>;
|
|
309
|
-
declare const provideDaffSearchErrorMatcher: <R extends typeof daffTransformErrorToStateError = typeof daffTransformErrorToStateError>(value: R) => i0.ValueProvider;
|
|
310
|
-
|
|
281
|
+
export declare const DAFF_SEARCH_STATE_CONFIG_DEFAULT: DaffSearchStateConfig;
|
|
282
|
+
export declare const DAFF_SEARCH_STATE_CONFIG: import("@angular/core").InjectionToken<DaffSearchStateConfig>, provideDaffSearchStateConfig: <R extends DaffSearchStateConfig = DaffSearchStateConfig>(config: Partial<R> | import("@angular/core").InjectionToken<Partial<R>>) => import("@angular/core").FactoryProvider;
|
|
283
|
+
export declare const DAFF_SEARCH_ERROR_MATCHER: import("@angular/core").InjectionToken<typeof daffTransformErrorToStateError>, provideDaffSearchErrorMatcher: <R extends typeof daffTransformErrorToStateError = typeof daffTransformErrorToStateError>(value: R) => import("@angular/core").ValueProvider;
|
|
311
284
|
/**
|
|
312
285
|
* Creates the search feature store.
|
|
286
|
+
*
|
|
287
|
+
* @deprecated in favor of {@link provideDaffSearchState} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
313
288
|
*/
|
|
314
|
-
declare class DaffSearchStateModule {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
289
|
+
export declare class DaffSearchStateModule {
|
|
290
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchStateModule, never>;
|
|
291
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchStateModule, never, [typeof i1$1.StoreFeatureModule], never>;
|
|
292
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchStateModule>;
|
|
318
293
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
294
|
+
/**
|
|
295
|
+
* @deprecated in favor of {@link provideDaffSearchIncrementalState} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
296
|
+
*/
|
|
297
|
+
export declare class DaffSearchIncrementalStateModule {
|
|
298
|
+
static withConfig(config?: DaffSearchStateConfig): ModuleWithProviders<DaffSearchIncrementalStateModule>;
|
|
299
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchIncrementalStateModule, never>;
|
|
300
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchIncrementalStateModule, never, [typeof i1.EffectsFeatureModule, typeof DaffSearchStateModule], never>;
|
|
301
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchIncrementalStateModule>;
|
|
325
302
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
303
|
+
/**
|
|
304
|
+
* @deprecated in favor of {@link provideDaffSearchPageState} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
305
|
+
*/
|
|
306
|
+
export declare class DaffSearchPageStateModule {
|
|
307
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchPageStateModule, never>;
|
|
308
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchPageStateModule, never, [typeof i1.EffectsFeatureModule, typeof DaffSearchStateModule], never>;
|
|
309
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchPageStateModule>;
|
|
331
310
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
311
|
+
/**
|
|
312
|
+
* Creates the search feature store.
|
|
313
|
+
*/
|
|
314
|
+
export declare const provideDaffSearchState: () => EnvironmentProviders;
|
|
315
|
+
/**
|
|
316
|
+
* Provides the search incremental effects and the search state config.
|
|
317
|
+
* Includes {@link provideDaffSearchState}.
|
|
318
|
+
*/
|
|
319
|
+
export declare const provideDaffSearchIncrementalState: (config?: DaffSearchStateConfig) => EnvironmentProviders;
|
|
320
|
+
/**
|
|
321
|
+
* Provides the search page effects.
|
|
322
|
+
* Includes {@link provideDaffSearchState}.
|
|
323
|
+
*/
|
|
324
|
+
export declare const provideDaffSearchPageState: () => EnvironmentProviders;
|
|
@@ -1,51 +1,50 @@
|
|
|
1
|
-
import { DaffModelFactory } from
|
|
2
|
-
import { DaffSearchResult } from
|
|
3
|
-
import * as i0 from
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { DaffModelFactory } from "@daffodil/core/testing";
|
|
2
|
+
import { DaffSearchResult } from "@daffodil/search";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import { EnvironmentProviders } from "@angular/core";
|
|
6
5
|
/**
|
|
7
6
|
* Mock class for {@link DaffSearchResult}.
|
|
8
7
|
*/
|
|
9
|
-
declare class MockSearchResult implements DaffSearchResult {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
export declare class MockSearchResult implements DaffSearchResult {
|
|
9
|
+
kind: string;
|
|
10
|
+
id: string;
|
|
11
|
+
url: string;
|
|
13
12
|
}
|
|
14
13
|
/**
|
|
15
14
|
* Model factory for {@link DaffSearchResult}.
|
|
16
15
|
*/
|
|
17
|
-
declare class DaffSearchResultFactory extends DaffModelFactory<DaffSearchResult> {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
export declare class DaffSearchResultFactory extends DaffModelFactory<DaffSearchResult> {
|
|
17
|
+
constructor();
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchResultFactory, never>;
|
|
19
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
21
20
|
}
|
|
22
|
-
|
|
23
21
|
/**
|
|
24
22
|
* Factory for creating DaffSearchResults.
|
|
25
23
|
* This will create a search result of random kind.
|
|
26
24
|
*/
|
|
27
|
-
declare class DaffSearchResultKindFactory extends DaffModelFactory<DaffSearchResult> {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
export declare class DaffSearchResultKindFactory extends DaffModelFactory<DaffSearchResult> {
|
|
26
|
+
private kindFactories;
|
|
27
|
+
constructor(kindFactories: DaffModelFactory<DaffSearchResult>[]);
|
|
28
|
+
private get _randomFactory();
|
|
29
|
+
/**
|
|
30
|
+
* Creates a search result of random kind.
|
|
31
|
+
*/
|
|
32
|
+
create(partial?: {}): DaffSearchResult;
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchResultKindFactory, never>;
|
|
34
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
37
35
|
}
|
|
38
|
-
|
|
39
|
-
declare const DAFF_SEARCH_RESULT_KIND_FACTORIES: i0.InjectionToken<DaffModelFactory<DaffSearchResult, _daffodil_core.Constructable<DaffSearchResult>>[]>;
|
|
40
|
-
declare const provideDaffSearchResultKindFactories: <R extends DaffModelFactory<DaffSearchResult, _daffodil_core.Constructable<DaffSearchResult>> = DaffModelFactory<DaffSearchResult, _daffodil_core.Constructable<DaffSearchResult>>>(...classes: i0.Type<R>[]) => Array<i0.ExistingProvider>;
|
|
41
|
-
|
|
36
|
+
export declare const DAFF_SEARCH_RESULT_KIND_FACTORIES: import("@angular/core").InjectionToken<DaffModelFactory<DaffSearchResult, import("@daffodil/core").Constructable<DaffSearchResult>>[]>, provideDaffSearchResultKindFactories: <R extends DaffModelFactory<DaffSearchResult, import("@daffodil/core").Constructable<DaffSearchResult>> = DaffModelFactory<DaffSearchResult, import("@daffodil/core").Constructable<DaffSearchResult>>>(...classes: import("@angular/core").Type<R>[]) => Array<import("@angular/core").ExistingProvider>;
|
|
42
37
|
/**
|
|
43
38
|
* Provides the default search result factory as a search result type factory.
|
|
39
|
+
*
|
|
40
|
+
* @deprecated in favor of {@link provideDaffSearchTesting} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
44
41
|
*/
|
|
45
|
-
declare class DaffSearchTestingModule {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
export declare class DaffSearchTestingModule {
|
|
43
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchTestingModule, never>;
|
|
44
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchTestingModule, never, never, never>;
|
|
45
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchTestingModule>;
|
|
49
46
|
}
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Provides the default search result factory as a search result type factory.
|
|
49
|
+
*/
|
|
50
|
+
export declare const provideDaffSearchTesting: () => EnvironmentProviders;
|