import { Subject, Observable } from 'rxjs'; import { DateService } from '../services/date/date.service'; import { Column } from './models/Column'; export declare class NgxCalendarTableService { private dateService; _date: Subject; date$: Observable; constructor(dateService: DateService); /** * Build calendar table columns. * Create range of dates to generate columns. * * @param date {Date} Receive a date * @param columnsNumber {number} Number of columns to render + 1 * @param frequency {string} Can set days, month, year * @param format {string} You can choose the format based on momentjs * * @example buildColumns(new Date(), 4, 'month', 'MM/YYYY') * * @returns Array of Columns */ buildColumns(date: Date, columnsNumber: number, frequency: string, format: string): Column[]; /** * Generate range of columns * * @param range {date} Receives an array of dates * @param frequency {string} Can set days, month, year * @param format {string} You can choose the format based on momentjs * * @returns Array of Columns */ generateColumns(range: Date[], frequency: string, format: string): Column[]; /** * Return a column * * @param key {string} column identificator * @param date {date} column date parameter * @param header {string} header to show on template * @param frequency {string} Can set days, month, year * * @returns Instance of Column */ getColumn(key: string, date: Date, header: string, frequency?: string): Column; /** * Return column header * * @param date {date} date to format * @param format {string} You can choose the format based on momentjs * */ getColumnHeader(date: Date, format: string): string; /** * Return column key * It usually be a column identificator but it is not a requirement * * @param date {date} * @param frequency {string} Can set days, month, year */ getColumnKey(date: Date, frequency: string): string; /** * Manipulate rows to create identification for matching with columns * * @param rows {any} An array of objects * @param frequency {string} Can set days, month, year */ manipulateRows(rows: any[], frequency: string): void[]; /** * Generate an identificator property to row * * @param row {object} it usually be date and value like { '2018-04-14' : value } * @param key {string} key of object. ex: '2018-04-14' * @param frequency {string} Can set days, month, year */ private generateRowIdentificator(row, key, frequency); /** * Build column key structure * * @param key * @param value */ private buildColumnKey(key, value); /** * Push into row generated by columnKey * * @param rowKey * @param rowValue */ private pushIntoKeyRow(rowKey, rowValue); /** * Verify if there are value in the row and it is an populated array * * @param row * @param columnKey */ private hasRowKeyIdentificator(row, columnKey); }