withReducer()

in src/alert/condition.ts [91:109]


    withReducer(type: GrafanaReducerType) {
        const types = [
            'min',
            'max',
            'sum',
            'avg',
            'count',
            'last',
            'median',
            'diff',
        ] satisfies GrafanaReducerType[];

        if (!types.includes(type)) {
            throw Error(`Reducer has to be one of [${types.toString()}]`);
        }

        this._reducer.type = type;
        return this;
    }