Skip to content

Commit

Permalink
7529b98e099d9d37cfc668b1306e562cca18734d Types: new constructor (ra…
Browse files Browse the repository at this point in the history
…rely used) returns an instance not void

Types: Fix for `noImplicit` any where a few parameters did not have types defined

b37a0cbaf05c35ba491d7d00cc9c6924e7ee706a Docs: Update for DataTable global object

Sync to source repo @b37a0cbaf05c35ba491d7d00cc9c6924e7ee706a
  • Loading branch information
dtbuild committed Feb 14, 2024
1 parent ef0bda8 commit e56ab0b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
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/Responsive",
"last-tag": "2.5.0",
"last-sync": "77f42bbabe7614914b32a2f3861acc3ade20b735"
"last-sync": "b37a0cbaf05c35ba491d7d00cc9c6924e7ee706a"
}
16 changes: 8 additions & 8 deletions types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

/// <reference types="jquery" />

import DataTables, {Api} from 'datatables.net';
import DataTables, {Api, ApiRow} from 'datatables.net';

export default DataTables;

Expand Down Expand Up @@ -38,14 +38,14 @@ declare module 'datatables.net' {
responsive: ApiResponsiveMethods<T>;
}

interface ApiColumnMethods {
interface ApiColumnMethods<T> {
/**
* Get the responsive visibility state of a column in the table
*/
responsiveHidden(): boolean;
}

interface ApiColumnsMethods {
interface ApiColumnsMethods<T> {
/**
* Get the responsive visibility state of columns in the table
*/
Expand All @@ -60,7 +60,7 @@ declare module 'datatables.net' {
/**
* Create a new Responsive instance for the target DataTable
*/
new (dt: Api<any>, settings: boolean | ConfigResponsive): void;
new (dt: Api<any>, settings: boolean | ConfigResponsive): DataTablesStatic['Responsive'];

/**
* Default configuration values
Expand Down Expand Up @@ -132,7 +132,7 @@ interface ApiResponsiveMethods<T> extends Api<T> {
* @param li The li node (or a jQuery collection containing the node) to get the cell index for.
* @returns Cell object that contains the properties row and column. This object can be used as a DataTables cell-selector.
*/
index(li): object;
index(li: HTMLElement): object;

/**
* Recalculate the column breakpoints based on the class information of the column header cells
Expand All @@ -159,17 +159,17 @@ interface ConfigResponsiveDetails {
* @param render The data to be shown - this is given as a function so it will be executed only when required (i.e. there is no point in gather data to display if the display function is simply going to hide it). The string returned by this function is that given by the responsive.details.renderer function. It accepts no input parameters.
* @returns boolean true if the display function has shown the hidden data, false
*/
display?(row, update, render): boolean;
display?(row: ApiRow<any>, update: boolean, render: () => string): boolean;

/**
* Define the renderer used to display the child rows.
*
* @param api DataTables API instance for the table in question
* @param rowIdx Row index for the row that the renderer is being asked to render. Use the row() and / or cells() methods to get information from the API about the row so the information can be rendered.
* @param columns Since 2.0.0: An array of objects containing information about each column in the DataTable. The array length is exactly equal to the number of columns in the DataTable, with each column represented by a DataTable in index order. Additionally, the structure of each object in the array is:
* @param columns Since 2.0.0: An array of objects containing information about each column in the DataTable. The array length is exactly equal to the number of columns in the DataTable, with each column represented by a DataTable in index order.
* @returns boolean | string `false` - Do not display a child row. Or a string - The information to be shown in the details display, including any required HTML.
*/
renderer?(api, rowIdx, columns): Node | false;
renderer?(api: Api, rowIdx: number, columns: ResponsiveColumn): Node | false;

/**
* As a number it is a column index to the show / hide control should be attached. This can be >=0 to count columns from the left, or <0 to count from the right.
Expand Down

0 comments on commit e56ab0b

Please sign in to comment.