Convert CommonJS exports to ES6-compatible exports

We use `export default` begrudgingly here. Ideally we'd use just `export`, though this entire SDK expects things to be exported as a default. Instead of breaking everything, we'll sacrifice our export pattern for a smaller diff - a later commit can always do the default export -> regular export conversion.
This commit is contained in:
Travis Ralston 2019-12-19 17:45:24 -07:00
parent 0b0fe92b17
commit 344dac4fb9
147 changed files with 649 additions and 620 deletions

View file

@ -1,5 +1,6 @@
/*
Copyright 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -16,16 +17,16 @@ limitations under the License.
'use strict';
const NotificationUtils = require('./NotificationUtils');
import {NotificationUtils} from "./NotificationUtils";
const encodeActions = NotificationUtils.encodeActions;
module.exports = {
ACTION_NOTIFY: encodeActions({notify: true}),
ACTION_NOTIFY_DEFAULT_SOUND: encodeActions({notify: true, sound: "default"}),
ACTION_NOTIFY_RING_SOUND: encodeActions({notify: true, sound: "ring"}),
ACTION_HIGHLIGHT: encodeActions({notify: true, highlight: true}),
ACTION_HIGHLIGHT_DEFAULT_SOUND: encodeActions({notify: true, sound: "default", highlight: true}),
ACTION_DONT_NOTIFY: encodeActions({notify: false}),
ACTION_DISABLED: null,
};
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;
}