@procore/core-react
Version:
React library of Procore Design Guidelines
11 lines (10 loc) • 684 B
TypeScript
import React from 'react';
declare type ConditionalCloseFunction<onClose extends undefined | ((...args: any[]) => any)> = onClose extends (...args: any[]) => any ? onClose : undefined;
interface UseCloseWithConfirmState {
closeWithConfirm: <onClose extends undefined | ((...args: any[]) => any)>(func: onClose) => ConditionalCloseFunction<onClose>;
setFormIsDifferent: React.Dispatch<React.SetStateAction<boolean>>;
}
export declare const useCloseWithConfirmState: () => UseCloseWithConfirmState;
export declare const CloseWithConfirmContext: React.Context<UseCloseWithConfirmState>;
export declare const useCloseWithConfirmContext: () => UseCloseWithConfirmState;
export {};