@daffodil/search 0.88.1 → 0.89.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 (114) hide show
  1. package/driver/federated/index.d.ts +50 -1
  2. package/driver/in-memory/index.d.ts +84 -1
  3. package/driver/index.d.ts +96 -1
  4. package/driver/testing/index.d.ts +34 -1
  5. package/fesm2022/daffodil-search-driver-federated.mjs +7 -7
  6. package/fesm2022/daffodil-search-driver-federated.mjs.map +1 -1
  7. package/fesm2022/daffodil-search-driver-in-memory.mjs +10 -10
  8. package/fesm2022/daffodil-search-driver-in-memory.mjs.map +1 -1
  9. package/fesm2022/daffodil-search-driver-testing.mjs +7 -7
  10. package/fesm2022/daffodil-search-driver-testing.mjs.map +1 -1
  11. package/fesm2022/daffodil-search-driver.mjs.map +1 -1
  12. package/fesm2022/daffodil-search-routing.mjs +7 -7
  13. package/fesm2022/daffodil-search-routing.mjs.map +1 -1
  14. package/fesm2022/daffodil-search-state-testing.mjs +7 -7
  15. package/fesm2022/daffodil-search-state-testing.mjs.map +1 -1
  16. package/fesm2022/daffodil-search-state.mjs +24 -24
  17. package/fesm2022/daffodil-search-state.mjs.map +1 -1
  18. package/fesm2022/daffodil-search-testing.mjs +10 -10
  19. package/fesm2022/daffodil-search-testing.mjs.map +1 -1
  20. package/fesm2022/daffodil-search.mjs.map +1 -1
  21. package/index.d.ts +19 -1
  22. package/package.json +1 -1
  23. package/routing/index.d.ts +36 -1
  24. package/state/index.d.ts +334 -1
  25. package/state/testing/index.d.ts +32 -1
  26. package/testing/index.d.ts +51 -1
  27. package/driver/errors/invalid-api-response.d.ts +0 -10
  28. package/driver/errors/map.d.ts +0 -9
  29. package/driver/errors/public_api.d.ts +0 -3
  30. package/driver/errors/query-too-short.d.ts +0 -10
  31. package/driver/federated/config/default.d.ts +0 -5
  32. package/driver/federated/config/interface.d.ts +0 -12
  33. package/driver/federated/config/public_api.d.ts +0 -2
  34. package/driver/federated/injection-tokens/drivers.token.d.ts +0 -2
  35. package/driver/federated/public_api.d.ts +0 -3
  36. package/driver/federated/search-driver.module.d.ts +0 -14
  37. package/driver/federated/search.service.d.ts +0 -19
  38. package/driver/in-memory/backend/search.service.d.ts +0 -35
  39. package/driver/in-memory/collection-name.const.d.ts +0 -1
  40. package/driver/in-memory/driver/search-driver.module.d.ts +0 -13
  41. package/driver/in-memory/driver/search.service.d.ts +0 -20
  42. package/driver/in-memory/injection-tokens/backends.token.d.ts +0 -2
  43. package/driver/in-memory/interfaces/get-backend.interface.d.ts +0 -14
  44. package/driver/in-memory/interfaces/public_api.d.ts +0 -1
  45. package/driver/in-memory/public_api.d.ts +0 -5
  46. package/driver/interfaces/response.interface.d.ts +0 -12
  47. package/driver/interfaces/search-service-kinded.interface.d.ts +0 -13
  48. package/driver/interfaces/search-service.interface.d.ts +0 -38
  49. package/driver/public_api.d.ts +0 -4
  50. package/driver/testing/drivers/public_api.d.ts +0 -2
  51. package/driver/testing/drivers/search-driver.module.d.ts +0 -12
  52. package/driver/testing/drivers/search.service.d.ts +0 -19
  53. package/driver/testing/public_api.d.ts +0 -1
  54. package/models/public_api.d.ts +0 -2
  55. package/models/search-result-collection.type.d.ts +0 -5
  56. package/models/search-result.type.d.ts +0 -5
  57. package/public_api.d.ts +0 -2
  58. package/routing/injection-tokens/public_api.d.ts +0 -2
  59. package/routing/injection-tokens/search-options/builder.token.d.ts +0 -2
  60. package/routing/injection-tokens/search-options/builders.token.d.ts +0 -4
  61. package/routing/module.d.ts +0 -6
  62. package/routing/public_api.d.ts +0 -3
  63. package/routing/resolvers/public_api.d.ts +0 -1
  64. package/routing/resolvers/search/search.resolver.d.ts +0 -20
  65. package/state/actions/search.actions.d.ts +0 -75
  66. package/state/config/default.d.ts +0 -5
  67. package/state/config/interface.d.ts +0 -12
  68. package/state/config/public_api.d.ts +0 -3
  69. package/state/config/token.d.ts +0 -2
  70. package/state/effects/incremental.effects.d.ts +0 -21
  71. package/state/effects/page.effects.d.ts +0 -18
  72. package/state/facades/public_api.d.ts +0 -4
  73. package/state/facades/search/base.facade.d.ts +0 -23
  74. package/state/facades/search/incremental.facade.d.ts +0 -16
  75. package/state/facades/search/page.facade.d.ts +0 -16
  76. package/state/facades/search/search-facade.interface.d.ts +0 -29
  77. package/state/incremental.module.d.ts +0 -11
  78. package/state/injection-tokens/error-matcher.token.d.ts +0 -2
  79. package/state/injection-tokens/public_api.d.ts +0 -1
  80. package/state/page.module.d.ts +0 -8
  81. package/state/public_api.d.ts +0 -9
  82. package/state/reducers/incremental/public_api.d.ts +0 -1
  83. package/state/reducers/incremental/reducer.d.ts +0 -7
  84. package/state/reducers/page/public_api.d.ts +0 -1
  85. package/state/reducers/page/reducer.d.ts +0 -7
  86. package/state/reducers/public_api.d.ts +0 -7
  87. package/state/reducers/reducers.d.ts +0 -6
  88. package/state/reducers/reducers.interface.d.ts +0 -16
  89. package/state/reducers/search/adapter.d.ts +0 -26
  90. package/state/reducers/search/initial-state.d.ts +0 -5
  91. package/state/reducers/search/interface.d.ts +0 -25
  92. package/state/reducers/search/public_api.d.ts +0 -3
  93. package/state/reducers/store-feature-key.d.ts +0 -4
  94. package/state/reducers/token/extra.token.d.ts +0 -3
  95. package/state/reducers/token/public_api.d.ts +0 -1
  96. package/state/reducers/token/reducers.token.d.ts +0 -3
  97. package/state/search.module.d.ts +0 -10
  98. package/state/selectors/incremental/selectors.d.ts +0 -3
  99. package/state/selectors/page/selectors.d.ts +0 -3
  100. package/state/selectors/public_api.d.ts +0 -4
  101. package/state/selectors/search-feature.selector.d.ts +0 -10
  102. package/state/selectors/search.selector.d.ts +0 -39
  103. package/state/testing/mock-search-facade.d.ts +0 -20
  104. package/state/testing/public_api.d.ts +0 -2
  105. package/state/testing/search-testing.module.d.ts +0 -9
  106. package/testing/factories/kind.factory.d.ts +0 -18
  107. package/testing/factories/public_api.d.ts +0 -2
  108. package/testing/factories/search-result.factory.d.ts +0 -19
  109. package/testing/injection-tokens/factories/kind.token.d.ts +0 -3
  110. package/testing/injection-tokens/public_api.d.ts +0 -1
  111. package/testing/public_api.d.ts +0 -3
  112. package/testing/testing.module.d.ts +0 -9
  113. package/transforms/public_api.d.ts +0 -1
  114. package/transforms/results-to-collection.d.ts +0 -5
@@ -1,13 +0,0 @@
1
- import { DaffSearchResult } from '@daffodil/search';
2
- import { DaffSearchDriverInterface } from './search-service.interface';
3
- /**
4
- * A driver interface for search feature drivers of a specific kind.
5
- * Search results are chunked per kind and feature drivers should associate
6
- * themselves with a specific kind.
7
- */
8
- export interface DaffSearchDriverKindedInterface<T extends DaffSearchResult = DaffSearchResult> extends DaffSearchDriverInterface<T> {
9
- /**
10
- * The kind of entity for which this driver can search.
11
- */
12
- readonly kind: T['kind'];
13
- }
@@ -1,38 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { DaffSearchResult, DaffSearchResultCollection } from '@daffodil/search';
3
- import type { DaffSearchDriverResponse } from './response.interface';
4
- 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;
5
- /**
6
- * The options for making a search.
7
- */
8
- export interface DaffSearchDriverOptions {
9
- /**
10
- * The number of results to request from the platform.
11
- *
12
- * There is an important caveat for this option.
13
- * This value only controls the requested number of results
14
- * from the platform *per request*.
15
- *
16
- * For drivers that might make multiple requests in the background, e.g. the federated driver,
17
- * this value will not match the actual number of results returned.
18
- *
19
- * This should be used as a performance option rather than controlling the result list size.
20
- */
21
- limit?: number;
22
- }
23
- /**
24
- * The search driver is responsible for interfacing with a platform to search for entites.
25
- */
26
- export interface DaffSearchDriverInterface<T extends DaffSearchResult = DaffSearchResult> {
27
- /**
28
- * Searches for entities according to the specified query.
29
- * This method provides substantially more information than `incremental`.
30
- * Its intended use is populating a page of search results.
31
- */
32
- search(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchDriverResponse<T>>;
33
- /**
34
- * Rapidly searches for entities. This is intended to be called as the user types their search query.
35
- * Less information is requested in comparison to `search`.
36
- */
37
- incremental(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchResultCollection<T>>;
38
- }
@@ -1,4 +0,0 @@
1
- export { DaffSearchDriver, DaffSearchDriverInterface, DaffSearchDriverOptions, provideDaffSearchDriver, } from './interfaces/search-service.interface';
2
- export { DaffSearchDriverKindedInterface } from './interfaces/search-service-kinded.interface';
3
- export { DaffSearchDriverResponse } from './interfaces/response.interface';
4
- export * from './errors/public_api';
@@ -1,2 +0,0 @@
1
- export { DaffSearchTestingDriverModule } from './search-driver.module';
2
- export { DaffTestingSearchDriver } from './search.service';
@@ -1,12 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "@angular/common";
4
- /**
5
- * Provides the {@link DaffTestingSearchDriver} as the {@link DaffSearchDriver}.
6
- */
7
- export declare class DaffSearchTestingDriverModule {
8
- static forRoot(): ModuleWithProviders<DaffSearchTestingDriverModule>;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchTestingDriverModule, never>;
10
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchTestingDriverModule, never, [typeof i1.CommonModule], never>;
11
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchTestingDriverModule>;
12
- }
@@ -1,19 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { DaffSearchResultCollection } from '@daffodil/search';
3
- import { DaffSearchDriverInterface, DaffSearchDriverOptions, DaffSearchDriverResponse } from '@daffodil/search/driver';
4
- import { DaffSearchResultKindFactory } from '@daffodil/search/testing';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * A basic search driver that creates mock search results of different kinds.
8
- * For testing purposes.
9
- *
10
- * @inheritdoc
11
- */
12
- export declare class DaffTestingSearchDriver implements DaffSearchDriverInterface {
13
- private searchResultFactory;
14
- constructor(searchResultFactory: DaffSearchResultKindFactory);
15
- search(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchDriverResponse>;
16
- incremental(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchResultCollection>;
17
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffTestingSearchDriver, never>;
18
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffTestingSearchDriver>;
19
- }
@@ -1 +0,0 @@
1
- export * from './drivers/public_api';
@@ -1,2 +0,0 @@
1
- export { DaffSearchResult } from './search-result.type';
2
- export { DaffSearchResultCollection } from './search-result-collection.type';
@@ -1,5 +0,0 @@
1
- import { DaffSearchResult } from './search-result.type';
2
- /**
3
- * A dictionary of search results keyed by the search result kind.
4
- */
5
- export type DaffSearchResultCollection<T extends DaffSearchResult = DaffSearchResult> = Record<T['kind'], T[]>;
@@ -1,5 +0,0 @@
1
- import { DaffIdentifiable, DaffLocatable, DaffKindable } from '@daffodil/core';
2
- /**
3
- * This represents the result for a searchable entity.
4
- */
5
- export type DaffSearchResult = DaffIdentifiable & DaffKindable & DaffLocatable;
package/public_api.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './models/public_api';
2
- export * from './transforms/public_api';
@@ -1,2 +0,0 @@
1
- export { DAFF_SEARCH_ROUTING_OPTIONS_BUILDERS, provideDaffSearchRoutingOptionBuilders, DaffSearchRoutingOptionBuilder, } from './search-options/builders.token';
2
- export { DAFF_SEARCH_ROUTING_OPTIONS_BUILDER } from './search-options/builder.token';
@@ -1,2 +0,0 @@
1
- import { DaffSearchRoutingOptionBuilder } from './builders.token';
2
- export declare const DAFF_SEARCH_ROUTING_OPTIONS_BUILDER: import("@angular/core").InjectionToken<DaffSearchRoutingOptionBuilder>, provideDaffSearchRoutingOptionsBuilder: <R extends DaffSearchRoutingOptionBuilder = DaffSearchRoutingOptionBuilder>(value: R) => import("@angular/core").ValueProvider;
@@ -1,4 +0,0 @@
1
- import { ActivatedRouteSnapshot } from '@angular/router';
2
- import { DaffSearchDriverOptions } from '@daffodil/search/driver';
3
- export type DaffSearchRoutingOptionBuilder<T extends DaffSearchDriverOptions = DaffSearchDriverOptions> = (route: ActivatedRouteSnapshot) => T;
4
- 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>;
@@ -1,6 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- export declare class DaffSearchRoutingModule {
3
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchRoutingModule, never>;
4
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchRoutingModule, never, never, never>;
5
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchRoutingModule>;
6
- }
@@ -1,3 +0,0 @@
1
- export * from './resolvers/public_api';
2
- export * from './injection-tokens/public_api';
3
- export * from './module';
@@ -1 +0,0 @@
1
- export { DaffSearchPageResolver } from './search/search.resolver';
@@ -1,20 +0,0 @@
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 { DaffSearchRoutingOptionBuilder } from '../../injection-tokens/public_api';
6
- import * as i0 from "@angular/core";
7
- /**
8
- * Resolves search data for search pages, and will only resolve the url after a search request succeeds or fails. This resolver expects a url
9
- * of the form `some/url/{id}` where `{id}` is the search id.
10
- */
11
- export declare class DaffSearchPageResolver {
12
- private platformId;
13
- private store;
14
- private dispatcher;
15
- private builder;
16
- constructor(platformId: string, store: Store<DaffSearchStateRootSlice>, dispatcher: ActionsSubject, builder: DaffSearchRoutingOptionBuilder);
17
- resolve(route: ActivatedRouteSnapshot): Observable<boolean>;
18
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchPageResolver, never>;
19
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchPageResolver>;
20
- }
@@ -1,75 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
- import { DaffStateError } from '@daffodil/core/state';
3
- import { DaffSearchResult, DaffSearchResultCollection } from '@daffodil/search';
4
- import { DaffSearchDriverOptions, DaffSearchDriverResponse } from '@daffodil/search/driver';
5
- /**
6
- * The search action types enum.
7
- */
8
- export declare enum DaffSearchActionTypes {
9
- SearchLoadAction = "[@daffodil/search] Search Load Action",
10
- SearchLoadSuccessAction = "[@daffodil/search] Search Load Success Action",
11
- SearchLoadFailureAction = "[@daffodil/search] Search Load Failure Action",
12
- SearchIncrementalAction = "[@daffodil/search] Search Incremental Action",
13
- SearchIncrementalSuccessAction = "[@daffodil/search] Search Incremental Success Action",
14
- SearchIncrementalFailureAction = "[@daffodil/search] Search Incremental Failure Action"
15
- }
16
- /**
17
- * Searches for the specified phrase.
18
- *
19
- * @param query The search query.
20
- */
21
- export declare class DaffSearchLoad implements Action {
22
- query: string;
23
- options: DaffSearchDriverOptions;
24
- readonly type = DaffSearchActionTypes.SearchLoadAction;
25
- constructor(query: string, options?: DaffSearchDriverOptions);
26
- }
27
- /**
28
- * A successful search with the dictionary of results.
29
- */
30
- export declare class DaffSearchLoadSuccess<T extends DaffSearchResult = DaffSearchResult> implements Action {
31
- payload: DaffSearchDriverResponse<T>;
32
- readonly type = DaffSearchActionTypes.SearchLoadSuccessAction;
33
- constructor(payload: DaffSearchDriverResponse<T>);
34
- }
35
- /**
36
- * A failed search with the error message.
37
- */
38
- export declare class DaffSearchLoadFailure implements Action {
39
- payload: DaffStateError;
40
- readonly type = DaffSearchActionTypes.SearchLoadFailureAction;
41
- constructor(payload: DaffStateError);
42
- }
43
- /**
44
- * Searches for the specified phrase.
45
- * Automatically applies a result limit and
46
- * does not save the search query in state.
47
- *
48
- * @param query The search query.
49
- */
50
- export declare class DaffSearchIncremental implements Action {
51
- query: string;
52
- options: DaffSearchDriverOptions;
53
- readonly type = DaffSearchActionTypes.SearchIncrementalAction;
54
- constructor(query: string, options?: DaffSearchDriverOptions);
55
- }
56
- /**
57
- * A successful search with the dictionary of results.
58
- */
59
- export declare class DaffSearchIncrementalSuccess<T extends DaffSearchResult = DaffSearchResult> implements Action {
60
- payload: DaffSearchResultCollection<T>;
61
- readonly type = DaffSearchActionTypes.SearchIncrementalSuccessAction;
62
- constructor(payload: DaffSearchResultCollection<T>);
63
- }
64
- /**
65
- * A failed search with the error message.
66
- */
67
- export declare class DaffSearchIncrementalFailure implements Action {
68
- payload: DaffStateError;
69
- readonly type = DaffSearchActionTypes.SearchIncrementalFailureAction;
70
- constructor(payload: DaffStateError);
71
- }
72
- /**
73
- * A union of the search action types.
74
- */
75
- export type DaffSearchActions<T extends DaffSearchResult = DaffSearchResult> = DaffSearchLoad | DaffSearchLoadSuccess<T> | DaffSearchLoadFailure | DaffSearchIncremental | DaffSearchIncrementalSuccess<T> | DaffSearchIncrementalFailure;
@@ -1,5 +0,0 @@
1
- import { DaffSearchStateConfig } from './interface';
2
- /**
3
- * The default configuration for the {@link DaffSearchStateConfig}.
4
- */
5
- export declare const DAFF_SEARCH_STATE_CONFIG_DEFAULT: DaffSearchStateConfig;
@@ -1,12 +0,0 @@
1
- /**
2
- * An interface for providing @daffodil/search/state with necessary config values.
3
- */
4
- export interface DaffSearchStateConfig {
5
- /**
6
- * The result limit to pass to the driver during an incremental search.
7
- * See {@link DaffSearchDriverOptions#limit}
8
- *
9
- * Defaults to 5.
10
- */
11
- incrementalResultLimit?: number;
12
- }
@@ -1,3 +0,0 @@
1
- export { DAFF_SEARCH_STATE_CONFIG_DEFAULT } from './default';
2
- export { DaffSearchStateConfig } from './interface';
3
- export * from './token';
@@ -1,2 +0,0 @@
1
- import { DaffSearchStateConfig } from './interface';
2
- 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;
@@ -1,21 +0,0 @@
1
- import { Actions } from '@ngrx/effects';
2
- import { asyncScheduler, Observable } from 'rxjs';
3
- import { ErrorTransformer } from '@daffodil/core/state';
4
- import { DaffSearchResult } from '@daffodil/search';
5
- import { DaffSearchDriverInterface } from '@daffodil/search/driver';
6
- import { DaffSearchIncrementalSuccess, DaffSearchIncrementalFailure } from '../actions/search.actions';
7
- import { DaffSearchStateConfig } from '../config/public_api';
8
- import * as i0 from "@angular/core";
9
- export declare class DaffSearchIncrementalEffects<T extends DaffSearchResult = DaffSearchResult> {
10
- private actions$;
11
- private driver;
12
- private errorMatcher;
13
- private config;
14
- constructor(actions$: Actions, driver: DaffSearchDriverInterface<T>, errorMatcher: ErrorTransformer, config: DaffSearchStateConfig);
15
- /**
16
- * An effect for incremental searching with the provided driver.
17
- */
18
- incremental$: (throttleWindow: number, scheduler: typeof asyncScheduler) => Observable<DaffSearchIncrementalSuccess | DaffSearchIncrementalFailure>;
19
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchIncrementalEffects<any>, never>;
20
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchIncrementalEffects<any>>;
21
- }
@@ -1,18 +0,0 @@
1
- import { Actions } from '@ngrx/effects';
2
- import { ErrorTransformer } from '@daffodil/core/state';
3
- import { DaffSearchResult } from '@daffodil/search';
4
- import { DaffSearchDriverInterface } from '@daffodil/search/driver';
5
- import { DaffSearchLoadSuccess, DaffSearchLoadFailure } from '../actions/search.actions';
6
- import * as i0 from "@angular/core";
7
- export declare class DaffSearchPageEffects<T extends DaffSearchResult = DaffSearchResult> {
8
- private actions$;
9
- private driver;
10
- private errorMatcher;
11
- constructor(actions$: Actions, driver: DaffSearchDriverInterface<T>, errorMatcher: ErrorTransformer);
12
- /**
13
- * An effect for searching with the provided driver.
14
- */
15
- search$: import("rxjs").Observable<DaffSearchLoadFailure | DaffSearchLoadSuccess<T>> & import("@ngrx/effects").CreateEffectMetadata;
16
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchPageEffects<any>, never>;
17
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchPageEffects<any>>;
18
- }
@@ -1,4 +0,0 @@
1
- export { DaffSearchFacadeInterface } from './search/search-facade.interface';
2
- export { DaffSearchFacadeBase } from './search/base.facade';
3
- export { DaffSearchIncrementalFacade } from './search/incremental.facade';
4
- export { DaffSearchPageFacade } from './search/page.facade';
@@ -1,23 +0,0 @@
1
- import { Action, Store } from '@ngrx/store';
2
- import { Observable } from 'rxjs';
3
- import { DaffStateError } from '@daffodil/core/state';
4
- import { DaffSearchResult } from '@daffodil/search';
5
- import { DaffSearchFacadeInterface } from './search-facade.interface';
6
- import { DaffSearchStateRootSlice } from '../../reducers/public_api';
7
- import { DaffSearchSelectors } from '../../selectors/public_api';
8
- /**
9
- * @inheritdoc
10
- *
11
- * Serves as the base for a search facade.
12
- * Extend this class and pass in the selectors for the specific state you wish to target.
13
- */
14
- export declare abstract class DaffSearchFacadeBase<T extends DaffSearchResult = DaffSearchResult, R extends DaffSearchStateRootSlice<T> = DaffSearchStateRootSlice<T>> implements DaffSearchFacadeInterface<T> {
15
- private store;
16
- loading$: Observable<boolean>;
17
- errors$: Observable<DaffStateError[]>;
18
- searchResultIds$: Observable<Record<T['kind'], T['id'][]>>;
19
- recent$: Observable<string[]>;
20
- resultCount$: Observable<number>;
21
- constructor(store: Store<R>, selectors: DaffSearchSelectors<T, R>);
22
- dispatch(action: Action): void;
23
- }
@@ -1,16 +0,0 @@
1
- import { Store } from '@ngrx/store';
2
- import { DaffSearchResult } from '@daffodil/search';
3
- import { DaffSearchFacadeBase } from './base.facade';
4
- import { DaffSearchFacadeInterface } from './search-facade.interface';
5
- import { DaffSearchStateRootSlice } from '../../reducers/public_api';
6
- import * as i0 from "@angular/core";
7
- /**
8
- * @inheritdoc
9
- *
10
- * A facade for the incremental search state.
11
- */
12
- export declare class DaffSearchIncrementalFacade<T extends DaffSearchResult = DaffSearchResult, R extends DaffSearchStateRootSlice<T> = DaffSearchStateRootSlice<T>> extends DaffSearchFacadeBase<T, R> implements DaffSearchFacadeInterface<T> {
13
- constructor(store: Store<R>);
14
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchIncrementalFacade<any, any>, never>;
15
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchIncrementalFacade<any, any>>;
16
- }
@@ -1,16 +0,0 @@
1
- import { Store } from '@ngrx/store';
2
- import { DaffSearchResult } from '@daffodil/search';
3
- import { DaffSearchFacadeBase } from './base.facade';
4
- import { DaffSearchFacadeInterface } from './search-facade.interface';
5
- import { DaffSearchStateRootSlice } from '../../reducers/public_api';
6
- import * as i0 from "@angular/core";
7
- /**
8
- * @inheritdoc
9
- *
10
- * A facade for the search page state.
11
- */
12
- export declare class DaffSearchPageFacade<T extends DaffSearchResult = DaffSearchResult, R extends DaffSearchStateRootSlice<T> = DaffSearchStateRootSlice<T>> extends DaffSearchFacadeBase<T, R> implements DaffSearchFacadeInterface<T> {
13
- constructor(store: Store<R>);
14
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchPageFacade<any, any>, never>;
15
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchPageFacade<any, any>>;
16
- }
@@ -1,29 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
- import { Observable } from 'rxjs';
3
- import { DaffStoreFacade, DaffStateError } from '@daffodil/core/state';
4
- import { DaffSearchResult } from '@daffodil/search';
5
- /**
6
- * Exposes the search state selectors.
7
- */
8
- export interface DaffSearchFacadeInterface<T extends DaffSearchResult = DaffSearchResult> extends DaffStoreFacade<Action> {
9
- /**
10
- * Whether there is a pending search operation.
11
- */
12
- loading$: Observable<boolean>;
13
- /**
14
- * A list of search errors, if any.
15
- */
16
- errors$: Observable<DaffStateError[]>;
17
- /**
18
- * The recent search queries.
19
- */
20
- recent$: Observable<string[]>;
21
- /**
22
- * The result IDs of the most recent search.
23
- */
24
- searchResultIds$: Observable<Record<T['kind'], T['id'][]>>;
25
- /**
26
- * The number of results in the most recent search.
27
- */
28
- resultCount$: Observable<number>;
29
- }
@@ -1,11 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import { DaffSearchStateConfig } from './config/public_api';
3
- import * as i0 from "@angular/core";
4
- import * as i1 from "@ngrx/effects";
5
- import * as i2 from "./search.module";
6
- export declare class DaffSearchIncrementalStateModule {
7
- static withConfig(config?: DaffSearchStateConfig): ModuleWithProviders<DaffSearchIncrementalStateModule>;
8
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchIncrementalStateModule, never>;
9
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchIncrementalStateModule, never, [typeof i1.EffectsFeatureModule, typeof i2.DaffSearchStateModule], never>;
10
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchIncrementalStateModule>;
11
- }
@@ -1,2 +0,0 @@
1
- import { daffTransformErrorToStateError } from '@daffodil/core/state';
2
- 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;
@@ -1 +0,0 @@
1
- export * from './error-matcher.token';
@@ -1,8 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "@ngrx/effects";
3
- import * as i2 from "./search.module";
4
- export declare class DaffSearchPageStateModule {
5
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchPageStateModule, never>;
6
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchPageStateModule, never, [typeof i1.EffectsFeatureModule, typeof i2.DaffSearchStateModule], never>;
7
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchPageStateModule>;
8
- }
@@ -1,9 +0,0 @@
1
- export * from './actions/search.actions';
2
- export * from './reducers/public_api';
3
- export * from './selectors/public_api';
4
- export * from './facades/public_api';
5
- export * from './config/public_api';
6
- export * from './injection-tokens/public_api';
7
- export * from './search.module';
8
- export * from './incremental.module';
9
- export * from './page.module';
@@ -1 +0,0 @@
1
- export { daffSearchIncrementalReducer } from './reducer';
@@ -1,7 +0,0 @@
1
- import { DaffSearchResult } from '@daffodil/search';
2
- import { DaffSearchActions } from '../../actions/search.actions';
3
- import { DaffSearchReducerState } from '../search/public_api';
4
- /**
5
- * The reducer for the incremental part of search state, see {@link DaffSearchReducerState}.
6
- */
7
- export declare function daffSearchIncrementalReducer<T extends DaffSearchResult = DaffSearchResult>(state: DaffSearchReducerState<DaffSearchResult>, action: DaffSearchActions<T>): DaffSearchReducerState;
@@ -1 +0,0 @@
1
- export { daffSearchPageReducer } from './reducer';
@@ -1,7 +0,0 @@
1
- import { DaffSearchResult } from '@daffodil/search';
2
- import { DaffSearchActions } from '../../actions/search.actions';
3
- import { DaffSearchReducerState } from '../search/public_api';
4
- /**
5
- * The reducer for the search page state, see {@link DaffSearchReducerState}.
6
- */
7
- export declare function daffSearchPageReducer<T extends DaffSearchResult = DaffSearchResult>(state: DaffSearchReducerState<DaffSearchResult>, action: DaffSearchActions<T>): DaffSearchReducerState;
@@ -1,7 +0,0 @@
1
- export { daffSearchReducers } from './reducers';
2
- export { DaffSearchReducersState, DaffSearchStateRootSlice, } from './reducers.interface';
3
- export { DAFF_SEARCH_STORE_FEATURE_KEY } from './store-feature-key';
4
- export * from './page/public_api';
5
- export * from './incremental/public_api';
6
- export * from './token/public_api';
7
- export * from './search/public_api';
@@ -1,6 +0,0 @@
1
- import { ActionReducerMap } from '@ngrx/store';
2
- import { DaffSearchReducersState } from './reducers.interface';
3
- /**
4
- * The reducers for the entire search feature state.
5
- */
6
- export declare const daffSearchReducers: ActionReducerMap<DaffSearchReducersState>;
@@ -1,16 +0,0 @@
1
- import { DaffSearchResult } from '@daffodil/search';
2
- import { DaffSearchReducerState } from './search/public_api';
3
- import { DAFF_SEARCH_STORE_FEATURE_KEY } from './store-feature-key';
4
- /**
5
- * The feature state for search.
6
- */
7
- export interface DaffSearchReducersState<T extends DaffSearchResult = DaffSearchResult> {
8
- search: DaffSearchReducerState<T>;
9
- incremental: DaffSearchReducerState;
10
- }
11
- /**
12
- * The footprint of search feature state in the root application state.
13
- */
14
- export interface DaffSearchStateRootSlice<T extends DaffSearchResult = DaffSearchResult> {
15
- [DAFF_SEARCH_STORE_FEATURE_KEY]: DaffSearchReducersState<T>;
16
- }
@@ -1,26 +0,0 @@
1
- import { DaffStateError } from '@daffodil/core/state';
2
- import { DaffSearchResult, DaffSearchResultCollection } from '@daffodil/search';
3
- import { DaffSearchReducerState } from './interface';
4
- /**
5
- * Manages {@link DaffSearchReducerState}.
6
- */
7
- export declare class DaffSearchStateReducerAdapter<T extends DaffSearchResult = DaffSearchResult> {
8
- private state;
9
- constructor(state: DaffSearchReducerState<T>);
10
- /**
11
- * Begins the search operation flow.
12
- * Sets loading to true and stores the query in the list of recent searches.
13
- * Resets the collection of results.
14
- */
15
- search(query: string): DaffSearchReducerState<T>;
16
- /**
17
- * Stores the results of a completed search.
18
- * Also sets loading to false and resets errors.
19
- */
20
- storeResults(collection: DaffSearchResultCollection<T>): DaffSearchReducerState<T>;
21
- /**
22
- * Stores the from a failed search.
23
- * Also sets loading to false.
24
- */
25
- storeError(error: DaffStateError): DaffSearchReducerState<T>;
26
- }
@@ -1,5 +0,0 @@
1
- import { DaffSearchReducerState } from './interface';
2
- /**
3
- * The initial state for the main search state, see {@link DaffSearchReducerState}.
4
- */
5
- export declare const daffSearchInitialState: DaffSearchReducerState;
@@ -1,25 +0,0 @@
1
- import { DaffStateError } from '@daffodil/core/state';
2
- import { DaffSearchResult } from '@daffodil/search';
3
- /**
4
- * The main search state.
5
- * Contains info about the current or most recent search operation.
6
- */
7
- export interface DaffSearchReducerState<T extends DaffSearchResult = DaffSearchResult> {
8
- /**
9
- * Whether there is a pending search operation.
10
- */
11
- loading: boolean;
12
- /**
13
- * A list of search errors, if any.
14
- */
15
- errors: DaffStateError[];
16
- /**
17
- * The result IDs of the most recent search grouped by kind.
18
- */
19
- results: Record<T['kind'], T['id'][]>;
20
- /**
21
- * A list of the most recently used search queries.
22
- * Does not include incremental searches.
23
- */
24
- recent: string[];
25
- }
@@ -1,3 +0,0 @@
1
- export { DaffSearchStateReducerAdapter } from './adapter';
2
- export { DaffSearchReducerState } from './interface';
3
- export { daffSearchInitialState } from './initial-state';
@@ -1,4 +0,0 @@
1
- /**
2
- * The key under which the search feature state will be stored.
3
- */
4
- export declare const DAFF_SEARCH_STORE_FEATURE_KEY = "daffSearch";
@@ -1,3 +0,0 @@
1
- import { ActionReducer } from '@ngrx/store';
2
- import { DaffSearchReducersState } from '../reducers.interface';
3
- export declare const DAFF_SEARCH_EXTRA_REDUCERS: import("@angular/core").InjectionToken<ActionReducer<DaffSearchReducersState<import("@daffodil/search").DaffSearchResult>, import("@ngrx/store").Action<string>>[]>, daffSearchProvideExtraReducers: <R extends ActionReducer<DaffSearchReducersState<import("@daffodil/search").DaffSearchResult>, import("@ngrx/store").Action<string>> = ActionReducer<DaffSearchReducersState<import("@daffodil/search").DaffSearchResult>, import("@ngrx/store").Action<string>>>(...values: R[]) => Array<import("@angular/core").ValueProvider>;
@@ -1 +0,0 @@
1
- export { daffSearchProvideExtraReducers, DAFF_SEARCH_EXTRA_REDUCERS, } from './extra.token';
@@ -1,3 +0,0 @@
1
- import { ActionReducer } from '@ngrx/store';
2
- import { DaffSearchReducersState } from '../reducers.interface';
3
- export declare const DAFF_SEARCH_REDUCERS: import("@angular/core").InjectionToken<ActionReducer<DaffSearchReducersState<import("@daffodil/search").DaffSearchResult>, import("@ngrx/store").Action<string>>>, provideDaffSearchReducers: <R extends ActionReducer<DaffSearchReducersState<import("@daffodil/search").DaffSearchResult>, import("@ngrx/store").Action<string>> = ActionReducer<DaffSearchReducersState<import("@daffodil/search").DaffSearchResult>, import("@ngrx/store").Action<string>>>(value: R) => import("@angular/core").ValueProvider;
@@ -1,10 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "@ngrx/store";
3
- /**
4
- * Creates the search feature store.
5
- */
6
- export declare class DaffSearchStateModule {
7
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchStateModule, never>;
8
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchStateModule, never, [typeof i1.StoreFeatureModule], never>;
9
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchStateModule>;
10
- }