Skip to content

Commit

Permalink
converts interfaces to types
Browse files Browse the repository at this point in the history
  • Loading branch information
farskid committed Jan 12, 2019
1 parent b318dbf commit f2486c4
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export type CheckInternetConnectionConfig = {
shouldPing?: boolean;
};

interface Connectivity {
type Connectivity = {
isConnected: boolean;
}

export interface NetworkProviderProps {
export type NetworkProviderProps = {
children: React.ReactNode;
pingTimeout?: number;
pingServerUrl?: string;
Expand All @@ -31,19 +31,14 @@ export interface NetworkProviderProps {
httpMethod?: HTTPMethod;
}

interface NetworkConsumerProps {
export type NetworkConsumerProps = {
children: ({ isConnected }: Connectivity) => JSX.Element;
}

interface ReduxNetworkProviderProps extends NetworkProviderProps, Connectivity {
dispatch: (action: AnyAction) => AnyAction;
actionQueue: Array<AnyAction>;
}

export const NetworkProvider: (props: NetworkProviderProps) => JSX.Element;
export const NetworkConsumer: (props: NetworkConsumerProps) => JSX.Element;
export const ReduxNetworkProvider: (
props: ReduxNetworkProviderProps
props: NetworkProviderProps
) => JSX.Element;
export const reducer: Reducer<NetworkState, AnyAction>;
export const createNetworkMiddleware: (config: MiddlewareConfig) => Middleware;
Expand Down

0 comments on commit f2486c4

Please sign in to comment.