1.1.3 • Published 1 year ago

@types/react-modal-view v1.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Installation

npm install --save @types/react-modal-view

Summary

This package contains type definitions for react-modal-view (https://github.com/StevenIseki/react-modal-view).

Details

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

index.d.ts

// Type definitions for react-modal-view 1.1
// Project: https://github.com/StevenIseki/react-modal-view
// Definitions by: Adam Thompson-Sharpe <https://github.com/MysteryBlokHed>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import { Component, ReactNode } from 'react';

export interface ModalProps {
    /** Modal contents */
    children?: ReactNode | undefined;
    /** Whether or not the modal should be visible */
    visible?: boolean | undefined;
    /** Whether or not the modal is closable */
    closable?: boolean | undefined;

    /** Called when the modal is shown */
    onShow?: (() => void) | undefined;
    /** Called when the modal is hidden */
    onHide?: (() => void) | undefined;
}

export default class Modal extends Component<ModalProps> {
    /**
     * Doesn't seem to be used anywhere.
     * Not actually assignable to ModalProps
     */
    static get defaultProps(): { type: 'notice'; message: null };

    handleBeforeComponentUpdate(props: ModalProps): void;

    handleComponentUpdate(prevProps: ModalProps, prevState: { visible: boolean }): void;

    handleCloseBtnClick(e: MouseEvent): void;

    handleOverlayClick(e: MouseEvent): void;

    toggleVisibility(): void;

    show(): void;

    hide(): void;
}

Additional Details

  • Last updated: Thu, 12 May 2022 18:31:40 GMT
  • Dependencies: @types/react
  • Global values: none

Credits

These definitions were written by Adam Thompson-Sharpe.