/**
 * Domain Event Types for Declarative Infrastructure API
 *
 * This module defines the domain event types used for event-driven
 * communication between resources through the Event Bus Mediator.
 *
 * @module declarative-api/event.types
 */
import type { ResourceType, LifecycleStateType } from './core.types';
import type { IResourceEntity } from './resource.types';
/**
 * Base interface for all domain events.
 *
 * All events have a type discriminator and timestamp.
 */
export interface IBaseEvent {
    /** Event type discriminator */
    readonly type: string;
    /** Timestamp when the event occurred */
    readonly timestamp: Date;
}
/**
 * Event published when a resource is created.
 *
 * Contains the created resource and context reference.
 *
 * Validates: Requirements 1.4, 6.1
 */
export interface ResourceCreatedEvent extends IBaseEvent {
    readonly type: 'resource:created';
    /** The created resource entity */
    readonly resource: IResourceEntity;
    /** Optional context identifier */
    readonly contextId?: string;
}
/**
 * Property change record for modification events.
 */
export interface PropertyChange {
    /** Path to the changed property (dot notation) */
    readonly path: string;
    /** Previous value */
    readonly oldValue: unknown;
    /** New value */
    readonly newValue: unknown;
}
/**
 * Event published when a resource is modified.
 *
 * Contains the modified resource and list of changes.
 *
 * Validates: Requirements 1.4, 6.1
 */
export interface ResourceModifiedEvent extends IBaseEvent {
    readonly type: 'resource:modified';
    /** The modified resource entity */
    readonly resource: IResourceEntity;
    /** List of property changes */
    readonly changes: readonly PropertyChange[];
}
/**
 * Event published when a resource is deleted.
 *
 * Contains the resource identifier and type (resource may no longer exist).
 *
 * Validates: Requirements 1.4, 6.1
 */
export interface ResourceDeletedEvent extends IBaseEvent {
    readonly type: 'resource:deleted';
    /** ID of the deleted resource */
    readonly resourceId: string;
    /** Type of the deleted resource */
    readonly resourceType: ResourceType;
}
/**
 * Event published when a resource's lifecycle state changes.
 *
 * Contains the resource and both previous and new states.
 *
 * Validates: Requirements 1.4, 6.1, 7.5
 */
export interface ResourceStateChangedEvent extends IBaseEvent {
    readonly type: 'resource:state-changed';
    /** The resource entity */
    readonly resource: IResourceEntity;
    /** Previous lifecycle state */
    readonly previousState: LifecycleStateType;
    /** New lifecycle state */
    readonly newState: LifecycleStateType;
}
/**
 * Discriminated union of all resource domain events.
 *
 * Use this type for type-safe event handling with exhaustive
 * pattern matching on the `type` discriminator.
 *
 * @example
 * ```typescript
 * function handleEvent(event: ResourceEvent): void {
 *   switch (event.type) {
 *     case 'resource:created':
 *       console.log(`Created: ${event.resource.id}`);
 *       break;
 *     case 'resource:modified':
 *       console.log(`Modified: ${event.resource.id}, changes: ${event.changes.length}`);
 *       break;
 *     case 'resource:deleted':
 *       console.log(`Deleted: ${event.resourceId}`);
 *       break;
 *     case 'resource:state-changed':
 *       console.log(`State: ${event.previousState} -> ${event.newState}`);
 *       break;
 *   }
 * }
 * ```
 *
 * Validates: Requirements 1.4, 6.1, 18.4
 */
export type ResourceEvent = ResourceCreatedEvent | ResourceModifiedEvent | ResourceDeletedEvent | ResourceStateChangedEvent;
/**
 * All resource event type strings.
 */
export declare const RESOURCE_EVENT_TYPES: readonly ["resource:created", "resource:modified", "resource:deleted", "resource:state-changed"];
/**
 * Type for resource event type strings.
 */
export type ResourceEventType = (typeof RESOURCE_EVENT_TYPES)[number];
/**
 * Type guard to check if a value is a valid ResourceEventType.
 *
 * @param value - The value to check
 * @returns True if the value is a valid ResourceEventType
 */
export declare function isResourceEventType(value: unknown): value is ResourceEventType;
/**
 * Type guard to check if an event is a ResourceCreatedEvent.
 *
 * @param event - The event to check
 * @returns True if the event is a ResourceCreatedEvent
 */
export declare function isResourceCreatedEvent(event: IBaseEvent): event is ResourceCreatedEvent;
/**
 * Type guard to check if an event is a ResourceModifiedEvent.
 *
 * @param event - The event to check
 * @returns True if the event is a ResourceModifiedEvent
 */
export declare function isResourceModifiedEvent(event: IBaseEvent): event is ResourceModifiedEvent;
/**
 * Type guard to check if an event is a ResourceDeletedEvent.
 *
 * @param event - The event to check
 * @returns True if the event is a ResourceDeletedEvent
 */
export declare function isResourceDeletedEvent(event: IBaseEvent): event is ResourceDeletedEvent;
/**
 * Type guard to check if an event is a ResourceStateChangedEvent.
 *
 * @param event - The event to check
 * @returns True if the event is a ResourceStateChangedEvent
 */
export declare function isResourceStateChangedEvent(event: IBaseEvent): event is ResourceStateChangedEvent;
/**
 * Type guard to check if an event is a ResourceEvent.
 *
 * @param event - The event to check
 * @returns True if the event is a ResourceEvent
 */
export declare function isResourceEvent(event: unknown): event is ResourceEvent;
/**
 * Factory function to create a ResourceCreatedEvent.
 *
 * @param resource - The created resource
 * @param contextId - Optional context identifier
 * @returns A new ResourceCreatedEvent
 */
export declare function createResourceCreatedEvent(resource: IResourceEntity, contextId?: string): ResourceCreatedEvent;
/**
 * Factory function to create a ResourceModifiedEvent.
 *
 * @param resource - The modified resource
 * @param changes - List of property changes
 * @returns A new ResourceModifiedEvent
 */
export declare function createResourceModifiedEvent(resource: IResourceEntity, changes: readonly PropertyChange[]): ResourceModifiedEvent;
/**
 * Factory function to create a ResourceDeletedEvent.
 *
 * @param resourceId - ID of the deleted resource
 * @param resourceType - Type of the deleted resource
 * @returns A new ResourceDeletedEvent
 */
export declare function createResourceDeletedEvent(resourceId: string, resourceType: ResourceType): ResourceDeletedEvent;
/**
 * Factory function to create a ResourceStateChangedEvent.
 *
 * @param resource - The resource entity
 * @param previousState - Previous lifecycle state
 * @param newState - New lifecycle state
 * @returns A new ResourceStateChangedEvent
 */
export declare function createResourceStateChangedEvent(resource: IResourceEntity, previousState: LifecycleStateType, newState: LifecycleStateType): ResourceStateChangedEvent;
