/**
 * SDK Iframe Message Types
 * Shared types cho SDK Iframe và Game Bridge
 */
// =============================================================================
// MESSAGE TYPES
// =============================================================================
export const SDK_MESSAGE_TYPES = {
    // Parent/Game → SDK Iframe
    SDK_INIT: 'SDK_INIT',
    SDK_PUSH_DATA: 'SDK_PUSH_DATA',
    SDK_CHECK_ANSWER: 'SDK_CHECK_ANSWER',
    SDK_GET_RESULT: 'SDK_GET_RESULT',
    SDK_RETRY_SYNC: 'SDK_RETRY_SYNC',
    // SDK Iframe → Parent/Game
    SDK_READY: 'SDK_READY',
    SDK_DATA_READY: 'SDK_DATA_READY',
    SDK_ANSWER_RESULT: 'SDK_ANSWER_RESULT',
    SDK_SYNC_STATUS: 'SDK_SYNC_STATUS',
    SDK_SYNC_ERROR: 'SDK_SYNC_ERROR',
    SDK_FINAL_RESULT: 'SDK_FINAL_RESULT',
    SDK_ERROR: 'SDK_ERROR',
};
// =============================================================================
// HELPER FUNCTIONS
// =============================================================================
export function createSdkMessage(type, payload, requestId) {
    return {
        type,
        payload,
        timestamp: Date.now(),
        request_id: requestId,
    };
}
export function isSdkMessage(data) {
    return data && typeof data === 'object' && 'type' in data && Object.values(SDK_MESSAGE_TYPES).includes(data.type);
}
//# sourceMappingURL=types.js.map