Skip to content

Commit

Permalink
e880efbe6582516f7eece94926a5de6814e7729b Typescript: Add type defs fo…
Browse files Browse the repository at this point in the history
…r the buttons that Select provides for the Buttons extension.

Sync to source repo @e880efbe6582516f7eece94926a5de6814e7729b
  • Loading branch information
dtbuild committed Oct 28, 2024
1 parent aab96cb commit d037a7a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
2 changes: 1 addition & 1 deletion datatables.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
],
"src-repo": "http://github.com/DataTables/Select",
"last-tag": "2.1.0",
"last-sync": "89f0b6b19b61eb7b6107e9e4e06eb82d650a58f4"
"last-sync": "e880efbe6582516f7eece94926a5de6814e7729b"
}
47 changes: 47 additions & 0 deletions types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,53 @@ declare module 'datatables.net' {
*/
select(valueProp: string, nameProp: string): ObjectColumnRender;
}

interface Buttons {
/** Select all rows in the table */
selectAll: {
extend: 'selectAll';
selectorModifier?: ApiSelectorModifier;
}

/** Change selection type to cells. Shows as active when cell selection is enabled */
selectCells: {
extend: 'selectCells';
}

/** Change selection type to columns. Shows as active when cell selection is enabled */
selectColumns: {
extend: 'selectColumns';
}

/** Button which is enabled only when one or more rows are selected. Provide your own action function. */
selected: {
extend: 'selected';
limitTo?: string[];
}

/** Button which is enabled only when a single row is selected. Provide your own action function. */
selectedSingle: {
extend: 'selected';
}

/** Deselect all currently selected rows. */
selectNone: {
extend: 'selectNone';
}

/** Change selection type to rows. Shows as active when cell selection is enabled */
selectRows: {
extend: 'selectRows';
}

/**
* Toggle a filter that will reduce the rows displayed to just those which are selected. Uses
* its own action function - don't provide your own.
*/
showSelected: {
extend: 'showSelected';
}
}
}

interface ConfigSelect {
Expand Down

0 comments on commit d037a7a

Please sign in to comment.