@types/muibox
TypeScript icon, indicating that this package has built-in type declarations

1.3.4 • Public • Published

Installation

npm install --save @types/muibox

Summary

This package contains type definitions for muibox (https://github.com/chunkai1312/muibox).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/muibox.

index.d.ts

import { ReactNode } from "react";

export function DialogProvider(_: any): any;
export function useDialog(): Dialog;
export function withDialog(): (WrappedComponent: any) => (props: any) => any;

export interface Dialog {
    alert(options: AlertOptions | string): Promise<void>;
    confirm(options: ConfirmOptions | string): Promise<void>;
    prompt(options: PromptOptions | string): Promise<string>;
}

export interface DialogButtonOptions {
    text?: string | undefined;
    color?: string | undefined;
    variant?: string | undefined;
    startIcon?: ReactNode | undefined;
    endIcon?: ReactNode | undefined;
}

export interface AlertOptions {
    title?: string | undefined;
    message?: string | ReactNode | undefined;
    ok?: DialogButtonOptions | undefined;
}

export interface ConfirmOptions extends AlertOptions {
    cancel?: DialogButtonOptions | undefined;
}

export interface PromptOptions extends ConfirmOptions {
    required?: boolean | undefined;
    defaultValue?: string | number | undefined;
    placeholder?: string | undefined;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/react

Credits

These definitions were written by Diego Mijelshon, and David DIVERRES.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/muibox

Weekly Downloads

84

Version

1.3.4

License

MIT

Unpacked Size

4.91 kB

Total Files

5

Last publish

Collaborators

  • types