DefinitelyTyped/types/datatables.net-rowgroup/index.d.ts
Nathan Shively-Sanders f0ce987bc1 Update project urls to match NPM url
Note that this *trivially* updates project urls by adding the NPM url to
the end, even when the urls are almost identical or the DT one is
outdated. I'll clean up the urls in a later commit.

This PR is unfinished! Please do not merge it yet.
2019-02-11 17:10:55 -08:00

89 lines
2.0 KiB
TypeScript

// Type definitions for datatables.net-rowgroup 1.0
// Project: https://datatables.net/extensions/rowgroup/, https://datatables.net
// Definitions by: Matthieu Tabuteau <https://github.com/maixiu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
/// <reference types="jquery" />
/// <reference types="datatables.net"/>
declare namespace DataTables {
interface Settings {
/**
* RowGroup extension options
*/
rowGroup?: boolean | RowGroupSettings;
}
interface StaticFunctions {
RowGroup: RowGroupStaticFunctions;
}
interface RowGroupStaticFunctions {
new (dt: Api, settings: boolean | RowGroupSettings): undefined;
version: string;
defaults: RowGroupSettings;
}
interface Api {
rowGroup(): RowGroupApi;
}
interface RowGroupApi {
/**
* Get the data source for the row grouping
*/
dataSrc(): number|string;
/**
* Set the data source for the row grouping
*/
dataSrc(prop: number|string): Api;
/**
* Disable RowGroup's interaction with the table
*/
disable(): Api;
/**
* Enable or disable RowGroup's interaction with the table
*/
enable(enable?: boolean): Api;
}
/**
* RowGroup extension options
*/
interface RowGroupSettings {
/**
* Set the class name to be used for the grouping rows
*/
className?: string;
/**
* Set the data point to use as the grouping data source
*/
dataSrc?: number|string;
/**
* Provides the ability to disable row grouping at initialisation
*/
enable?: boolean;
/**
* Set the class name to be used for the grouping end rows
*/
endClassName?: string;
/**
* Provide a function that can be used to control the data shown in the end grouping row
*/
endRender?: (rows: Api, group: string) => string|HTMLElement|JQuery;
/**
* Provide a function that can be used to control the data shown in the start grouping row
*/
startRender?: (rows: Api, group: string) => string|HTMLElement|JQuery;
}
}