UNPKG

@spaced-out/ui-design-system

Version:
42 lines (33 loc) 791 B
// @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;