claritykit-svelte
Version:
A comprehensive Svelte component library focused on accessibility, ADHD-optimized design, developer experience, and full SSR compatibility
228 lines • 5.69 kB
TypeScript
/**
* ApprovalWorkflow Component Types
*
* Type definitions for the ApprovalWorkflow component that handles
* complex multi-step approval processes with validation, conflict
* resolution, and error recovery.
*/
export interface Task {
id: string;
name: string;
description: string;
status: TaskStatus;
created_at: string;
updated_at: string;
}
export interface TaskGroup {
name: string;
tasks: Task[];
reasoning: string;
estimatedEffort: number;
}
export interface ProjectSuggestion {
id: string;
projectName: string;
description: string;
taskGroupings: TaskGroup[];
reasoning: string;
architectReasoning?: string;
priority: Priority;
complexity: Complexity;
affectedTasks: Task[];
estimatedDuration: {
value: number;
unit: string;
};
dependencies: string[];
createdAt: Date;
status: SuggestionStatus;
}
export interface TaskModification {
originalTaskId: string;
name: string;
description?: string;
status: TaskStatus;
}
export interface TaskGroupModification {
originalGroupId: string;
name: string;
tasks: TaskModification[];
}
export interface ProjectModifications {
projectName: string;
description: string;
taskGroupings?: TaskGroupModification[];
}
export interface ProjectCreationResult {
project: {
id: string;
name: string;
description: string;
status: string;
metadata: Record<string, unknown>;
};
tasks: Array<{
id: string;
name: string;
projectId: string;
groupName: string;
status: TaskStatus;
originalTaskId?: string;
}>;
integrations: {
kanban: {
success: boolean;
resourceId?: string;
};
calendar: {
success: boolean;
resourceId?: string;
};
chat: {
success: boolean;
resourceId?: string;
};
};
}
export interface TaskRegroupingResult {
success: boolean;
regroupedTasks: Array<{
taskId: string;
originalGroup: string;
newGroup: string;
projectId: string;
preservedProperties: Record<string, unknown>;
}>;
}
export interface InterfaceUpdateResult {
kanban: {
success: boolean;
resourceId?: string;
error?: string;
};
calendar: {
success: boolean;
resourceId?: string;
error?: string;
};
chat: {
success: boolean;
resourceId?: string;
error?: string;
};
}
export interface ErrorRecoveryStep {
id: string;
description: string;
action?: () => Promise<void>;
}
export interface IntegrationErrorResult {
error: {
type: string;
message: string;
code?: string;
details?: Record<string, unknown>;
};
recoveryOptions: {
canRetry: boolean;
canRollback: boolean;
recoverySteps: string[];
};
rollbackResult?: {
success: boolean;
errors?: Array<{
error: string;
details?: unknown;
}>;
};
}
export declare enum TaskStatus {
PENDING = "pending",
IN_PROGRESS = "in_progress",
COMPLETED = "completed",
BLOCKED = "blocked",
CANCELLED = "cancelled"
}
export declare enum Priority {
LOW = "low",
MEDIUM = "medium",
HIGH = "high",
CRITICAL = "critical"
}
export declare enum Complexity {
SIMPLE = "simple",
MODERATE = "moderate",
COMPLEX = "complex"
}
export declare enum SuggestionStatus {
PENDING = "pending",
APPROVED = "approved",
MODIFIED = "modified",
REJECTED = "rejected",
DEFERRED = "deferred"
}
export declare enum WorkflowStep {
REVIEW = "review",
MODIFY = "modify",
CONFLICTS = "conflicts",
PREVIEW = "preview"
}
export interface ApprovalWorkflowProps {
/** Whether the workflow modal is open */
isOpen: boolean;
/** The project suggestion to approve */
suggestion: ProjectSuggestion;
/** Loading state */
isLoading?: boolean;
/** Error message */
error?: string | null;
/** Component size variant */
size?: 'sm' | 'md' | 'lg';
/** Component visual variant */
variant?: 'default' | 'elevated' | 'minimal';
/** Additional CSS classes */
class?: string;
/** Whether to show debug information */
debug?: boolean;
/** Called when the workflow is closed */
onclose?: () => void;
/** Called when the project is approved */
onapprove?: (event: ApprovalActionEvent) => void;
/** Called when the workflow is cancelled */
oncancel?: () => void;
}
export interface ApprovalActionEvent {
suggestion: ProjectSuggestion;
modifications?: ProjectModifications;
conflictResolutions?: Record<string, 'merge' | 'override' | 'skip'>;
projectResult?: ProjectCreationResult;
regroupingResult?: TaskRegroupingResult;
interfaceResult?: InterfaceUpdateResult;
}
export interface StepConfiguration {
id: WorkflowStep;
label: string;
icon: string;
description: string;
}
export interface ConflictResolution {
taskId: string;
resolution: 'merge' | 'override' | 'skip';
reason?: string;
}
export interface ValidationError {
field: string;
message: string;
code?: string;
}
export interface ValidationResult {
valid: boolean;
errors: ValidationError[];
}
export interface AccessibilityOptions {
announceStepChanges?: boolean;
announceValidationErrors?: boolean;
announceConflictResolutions?: boolean;
screenReaderOptimized?: boolean;
}
//# sourceMappingURL=types.d.ts.map