@spaced-out/ui-design-system
Version:
Sense UI components library
42 lines (33 loc) • 791 B
Flow
// @flow strict
import * as React from 'react';
export const POSITIONS = {
TOP_CENTER: 'topCenter',
TOP_LEFT: 'topLeft',
TOP_RIGHT: 'topRight',
BOTTOM_LEFT: 'bottomLeft',
BOTTOM_RIGHT: 'bottomRight',
BOTTOM_CENTER: 'bottomCenter',
};
export const ACTIONS = {
ADD: 'ADD',
REMOVE: 'REMOVE',
};
export type positionTypes = $Values<typeof POSITIONS>;
export type actionTypes = $Values<typeof ACTIONS>;
export type contentTypes = React.Node;
export type ToastOptions = {
timeout?: number,
position?: positionTypes,
autoClose?: boolean,
uniqueCode?: string | number,
};
export type optionTypes = {
...ToastOptions,
id: string,
key?: string,
};
export type callbackFuncTypes = (
type: actionTypes,
content: contentTypes,
options: optionTypes,
) => void;