aboutsummaryrefslogtreecommitdiffstats
path: root/core/src/OCP/toast.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/OCP/toast.js')
-rw-r--r--core/src/OCP/toast.js67
1 files changed, 67 insertions, 0 deletions
diff --git a/core/src/OCP/toast.js b/core/src/OCP/toast.js
new file mode 100644
index 00000000000..f93344bbc8e
--- /dev/null
+++ b/core/src/OCP/toast.js
@@ -0,0 +1,67 @@
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+import {
+ showError,
+ showInfo, showMessage,
+ showSuccess,
+ showWarning,
+} from '@nextcloud/dialogs'
+
+/** @typedef {import('toastify-js')} Toast */
+
+export default {
+ /**
+ * @deprecated 19.0.0 use `showSuccess` from the `@nextcloud/dialogs` package instead
+ *
+ * @param {string} text the toast text
+ * @param {object} options options
+ * @return {Toast}
+ */
+ success(text, options) {
+ return showSuccess(text, options)
+ },
+ /**
+ * @deprecated 19.0.0 use `showWarning` from the `@nextcloud/dialogs` package instead
+ *
+ * @param {string} text the toast text
+ * @param {object} options options
+ * @return {Toast}
+ */
+ warning(text, options) {
+ return showWarning(text, options)
+ },
+ /**
+ * @deprecated 19.0.0 use `showError` from the `@nextcloud/dialogs` package instead
+ *
+ * @param {string} text the toast text
+ * @param {object} options options
+ * @return {Toast}
+ */
+ error(text, options) {
+ return showError(text, options)
+ },
+ /**
+ * @deprecated 19.0.0 use `showInfo` from the `@nextcloud/dialogs` package instead
+ *
+ * @param {string} text the toast text
+ * @param {object} options options
+ * @return {Toast}
+ */
+ info(text, options) {
+ return showInfo(text, options)
+ },
+ /**
+ * @deprecated 19.0.0 use `showMessage` from the `@nextcloud/dialogs` package instead
+ *
+ * @param {string} text the toast text
+ * @param {object} options options
+ * @return {Toast}
+ */
+ message(text, options) {
+ return showMessage(text, options)
+ },
+
+}