1 | import { BaseComponent, BaseProps } from './view/base';
|
2 | import { Component, ComponentProps } from 'preact';
|
3 | export interface PluginBaseProps<T extends PluginBaseComponentCtor> {
|
4 | plugin: Plugin<T>;
|
5 | }
|
6 | export declare abstract class PluginBaseComponent<P extends PluginBaseProps<any> = any, S = unknown> extends BaseComponent<P, S> {
|
7 | }
|
8 | export interface PluginBaseComponentCtor<P extends PluginBaseProps<any> = any, S = unknown> {
|
9 | new (props: P, context?: any): Component<P, S>;
|
10 | }
|
11 | export declare enum PluginPosition {
|
12 | Header = 0,
|
13 | Footer = 1,
|
14 | Cell = 2
|
15 | }
|
16 | export interface Plugin<T extends PluginBaseComponentCtor> {
|
17 | id: string;
|
18 | position: PluginPosition;
|
19 | component: T;
|
20 | props?: Partial<ComponentProps<T>>;
|
21 | order?: number;
|
22 | }
|
23 | export declare class PluginManager {
|
24 | private readonly plugins;
|
25 | constructor();
|
26 | get<T extends PluginBaseComponentCtor>(id: string): Plugin<T> | null;
|
27 | add<T extends PluginBaseComponentCtor>(plugin: Plugin<T>): this;
|
28 | remove(id: string): this;
|
29 | list<T extends PluginBaseComponentCtor>(position?: PluginPosition): Plugin<T>[];
|
30 | }
|
31 | export interface PluginRendererProps extends BaseProps {
|
32 | props?: any;
|
33 | pluginId?: string;
|
34 | position?: PluginPosition;
|
35 | }
|
36 | export declare class PluginRenderer extends BaseComponent<PluginRendererProps> {
|
37 | render(): import("preact").VNode<any>;
|
38 | }
|