1 | import { ModuleWithProviders, Type } from '@angular/core';
|
2 | import { HttpBackend, XhrFactory } from '@angular/common/http';
|
3 | import { InMemoryBackendConfigArgs, InMemoryBackendConfig, InMemoryDbService } from './interfaces';
|
4 | export declare function httpClientInMemBackendServiceFactory(dbService: InMemoryDbService, options: InMemoryBackendConfig, xhrFactory: XhrFactory): HttpBackend;
|
5 | export declare class HttpClientInMemoryWebApiModule {
|
6 | /**
|
7 | * Redirect the Angular `HttpClient` XHR calls
|
8 | * to in-memory data store that implements `InMemoryDbService`.
|
9 | * with class that implements InMemoryDbService and creates an in-memory database.
|
10 | *
|
11 | * Usually imported in the root application module.
|
12 | * Can import in a lazy feature module too, which will shadow modules loaded earlier
|
13 | *
|
14 | * @param {Type} dbCreator - Class that creates seed data for in-memory database. Must implement InMemoryDbService.
|
15 | * @param {InMemoryBackendConfigArgs} [options]
|
16 | *
|
17 | * @example
|
18 | * HttpInMemoryWebApiModule.forRoot(dbCreator);
|
19 | * HttpInMemoryWebApiModule.forRoot(dbCreator, {useValue: {delay:600}});
|
20 | */
|
21 | static forRoot(dbCreator: Type<InMemoryDbService>, options?: InMemoryBackendConfigArgs): ModuleWithProviders<HttpClientInMemoryWebApiModule>;
|
22 | /**
|
23 | *
|
24 | * Enable and configure the in-memory web api in a lazy-loaded feature module.
|
25 | * Same as `forRoot`.
|
26 | * This is a feel-good method so you can follow the Angular style guide for lazy-loaded modules.
|
27 | */
|
28 | static forFeature(dbCreator: Type<InMemoryDbService>, options?: InMemoryBackendConfigArgs): ModuleWithProviders<HttpClientInMemoryWebApiModule>;
|
29 | }
|