npm.io
1.6.6 • Published 2 years ago

@types/react-hooks-helper

Licence
MIT
Version
1.6.6
Deps
1
Size
5 kB
Vulns
0
Weekly
0

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

/// <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: Tue, 07 Nov 2023 0939 GMT
  • Dependencies: @types/react

Credits

These definitions were written by Joao Edmundo.