up
All checks were successful
Deploy to Production / deploy (push) Successful in 8s

This commit is contained in:
lubukhu
2026-01-24 13:35:11 +07:00
parent 6c3e93636e
commit 65fd0158a3
145 changed files with 10262 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
/**
* SDK Iframe Core
* Chạy trong hidden iframe riêng biệt
*
* Responsibilities:
* - Receive data từ parent (preview mode)
* - Fetch data từ API (live mode)
* - Store answers securely
* - Verify answers locally (fast feedback)
* - Sync với server (background)
* - Report results
*/
interface SdkIframeConfig {
debug?: boolean;
allowedOrigins?: string[];
}
export declare class SdkIframeCore {
private config;
private boundMessageHandler;
private mode;
private gameCode;
private assignmentId;
private studentId;
private apiBaseUrl;
private authToken;
private originalItems;
private clientItems;
private sanitizedItems;
private userAnswers;
private completedQuestions;
private isInitialized;
private parentOrigin;
constructor(config?: SdkIframeConfig);
private setupMessageListener;
private handleMessage;
private isAllowedOrigin;
private handleInit;
private handlePushData;
private handleCheckAnswer;
/**
* Submit answer to server and wait for result (Live mode)
*/
private submitAnswerToServer;
private handleGetResult;
private handleRetrySync;
private processData;
private fetchLiveData;
private sendToParent;
private sendError;
private log;
destroy(): void;
}
declare global {
interface Window {
SdkIframe: SdkIframeCore;
}
}
export {};
//# sourceMappingURL=SdkIframeCore.d.ts.map