export const ENGINE_CELL_PATCH_KIND = 'cell';
export const ENGINE_RANGE_INVALIDATION_PATCH_KIND = 'range-invalidation';
export const ENGINE_ROW_INVALIDATION_PATCH_KIND = 'row-invalidation';
export const ENGINE_COLUMN_INVALIDATION_PATCH_KIND = 'column-invalidation';
export function isEngineCellPatch(value) {
    if (typeof value !== 'object' || value === null) {
        return false;
    }
    return (Reflect.get(value, 'kind') === ENGINE_CELL_PATCH_KIND &&
        typeof Reflect.get(value, 'cellIndex') === 'number' &&
        typeof Reflect.get(value, 'sheetName') === 'string' &&
        typeof Reflect.get(value, 'a1') === 'string');
}
export function isEngineRangeInvalidationPatch(value) {
    if (typeof value !== 'object' || value === null) {
        return false;
    }
    const range = Reflect.get(value, 'range');
    return (Reflect.get(value, 'kind') === ENGINE_RANGE_INVALIDATION_PATCH_KIND &&
        typeof range === 'object' &&
        range !== null &&
        typeof Reflect.get(range, 'sheetName') === 'string' &&
        typeof Reflect.get(range, 'startAddress') === 'string' &&
        typeof Reflect.get(range, 'endAddress') === 'string');
}
function isAxisInvalidationPatch(value, kind) {
    return (typeof value === 'object' &&
        value !== null &&
        Reflect.get(value, 'kind') === kind &&
        typeof Reflect.get(value, 'sheetName') === 'string' &&
        typeof Reflect.get(value, 'startIndex') === 'number' &&
        typeof Reflect.get(value, 'endIndex') === 'number');
}
export function isEngineRowInvalidationPatch(value) {
    return isAxisInvalidationPatch(value, ENGINE_ROW_INVALIDATION_PATCH_KIND);
}
export function isEngineColumnInvalidationPatch(value) {
    return isAxisInvalidationPatch(value, ENGINE_COLUMN_INVALIDATION_PATCH_KIND);
}
//# sourceMappingURL=patch-types.js.map