import { FararuIconComponentInterface } from '../design-systems/components/atoms/fararu-icon/fararu-icon.component'; import { ButtonColors } from '../enums/button-colors'; import { ButtonVarients } from '../enums/button-varients'; import { ButtonVariantType } from '../types/button-variant.type'; import { ButtonColorType } from '../types/button-color.type'; import { IconInterface } from './icon-interface'; import { Observable, Subject } from 'rxjs'; export type MapFunction = 'switch' | 'merge' | 'concat' | 'exhaust' | 'disabled'; export interface ClickSubscription { subject: Subject; event?: Event; selectedRow?: any; } export interface GeneralActionInterface { id?: string; text?: string; tooltip?: string; icon?: IconInterface; fararuIcon?: FararuIconComponentInterface; click?: (event: Event, args?: any) => void | Promise | Observable; items?: GeneralActionInterface[]; isDanger?: boolean; nodeAccessId?: string; actionId?: string; onSuccess?: (response: any) => void; onFailure?: (response: any) => void; mapFunction?: MapFunction; disabled?: boolean; isSelected?: boolean; type?: 'group' | 'view' | 'approve' | 'disapprove' | 'item' | 'note' | 'attachment' | 'delete'; } export interface GeneralIconActionInterface { icon: { type?: string; group?: string; name?: string; color?: ButtonColors; fararuIcon?: FararuIconComponentInterface; }; title?: string; callback: (event: Event, args?: any) => void; } export interface GeneralActionButtonInterface extends GeneralActionInterface { varient?: ButtonVariantType | ButtonVarients; color?: ButtonColorType | ButtonColors; for?: string; shortcut?: string; idAttr?: string; formAttr?: string; }