@kiwicom/orbit-components
Version:
Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.
46 lines (37 loc) • 1.22 kB
TypeScript
// Type definitions for @kiwicom/orbit-components
// Project: http://github.com/kiwicom/orbit
import * as React from "react";
import * as Common from "../common/common";
type Placement =
| "top-left"
| "top-center"
| "top-right"
| "bottom-left"
| "bottom-center"
| "bottom-right";
interface Props extends Common.Global {
readonly topOffset?: number;
readonly leftOffset?: number;
readonly rightOffset?: number;
readonly bottomOffset?: number;
readonly gutter?: number;
readonly dismissTimeout?: number;
readonly placement?: Placement;
}
interface Options {
readonly icon?: React.ReactElement<unknown>;
readonly loading?: React.ReactNode;
readonly success?: string | ((data: unknown) => string);
readonly error?: string | ((err: unknown) => string);
}
declare const ToastRoot: React.FunctionComponent<Props>;
declare function createToast(
message: React.ReactNode,
options?: { readonly icon?: React.ReactElement<unknown> },
): void;
declare function createToastPromise(
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
promise: Promise<unknown>,
options?: Options,
): Promise<void>;
export { ToastRoot, createToast, createToastPromise };