npm.io
1.3.4 • Published 2 years ago

@types/muibox

Licence
MIT
Version
1.3.4
Deps
1
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

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 0939 GMT
  • Dependencies: @types/react

Credits

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