@@ -311,82 +311,4 @@ if (table.pagination) {
311311
312312// Access the current page of rows
313313const currentPageRows = table .rows ;
314- ```
315-
316- ## Plugin Types
317-
318- ### TablePlugin
319-
320- Core interface for implementing plugins:
321-
322- ``` ts
323- interface TablePlugin <T , TPluginState , TPluginId extends string = string > {
324- readonly id: TPluginId ;
325- init(getRows : () => Row <T >[], getColumns : () => Column <T >[]): PluginOutput <T , TPluginState >;
326- }
327- ```
328-
329- | Type Parameter | Description |
330- | -------------- | ------------------------------------ |
331- | ` T ` | Type of data items in the table |
332- | ` TPluginState ` | Type of state managed by this plugin |
333- | ` TPluginId ` | String literal type for plugin ID |
334-
335- #### Properties
336-
337- | Name | Type | Description |
338- | ---- | ----------- | -------------------------------- |
339- | ` id ` | ` TPluginId ` | Unique identifier for the plugin |
340-
341- #### Methods
342-
343- | Name | Parameters | Return Type | Description |
344- | ------ | ------------------------------------------------------------ | ------------------------------- | ---------------------------------------------------------- |
345- | ` init ` | ` getRows: () => Row<T>[] ` <br >` getColumns: () => Column<T>[] ` | ` PluginOutput<T, TPluginState> ` | Initialize plugin and return its state and transformations |
346-
347- ### PluginOutput
348-
349- Interface defining plugin initialization output:
350-
351- ``` ts
352- interface PluginOutput <T , TPluginState = unknown > {
353- state: TPluginState ;
354- rows: Row <T >[];
355- columns: Column <T >[];
356- }
357- ```
358-
359- | Property | Type | Description |
360- | --------- | -------------- | ------------------------------------------------------------ |
361- | ` state ` | ` TPluginState ` | Plugin state that will be accessible via ` table.plugins[id] ` |
362- | ` rows ` | ` Row<T>[] ` | Transformed rows that will be used for rendering |
363- | ` columns ` | ` Column<T>[] ` | Transformed columns that will be used for rendering |
364-
365- ### ReactiveTableWithPlugins
366-
367- Type definition for a table instance with plugins:
368-
369- ``` ts
370- type ReactiveTableWithPlugins <
371- T ,
372- TPluginsMap extends Record <string , unknown > = EmptyPluginsMap
373- > = ReactiveTable <T > & {
374- plugins: TPluginsMap ;
375- use<TPluginId extends string , TPluginState >(
376- plugin : TablePlugin <T , TPluginState , TPluginId >
377- ): ReactiveTableWithPlugins <T , TPluginsMap & Record <TPluginId , TPluginState >>;
378- };
379- ```
380-
381- | Property | Type | Description |
382- | --------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
383- | ` plugins ` | ` TPluginsMap ` | Registry of installed plugins and their state |
384- | ` use ` | ` <TPluginId, TPluginState>(plugin: TablePlugin<T, TPluginState, TPluginId>) => ReactiveTableWithPlugins ` | Install a new plugin and return updated table instance |
385-
386- ### EmptyPluginsMap
387-
388- Type representing an empty plugin registry:
389-
390- ``` ts
391- type EmptyPluginsMap = Record <string , never >;
392- ```
314+ ```
0 commit comments