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,49 @@
/**
* Data Validator
* Verify data structure cho từng game code
*
* Usage:
* ```typescript
* import { validateGameData, DataValidator } from 'game-iframe-sdk/client';
*
* const result = validateGameData('G001', receivedData);
* if (!result.valid) {
* console.error('Invalid data:', result.errors);
* }
* ```
*/
import { GameCode } from '../kit/GameDataHandler';
export interface ValidationResult {
valid: boolean;
errors: string[];
warnings: string[];
}
export interface FieldSchema {
type: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'any';
required: boolean;
arrayItemType?: 'string' | 'number' | 'object' | 'any';
description?: string;
}
export interface ItemSchema {
[field: string]: FieldSchema;
}
/**
* Validate game data payload
*/
export declare function validateGameData(gameCode: GameCode, payload: any): ValidationResult;
/**
* Get schema for a game code
*/
export declare function getSchema(gameCode: GameCode): ItemSchema | null;
/**
* Get schema documentation for a game code
*/
export declare function getSchemaDoc(gameCode: GameCode): string;
export declare class DataValidator {
private gameCode;
constructor(gameCode: GameCode);
validate(payload: any): ValidationResult;
getSchema(): ItemSchema | null;
getSchemaDoc(): string;
}
//# sourceMappingURL=DataValidator.d.ts.map