mirror of
https://github.com/getredash/redash.git
synced 2026-03-22 19:00:09 -04:00
* Set corejs version in .babelrc so Jest doesn't complain. * Rewrite services/routes in TypeScript. * Add TypeScript definitions for DialogComponent. * Make image paths more portable * Add current route context and hook. * Make EmptyState more flexible by being able to pass in getSteps function. * Rewrite ItemsList in TypeScript. * Introduce the possibility to add custom sorters for a column. * Rearrange props to be friendly to TypeScript. * Type definitions for NotificationApi. * Use Databricks query editor components for databricks_internal type of query runner. * URL Escape password in Alembic configuration. * Compare types in migrations.
31 lines
881 B
TypeScript
31 lines
881 B
TypeScript
import { ModalProps } from "antd/lib/modal/Modal";
|
|
|
|
export interface DialogProps<ROk, RCancel> {
|
|
props: ModalProps;
|
|
close: (result: ROk) => void;
|
|
dismiss: (result: RCancel) => void;
|
|
}
|
|
|
|
export type DialogWrapperChildProps<ROk, RCancel> = {
|
|
dialog: DialogProps<ROk, RCancel>;
|
|
};
|
|
|
|
export type DialogComponentType<ROk = void, P = {}, RCancel = void> = React.ComponentType<
|
|
DialogWrapperChildProps<ROk, RCancel> & P
|
|
>;
|
|
|
|
export function wrap<ROk = void, P = {}, RCancel = void>(
|
|
DialogComponent: DialogComponentType<ROk, P, RCancel>
|
|
): {
|
|
Component: DialogComponentType<ROk, P, RCancel>;
|
|
showModal: (
|
|
props?: P
|
|
) => {
|
|
update: (props: P) => void;
|
|
onClose: (handler: (result: ROk) => Promise<void>) => void;
|
|
onDismiss: (handler: (result: RCancel) => Promise<void>) => void;
|
|
close: (result: ROk) => void;
|
|
dismiss: (result: RCancel) => void;
|
|
};
|
|
};
|