import type { AccountKvstoreListGetRequest, AccountUidKvstoreGetRequest, ExternalContentsCourseUserListGetRequest } from './apis'; import type { EliceCDK } from './EliceCDK'; import type { AnyObject, Primitive } from './typings'; /** * Tutoring interface for accessing student data when viewing content as a tutor. * * Only available when the current user is authenticated as a tutor. * Use `isEnabled` to check if tutoring features are available. */ export declare class EliceCDKTutoring { private readonly ctx; constructor(ctx: EliceCDK); /** * Retrieves a value from a student's key-value store. * * @param params - Object containing `uid` (student's user ID) and `key`. * @param init - Optional fetch request configuration. * @returns The stored value, or `null` if not found. * * @example * ```ts * import { EliceCDK } from '@eliceio/cdk'; * * const sdk = new EliceCDK(); * await sdk.init(); * * const progress = await sdk.tutoring.getAccountKvstore({ * uid: 12345, * key: 'userProgress', * }); * ``` */ getAccountKvstore(params: AccountUidKvstoreGetRequest, init?: RequestInit): Promise; /** * Retrieves a file from a student's file store. * * @param params - Object containing `uid` (student's user ID) and `key`. * @param init - Optional fetch request configuration. * @returns File metadata (`name`, `size`, `mime`) and download `url`, or `null` if not found. * @throws {EliceCDKError} If the server response is invalid. * * @example * ```ts * import { EliceCDK } from '@eliceio/cdk'; * * const sdk = new EliceCDK(); * await sdk.init(); * * const file = await sdk.tutoring.getAccountFilestore({ * uid: 12345, * key: 'submission', * }); * * if (file) { * console.log('Download URL:', file.url); * } * ``` */ getAccountFilestore(params: AccountUidKvstoreGetRequest, init?: RequestInit): Promise<{ url: string; name: string; size: number; mime: string; } | null>; /** * Retrieves the list of students enrolled in the current course. * * @param params - Pagination options: `offset` (starting index) and `count` (number of results). * @returns Array of student objects with `uid` and `fullname`. * @throws {EliceCDKError} If `courseId` is not available. * * @example * ```ts * import { EliceCDK } from '@eliceio/cdk'; * * const sdk = new EliceCDK(); * await sdk.init(); * * const students = await sdk.tutoring.getAccountList({ * offset: 0, * count: 10, * }); * // [{ uid: 123, fullname: 'Student A' }, ...] * ``` */ getAccountList(params: Omit): Promise<{ uid: number; fullname: string; }[]>; /** * Retrieves key-value store values for multiple students at once. * * @param params - Object containing `key` and `filterUids` (array of student UIDs, max 10). * @returns Array of objects with `uid` and optional `value`. * * @example * ```ts * import { EliceCDK } from '@eliceio/cdk'; * * const sdk = new EliceCDK(); * await sdk.init(); * * const results = await sdk.tutoring.getAccountKvstoreList({ * key: 'userProgress', * filterUids: [123, 456, 789], * }); * // [{ uid: 123, value: {...} }, { uid: 456, value: {...} }, ...] * ``` */ getAccountKvstoreList(params: AccountKvstoreListGetRequest): Promise<{ uid: number; value?: T; }[]>; /** * Indicates whether the current user is viewing content as a tutor. * * When `true`, tutoring-specific methods like `getAccountList` and `getAccountKvstore` are available. * * @example * ```ts * import { EliceCDK } from '@eliceio/cdk'; * * const sdk = new EliceCDK(); * await sdk.init(); * * if (sdk.tutoring.isEnabled) { * const students = await sdk.tutoring.getAccountList({ offset: 0, count: 10 }); * console.log('Students:', students); * } * ``` */ get isEnabled(): boolean; }