import { U as UserDBInterface, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface, a as UserDBReader, d as CourseInfo, S as StudySessionItem, D as DataLayerResult, e as ContentNavigationStrategyData, f as ContentNavigator, R as ReplanHints, G as GeneratorResult } from '../../contentSource-C-0t0y0V.js'; import { D as DataLayerProvider } from '../../dataLayerProvider-BB0oi9T0.js'; import { S as StaticCourseManifest } from '../../types-CHgpWQAY.js'; import { CourseConfig, CourseElo, DataShape } from '@vue-skuilder/common'; import { S as SkuilderCourseData, Q as QualifiedCardID, T as TagStub, a as Tag } from '../../types-legacy-4tlwHnXo.js'; import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-CyATpyLQ.js'; import 'moment'; interface SkuilderManifest { name?: string; version?: string; description?: string; dependencies?: Record; } interface StaticDataLayerConfig { localStoragePrefix?: string; rootManifest: SkuilderManifest; rootManifestUrl: string; } declare class StaticDataLayerProvider implements DataLayerProvider { private config; private initialized; private courseUnpackers; private manifests; private dependencyNameToCourseId; constructor(config: Partial); private resolveCourseDependencies; initialize(): Promise; teardown(): Promise; getUserDB(): UserDBInterface; getCourseDB(courseId: string): CourseDBInterface; getCoursesDB(): CoursesDBInterface; getClassroomDB(_classId: string, _type: 'student' | 'teacher'): Promise; getAdminDB(): AdminDBInterface; createUserReaderForUser(targetUsername: string): Promise; isReadOnly(): boolean; } interface TagsIndex { byTag: Record; byCard: Record; } declare class StaticDataUnpacker { private manifest; private basePath; private documentCache; private chunkCache; private indexCache; constructor(manifest: StaticCourseManifest, basePath: string); /** * Get a document by ID, loading from appropriate chunk if needed */ getDocument(id: string): Promise; /** * Get all documents with IDs starting with a specific prefix. * * This method loads the relevant chunk(s) and returns all matching documents. * Useful for querying documents by type (e.g., all NAVIGATION_STRATEGY documents). * * @param prefix - Document ID prefix to match (e.g., "NAVIGATION_STRATEGY") * @returns Array of all documents with IDs starting with the prefix */ getAllDocumentsByPrefix(prefix: string): Promise; /** * Query cards by ELO score, returning card IDs sorted by ELO */ queryByElo(targetElo: number, limit?: number): Promise; /** * Get all tag names mapped to their card arrays */ getTagsIndex(): Promise; private getDocTypeFromId; /** * Find which chunk contains a specific document ID */ private findChunkForDocument; /** * Verify that a document actually exists in a specific chunk by loading and checking it */ private verifyDocumentInChunk; /** * Load a chunk file and cache its documents */ private loadChunk; /** * Load an index file and cache it */ private loadIndex; /** * Get a document by ID without hydration (raw document access) * Used internally to avoid recursion during attachment hydration */ private getRawDocument; /** * Get attachment URL for a given document and attachment name */ getAttachmentUrl(docId: string, attachmentName: string): string; /** * Load attachment data from the document and get the correct file path * Uses raw document access to avoid recursion with hydration */ getAttachmentPath(docId: string, attachmentName: string): Promise; /** * Load attachment as a blob (for browser) or buffer (for Node.js) */ getAttachmentBlob(docId: string, attachmentName: string): Promise; /** * Hydrate document attachments by converting file paths to blob URLs */ private hydrateAttachments; /** * Clear all caches (useful for testing or memory management) */ clearCaches(): void; /** * Get cache statistics for debugging */ getCacheStats(): { documents: number; chunks: number; indices: number; }; /** * Check if a path is a local file path (vs URL) */ private isLocalPath; } declare class StaticCourseDB implements CourseDBInterface { private courseId; private unpacker; private userDB; private manifest; constructor(courseId: string, unpacker: StaticDataUnpacker, userDB: UserDBInterface, manifest: StaticCourseManifest); getCourseID(): string; getCourseConfig(): Promise; updateCourseConfig(_cfg: CourseConfig): Promise; getCourseInfo(): Promise; getCourseDoc(id: string, _options?: PouchDB.Core.GetOptions): Promise; getCourseDocs(ids: string[], _options?: PouchDB.Core.AllDocsOptions): Promise>; getCardsByELO(elo: number, limit?: number): Promise<{ courseID: string; cardID: string; elo?: number; }[]>; getCardEloData(cardIds: string[]): Promise; updateCardElo(cardId: string, _elo: CourseElo): Promise; getCardsCenteredAtELO(options: { limit: number; elo: 'user' | 'random' | number; }, filter?: (id: QualifiedCardID) => boolean): Promise; getAppliedTags(cardId: string): Promise>; getAppliedTagsBatch(cardIds: string[]): Promise>; getAllCardIds(): Promise; addTagToCard(_cardId: string, _tagId: string): Promise; removeTagFromCard(_cardId: string, _tagId: string): Promise; createTag(_tagName: string): Promise; getTag(tagName: string): Promise; updateTag(_tag: Tag): Promise; getCourseTagStubs(): Promise>; addNote(_codeCourse: string, _shape: DataShape, _data: unknown, _author: string, _tags: string[], _uploads?: { [key: string]: PouchDB.Core.FullAttachment; }, _elo?: CourseElo): Promise; removeCard(_cardId: string): Promise; getInexperiencedCards(): Promise; getNavigationStrategy(id: string): Promise; getAllNavigationStrategies(): Promise; addNavigationStrategy(_data: ContentNavigationStrategyData): Promise; updateNavigationStrategy(_id: string, _data: ContentNavigationStrategyData): Promise; /** * Create a ContentNavigator for this course. * * Loads navigation strategy documents from static data and uses PipelineAssembler * to build a Pipeline. Falls back to default pipeline if no strategies found. */ createNavigator(user: UserDBInterface): Promise; private _pendingHints; setEphemeralHints(hints: ReplanHints): void; getWeightedCards(limit: number): Promise; /** * Get attachment URL for a document and attachment name * Internal helper method for static attachment serving */ getAttachmentUrl(docId: string, attachmentName: string): string; /** * Load attachment as blob/buffer * Internal helper method for static attachment serving */ getAttachmentBlob(docId: string, attachmentName: string): Promise; searchCards(_query: string): Promise; find(_request: PouchDB.Find.FindRequest): Promise>; } declare class StaticCoursesDB implements CoursesDBInterface { private manifests; private dependencyNameToCourseId?; constructor(manifests: Record, dependencyNameToCourseId?: Map | undefined); getCourseConfig(courseId: string): Promise; getCourseList(): Promise; disambiguateCourse(_courseId: string, _disambiguator: string): Promise; } /** * Sync strategy for static deployments that provides no-op implementations * for remote operations. Uses only local storage with no remote synchronization. */ declare class NoOpSyncStrategy implements SyncStrategy { private currentUsername; setupRemoteDB(username: string): PouchDB.Database; getWriteDB(username: string): PouchDB.Database; startSync(_localDB: PouchDB.Database, _remoteDB: PouchDB.Database): void; stopSync?(): void; canCreateAccount(): boolean; canAuthenticate(): boolean; createAccount(_username: string, _password: string): Promise; authenticate(_username: string, _password: string): Promise; logout(): Promise; getCurrentUsername(): Promise; /** * Set the current username (for local account switching) * This method is specific to NoOpSyncStrategy and not part of the base interface */ setCurrentUsername(username: string): void; } export { NoOpSyncStrategy, StaticCourseDB, StaticCoursesDB, StaticDataLayerProvider, StaticDataUnpacker };