Class BasePlugin<Signature>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

  • Signature = unknown

Hierarchy

Implements

Constructors

Properties

[___Signature__]: Signature

(secret)

Because classes are kind of like interfaces, we need "something" to help TS know what a Resource is.

This isn't a real API, but does help with type inference with the SignatureFrom utility above

meta?: {
    column?: Constructor<ColumnMetaFor<Signature>, any[]>;
    row?: Constructor<RowMetaFor<Signature>, any[]>;
    table?: Constructor<TableMetaFor<Signature>, 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

  • Optional column?: Constructor<ColumnMetaFor<Signature>, any[]>
  • Optional row?: Constructor<RowMetaFor<Signature>, any[]>
  • Optional table?: Constructor<TableMetaFor<Signature>, 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[]

Methods

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

    Type Parameters

    Parameters

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

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

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

    Type Parameters

    Parameters

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

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

Generated using TypeDoc