Enable @typescript-eslint/explicit-member-accessibility on /src (#9785)
* Enable `@typescript-eslint/explicit-member-accessibility` on /src * Prettier
This commit is contained in:
@@ -29,7 +29,7 @@ export class NotificationUtils {
|
||||
// "highlight: true/false,
|
||||
// }
|
||||
// to a list of push actions.
|
||||
static encodeActions(action: IEncodedActions): PushRuleAction[] {
|
||||
public static encodeActions(action: IEncodedActions): PushRuleAction[] {
|
||||
const notify = action.notify;
|
||||
const sound = action.sound;
|
||||
const highlight = action.highlight;
|
||||
@@ -55,7 +55,7 @@ export class NotificationUtils {
|
||||
// "highlight: true/false,
|
||||
// }
|
||||
// If the actions couldn't be decoded then returns null.
|
||||
static decodeActions(actions: PushRuleAction[]): IEncodedActions {
|
||||
public static decodeActions(actions: PushRuleAction[]): IEncodedActions {
|
||||
let notify = false;
|
||||
let sound = null;
|
||||
let highlight = false;
|
||||
|
||||
@@ -31,23 +31,23 @@ export enum VectorState {
|
||||
|
||||
export class PushRuleVectorState {
|
||||
// Backwards compatibility (things should probably be using the enum above instead)
|
||||
static OFF = VectorState.Off;
|
||||
static ON = VectorState.On;
|
||||
static LOUD = VectorState.Loud;
|
||||
public static OFF = VectorState.Off;
|
||||
public static ON = VectorState.On;
|
||||
public static LOUD = VectorState.Loud;
|
||||
|
||||
/**
|
||||
* Enum for state of a push rule as defined by the Vector UI.
|
||||
* @readonly
|
||||
* @enum {string}
|
||||
*/
|
||||
static states = VectorState;
|
||||
public static states = VectorState;
|
||||
|
||||
/**
|
||||
* Convert a PushRuleVectorState to a list of actions
|
||||
*
|
||||
* @return [object] list of push-rule actions
|
||||
*/
|
||||
static actionsFor(pushRuleVectorState: VectorState) {
|
||||
public static actionsFor(pushRuleVectorState: VectorState) {
|
||||
if (pushRuleVectorState === VectorState.On) {
|
||||
return StandardActions.ACTION_NOTIFY;
|
||||
} else if (pushRuleVectorState === VectorState.Loud) {
|
||||
@@ -62,7 +62,7 @@ export class PushRuleVectorState {
|
||||
* category or in PushRuleVectorState.LOUD, regardless of its enabled
|
||||
* state. Returns null if it does not match these categories.
|
||||
*/
|
||||
static contentRuleVectorStateKind(rule: IPushRule): VectorState {
|
||||
public static contentRuleVectorStateKind(rule: IPushRule): VectorState {
|
||||
const decoded = NotificationUtils.decodeActions(rule.actions);
|
||||
|
||||
if (!decoded) {
|
||||
|
||||
@@ -20,11 +20,11 @@ import { NotificationUtils } from "./NotificationUtils";
|
||||
const encodeActions = NotificationUtils.encodeActions;
|
||||
|
||||
export class StandardActions {
|
||||
static ACTION_NOTIFY = encodeActions({ notify: true });
|
||||
static ACTION_NOTIFY_DEFAULT_SOUND = encodeActions({ notify: true, sound: "default" });
|
||||
static ACTION_NOTIFY_RING_SOUND = encodeActions({ notify: true, sound: "ring" });
|
||||
static ACTION_HIGHLIGHT = encodeActions({ notify: true, highlight: true });
|
||||
static ACTION_HIGHLIGHT_DEFAULT_SOUND = encodeActions({ notify: true, sound: "default", highlight: true });
|
||||
static ACTION_DONT_NOTIFY = encodeActions({ notify: false });
|
||||
static ACTION_DISABLED = null;
|
||||
public static ACTION_NOTIFY = encodeActions({ notify: true });
|
||||
public static ACTION_NOTIFY_DEFAULT_SOUND = encodeActions({ notify: true, sound: "default" });
|
||||
public static ACTION_NOTIFY_RING_SOUND = encodeActions({ notify: true, sound: "ring" });
|
||||
public static ACTION_HIGHLIGHT = encodeActions({ notify: true, highlight: true });
|
||||
public static ACTION_HIGHLIGHT_DEFAULT_SOUND = encodeActions({ notify: true, sound: "default", highlight: true });
|
||||
public static ACTION_DONT_NOTIFY = encodeActions({ notify: false });
|
||||
public static ACTION_DISABLED = null;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class VectorPushRuleDefinition {
|
||||
public readonly description: string;
|
||||
public readonly vectorStateToActions: StateToActionsMap;
|
||||
|
||||
constructor(opts: IVectorPushRuleDefinition) {
|
||||
public constructor(opts: IVectorPushRuleDefinition) {
|
||||
this.description = opts.description;
|
||||
this.vectorStateToActions = opts.vectorStateToActions;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user