1.6.6 • Published 6 months ago

@types/react-hooks-helper v1.6.6

Weekly downloads
722
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/react-hooks-helper

Summary

This package contains type definitions for react-hooks-helper (https://github.com/revelcw/react-hooks-helper#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-hooks-helper.

index.d.ts

// Type definitions for react-hooks-helper 1.6
// Project: https://github.com/revelcw/react-hooks-helper#readme
// Definitions by: Joao Edmundo <https://github.com/jedmundo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8

/// <reference types="react"/>

export as namespace ReactHooksHelper;

export interface NavigationProps {
    next: () => void;
    previous?: (() => void) | undefined;
    go?: ((step: number | string) => void) | undefined;
    play?: (() => void) | undefined;
    pause?: (() => void) | undefined;
}

export interface Step {
    id: string;
}

export interface UseStepParams {
    initialStep?: number | undefined;
    autoAdvanceDuration?: number | undefined;
    steps: Step[] | number;
}

export interface UseStepResponse {
    autoAdvanceDuration: number;
    isPaused: boolean;
    index: number;
    step: Step | number;
    navigation: NavigationProps;
}

export function useStep(params: UseStepParams): UseStepResponse;

export interface FormTarget {
    target: {
        name: string; // object property name or Dot separated when hierarchical
        value: any;
        type?: string | undefined;
        checked?: boolean | undefined;
    };
}

export type SetForm = (
    event: React.SyntheticEvent<HTMLInputElement> | React.ChangeEvent<HTMLInputElement> | FormTarget,
) => void;

export function useForm<T>(defaultFormConfig: T): [T, SetForm];

Additional Details

  • Last updated: Thu, 08 Jul 2021 20:20:47 GMT
  • Dependencies: @types/react
  • Global values: ReactHooksHelper

Credits

These definitions were written by Joao Edmundo.

1.6.6

6 months ago

1.6.5

7 months ago

1.6.4

3 years ago

1.6.3

3 years ago

1.6.2

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago