Class BasePlugin<ColumnMeta, TableMeta, Options, ColumnOptions>Abstract

If your table plugin is a class, you may extend from BasePlugin, which provides small utility methods and properties for getting the metadata for your plugin for the table and each column

One instance of a plugin exists per table

Type Parameters

  • ColumnMeta = unknown

  • TableMeta = unknown

  • Options = unknown

  • ColumnOptions = unknown

Hierarchy

Implements

  • Plugin<ColumnMeta, TableMeta>

Constructors

Properties

meta: {
    column: Constructor<ColumnMeta, any[]>;
    table: Constructor<TableMeta, any[]>;
}

Optional state that this plugin may or may not choose to use

columns will each have an instance of meta.column. the table will have only one instance of meta.table.

Type declaration

  • column: Constructor<ColumnMeta, any[]>
  • table: Constructor<TableMeta, any[]>
name: string

Unique name for the plugin.

  • only one plugin of the same name is allowed
  • the name is used for storing preferences / serializable information
table: Table<unknown>
features?: string[]
requires?: string[]

Accessors

Methods

  • Utility to get the meta / state for this plugin for a given column

    Parameters

    Returns InstanceOf<NonNullable<NonNullable<this["meta"]>["column"]>>

  • Utility to get the meta / state for this plugin for the table

    Returns InstanceOf<NonNullable<NonNullable<this["meta"]>["table"]>>

  • Helper for specifying column-level configurations for a plugin on headlessTable's columns option

    Type Parameters

    • T extends BasePlugin<unknown, unknown, unknown, unknown, T>

    Parameters

    • this: Constructor<T, any[]>
    • configFn: (() => ReturnType<InstanceOf<T>["getColumnOptions"]>)
        • (): ReturnType<InstanceOf<T>["getColumnOptions"]>
        • Returns ReturnType<InstanceOf<T>["getColumnOptions"]>

    Returns [Constructor<T, any[]>, (() => ReturnType<InstanceOf<T>["getColumnOptions"]>)]

  • Helper for specifying plugins on headlessTable with the plugin-level options

    Type Parameters

    • T extends BasePlugin<unknown, unknown, unknown, unknown, T>

    Parameters

    • this: Constructor<T, any[]>
    • configFn: (() => OptionsFor<T>)
        • (): OptionsFor<T>
        • Returns OptionsFor<T>

    Returns [Constructor<T, any[]>, (() => OptionsFor<T>)]

Generated using TypeDoc