@excentone/spfx-react
Version:
Contains custom ReactJs components and hooks intended to use when developing SharePoint Framework (SPFx) Web components.
18 lines (17 loc) • 815 B
TypeScript
import { Dispatch } from "react";
import { IMessageBarProps } from "@fluentui/react";
import { ActionWithoutArgs } from "@excentone/spfx-utilities";
export declare type MessageBarType = 'info' | 'error' | 'blocked' | 'severeWarning' | 'success' | 'warning';
export interface IMessageBarArgs extends Pick<IMessageBarProps, 'actions' | 'role' | 'onDismiss' | 'truncated'> {
title?: string;
dismissAfter?: number;
message: string | JSX.Element;
}
export interface IShowMessageBarArgs extends IMessageBarArgs {
type: MessageBarType;
}
export interface IMessageBarHookOperations extends Record<MessageBarType, Dispatch<IMessageBarArgs>> {
hide: ActionWithoutArgs;
show: Dispatch<IShowMessageBarArgs>;
}
export declare type MessageBarHook = readonly [IMessageBarProps, IMessageBarHookOperations];