0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

View file

@ -0,0 +1,5 @@
import { Default } from './constant';
/**
* Used to collapse toast after exit animation
*/
export declare function collapseToast(node: HTMLElement, done: () => void, duration?: Default): void;

View file

@ -0,0 +1,20 @@
import { ToastPosition, TypeOptions } from '../types';
declare type KeyOfPosition = 'TOP_LEFT' | 'TOP_RIGHT' | 'TOP_CENTER' | 'BOTTOM_LEFT' | 'BOTTOM_RIGHT' | 'BOTTOM_CENTER';
declare type KeyOfType = 'INFO' | 'SUCCESS' | 'WARNING' | 'ERROR' | 'DEFAULT' | 'DARK';
export declare const POSITION: {
[key in KeyOfPosition]: ToastPosition;
};
export declare const TYPE: {
[key in KeyOfType]: TypeOptions;
};
export declare const enum Default {
COLLAPSE_DURATION = 300,
DEBOUNCE_DURATION = 50,
CSS_NAMESPACE = "Toastify",
DRAGGABLE_PERCENT = 80
}
export declare const enum Direction {
X = "x",
Y = "y"
}
export {};

View file

@ -0,0 +1,42 @@
import { ToastTransitionProps } from '../types';
export interface CSSTransitionProps {
/**
* Css class to apply when toast enter
*/
enter: string;
/**
* Css class to apply when toast leave
*/
exit: string;
/**
* Append current toast position to the classname.
* If multiple classes are provided, only the last one will get the position
* For instance `myclass--top-center`...
* `Default: false`
*/
appendPosition?: boolean;
/**
* Collapse toast smoothly when exit animation end
* `Default: true`
*/
collapse?: boolean;
/**
* Collapse transition duration
* `Default: 300`
*/
collapseDuration?: number;
}
/**
* Css animation that just work.
* You could use animate.css for instance
*
*
* ```
* cssTransition({
* enter: "animate__animated animate__bounceIn",
* exit: "animate__animated animate__bounceOut"
* })
* ```
*
*/
export declare function cssTransition({ enter, exit, appendPosition, collapse, collapseDuration }: CSSTransitionProps): ({ children, position, preventExitTransition, done, nodeRef, isIn }: ToastTransitionProps) => JSX.Element;

View file

@ -0,0 +1,4 @@
export * from './propValidator';
export * from './constant';
export * from './cssTransition';
export * from './collapseToast';

View file

@ -0,0 +1,10 @@
import { Id } from '../types';
export declare function isNum(v: any): v is Number;
export declare function isBool(v: any): v is Boolean;
export declare function isStr(v: any): v is String;
export declare function isFn(v: any): v is Function;
export declare function parseClassName(v: any): any;
export declare function isToastIdValid(toastId?: Id): string | number | true | undefined;
export declare function getAutoCloseDelay(toastAutoClose?: false | number, containerAutoClose?: false | number): number | false | undefined;
export declare const canUseDom: boolean;
export declare function canBeRendered<T>(content: T): boolean;