import { JSXElement } from 'solid-js';
import { Tag } from '@malloydata/malloy-tag';
import { Field, NestField, NestCell, FieldType, Cell } from '../data_tree';
import { RenderMetadata, GetResultMetadataOptions } from '../component/render-result-metadata';
import { JSONSchemaObject } from './json-schema-types';
export interface RenderProps {
    dataColumn: Cell;
    field: Field;
    customProps?: Record<string, unknown>;
}
export interface RendererValidationSpec {
    readonly renderer: string;
    readonly ownedPaths?: string[][];
    readonly childOwnedPaths?: string[][];
}
interface BaseRenderPluginInstance<TMetadata = unknown> {
    readonly name: string;
    readonly field: Field;
    readonly sizingStrategy: 'fixed' | 'fill';
    getMetadata(): TMetadata;
    processData?(field: NestField, cell: NestCell): void;
    beforeRender?(metadata: RenderMetadata, options: GetResultMetadataOptions): void;
    getStyleOverrides?(): Record<string, string>;
}
export interface SolidJSRenderPluginInstance<TMetadata = unknown> extends BaseRenderPluginInstance<TMetadata> {
    readonly renderMode: 'solidjs';
    renderComponent(props: RenderProps): JSXElement;
}
export interface DOMRenderPluginInstance<TMetadata = unknown> extends BaseRenderPluginInstance<TMetadata> {
    readonly renderMode: 'dom';
    renderToDOM(container: HTMLElement, props: RenderProps): void;
    cleanup?(container: HTMLElement): void;
}
export type RenderPluginInstance<TMetadata = unknown> = SolidJSRenderPluginInstance<TMetadata> | DOMRenderPluginInstance<TMetadata>;
export interface CoreVizPluginMethods {
    getSchema(): JSONSchemaObject;
    getSettings(): Record<string, unknown>;
    getDefaultSettings(): Record<string, unknown>;
    settingsToTag(settings: Record<string, unknown>): Tag;
}
export type CoreVizPluginInstance<TMetadata = unknown> = SolidJSRenderPluginInstance<TMetadata> & CoreVizPluginMethods;
export interface RenderPluginFactory<TInstance extends RenderPluginInstance = RenderPluginInstance> {
    readonly name: string;
    /**
     * IMPORTANT: Declare the tags this renderer OWNS, not every tag it might
     * ever read.
     *
     * Own a tag here if this renderer is the authority for its meaning:
     * - the tag is only meaningful when this renderer is active
     * - this renderer is responsible for validating it
     * - this renderer should suppress "unknown render tag" warnings for it
     *
     * This applies to:
     * - tags on the renderer field itself
     * - context-sensitive tags on child fields
     *
     * Do NOT declare globally meaningful field tags just because this renderer
     * happens to read them during implementation. Examples: `label`, `hidden`,
     * `description`, `column`.
     *
     * Rule:
     * - if the tag would be meaningless without this renderer, declare it here
     * - if the tag is meaningful independently of this renderer, do not
     *
     * Think in terms of semantic ownership, not literal runtime reads.
     */
    getValidationSpec?(): RendererValidationSpec;
    matches(field: Field, fieldTag: Tag, fieldType: FieldType): boolean;
    create(field: Field, pluginOptions?: unknown, modelTag?: Tag): TInstance;
}
export declare function isCoreVizPluginInstance(plugin: RenderPluginInstance): plugin is CoreVizPluginInstance;
export {};
