matrix-react-sdk
Version:
SDK for matrix.org using React
22 lines (21 loc) • 1.09 kB
TypeScript
import { MatrixClient, IPushRule, PushRuleAction, PushRuleKind } from "matrix-js-sdk/src/matrix";
/**
* Sets the actions for a given push rule id and kind
* When actions are falsy, disables the rule
* @param matrixClient - cli
* @param ruleId - rule id to update
* @param kind - PushRuleKind
* @param actions - push rule actions to set for rule
*/
export declare const updatePushRuleActions: (matrixClient: MatrixClient, ruleId: IPushRule["rule_id"], kind: PushRuleKind, actions?: PushRuleAction[]) => Promise<void>;
/**
* Update push rules with given actions
* Where they already exist for current user
* Rules are updated sequentially and stop at first error
* @param matrixClient - cli
* @param ruleIds - RuleIds of push rules to attempt to set actions for
* @param actions - push rule actions to set for rule
* @returns resolves when all rules have been updated
* @returns rejects when a rule update fails
*/
export declare const updateExistingPushRulesWithActions: (matrixClient: MatrixClient, ruleIds?: IPushRule["rule_id"][], actions?: PushRuleAction[]) => Promise<void>;