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