Adds I-prefix to all interfaces
This commit is contained in:
parent
80aaab46f2
commit
8ec5f52872
44 changed files with 1731 additions and 1949 deletions
|
|
@ -8,13 +8,13 @@ export type CalendarView = ViewPeriod;
|
|||
|
||||
export type SyncStatus = 'synced' | 'pending' | 'error';
|
||||
|
||||
export interface RenderContext {
|
||||
export interface IRenderContext {
|
||||
container: HTMLElement;
|
||||
startDate: Date;
|
||||
endDate: Date;
|
||||
}
|
||||
|
||||
export interface CalendarEvent {
|
||||
export interface ICalendarEvent {
|
||||
id: string;
|
||||
title: string;
|
||||
start: Date;
|
||||
|
|
@ -55,13 +55,13 @@ export interface ICalendarConfig {
|
|||
maxEventDuration: number; // Minutes
|
||||
}
|
||||
|
||||
export interface EventLogEntry {
|
||||
export interface IEventLogEntry {
|
||||
type: string;
|
||||
detail: unknown;
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export interface ListenerEntry {
|
||||
export interface IListenerEntry {
|
||||
eventType: string;
|
||||
handler: EventListener;
|
||||
options?: AddEventListenerOptions;
|
||||
|
|
@ -72,6 +72,6 @@ export interface IEventBus {
|
|||
once(eventType: string, handler: EventListener): () => void;
|
||||
off(eventType: string, handler: EventListener): void;
|
||||
emit(eventType: string, detail?: unknown): boolean;
|
||||
getEventLog(eventType?: string): EventLogEntry[];
|
||||
getEventLog(eventType?: string): IEventLogEntry[];
|
||||
setDebug(enabled: boolean): void;
|
||||
}
|
||||
|
|
@ -2,46 +2,46 @@
|
|||
* Type definitions for drag and drop functionality
|
||||
*/
|
||||
|
||||
export interface MousePosition {
|
||||
export interface IMousePosition {
|
||||
x: number;
|
||||
y: number;
|
||||
clientX?: number;
|
||||
clientY?: number;
|
||||
}
|
||||
|
||||
export interface DragOffset {
|
||||
export interface IDragOffset {
|
||||
x: number;
|
||||
y: number;
|
||||
offsetX?: number;
|
||||
offsetY?: number;
|
||||
}
|
||||
|
||||
export interface DragState {
|
||||
export interface IDragState {
|
||||
isDragging: boolean;
|
||||
draggedElement: HTMLElement | null;
|
||||
draggedClone: HTMLElement | null;
|
||||
eventId: string | null;
|
||||
startColumn: string | null;
|
||||
currentColumn: string | null;
|
||||
mouseOffset: DragOffset;
|
||||
mouseOffset: IDragOffset;
|
||||
}
|
||||
|
||||
export interface DragEndPosition {
|
||||
export interface IDragEndPosition {
|
||||
column: string;
|
||||
y: number;
|
||||
snappedY: number;
|
||||
time?: Date;
|
||||
}
|
||||
|
||||
export interface StackLinkData {
|
||||
export interface IStackLinkData {
|
||||
prev?: string;
|
||||
next?: string;
|
||||
isFirst?: boolean;
|
||||
isLast?: boolean;
|
||||
}
|
||||
|
||||
export interface DragEventHandlers {
|
||||
handleDragStart?(originalElement: HTMLElement, eventId: string, mouseOffset: DragOffset, column: string): void;
|
||||
handleDragMove?(eventId: string, snappedY: number, column: string, mouseOffset: DragOffset): void;
|
||||
export interface IDragEventHandlers {
|
||||
handleDragStart?(originalElement: HTMLElement, eventId: string, mouseOffset: IDragOffset, column: string): void;
|
||||
handleDragMove?(eventId: string, snappedY: number, column: string, mouseOffset: IDragOffset): void;
|
||||
handleDragEnd?(eventId: string, originalElement: HTMLElement, draggedClone: HTMLElement, finalColumn: string, finalY: number): void;
|
||||
}
|
||||
|
|
@ -2,8 +2,8 @@
|
|||
* Type definitions for calendar events and drag operations
|
||||
*/
|
||||
|
||||
import { ColumnBounds } from "../utils/ColumnDetectionUtils";
|
||||
import { CalendarEvent } from "./CalendarTypes";
|
||||
import { IColumnBounds } from "../utils/ColumnDetectionUtils";
|
||||
import { ICalendarEvent } from "./CalendarTypes";
|
||||
|
||||
/**
|
||||
* Drag Event Payload Interfaces
|
||||
|
|
@ -11,89 +11,89 @@ import { CalendarEvent } from "./CalendarTypes";
|
|||
*/
|
||||
|
||||
// Common position interface
|
||||
export interface MousePosition {
|
||||
export interface IMousePosition {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
// Drag start event payload
|
||||
export interface DragStartEventPayload {
|
||||
export interface IDragStartEventPayload {
|
||||
originalElement: HTMLElement;
|
||||
draggedClone: HTMLElement | null;
|
||||
mousePosition: MousePosition;
|
||||
mouseOffset: MousePosition;
|
||||
columnBounds: ColumnBounds | null;
|
||||
mousePosition: IMousePosition;
|
||||
mouseOffset: IMousePosition;
|
||||
columnBounds: IColumnBounds | null;
|
||||
}
|
||||
|
||||
// Drag move event payload
|
||||
export interface DragMoveEventPayload {
|
||||
export interface IDragMoveEventPayload {
|
||||
originalElement: HTMLElement;
|
||||
draggedClone: HTMLElement;
|
||||
mousePosition: MousePosition;
|
||||
mouseOffset: MousePosition;
|
||||
columnBounds: ColumnBounds | null;
|
||||
mousePosition: IMousePosition;
|
||||
mouseOffset: IMousePosition;
|
||||
columnBounds: IColumnBounds | null;
|
||||
snappedY: number;
|
||||
}
|
||||
|
||||
// Drag end event payload
|
||||
export interface DragEndEventPayload {
|
||||
export interface IDragEndEventPayload {
|
||||
originalElement: HTMLElement;
|
||||
draggedClone: HTMLElement | null;
|
||||
mousePosition: MousePosition;
|
||||
sourceColumn: ColumnBounds;
|
||||
mousePosition: IMousePosition;
|
||||
sourceColumn: IColumnBounds;
|
||||
finalPosition: {
|
||||
column: ColumnBounds | null; // Where drag ended
|
||||
column: IColumnBounds | null; // Where drag ended
|
||||
snappedY: number;
|
||||
};
|
||||
target: 'swp-day-column' | 'swp-day-header' | null;
|
||||
}
|
||||
|
||||
// Drag mouse enter header event payload
|
||||
export interface DragMouseEnterHeaderEventPayload {
|
||||
targetColumn: ColumnBounds;
|
||||
mousePosition: MousePosition;
|
||||
export interface IDragMouseEnterHeaderEventPayload {
|
||||
targetColumn: IColumnBounds;
|
||||
mousePosition: IMousePosition;
|
||||
originalElement: HTMLElement | null;
|
||||
draggedClone: HTMLElement;
|
||||
calendarEvent: CalendarEvent;
|
||||
calendarEvent: ICalendarEvent;
|
||||
replaceClone: (newClone: HTMLElement) => void;
|
||||
}
|
||||
|
||||
// Drag mouse leave header event payload
|
||||
export interface DragMouseLeaveHeaderEventPayload {
|
||||
export interface IDragMouseLeaveHeaderEventPayload {
|
||||
targetDate: string | null;
|
||||
mousePosition: MousePosition;
|
||||
mousePosition: IMousePosition;
|
||||
originalElement: HTMLElement| null;
|
||||
draggedClone: HTMLElement| null;
|
||||
}
|
||||
|
||||
// Drag mouse enter column event payload
|
||||
export interface DragMouseEnterColumnEventPayload {
|
||||
targetColumn: ColumnBounds;
|
||||
mousePosition: MousePosition;
|
||||
export interface IDragMouseEnterColumnEventPayload {
|
||||
targetColumn: IColumnBounds;
|
||||
mousePosition: IMousePosition;
|
||||
snappedY: number;
|
||||
originalElement: HTMLElement | null;
|
||||
draggedClone: HTMLElement;
|
||||
calendarEvent: CalendarEvent;
|
||||
calendarEvent: ICalendarEvent;
|
||||
replaceClone: (newClone: HTMLElement) => void;
|
||||
}
|
||||
|
||||
// Drag column change event payload
|
||||
export interface DragColumnChangeEventPayload {
|
||||
export interface IDragColumnChangeEventPayload {
|
||||
originalElement: HTMLElement;
|
||||
draggedClone: HTMLElement;
|
||||
previousColumn: ColumnBounds | null;
|
||||
newColumn: ColumnBounds;
|
||||
mousePosition: MousePosition;
|
||||
previousColumn: IColumnBounds | null;
|
||||
newColumn: IColumnBounds;
|
||||
mousePosition: IMousePosition;
|
||||
}
|
||||
|
||||
// Header ready event payload
|
||||
export interface HeaderReadyEventPayload {
|
||||
headerElements: ColumnBounds[];
|
||||
export interface IHeaderReadyEventPayload {
|
||||
headerElements: IColumnBounds[];
|
||||
|
||||
}
|
||||
|
||||
// Resize end event payload
|
||||
export interface ResizeEndEventPayload {
|
||||
export interface IResizeEndEventPayload {
|
||||
eventId: string;
|
||||
element: HTMLElement;
|
||||
finalHeight: number;
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
import { IEventBus, CalendarEvent, CalendarView } from './CalendarTypes';
|
||||
import { IEventBus, ICalendarEvent, CalendarView } from './CalendarTypes';
|
||||
|
||||
/**
|
||||
* Complete type definition for all managers returned by ManagerFactory
|
||||
*/
|
||||
export interface CalendarManagers {
|
||||
eventManager: EventManager;
|
||||
eventRenderer: EventRenderingService;
|
||||
gridManager: GridManager;
|
||||
scrollManager: ScrollManager;
|
||||
export interface ICalendarManagers {
|
||||
eventManager: IEventManager;
|
||||
eventRenderer: IEventRenderingService;
|
||||
gridManager: IGridManager;
|
||||
scrollManager: IScrollManager;
|
||||
navigationManager: unknown; // Avoid interface conflicts
|
||||
viewManager: ViewManager;
|
||||
calendarManager: CalendarManager;
|
||||
viewManager: IViewManager;
|
||||
calendarManager: ICalendarManager;
|
||||
dragDropManager: unknown; // Avoid interface conflicts
|
||||
allDayManager: unknown; // Avoid interface conflicts
|
||||
resizeHandleManager: ResizeHandleManager;
|
||||
resizeHandleManager: IResizeHandleManager;
|
||||
edgeScrollManager: unknown; // Avoid interface conflicts
|
||||
dragHoverManager: unknown; // Avoid interface conflicts
|
||||
headerManager: unknown; // Avoid interface conflicts
|
||||
|
|
@ -27,50 +27,50 @@ interface IManager {
|
|||
refresh?(): void;
|
||||
}
|
||||
|
||||
export interface EventManager extends IManager {
|
||||
export interface IEventManager extends IManager {
|
||||
loadData(): Promise<void>;
|
||||
getEvents(): CalendarEvent[];
|
||||
getEventsForPeriod(startDate: Date, endDate: Date): CalendarEvent[];
|
||||
getEvents(): ICalendarEvent[];
|
||||
getEventsForPeriod(startDate: Date, endDate: Date): ICalendarEvent[];
|
||||
navigateToEvent(eventId: string): boolean;
|
||||
}
|
||||
|
||||
export interface EventRenderingService extends IManager {
|
||||
export interface IEventRenderingService extends IManager {
|
||||
// EventRenderingService doesn't have a render method in current implementation
|
||||
}
|
||||
|
||||
export interface GridManager extends IManager {
|
||||
export interface IGridManager extends IManager {
|
||||
render(): Promise<void>;
|
||||
getDisplayDates(): Date[];
|
||||
}
|
||||
|
||||
export interface ScrollManager extends IManager {
|
||||
export interface IScrollManager extends IManager {
|
||||
scrollTo(scrollTop: number): void;
|
||||
scrollToHour(hour: number): void;
|
||||
}
|
||||
|
||||
// Use a more flexible interface that matches actual implementation
|
||||
export interface NavigationManager extends IManager {
|
||||
export interface INavigationManager extends IManager {
|
||||
[key: string]: unknown; // Allow any properties from actual implementation
|
||||
}
|
||||
|
||||
export interface ViewManager extends IManager {
|
||||
export interface IViewManager extends IManager {
|
||||
// ViewManager doesn't have setView in current implementation
|
||||
getCurrentView?(): CalendarView;
|
||||
}
|
||||
|
||||
export interface CalendarManager extends IManager {
|
||||
export interface ICalendarManager extends IManager {
|
||||
setView(view: CalendarView): void;
|
||||
setCurrentDate(date: Date): void;
|
||||
}
|
||||
|
||||
export interface DragDropManager extends IManager {
|
||||
export interface IDragDropManager extends IManager {
|
||||
// DragDropManager has different interface in current implementation
|
||||
}
|
||||
|
||||
export interface AllDayManager extends IManager {
|
||||
export interface IAllDayManager extends IManager {
|
||||
[key: string]: unknown; // Allow any properties from actual implementation
|
||||
}
|
||||
|
||||
export interface ResizeHandleManager extends IManager {
|
||||
export interface IResizeHandleManager extends IManager {
|
||||
// ResizeHandleManager handles hover effects for resize handles
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue