UNPKG

1.72 kBTypeScriptView Raw
1import { InjectionToken } from '@angular/core';
2import { Observable } from 'rxjs';
3import { SerializationOptions, StoreDevtoolsConfig } from './config';
4import { DevtoolsDispatcher } from './devtools-dispatcher';
5import { LiftedAction, LiftedState } from './reducer';
6export declare const ExtensionActionTypes: {
7 START: string;
8 DISPATCH: string;
9 STOP: string;
10 ACTION: string;
11};
12export declare const REDUX_DEVTOOLS_EXTENSION: InjectionToken<ReduxDevtoolsExtension>;
13export interface ReduxDevtoolsExtensionConnection {
14 subscribe(listener: (change: any) => void): void;
15 unsubscribe(): void;
16 send(action: any, state: any): void;
17 init(state?: any): void;
18 error(anyErr: any): void;
19}
20export interface ReduxDevtoolsExtensionConfig {
21 features?: object | boolean;
22 name: string | undefined;
23 maxAge?: number;
24 autoPause?: boolean;
25 serialize?: boolean | SerializationOptions;
26}
27export interface ReduxDevtoolsExtension {
28 connect(options: ReduxDevtoolsExtensionConfig): ReduxDevtoolsExtensionConnection;
29 send(action: any, state: any, options: ReduxDevtoolsExtensionConfig): void;
30}
31export declare class DevtoolsExtension {
32 private config;
33 private dispatcher;
34 private devtoolsExtension;
35 private extensionConnection;
36 liftedActions$: Observable<any>;
37 actions$: Observable<any>;
38 start$: Observable<any>;
39 constructor(devtoolsExtension: ReduxDevtoolsExtension, config: StoreDevtoolsConfig, dispatcher: DevtoolsDispatcher);
40 notify(action: LiftedAction, state: LiftedState): void;
41 private createChangesObservable;
42 private createActionStreams;
43 private unwrapAction;
44 private getExtensionConfig;
45 private sendToReduxDevtools;
46}