@wulperstudio/cms
Version:
Wulper Studio Library Components CMS
53 lines (52 loc) • 1.43 kB
TypeScript
import { ReactNode } from 'react';
import { EntryModel } from '../../components';
export interface BaseModel {
id: string;
}
export interface ItemModel<T> {
id: string;
label: string;
items: Array<T>;
total?: ReactNode;
EntryProps?: EntryModel;
}
export type DataModel<T> = Array<ItemModel<T>>;
export interface StateModel<T> {
columns: DataModel<T>;
columnTitles: string[];
}
export interface ValidateModel<T> {
source: string;
destination?: string;
item: string;
element?: T;
}
export interface BoardModel<T> {
boardItems: DataModel<T>;
children: (item: T) => ReactNode;
onCreateColumn?: (text: string) => void;
onCreateItem?: (text: string) => T;
onUpdateColumn?: (text: string, columnId: string) => void;
onDeleteColumn?: (columnId: string) => void;
onDropAccepted?: (data: ValidateModel<T>) => boolean;
showCreateColumns?: boolean;
showMenuColumn?: boolean;
variant?: 'float' | 'fixed' | 'transparent' | 'border';
positionCreateElement?: 'top' | 'bottom';
isDropDisabled?: boolean;
isDragDisabled?: boolean;
columnWidth?: string | number;
AddColumnProps: {
title: string;
placeholder: string;
};
AddCardProps: {
title: string;
placeholder: string;
};
menuColumnProps: {
textDelete: string;
textUpdate: string;
};
customColorBorder?: string;
}