19 lines
514 B
TypeScript
19 lines
514 B
TypeScript
import { AppError, Result } from '../utils/result';
|
|
import { WidgetDataLoaderInterface } from './widget-data-loader-interface';
|
|
|
|
/**
|
|
* - WP - widget params
|
|
* - DLP - dataloader params
|
|
* - DBP - dashboard params
|
|
* - DLR - dataloader result
|
|
* - R - result
|
|
*/
|
|
export interface WidgetInterface<WP, DLP, DBP, DLR, R> {
|
|
dataLoader: WidgetDataLoaderInterface<DLP, DBP, DLR>;
|
|
type: string;
|
|
render(
|
|
widgetParams: WP,
|
|
dataLoaderParams: DLP,
|
|
dashboardParams: DBP,
|
|
): Promise<Result<R, AppError>>;
|
|
}
|