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