/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
export function mockCancellableGrpcUnaryResult(result, timeout = 10, onCancel
// eslint-disable-next-line @typescript-eslint/no-explicit-any
) {
    return (_, __, handler) => {
        const timer = setTimeout(() => {
            handler(null, result);
        }, timeout);
        return {
            cancel: () => {
                clearTimeout(timer);
                onCancel === null || onCancel === void 0 ? void 0 : onCancel();
            },
        };
    };
}
export function mockGrpcUnaryResult(result, timeout = 10
// eslint-disable-next-line @typescript-eslint/no-explicit-any
) {
    return mockCancellableGrpcUnaryResult(result, timeout);
}
export function mockGrpcUnaryError(error, timeout = 10
// eslint-disable-next-line @typescript-eslint/no-explicit-any
) {
    return (_, __, handler) => {
        setTimeout(() => {
            handler(error);
        }, timeout);
    };
}
//# sourceMappingURL=grpc.js.map
