@defikitdotnet/education-module-ai
Version:
AI Education Module using Agent Framework
30 lines (29 loc) • 1.17 kB
TypeScript
export type ContentType = "text" | "video" | "h5p";
export interface CourseContent {
id?: string;
title: string;
description?: string;
type: ContentType;
content: any;
order: number;
createdAt: string;
updatedAt: string;
videoUrl?: string;
videoDescription?: string;
h5pUrl?: string;
}
export declare const useCourseContent: (agentId: string, apiUrl?: string) => {
content: CourseContent | null;
isLoading: boolean;
error: string | null;
fetchContent: (courseId: string, contentId: string) => Promise<void>;
fetchCourseContents: (courseId: string) => Promise<CourseContent[]>;
fetchContentById: (courseId: string, contentId: string) => Promise<CourseContent | null>;
createContent: (courseId: string, content: CourseContent) => Promise<CourseContent | null>;
updateContent: (courseId: string, contentId: string, content: Partial<CourseContent>) => Promise<CourseContent | null>;
deleteContent: (courseId: string, contentId: string) => Promise<boolean>;
reorderContents: (courseId: string, contentOrders: {
id: string;
order: number;
}[]) => Promise<boolean>;
};