import { makePropDecorator } from '@ditsmod/core';
function oasRouteCallback(httpMethod, path, guardsOrOperationObj, interceptorsOrOperationObj, operationObject) {
    if (operationObject) {
        return {
            httpMethod,
            path: path || '',
            guards: (guardsOrOperationObj || []),
            interceptors: (interceptorsOrOperationObj || []),
            operationObject: operationObject || {},
        };
    }
    else if (Array.isArray(interceptorsOrOperationObj)) {
        return {
            httpMethod,
            path: path || '',
            guards: (guardsOrOperationObj || []),
            interceptors: interceptorsOrOperationObj,
            operationObject: {},
        };
    }
    else if (interceptorsOrOperationObj) {
        return {
            httpMethod,
            path: path || '',
            guards: (guardsOrOperationObj || []),
            operationObject: interceptorsOrOperationObj,
            interceptors: [],
        };
    }
    else if (Array.isArray(guardsOrOperationObj)) {
        return {
            httpMethod,
            path: path || '',
            guards: guardsOrOperationObj,
            operationObject: {},
            interceptors: [],
        };
    }
    else {
        return {
            httpMethod,
            path: path || '',
            operationObject: guardsOrOperationObj || {},
            guards: [],
            interceptors: [],
        };
    }
}
/**
 * Open API Specification Route.
 */
export const oasRoute = makePropDecorator(oasRouteCallback);
//# sourceMappingURL=oas-route.js.map