@daffodil/search 0.94.1 → 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.
Files changed (28) hide show
  1. package/fesm2022/daffodil-search-driver-federated.mjs +131 -128
  2. package/fesm2022/daffodil-search-driver-federated.mjs.map +1 -1
  3. package/fesm2022/daffodil-search-driver-in-memory.mjs +170 -158
  4. package/fesm2022/daffodil-search-driver-in-memory.mjs.map +1 -1
  5. package/fesm2022/daffodil-search-driver-testing.mjs +102 -69
  6. package/fesm2022/daffodil-search-driver-testing.mjs.map +1 -1
  7. package/fesm2022/daffodil-search-driver.mjs +22 -47
  8. package/fesm2022/daffodil-search-driver.mjs.map +1 -1
  9. package/fesm2022/daffodil-search-routing.mjs +123 -112
  10. package/fesm2022/daffodil-search-routing.mjs.map +1 -1
  11. package/fesm2022/daffodil-search-state-testing.mjs +91 -54
  12. package/fesm2022/daffodil-search-state-testing.mjs.map +1 -1
  13. package/fesm2022/daffodil-search-state.mjs +470 -469
  14. package/fesm2022/daffodil-search-state.mjs.map +1 -1
  15. package/fesm2022/daffodil-search-testing.mjs +141 -113
  16. package/fesm2022/daffodil-search-testing.mjs.map +1 -1
  17. package/fesm2022/daffodil-search.mjs +4 -12
  18. package/fesm2022/daffodil-search.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/types/daffodil-search-driver-federated.d.ts +39 -35
  21. package/types/daffodil-search-driver-in-memory.d.ts +61 -65
  22. package/types/daffodil-search-driver-testing.d.ts +26 -24
  23. package/types/daffodil-search-driver.d.ts +59 -70
  24. package/types/daffodil-search-routing.d.ts +31 -30
  25. package/types/daffodil-search-state-testing.d.ts +25 -22
  26. package/types/daffodil-search-state.d.ts +207 -217
  27. package/types/daffodil-search-testing.d.ts +33 -34
  28. package/types/daffodil-search.d.ts +4 -10
@@ -1,50 +1,54 @@
1
- import * as _angular_core from '@angular/core';
2
- import { ModuleWithProviders } from '@angular/core';
3
- import * as _daffodil_search_types_daffodil_search from '@daffodil/search/types/daffodil-search';
4
- import { DaffSearchDriverKindedInterface, DaffSearchDriverInterface, DaffSearchDriverOptions, DaffSearchDriverResponse } from '@daffodil/search/driver';
5
- import { Observable } from 'rxjs';
6
- import { DaffSearchResultCollection } from '@daffodil/search';
7
- import * as i1 from '@angular/common';
8
-
9
- declare const DAFF_SEARCH_FEDERATED_DRIVERS: _angular_core.InjectionToken<DaffSearchDriverKindedInterface<_daffodil_search_types_daffodil_search.DaffSearchResult>[]>;
10
- declare const provideDaffSearchFederatedDrivers: <R extends DaffSearchDriverKindedInterface<_daffodil_search_types_daffodil_search.DaffSearchResult> = DaffSearchDriverKindedInterface<_daffodil_search_types_daffodil_search.DaffSearchResult>>(...classes: _angular_core.Type<R>[]) => Array<_angular_core.ExistingProvider>;
11
-
1
+ import { DaffSearchDriverInterface, DaffSearchDriverKindedInterface, DaffSearchDriverOptions, DaffSearchDriverResponse } from "@daffodil/search/driver";
2
+ import { Observable } from "rxjs";
3
+ import { DaffSearchResultCollection } from "@daffodil/search";
4
+ import * as i0 from "@angular/core";
5
+ import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
6
+ import * as i1 from "@angular/common";
7
+ export declare const DAFF_SEARCH_FEDERATED_DRIVERS: import("@angular/core").InjectionToken<DaffSearchDriverKindedInterface<import("@daffodil/search/types/daffodil-search").DaffSearchResult>[]>, provideDaffSearchFederatedDrivers: <R extends DaffSearchDriverKindedInterface<import("@daffodil/search/types/daffodil-search").DaffSearchResult> = DaffSearchDriverKindedInterface<import("@daffodil/search/types/daffodil-search").DaffSearchResult>>(...classes: import("@angular/core").Type<R>[]) => Array<import("@angular/core").ExistingProvider>;
12
8
  /**
13
9
  * An interface for providing @daffodil/search/driver/federated with necessary config values.
14
10
  */
15
11
  interface DaffSearchFederatedDriverConfig {
16
- /**
17
- * The search driver kind that is the main kind of search result.
18
- * Optional.
19
- * If set, the search response metadata will be entirely from this kind.
20
- */
21
- preferredDriverKind?: string;
12
+ /**
13
+ * The search driver kind that is the main kind of search result.
14
+ * Optional.
15
+ * If set, the search response metadata will be entirely from this kind.
16
+ */
17
+ preferredDriverKind?: string;
22
18
  }
23
-
24
19
  /**
25
20
  * A service for calling and combining the results of provided federated search drivers.
26
21
  *
27
22
  * @inheritdoc
28
23
  */
29
- declare class DaffSearchFederatedDriver implements DaffSearchDriverInterface {
30
- private drivers;
31
- private config;
32
- constructor(drivers: DaffSearchDriverKindedInterface[], config: DaffSearchFederatedDriverConfig);
33
- search(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchDriverResponse>;
34
- incremental(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchResultCollection>;
35
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<DaffSearchFederatedDriver, never>;
36
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<DaffSearchFederatedDriver>;
24
+ export declare class DaffSearchFederatedDriver implements DaffSearchDriverInterface {
25
+ private drivers;
26
+ private config;
27
+ constructor(drivers: DaffSearchDriverKindedInterface[], config: DaffSearchFederatedDriverConfig);
28
+ search(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchDriverResponse>;
29
+ incremental(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchResultCollection>;
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchFederatedDriver, never>;
31
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
37
32
  }
38
-
39
33
  /**
40
34
  * Provides the {@link DaffSearchFederatedDriver} as the {@link DaffSearchDriver}.
35
+ *
36
+ * @deprecated in favor of {@link provideDaffSearchFederatedDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
41
37
  */
42
- declare class DaffSearchFederatedDriverModule {
43
- static forRoot(config?: DaffSearchFederatedDriverConfig): ModuleWithProviders<DaffSearchFederatedDriverModule>;
44
- static forFeature(config?: DaffSearchFederatedDriverConfig): ModuleWithProviders<DaffSearchFederatedDriverModule>;
45
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<DaffSearchFederatedDriverModule, never>;
46
- static ɵmod: _angular_core.ɵɵNgModuleDeclaration<DaffSearchFederatedDriverModule, never, [typeof i1.CommonModule], never>;
47
- static ɵinj: _angular_core.ɵɵInjectorDeclaration<DaffSearchFederatedDriverModule>;
38
+ export declare class DaffSearchFederatedDriverModule {
39
+ static forRoot(config?: DaffSearchFederatedDriverConfig): ModuleWithProviders<DaffSearchFederatedDriverModule>;
40
+ static forFeature(config?: DaffSearchFederatedDriverConfig): ModuleWithProviders<DaffSearchFederatedDriverModule>;
41
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchFederatedDriverModule, never>;
42
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchFederatedDriverModule, never, [typeof i1.CommonModule], never>;
43
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchFederatedDriverModule>;
48
44
  }
49
-
50
- export { DAFF_SEARCH_FEDERATED_DRIVERS, DaffSearchFederatedDriver, DaffSearchFederatedDriverModule, provideDaffSearchFederatedDrivers };
45
+ /**
46
+ * Provides the {@link DaffSearchFederatedDriver} as the {@link DaffSearchDriver}.
47
+ */
48
+ export declare const provideDaffSearchFederatedDriver: (config?: DaffSearchFederatedDriverConfig) => EnvironmentProviders;
49
+ /**
50
+ * Provides the {@link DaffSearchFederatedDriver} as the {@link DaffSearchDriver} with `useClass`,
51
+ * creating a new instance of the driver in the current injector.
52
+ */
53
+ export declare const provideDaffSearchFederatedFeatureDriver: (config?: DaffSearchFederatedDriverConfig) => EnvironmentProviders;
54
+ export {};
@@ -1,84 +1,80 @@
1
- import * as rxjs from 'rxjs';
2
- import { Observable } from 'rxjs';
3
- import { RequestInfo, InMemoryDbService, RequestInfoUtilities, ParsedRequestUrl, InMemoryBackendConfig } from 'angular-in-memory-web-api';
4
- import { DaffInMemorySingleRouteableBackend, DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';
5
- import { HttpResponse, HttpClient } from '@angular/common/http';
6
- import { DaffSearchDriverResponse, DaffSearchDriverInterface, DaffSearchDriverOptions } from '@daffodil/search/driver';
7
- import * as i0 from '@angular/core';
8
- import { ModuleWithProviders } from '@angular/core';
9
- import { DaffSearchResultCollection } from '@daffodil/search';
10
- import * as i1 from '@angular/common';
11
- import * as i2 from '@daffodil/search/testing';
12
-
1
+ import { InMemoryBackendConfig, InMemoryDbService, ParsedRequestUrl, RequestInfo, RequestInfoUtilities } from "angular-in-memory-web-api";
2
+ import { DaffInMemoryDriverBase, DaffInMemorySingleRouteableBackend } from "@daffodil/driver/in-memory";
3
+ import { HttpClient, HttpResponse } from "@angular/common/http";
4
+ import { Observable } from "rxjs";
5
+ import { DaffSearchDriverInterface, DaffSearchDriverOptions, DaffSearchDriverResponse } from "@daffodil/search/driver";
6
+ import * as i0 from "@angular/core";
7
+ import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
8
+ import { DaffSearchResultCollection } from "@daffodil/search";
9
+ import * as i1 from "@angular/common";
13
10
  /**
14
11
  * The child backends to which the search in-memory backend will delegate search queries.
15
12
  */
16
- interface DaffSearchInMemoryChildBackend {
17
- readonly kind: string;
18
- /**
19
- * Search for entities and get the results.
20
- */
21
- get(reqInfo: RequestInfo): Observable<HttpResponse<DaffSearchDriverResponse>>;
13
+ export interface DaffSearchInMemoryChildBackend {
14
+ readonly kind: string;
15
+ /**
16
+ * Search for entities and get the results.
17
+ */
18
+ get(reqInfo: RequestInfo): Observable<HttpResponse<DaffSearchDriverResponse>>;
22
19
  }
23
-
24
20
  /**
25
21
  * An in-memory service that delegates search queries to child backends
26
22
  * via the {@link DAFF_SEARCH_IN_MEMORY_BACKENDS}.
27
23
  */
28
- declare class DaffInMemoryBackendSearchDriver implements InMemoryDbService, DaffInMemorySingleRouteableBackend {
29
- private backends;
30
- readonly collectionName = "search";
31
- constructor(backends: DaffSearchInMemoryChildBackend[]);
32
- /**
33
- * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.
34
- *
35
- * @param url initial url
36
- * @param utils utility to parse url
37
- * @returns ParsedRequestUrl
38
- * @docs-private
39
- */
40
- parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl;
41
- /**
42
- * @docs-private
43
- */
44
- createDb(): any;
45
- /**
46
- * Searches for entities in child backends.
47
- *
48
- * @param reqInfo request object
49
- * @returns An http response object
50
- */
51
- get(reqInfo: RequestInfo): rxjs.Observable<any>;
52
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryBackendSearchDriver, never>;
53
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffInMemoryBackendSearchDriver>;
24
+ export declare class DaffInMemoryBackendSearchDriver implements InMemoryDbService, DaffInMemorySingleRouteableBackend {
25
+ private backends;
26
+ readonly collectionName = "search";
27
+ constructor(backends: DaffSearchInMemoryChildBackend[]);
28
+ /**
29
+ * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.
30
+ *
31
+ * @param url initial url
32
+ * @param utils utility to parse url
33
+ * @returns ParsedRequestUrl
34
+ * @docs-private
35
+ */
36
+ parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl;
37
+ /**
38
+ * @docs-private
39
+ */
40
+ createDb(): any;
41
+ /**
42
+ * Searches for entities in child backends.
43
+ *
44
+ * @param reqInfo request object
45
+ * @returns An http response object
46
+ */
47
+ get(reqInfo: RequestInfo): import("rxjs").Observable<any>;
48
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryBackendSearchDriver, never>;
49
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
54
50
  }
55
-
56
51
  /**
57
52
  * The search inmemory driver to mock the search backend service.
58
53
  *
59
54
  * @inheritdoc
60
55
  */
61
- declare class DaffInMemorySearchDriver extends DaffInMemoryDriverBase implements DaffSearchDriverInterface {
62
- private http;
63
- constructor(http: HttpClient, config: InMemoryBackendConfig);
64
- search(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchDriverResponse>;
65
- incremental(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchResultCollection>;
66
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemorySearchDriver, never>;
67
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffInMemorySearchDriver>;
56
+ export declare class DaffInMemorySearchDriver extends DaffInMemoryDriverBase implements DaffSearchDriverInterface {
57
+ private http;
58
+ constructor(http: HttpClient, config: InMemoryBackendConfig);
59
+ search(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchDriverResponse>;
60
+ incremental(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchResultCollection>;
61
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemorySearchDriver, never>;
62
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
68
63
  }
69
-
70
64
  /**
71
65
  * Provides the {@link DaffInMemorySearchDriver} as the {@link DaffSearchDriver}.
66
+ *
67
+ * @deprecated in favor of {@link provideDaffSearchInMemoryDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
72
68
  */
73
- declare class DaffSearchInMemoryDriverModule {
74
- static forRoot(): ModuleWithProviders<DaffSearchInMemoryDriverModule>;
75
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchInMemoryDriverModule, never>;
76
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchInMemoryDriverModule, never, [typeof i1.CommonModule, typeof i2.DaffSearchTestingModule], never>;
77
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchInMemoryDriverModule>;
69
+ export declare class DaffSearchInMemoryDriverModule {
70
+ static forRoot(): ModuleWithProviders<DaffSearchInMemoryDriverModule>;
71
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchInMemoryDriverModule, never>;
72
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchInMemoryDriverModule, never, [typeof i1.CommonModule], never>;
73
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchInMemoryDriverModule>;
78
74
  }
79
-
80
- declare const DAFF_SEARCH_IN_MEMORY_BACKENDS: i0.InjectionToken<DaffSearchInMemoryChildBackend[]>;
81
- declare const provideDaffSearchInMemoryBackends: <R extends DaffSearchInMemoryChildBackend = DaffSearchInMemoryChildBackend>(...classes: i0.Type<R>[]) => Array<i0.ExistingProvider>;
82
-
83
- export { DAFF_SEARCH_IN_MEMORY_BACKENDS, DaffInMemoryBackendSearchDriver, DaffInMemorySearchDriver, DaffSearchInMemoryDriverModule, provideDaffSearchInMemoryBackends };
84
- export type { DaffSearchInMemoryChildBackend };
75
+ /**
76
+ * Provides the {@link DaffInMemorySearchDriver} as the {@link DaffSearchDriver}.
77
+ * Includes {@link provideDaffSearchTesting}.
78
+ */
79
+ export declare const provideDaffSearchInMemoryDriver: () => EnvironmentProviders;
80
+ export declare const DAFF_SEARCH_IN_MEMORY_BACKENDS: import("@angular/core").InjectionToken<DaffSearchInMemoryChildBackend[]>, provideDaffSearchInMemoryBackends: <R extends DaffSearchInMemoryChildBackend = DaffSearchInMemoryChildBackend>(...classes: import("@angular/core").Type<R>[]) => Array<import("@angular/core").ExistingProvider>;
@@ -1,34 +1,36 @@
1
- import * as i0 from '@angular/core';
2
- import { ModuleWithProviders } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import { Observable } from 'rxjs';
5
- import { DaffSearchResultCollection } from '@daffodil/search';
6
- import { DaffSearchDriverInterface, DaffSearchDriverOptions, DaffSearchDriverResponse } from '@daffodil/search/driver';
7
- import { DaffSearchResultKindFactory } from '@daffodil/search/testing';
8
-
1
+ import * as i0 from "@angular/core";
2
+ import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
3
+ import * as i1 from "@angular/common";
4
+ import { Observable } from "rxjs";
5
+ import { DaffSearchResultCollection } from "@daffodil/search";
6
+ import { DaffSearchDriverInterface, DaffSearchDriverOptions, DaffSearchDriverResponse } from "@daffodil/search/driver";
7
+ import { DaffSearchResultKindFactory } from "@daffodil/search/testing";
9
8
  /**
10
9
  * Provides the {@link DaffTestingSearchDriver} as the {@link DaffSearchDriver}.
10
+ *
11
+ * @deprecated in favor of {@link provideDaffSearchTestingDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
11
12
  */
12
- declare class DaffSearchTestingDriverModule {
13
- static forRoot(): ModuleWithProviders<DaffSearchTestingDriverModule>;
14
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchTestingDriverModule, never>;
15
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchTestingDriverModule, never, [typeof i1.CommonModule], never>;
16
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchTestingDriverModule>;
13
+ export declare class DaffSearchTestingDriverModule {
14
+ static forRoot(): ModuleWithProviders<DaffSearchTestingDriverModule>;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchTestingDriverModule, never>;
16
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchTestingDriverModule, never, [typeof i1.CommonModule], never>;
17
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchTestingDriverModule>;
17
18
  }
18
-
19
+ /**
20
+ * Provides the {@link DaffTestingSearchDriver} as the {@link DaffSearchDriver}.
21
+ */
22
+ export declare const provideDaffSearchTestingDriver: () => EnvironmentProviders;
19
23
  /**
20
24
  * A basic search driver that creates mock search results of different kinds.
21
25
  * For testing purposes.
22
26
  *
23
27
  * @inheritdoc
24
28
  */
25
- declare class DaffTestingSearchDriver implements DaffSearchDriverInterface {
26
- private searchResultFactory;
27
- constructor(searchResultFactory: DaffSearchResultKindFactory);
28
- search(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchDriverResponse>;
29
- incremental(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchResultCollection>;
30
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffTestingSearchDriver, never>;
31
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffTestingSearchDriver>;
32
- }
33
-
34
- export { DaffSearchTestingDriverModule, DaffTestingSearchDriver };
29
+ export declare class DaffTestingSearchDriver implements DaffSearchDriverInterface {
30
+ private searchResultFactory;
31
+ constructor(searchResultFactory: DaffSearchResultKindFactory);
32
+ search(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchDriverResponse>;
33
+ incremental(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchResultCollection>;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffTestingSearchDriver, never>;
35
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
36
+ }
@@ -1,96 +1,85 @@
1
- import * as _angular_core from '@angular/core';
2
- import { Observable } from 'rxjs';
3
- import { DaffSearchResult, DaffSearchResultCollection } from '@daffodil/search';
4
- import { DaffInheritableError, DaffError } from '@daffodil/core';
5
-
6
- interface DaffSearchDriverResponse<T extends DaffSearchResult = DaffSearchResult> {
7
- /**
8
- * The collection of search result entities.
9
- */
10
- collection: DaffSearchResultCollection<T>;
11
- /**
12
- * A place for specific drivers to return extra info that applies to the entire response.
13
- * For example, this could be pagination, sorting, or filtering.
14
- */
15
- metadata: unknown;
1
+ import { Observable } from "rxjs";
2
+ import { DaffSearchResult, DaffSearchResultCollection } from "@daffodil/search";
3
+ import { DaffError, DaffInheritableError } from "@daffodil/core";
4
+ export interface DaffSearchDriverResponse<T extends DaffSearchResult = DaffSearchResult> {
5
+ /**
6
+ * The collection of search result entities.
7
+ */
8
+ collection: DaffSearchResultCollection<T>;
9
+ /**
10
+ * A place for specific drivers to return extra info that applies to the entire response.
11
+ * For example, this could be pagination, sorting, or filtering.
12
+ */
13
+ metadata: unknown;
16
14
  }
17
-
18
- declare const DaffSearchDriver: _angular_core.InjectionToken<DaffSearchDriverInterface<DaffSearchResult>>;
19
- declare const provideDaffSearchDriver: <R extends DaffSearchDriverInterface<DaffSearchResult> = DaffSearchDriverInterface<DaffSearchResult>>(klass: _angular_core.Type<R>) => _angular_core.ExistingProvider;
15
+ export declare const DaffSearchDriver: import("@angular/core").InjectionToken<DaffSearchDriverInterface<DaffSearchResult>>, provideDaffSearchDriver: <R extends DaffSearchDriverInterface<DaffSearchResult> = DaffSearchDriverInterface<DaffSearchResult>>(klass: import("@angular/core").Type<R>) => import("@angular/core").ExistingProvider;
20
16
  /**
21
17
  * The options for making a search.
22
18
  */
23
- interface DaffSearchDriverOptions {
24
- /**
25
- * The number of results to request from the platform.
26
- *
27
- * There is an important caveat for this option.
28
- * This value only controls the requested number of results
29
- * from the platform *per request*.
30
- *
31
- * For drivers that might make multiple requests in the background, e.g. the federated driver,
32
- * this value will not match the actual number of results returned.
33
- *
34
- * This should be used as a performance option rather than controlling the result list size.
35
- */
36
- limit?: number;
19
+ export interface DaffSearchDriverOptions {
20
+ /**
21
+ * The number of results to request from the platform.
22
+ *
23
+ * There is an important caveat for this option.
24
+ * This value only controls the requested number of results
25
+ * from the platform *per request*.
26
+ *
27
+ * For drivers that might make multiple requests in the background, e.g. the federated driver,
28
+ * this value will not match the actual number of results returned.
29
+ *
30
+ * This should be used as a performance option rather than controlling the result list size.
31
+ */
32
+ limit?: number;
37
33
  }
38
34
  /**
39
35
  * The search driver is responsible for interfacing with a platform to search for entites.
40
36
  */
41
- interface DaffSearchDriverInterface<T extends DaffSearchResult = DaffSearchResult> {
42
- /**
43
- * Searches for entities according to the specified query.
44
- * This method provides substantially more information than `incremental`.
45
- * Its intended use is populating a page of search results.
46
- */
47
- search(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchDriverResponse<T>>;
48
- /**
49
- * Rapidly searches for entities. This is intended to be called as the user types their search query.
50
- * Less information is requested in comparison to `search`.
51
- */
52
- incremental(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchResultCollection<T>>;
37
+ export interface DaffSearchDriverInterface<T extends DaffSearchResult = DaffSearchResult> {
38
+ /**
39
+ * Searches for entities according to the specified query.
40
+ * This method provides substantially more information than `incremental`.
41
+ * Its intended use is populating a page of search results.
42
+ */
43
+ search(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchDriverResponse<T>>;
44
+ /**
45
+ * Rapidly searches for entities. This is intended to be called as the user types their search query.
46
+ * Less information is requested in comparison to `search`.
47
+ */
48
+ incremental(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchResultCollection<T>>;
53
49
  }
54
-
55
50
  /**
56
51
  * A driver interface for search feature drivers of a specific kind.
57
52
  * Search results are chunked per kind and feature drivers should associate
58
53
  * themselves with a specific kind.
59
54
  */
60
- interface DaffSearchDriverKindedInterface<T extends DaffSearchResult = DaffSearchResult> extends DaffSearchDriverInterface<T> {
61
- /**
62
- * The kind of entity for which this driver can search.
63
- */
64
- readonly kind: T['kind'];
55
+ export interface DaffSearchDriverKindedInterface<T extends DaffSearchResult = DaffSearchResult> extends DaffSearchDriverInterface<T> {
56
+ /**
57
+ * The kind of entity for which this driver can search.
58
+ */
59
+ readonly kind: T['kind'];
65
60
  }
66
-
67
- declare const DAFF_SEARCH_INVALID_API_RESPONSE_ERROR_CODE = "DAFF_SEARCH_INVALID_API_RESPONSE";
61
+ export declare const DAFF_SEARCH_INVALID_API_RESPONSE_ERROR_CODE = "DAFF_SEARCH_INVALID_API_RESPONSE";
68
62
  /**
69
63
  * A general error indicating that the platform returned a response which cannot be processed.
70
64
  */
71
- declare class DaffSearchInvalidAPIResponseError extends DaffInheritableError implements DaffError {
72
- message: string;
73
- readonly code: string;
74
- constructor(message: string);
65
+ export declare class DaffSearchInvalidAPIResponseError extends DaffInheritableError implements DaffError {
66
+ message: string;
67
+ readonly code: string;
68
+ constructor(message: string);
75
69
  }
76
-
77
- declare const DAFF_SEARCH_QUERY_TOO_SHORT_ERROR_CODE = "DAFF_SEARCH_QUERY_TOO_SHORT";
70
+ export declare const DAFF_SEARCH_QUERY_TOO_SHORT_ERROR_CODE = "DAFF_SEARCH_QUERY_TOO_SHORT";
78
71
  /**
79
72
  * Thrown when the specified search query is too short.
80
73
  */
81
- declare class DaffSearchQueryTooShortError extends DaffInheritableError implements DaffError {
82
- message: string;
83
- readonly code: string;
84
- constructor(message: string);
74
+ export declare class DaffSearchQueryTooShortError extends DaffInheritableError implements DaffError {
75
+ message: string;
76
+ readonly code: string;
77
+ constructor(message: string);
85
78
  }
86
-
87
79
  /**
88
80
  * A mapping from error codes to error class constructors.
89
81
  */
90
- declare const DaffSearchDriverErrorMap: {
91
- DAFF_SEARCH_INVALID_API_RESPONSE: typeof DaffSearchInvalidAPIResponseError;
92
- DAFF_SEARCH_QUERY_TOO_SHORT: typeof DaffSearchQueryTooShortError;
93
- };
94
-
95
- export { DAFF_SEARCH_INVALID_API_RESPONSE_ERROR_CODE, DAFF_SEARCH_QUERY_TOO_SHORT_ERROR_CODE, DaffSearchDriver, DaffSearchDriverErrorMap, DaffSearchInvalidAPIResponseError, DaffSearchQueryTooShortError, provideDaffSearchDriver };
96
- export type { DaffSearchDriverInterface, DaffSearchDriverKindedInterface, DaffSearchDriverOptions, DaffSearchDriverResponse };
82
+ export declare const DaffSearchDriverErrorMap: {
83
+ DAFF_SEARCH_INVALID_API_RESPONSE: typeof DaffSearchInvalidAPIResponseError;
84
+ DAFF_SEARCH_QUERY_TOO_SHORT: typeof DaffSearchQueryTooShortError;
85
+ };
@@ -1,36 +1,37 @@
1
- import { ActivatedRouteSnapshot } from '@angular/router';
2
- import { Store, ActionsSubject } from '@ngrx/store';
3
- import { Observable } from 'rxjs';
4
- import { DaffSearchStateRootSlice } from '@daffodil/search/state';
5
- import * as i0 from '@angular/core';
6
- import { DaffSearchDriverOptions } from '@daffodil/search/driver';
7
-
8
- type DaffSearchRoutingOptionBuilder<T extends DaffSearchDriverOptions = DaffSearchDriverOptions> = (route: ActivatedRouteSnapshot) => T;
9
- declare const DAFF_SEARCH_ROUTING_OPTIONS_BUILDERS: i0.InjectionToken<DaffSearchRoutingOptionBuilder<DaffSearchDriverOptions>[]>;
10
- declare const provideDaffSearchRoutingOptionBuilders: <R extends DaffSearchRoutingOptionBuilder<DaffSearchDriverOptions> = DaffSearchRoutingOptionBuilder<DaffSearchDriverOptions>>(...values: R[]) => Array<i0.ValueProvider>;
11
-
12
- declare const DAFF_SEARCH_ROUTING_OPTIONS_BUILDER: i0.InjectionToken<DaffSearchRoutingOptionBuilder>;
13
-
1
+ import { ActivatedRouteSnapshot } from "@angular/router";
2
+ import { ActionsSubject, Store } from "@ngrx/store";
3
+ import { Observable } from "rxjs";
4
+ import { DaffSearchStateRootSlice } from "@daffodil/search/state";
5
+ import { DaffSearchDriverOptions } from "@daffodil/search/driver";
6
+ import * as i0 from "@angular/core";
7
+ import { EnvironmentProviders } from "@angular/core";
8
+ export type DaffSearchRoutingOptionBuilder<T extends DaffSearchDriverOptions = DaffSearchDriverOptions> = (route: ActivatedRouteSnapshot) => T;
9
+ export declare const DAFF_SEARCH_ROUTING_OPTIONS_BUILDERS: import("@angular/core").InjectionToken<DaffSearchRoutingOptionBuilder<DaffSearchDriverOptions>[]>, provideDaffSearchRoutingOptionBuilders: <R extends DaffSearchRoutingOptionBuilder<DaffSearchDriverOptions> = DaffSearchRoutingOptionBuilder<DaffSearchDriverOptions>>(...values: R[]) => Array<import("@angular/core").ValueProvider>;
10
+ declare const DAFF_SEARCH_ROUTING_OPTIONS_BUILDER: import("@angular/core").InjectionToken<DaffSearchRoutingOptionBuilder>, provideDaffSearchRoutingOptionsBuilder: <R extends DaffSearchRoutingOptionBuilder = DaffSearchRoutingOptionBuilder>(value: R) => import("@angular/core").ValueProvider;
14
11
  /**
15
12
  * Resolves search data for search pages, and will only resolve the url after a search request succeeds or fails. This resolver expects a url
16
13
  * of the form `some/url/{id}` where `{id}` is the search id.
17
14
  */
18
- declare class DaffSearchPageResolver {
19
- private platformId;
20
- private store;
21
- private dispatcher;
22
- private builder;
23
- constructor(platformId: string, store: Store<DaffSearchStateRootSlice>, dispatcher: ActionsSubject, builder: DaffSearchRoutingOptionBuilder);
24
- resolve(route: ActivatedRouteSnapshot): Observable<boolean>;
25
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchPageResolver, never>;
26
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchPageResolver>;
15
+ export declare class DaffSearchPageResolver {
16
+ private platformId;
17
+ private store;
18
+ private dispatcher;
19
+ private builder;
20
+ constructor(platformId: string, store: Store<DaffSearchStateRootSlice>, dispatcher: ActionsSubject, builder: DaffSearchRoutingOptionBuilder);
21
+ resolve(route: ActivatedRouteSnapshot): Observable<boolean>;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchPageResolver, never>;
23
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
27
24
  }
28
-
29
- declare class DaffSearchRoutingModule {
30
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchRoutingModule, never>;
31
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchRoutingModule, never, never, never>;
32
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchRoutingModule>;
25
+ /**
26
+ * @deprecated in favor of {@link provideDaffSearchRouting} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
27
+ */
28
+ export declare class DaffSearchRoutingModule {
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchRoutingModule, never>;
30
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchRoutingModule, never, never, never>;
31
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchRoutingModule>;
33
32
  }
34
-
35
- export { DAFF_SEARCH_ROUTING_OPTIONS_BUILDER, DAFF_SEARCH_ROUTING_OPTIONS_BUILDERS, DaffSearchPageResolver, DaffSearchRoutingModule, provideDaffSearchRoutingOptionBuilders };
36
- export type { DaffSearchRoutingOptionBuilder };
33
+ /**
34
+ * Provides the `@daffodil/search/routing` options builder and resolver.
35
+ */
36
+ export declare const provideDaffSearchRouting: () => EnvironmentProviders;
37
+ export { DAFF_SEARCH_ROUTING_OPTIONS_BUILDER };
@@ -1,32 +1,35 @@
1
- import { Action } from '@ngrx/store';
2
- import { BehaviorSubject } from 'rxjs';
3
- import { DaffStateError } from '@daffodil/core/state';
4
- import { DaffSearchFacadeInterface } from '@daffodil/search/state';
5
- import * as i0 from '@angular/core';
6
-
1
+ import { Action } from "@ngrx/store";
2
+ import { BehaviorSubject } from "rxjs";
3
+ import { DaffStateError } from "@daffodil/core/state";
4
+ import { DaffSearchFacadeInterface } from "@daffodil/search/state";
5
+ import * as i0 from "@angular/core";
6
+ import { EnvironmentProviders } from "@angular/core";
7
7
  /**
8
8
  * Mocks out facade fields and methods for testing purposes.
9
9
  *
10
10
  * @inheritdoc
11
11
  */
12
- declare class MockDaffSearchFacade implements DaffSearchFacadeInterface {
13
- loading$: BehaviorSubject<boolean>;
14
- errors$: BehaviorSubject<DaffStateError[]>;
15
- recent$: BehaviorSubject<string[]>;
16
- searchResultIds$: BehaviorSubject<Record<string, string[]>>;
17
- resultCount$: BehaviorSubject<number>;
18
- dispatch(action: Action): void;
19
- static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffSearchFacade, never>;
20
- static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffSearchFacade>;
12
+ export declare class MockDaffSearchFacade implements DaffSearchFacadeInterface {
13
+ loading$: BehaviorSubject<boolean>;
14
+ errors$: BehaviorSubject<DaffStateError[]>;
15
+ recent$: BehaviorSubject<string[]>;
16
+ searchResultIds$: BehaviorSubject<Record<string, string[]>>;
17
+ resultCount$: BehaviorSubject<number>;
18
+ dispatch(action: Action): void;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffSearchFacade, never>;
20
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
21
21
  }
22
-
23
22
  /**
24
23
  * Provides the {@link MockDaffSearchFacade} for {@link DaffSearchFacade}.
24
+ *
25
+ * @deprecated in favor of {@link provideDaffSearchStateTesting} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
25
26
  */
26
- declare class DaffSearchStateTestingModule {
27
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchStateTestingModule, never>;
28
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchStateTestingModule, never, never, never>;
29
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchStateTestingModule>;
27
+ export declare class DaffSearchStateTestingModule {
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchStateTestingModule, never>;
29
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchStateTestingModule, never, never, never>;
30
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchStateTestingModule>;
30
31
  }
31
-
32
- export { DaffSearchStateTestingModule, MockDaffSearchFacade };
32
+ /**
33
+ * Provides the {@link MockDaffSearchFacade} for {@link DaffSearchPageFacade} and {@link DaffSearchIncrementalFacade}.
34
+ */
35
+ export declare const provideDaffSearchStateTesting: () => EnvironmentProviders;