import { ErrorResponse } from "../../../utils"; import { State } from "./state"; import { Action as TAction, StoreDispatchProps } from "../../../Store"; import { Dispatch } from "redux"; export declare namespace Actions { const REQUEST_GET = "io/request/unix/get"; const REQUEST_POST = "io/request/unix/post"; const REQUEST_SYNC = "io/request/unix/sync"; const RESPONSE_GET = "io/response/unix/get"; const RESPONSE_POST = "io/response/unix/post"; const RESPONSE_SYNC = "io/response/unix/sync"; const POLL_START = "io/poll/unix/start"; const POLL_STOP = "io/poll/unix/stop"; type Requests = GetRequest | PostRequest; interface GetRequest extends TAction { } interface PostRequest extends TAction { data: Partial; } interface SyncRequest extends TAction { data: State.DataServer; } interface GetResponse extends TAction { data: State.DataServer; } interface PostResponse extends TAction { data: ErrorResponse; } interface SyncResponse extends TAction { data: ErrorResponse; } interface PollStart extends TAction { } interface PollStop extends TAction { } interface DispatchProps extends StoreDispatchProps { } const getRequest: (payload?: Pick | undefined) => GetRequest; const getResponse: (payload?: Pick | undefined) => GetResponse; const postRequest: (payload?: Pick | undefined) => PostRequest; const postResponse: (payload?: Pick | undefined) => PostResponse; const syncRequest: (payload?: Pick | undefined) => SyncRequest; const syncResponse: (payload?: Pick | undefined) => SyncResponse; const pollStart: (payload?: Pick | undefined) => PollStart; const pollStop: (payload?: Pick | undefined) => PollStop; function fetchRequest(): GetRequest; function fetchRequest(data: Partial): PostRequest; const bindDispatchProps: (dispatch: Dispatch) => { fetch: (data?: Partial | undefined) => Requests; poll: (p: boolean) => PollStart | PollStop; sync: () => SyncRequest; }; } export default Actions;