@twilio/flex-ui
Version:
Twilio Flex UI
40 lines (39 loc) • 2.01 kB
TypeScript
import { ITask } from "../../../models";
/**
* Properties of TaskCardList.
*
* @typedef Supervisor․TaskCardListProps
* @memberof Supervisor․TaskCardList
* @property {Array<ITask>} tasks - List of tasks.
* @property {DynamicContentStore.DynamicComponentChildren<TaskCardList.TaskCardListChildrenProps>} [children] - children
*/
export interface TaskCardListProps {
compareFunction?: (a: ITask, b: ITask) => number;
filter?: (task: ITask) => boolean;
onCardSelected?: (task: ITask) => void;
selectedTaskSid?: string;
highlightedTaskSid?: string;
tasks: Array<ITask>;
}
/**
* Props passed to children of TaskCardList.
*
* @typedef Supervisor․TaskCardListChildrenProps
* @memberof Supervisor․TaskCardList
* @property {Function} [compareFunction] - A compare function that receives two tasks as arguments. Negative number means task a should be above task b, positive number that a should be below b. 0 indicates equal priority.
* @property {Function} [filter] - Filter function used to filter tasks for this list.
* @property {Function} [onCardSelected] - A function to call with ITask in order to select the task.
* @property {string} [selectedTaskSid] - Sid of the selected task.
* @property {string} [highlightedTaskSid] - Sid of the highlighted task.
* @property {Array<ITask>} tasks - Unfiltered tasks in the list.
* @property {DynamicContentStore.DynamicComponentChildren<TaskCardList.TaskCardListProps>} [children] - children
*/
export type TaskCardListChildrenProps = TaskCardListProps;
/**
* Programmable properties of TaskCardList.
*
* @typedef Supervisor․TaskCardListProgrammableProps
* @memberof Supervisor․TaskCardList
* @property {Function} [compareFunction] - A compare function that receives two tasks as arguments. Negative number means task a should be above task b, positive number that a should be below b. 0 indicates equal priority.
*/
export type TaskCardListProgrammableProps = Partial<Pick<TaskCardListProps, "compareFunction">>;