Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/redux-saga-routines

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/redux-saga-routines - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

347

redux-saga-routines/index.d.ts

@@ -1,2 +0,2 @@

// Type definitions for redux-saga-routines 3.0
// Type definitions for redux-saga-routines 3.1
// Project: https://github.com/afitiskin/redux-saga-routines

@@ -12,4 +12,2 @@ // Definitions by: Alexey Pelykh <https://github.com/alexey-pelykh>

createAction,
ActionFunctions,
ActionWithMetaFunctions,
ActionFunction0,

@@ -23,23 +21,95 @@ ActionFunction1,

import { FormSubmitHandler } from 'redux-form';
import { string } from 'prop-types';
export function routinePromiseWatcherSaga(): Generator;
export function routinePromiseWatcherSaga(): IterableIterator<any>;
export type ActionCreator = ActionFunctions<any> | ActionWithMetaFunctions<any, any>;
export type RoutineStages = 'TRIGGER' | 'REQUEST' | 'SUCCESS' | 'FAILURE' | 'FULFILL';
export type ActionCreatorFunction<Payload = any, Meta = any> = ActionFunctionAny<
Action<Payload> | ActionMeta<Payload, Meta>
>;
export type Routine<
TTriggerActionCreator = ActionCreator
TTriggerActionCreator = ActionCreatorFunction,
TRequestActionCreator = ActionCreatorFunction,
TSuccessActionCreator = ActionCreatorFunction,
TFailureActionCreator = ActionCreatorFunction,
TFulfillActionCreator = ActionCreatorFunction
> = TTriggerActionCreator & {
TRIGGER: string;
REQUEST: string;
SUCCESS: string;
FAILURE: string;
FULFILL: string;
[key in RoutineStages]: string;
} & {
trigger: TTriggerActionCreator;
request: ActionCreator;
success: ActionCreator;
failure: ActionCreator;
fulfill: ActionCreator;
request: TRequestActionCreator;
success: TSuccessActionCreator;
failure: TFailureActionCreator;
fulfill: TFulfillActionCreator;
};
export type UnifiedRoutine<TActionCreator = ActionCreatorFunction> = Routine<
TActionCreator,
TActionCreator,
TActionCreator,
TActionCreator,
TActionCreator
>;
export type ResolveFunctionReturnType<TFunction> =
TFunction extends (...args: any[]) => infer TReturn ? TReturn : undefined;
export type ResolveFunctionArg1Type<TFunction> =
TFunction extends (arg1: infer TArg1, ...args: any[]) => any ? TArg1 : undefined;
export type ResolveFunctionArg2Type<TFunction> =
TFunction extends (arg1: any, arg2: infer TArg1, ...args: any[]) => any ? TArg1 : undefined;
export type ResolveFunctionArg3Type<TFunction> =
TFunction extends (arg1: any, arg2: any, arg3: infer TArg1, ...args: any[]) => any ? TArg1 : undefined;
export type ResolveFunctionArg4Type<TFunction> =
TFunction extends (arg1: any, arg2: any, arg3: any, arg4: infer TArg1, ...args: any[]) => any ? TArg1 : undefined;
export type ResolveActionCreatorByPayload<
TPayloadCreator,
TPayload = ResolveFunctionReturnType<TPayloadCreator>,
TArg1 = ResolveFunctionArg1Type<TPayloadCreator>,
TArg2 = ResolveFunctionArg2Type<TPayloadCreator>,
TArg3 = ResolveFunctionArg3Type<TPayloadCreator>,
TArg4 = ResolveFunctionArg4Type<TPayloadCreator>
> =
TPayloadCreator extends ActionFunction0<TPayload> ? ActionFunction0<Action<TPayload>> :
TPayloadCreator extends ActionFunction1<TArg1, TPayload> ? ActionFunction1<TArg1, Action<TPayload>> :
TPayloadCreator extends ActionFunction2<TArg1, TArg2, TPayload> ? ActionFunction2<TArg1, TArg2, Action<TPayload>> :
TPayloadCreator extends ActionFunction3<TArg1, TArg2, TArg3, TPayload> ? ActionFunction3<TArg1, TArg2, TArg3, Action<TPayload>> :
TPayloadCreator extends ActionFunction4<TArg1, TArg2, TArg3, TArg4, TPayload> ? ActionFunction4<TArg1, TArg2, TArg3, TArg4, Action<TPayload>> : ActionFunctionAny<Action<TPayload>>;
export type ResolveActionCreatorByMeta<
TMetaCreator,
TMeta = ResolveFunctionReturnType<TMetaCreator>,
TArg1 = ResolveFunctionArg1Type<TMetaCreator>,
TArg2 = ResolveFunctionArg2Type<TMetaCreator>,
TArg3 = ResolveFunctionArg3Type<TMetaCreator>,
TArg4 = ResolveFunctionArg4Type<TMetaCreator>
> =
TMetaCreator extends ActionFunction0<TMeta> ? ActionFunction0<ActionMeta<any, TMeta>> :
TMetaCreator extends ActionFunction1<TArg1, TMeta> ? ActionFunction1<TArg1, ActionMeta<any, TMeta>> :
TMetaCreator extends ActionFunction2<TArg1, TArg2, TMeta> ? ActionFunction2<TArg1, TArg2, ActionMeta<any, TMeta>> :
TMetaCreator extends ActionFunction3<TArg1, TArg2, TArg3, TMeta> ? ActionFunction3<TArg1, TArg2, TArg3, ActionMeta<any, TMeta>> :
TMetaCreator extends ActionFunction4<TArg1, TArg2, TArg3, TArg4, TMeta> ? ActionFunction4<TArg1, TArg2, TArg3, TArg4, ActionMeta<any, TMeta>> : ActionFunctionAny<ActionMeta<any, TMeta>>;
export type ResolveActionCreatorByPayloadMeta<
TPayloadCreator,
TMetaCreator,
TPayload = ResolveFunctionReturnType<TPayloadCreator>,
TMeta = ResolveFunctionReturnType<TMetaCreator>,
TArg1 = ResolveFunctionArg1Type<TPayloadCreator>,
TArg2 = ResolveFunctionArg2Type<TPayloadCreator>,
TArg3 = ResolveFunctionArg3Type<TPayloadCreator>,
TArg4 = ResolveFunctionArg4Type<TPayloadCreator>
> =
TMetaCreator extends ActionFunction0<TMeta> ? ActionFunction0<ActionMeta<TPayload, TMeta>> :
TMetaCreator extends ActionFunction1<TArg1, TMeta> ? ActionFunction1<TArg1, ActionMeta<TPayload, TMeta>> :
TMetaCreator extends ActionFunction2<TArg1, TArg2, TMeta> ? ActionFunction2<TArg1, TArg2, ActionMeta<TPayload, TMeta>> :
TMetaCreator extends ActionFunction3<TArg1, TArg2, TArg3, TMeta> ? ActionFunction3<TArg1, TArg2, TArg3, ActionMeta<TPayload, TMeta>> :
TMetaCreator extends ActionFunction4<TArg1, TArg2, TArg3, TArg4, TMeta> ? ActionFunction4<TArg1, TArg2, TArg3, TArg4, ActionMeta<TPayload, TMeta>> : ActionFunctionAny<ActionMeta<TPayload, TMeta>>;
export interface ReduxFormPayload<TFormData = {}, TProps = {}> {

@@ -93,71 +163,254 @@ values: TFormData;

// TODO: support https://github.com/afitiskin/redux-saga-routines/commit/9eb5a240df25d771f9dfbd4cb90e898d111242ab
// NOTE: Default payloadCreator is identity (x => x)
// NOTE: Same payloadCreator is used for all actions of the routine
export function createRoutine<
Payload = any
>(
typePrefix: string
): UnifiedRoutine<
(payload?: Payload) => Action<Payload | undefined>
>;
export function createRoutine(
// NOTE: Same payloadCreator is used for all actions of the routine
export function createRoutine<
Payload
>(
typePrefix: string,
): Routine<ActionFunctionAny<Action<any>>>;
payloadCreator: ActionFunction0<Payload>
): UnifiedRoutine<
ActionFunction0<Action<Payload>>
>;
export function createRoutine<Payload>(
// NOTE: Same payloadCreator is used for all actions of the routine
export function createRoutine<
Payload,
Arg1
>(
typePrefix: string,
payloadCreator: ActionFunction0<Payload>,
): Routine<ActionFunction0<Action<Payload>>>;
export function createRoutine<Payload, Arg1>(
typePrefix: string,
payloadCreator: ActionFunction1<Arg1, Payload>,
): Routine<ActionFunction1<Arg1, Action<Payload>>>;
): UnifiedRoutine<
ActionFunction1<Arg1, Action<Payload>>
>;
export function createRoutine<Payload, Arg1, Arg2>(
// NOTE: Same payloadCreator is used for all actions of the routine
export function createRoutine<
Payload,
Arg1,
Arg2
>(
typePrefix: string,
payloadCreator: ActionFunction2<Arg1, Arg2, Payload>,
): Routine<ActionFunction2<Arg1, Arg2, Action<Payload>>>;
): UnifiedRoutine<
ActionFunction2<Arg1, Arg2, Action<Payload>>
>;
export function createRoutine<Payload, Arg1, Arg2, Arg3>(
// NOTE: Same payloadCreator is used for all actions of the routine
export function createRoutine<
Payload,
Arg1,
Arg2,
Arg3
>(
typePrefix: string,
payloadCreator: ActionFunction3<Arg1, Arg2, Arg3, Payload>,
): Routine<ActionFunction3<Arg1, Arg2, Arg3, Action<Payload>>>;
): UnifiedRoutine<
ActionFunction3<Arg1, Arg2, Arg3, Action<Payload>>
>;
export function createRoutine<Payload, Arg1, Arg2, Arg3, Arg4>(
// NOTE: Same payloadCreator is used for all actions of the routine
export function createRoutine<
Payload,
Arg1,
Arg2,
Arg3,
Arg4
>(
typePrefix: string,
payloadCreator: ActionFunction4<Arg1, Arg2, Arg3, Arg4, Payload>,
): Routine<ActionFunction4<Arg1, Arg2, Arg3, Arg4, Action<Payload>>>;
): UnifiedRoutine<
ActionFunction4<Arg1, Arg2, Arg3, Arg4, Action<Payload>>
>;
export function createRoutine<Payload>(
// NOTE: Default payloadCreator is identity (x => x)
// NOTE: Same payloadCreator is used for all actions of the routine
export function createRoutine<
Meta
>(
typePrefix: string,
): Routine<ActionFunction1<Payload, Action<Payload>>>;
export function createRoutine<Meta>(
typePrefix: string,
payloadCreator: null | undefined,
metaCreator: ActionFunctionAny<Meta>,
): Routine<ActionFunctionAny<ActionMeta<any, Meta>>>;
): UnifiedRoutine<
(payload?: any) => ActionMeta<any, Meta>
>;
export function createRoutine<Payload, Meta>(
// NOTE: Same payloadCreator is used for all actions of the routine
export function createRoutine<
Payload,
Meta
>(
typePrefix: string,
payloadCreator: ActionFunctionAny<Payload>,
metaCreator: ActionFunctionAny<Meta>,
): Routine<ActionFunctionAny<ActionMeta<Payload, Meta>>>;
): UnifiedRoutine<
ActionFunctionAny<ActionMeta<Payload, Meta>>
>;
export function createRoutine<Payload, Meta, Arg1>(
// NOTE: Same payloadCreator is used for all actions of the routine
export function createRoutine<
Payload,
Meta,
Arg1
>(
typePrefix: string,
payloadCreator: ActionFunction1<Arg1, Payload>,
metaCreator: ActionFunction1<Arg1, Meta>,
): Routine<ActionFunction1<Arg1, ActionMeta<Payload, Meta>>>;
): UnifiedRoutine<
ActionFunction1<Arg1, ActionMeta<Payload, Meta>>
>;
export function createRoutine<Payload, Meta, Arg1, Arg2>(
// NOTE: Same payloadCreator is used for all actions of the routine
export function createRoutine<
Payload,
Meta,
Arg1,
Arg2
>(
typePrefix: string,
payloadCreator: ActionFunction2<Arg1, Arg2, Payload>,
metaCreator: ActionFunction2<Arg1, Arg2, Meta>,
): Routine<ActionFunction2<Arg1, Arg2, ActionMeta<Payload, Meta>>>;
): UnifiedRoutine<
ActionFunction2<Arg1, Arg2, ActionMeta<Payload, Meta>>
>;
export function createRoutine<Payload, Meta, Arg1, Arg2, Arg3>(
// NOTE: Same payloadCreator is used for all actions of the routine
export function createRoutine<
Payload,
Meta,
Arg1,
Arg2,
Arg3
>(
typePrefix: string,
payloadCreator: ActionFunction3<Arg1, Arg2, Arg3, Payload>,
metaCreator: ActionFunction3<Arg1, Arg2, Arg3, Meta>,
): Routine<ActionFunction3<Arg1, Arg2, Arg3, ActionMeta<Payload, Meta>>>;
): UnifiedRoutine<
ActionFunction3<Arg1, Arg2, Arg3, ActionMeta<Payload, Meta>>
>;
export function createRoutine<Payload, Meta, Arg1, Arg2, Arg3, Arg4>(
// NOTE: Same payloadCreator is used for all actions of the routine
export function createRoutine<
Payload,
Meta,
Arg1,
Arg2,
Arg3,
Arg4
>(
typePrefix: string,
payloadCreator: ActionFunction4<Arg1, Arg2, Arg3, Arg4, Payload>,
metaCreator: ActionFunction4<Arg1, Arg2, Arg3, Arg4, Meta>,
): Routine<ActionFunction4<Arg1, Arg2, Arg3, Arg4, ActionMeta<Payload, Meta>>>;
): UnifiedRoutine<
ActionFunction4<Arg1, Arg2, Arg3, Arg4, ActionMeta<Payload, Meta>>
>;
export function createRoutine<
TTriggerPayloadCreator,
TRequestPayloadCreator,
TSuccessPayloadCreator,
TFailurePayloadCreator,
TFulfillPayloadCreator
>(
typePrefix: string,
payloadCreator: {
TRIGGER?: TTriggerPayloadCreator,
trigger?: TTriggerPayloadCreator,
REQUEST?: TRequestPayloadCreator,
request?: TRequestPayloadCreator,
SUCCESS?: TSuccessPayloadCreator,
success?: TSuccessPayloadCreator,
FAILURE?: TFailurePayloadCreator,
failure?: TFailurePayloadCreator,
FULFILL?: TFulfillPayloadCreator,
fulfill?: TFulfillPayloadCreator
}
): Routine<
ResolveActionCreatorByPayload<TTriggerPayloadCreator>,
ResolveActionCreatorByPayload<TRequestPayloadCreator>,
ResolveActionCreatorByPayload<TSuccessPayloadCreator>,
ResolveActionCreatorByPayload<TFailurePayloadCreator>,
ResolveActionCreatorByPayload<TFulfillPayloadCreator>
>;
export function createRoutine<
TTriggerMetaCreator,
TRequestMetaCreator,
TSuccessMetaCreator,
TFailureMetaCreator,
TFulfillMetaCreator
>(
typePrefix: string,
payloadCreator: null | undefined,
metaCreator: {
TRIGGER?: TTriggerMetaCreator,
trigger?: TTriggerMetaCreator,
REQUEST?: TRequestMetaCreator,
request?: TRequestMetaCreator,
SUCCESS?: TSuccessMetaCreator,
success?: TSuccessMetaCreator,
FAILURE?: TFailureMetaCreator,
failure?: TFailureMetaCreator,
FULFILL?: TFulfillMetaCreator,
fulfill?: TFulfillMetaCreator
}
): Routine<
ResolveActionCreatorByMeta<TTriggerMetaCreator>,
ResolveActionCreatorByMeta<TRequestMetaCreator>,
ResolveActionCreatorByMeta<TSuccessMetaCreator>,
ResolveActionCreatorByMeta<TFailureMetaCreator>,
ResolveActionCreatorByMeta<TFulfillMetaCreator>
>;
export function createRoutine<
TTriggerPayloadCreator,
TRequestPayloadCreator,
TSuccessPayloadCreator,
TFailurePayloadCreator,
TFulfillPayloadCreator,
TTriggerMetaCreator,
TRequestMetaCreator,
TSuccessMetaCreator,
TFailureMetaCreator,
TFulfillMetaCreator
>(
typePrefix: string,
payloadCreator: {
TRIGGER?: TTriggerPayloadCreator,
trigger?: TTriggerPayloadCreator,
REQUEST?: TRequestPayloadCreator,
request?: TRequestPayloadCreator,
SUCCESS?: TSuccessPayloadCreator,
success?: TSuccessPayloadCreator,
FAILURE?: TFailurePayloadCreator,
failure?: TFailurePayloadCreator,
FULFILL?: TFulfillPayloadCreator,
fulfill?: TFulfillPayloadCreator
},
metaCreator: {
TRIGGER?: TTriggerMetaCreator,
trigger?: TTriggerMetaCreator,
REQUEST?: TRequestMetaCreator,
request?: TRequestMetaCreator,
SUCCESS?: TSuccessMetaCreator,
success?: TSuccessMetaCreator,
FAILURE?: TFailureMetaCreator,
failure?: TFailureMetaCreator,
FULFILL?: TFulfillMetaCreator,
fulfill?: TFulfillMetaCreator
}
): Routine<
ResolveActionCreatorByPayloadMeta<TTriggerPayloadCreator, TTriggerMetaCreator>,
ResolveActionCreatorByPayloadMeta<TRequestPayloadCreator, TRequestMetaCreator>,
ResolveActionCreatorByPayloadMeta<TSuccessPayloadCreator, TSuccessMetaCreator>,
ResolveActionCreatorByPayloadMeta<TFailurePayloadCreator, TFailureMetaCreator>,
ResolveActionCreatorByPayloadMeta<TFulfillPayloadCreator, TFulfillMetaCreator>
>;

5

redux-saga-routines/package.json
{
"name": "@types/redux-saga-routines",
"version": "3.0.0",
"version": "3.1.0",
"description": "TypeScript definitions for redux-saga-routines",

@@ -22,2 +22,3 @@ "license": "MIT",

"dependencies": {
"@types/prop-types": "*",
"@types/redux-actions": "*",

@@ -27,4 +28,4 @@ "@types/redux-form": "*",

},
"typesPublisherContentHash": "212eb47b53c3a74e44ce8f1052863360cbd385063a98f708a229a8c2332b3a3e",
"typesPublisherContentHash": "4078fc8e2e4743b8fdbdb79ecef9cde6d4a894ee1bb361440b9cde5579dfbddf",
"typeScriptVersion": "3.0"
}

@@ -11,4 +11,4 @@ # Installation

Additional Details
* Last updated: Tue, 16 Apr 2019 00:00:35 GMT
* Dependencies: @types/redux, @types/redux-actions, @types/redux-form
* Last updated: Wed, 17 Apr 2019 22:20:05 GMT
* Dependencies: @types/redux, @types/redux-actions, @types/redux-form, @types/prop-types
* Global values: none

@@ -15,0 +15,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc