Skip to content

Commit

Permalink
add type for the method
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Nov 30, 2023
1 parent d6ce9fc commit d49a6e4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
13 changes: 13 additions & 0 deletions src/app/components/table/table.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,19 @@ export interface TableSelectAllChangeEvent {
*/
checked: boolean;
}
/**
* Custom CSV export options.
*/
export interface ExportCSVOptions {
/**
* Boolean value determining whether to export all selected values.
*/
selectionOnly?: boolean;
/**
* Boolean value determining whether to export all values.
*/
allValues?: boolean;
}
/**
* Defines valid templates in Table.
* @group Templates
Expand Down
5 changes: 3 additions & 2 deletions src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import { SortAmountDownIcon } from 'primeng/icons/sortamountdown';
import { SortAmountUpAltIcon } from 'primeng/icons/sortamountupalt';
import { SpinnerIcon } from 'primeng/icons/spinner';
import {
ExportCSVOptions,
TableColResizeEvent,
TableColumnReorderEvent,
TableContextMenuSelectEvent,
Expand Down Expand Up @@ -2243,10 +2244,10 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable
}
/**
* Data export method.
* @param {Object} object - Export options.
* @param {ExportCSVOptions} object - Export options.
* @group Method
*/
public exportCSV(options?: any) {
public exportCSV(options?: ExportCSVOptions) {
let data;
let csv = '';
let columns = this.columns;
Expand Down

0 comments on commit d49a6e4

Please sign in to comment.