@discoveryjs/discovery
Version:
Frontend framework for rapid data (JSON) analysis, shareable serverless reports and dashboards
37 lines (36 loc) • 1.35 kB
TypeScript
import type { ViewModel } from '../../main/view-model.js';
import type { Query } from '../../main/model.js';
import type { RenderContext, TooltipConfig } from '../../core/view.js';
export type ValueAnnotation = {
query: Query;
debug?: string | boolean;
};
export type ValueAnnotationContext = {
parent: ValueAnnotationContext | null;
host: any;
key: string | number;
index: number;
};
type RenderAnnotation = {
el: HTMLElement;
config: Partial<RenderAnnotationConfig>;
renderer: RenderContext;
data: unknown;
context: unknown;
};
type RenderAnnotationConfig = {
place: 'before' | 'after';
style: 'none' | 'badge' | 'default';
className: string;
text: any;
icon: string;
href: string;
external: boolean;
tooltip: TooltipConfig;
};
export declare function concatAnnotations(a: ValueAnnotation[] | false, b: ValueAnnotation[] | false): false | ValueAnnotation[];
export declare function preprocessAnnotations(annotations: unknown[]): false | ValueAnnotation[];
export declare function getDefaultAnnotations(host: ViewModel): false | ValueAnnotation[];
export declare function prepareAnnotations(viewAnnotations: unknown[], customAnnotations: ValueAnnotation[]): false | ValueAnnotation[];
export declare function renderAnnotations(annotations: RenderAnnotation[]): void;
export {};