import { Principal } from '../core/index.js'; interface Authentication extends Principal { '@class': string; principal?: Principal; authorities?: string[]; credentials?: object; details?: object; } interface SecurityContext { '@class': string; authentication?: Authentication; } type Namespace = `${string}:session`; interface Session { getId(): string; changeSessionId(): string; getAttribute(name: string): string | number | null; getAttributeNames(): string[]; setAttribute(name: string, value: string | number): void; removeAttribute(name: string): void; getCreationTime(): number; getLastAccessedTime(): number; setLastAccessedTime(lastAccessedTime: number): void; getMaxInactiveInterval(): number; setMaxInactiveInterval(interval: number): void; isExpired(): boolean; } interface SessionRepository { createSession(): S; save(session: S): Promise; findById(sessionId: string): Promise; deleteById(sessionId: string): Promise; findByIndexNameAndIndexValue(indexName: string, indexValue: string): Promise>; findByPrincipalName(principalName: string): Promise>; cleanupExpiredSessions(cleanupCount?: number): Promise; } interface KVRepository { setItem(key: string, value: string, expiresIn?: number): Promise; getItem(key: string): Promise; removeItem(key: string): Promise; } export type { Authentication, KVRepository, Namespace, SecurityContext, Session, SessionRepository };