/** * Base error class for all Rollease errors. * Provides consistent shape: statusCode, code, message, meta. */ declare class RolleaseError extends Error { readonly statusCode: number; readonly code: string; readonly meta: Record; constructor(message: string, statusCode: number, code: string, meta?: Record); toJSON(): { error: string; statusCode: number; code: string; message: string; meta: Record; }; } /** * Thrown when a flag key is not found. * Note: `isEnabled()` returns false for missing flags — only management operations throw. */ declare class FlagNotFoundError extends RolleaseError { constructor(flagKey: string); } /** * Thrown when trying to modify a locked flag. */ declare class FlagLockedError extends RolleaseError { constructor(flagKey: string, reason?: string); } /** * Thrown when creating a flag/segment/release with a duplicate key. */ declare class FlagConflictError extends RolleaseError { constructor(key: string, type?: string); } /** * Thrown for invalid inputs: bad flag config, malformed conditions, bad semver, etc. */ declare class ValidationError extends RolleaseError { constructor(message: string, meta?: Record); } /** * Thrown when deploying a release with conflicting flag states. */ declare class ReleaseConflictError extends RolleaseError { constructor(releaseId: string, details?: string); } /** * Thrown for unexpected internal errors (DB failure, cache unavailable, etc.) */ declare class RolleaseInternalError extends RolleaseError { constructor(message: string, meta?: Record); } /** * Thrown when a rule is not found. */ declare class RuleNotFoundError extends RolleaseError { constructor(flagKey: string, ruleId: string); } /** * Thrown when a segment key is not found. */ declare class SegmentNotFoundError extends RolleaseError { constructor(segmentKey: string); } /** * Thrown when a release is not found. */ declare class ReleaseNotFoundError extends RolleaseError { constructor(releaseId: string); } export { FlagConflictError, FlagLockedError, FlagNotFoundError, ReleaseConflictError, ReleaseNotFoundError, RolleaseError, RolleaseInternalError, RuleNotFoundError, SegmentNotFoundError, ValidationError };