محورية / المخطر
واجهة: Notifier
محدد في: ui/Notifier.ts:197
يدير ويعرض رسائل الإعلام في واجهة المستخدم الرسم البياني.
استخدم هذا المكون لإظهار رسائل النجاح أو التحذير أو الخطأ أو المعلومات للمستخدم.
أمثلة
graph.notifier.warning('This is a warning', 'Content of the message goes here.')يمكن أن يحمل الإشعار أيضًا إجراءً واحدًا ويستمر لمدة تزيد عن أربع ثوانٍ افتراضية، وهي الطريقة التي تعرض بها النتيجة التراجع عن نفسها:
const toast = graph.notifier.success('Ingested 12 nodes', undefined, {
action: { label: 'Undo', onClick: (t) => { undo(); t.update({ title: 'Undone' }) } },
})طرق
error()
error(
title,message?,options?):NotificationHandle|undefined
محدد في: ui/Notifier.ts:234
المعلمات
title
string
message?
string
options?
Pick<Notification, "action" | "duration">
المرتجعات
NotificationHandle | undefined
info()
info(
title,message?,options?):NotificationHandle|undefined
محدد في: ui/Notifier.ts:238
المعلمات
title
string
message?
string
options?
Pick<Notification, "action" | "duration">
المرتجعات
NotificationHandle | undefined
notify()
notify(
level,title,message?,options?):NotificationHandle|undefined
محدد في: ui/Notifier.ts:216
أرسل إشعارًا إلى UIManager.
المعلمات
level
مستوى خطورة الإخطار.
title
string
العنوان الذي سيتم عرضه في الإشعار.
message?
string
رسالة تفصيلية اختيارية للإخطار.
options?
Pick<Notification, "action" | "duration">
إجراء يجب تقديمه، ومدة البقاء.
المرتجعات
NotificationHandle | undefined
مقبض على الخبز المحمص، أو undefined حيث لا يوجد مكان إظهار واحد (وضع واجهة المستخدم بدون فتحة إعلام).
success()
success(
title,message?,options?):NotificationHandle|undefined
محدد في: ui/Notifier.ts:226
المعلمات
title
string
message?
string
options?
Pick<Notification, "action" | "duration">
المرتجعات
NotificationHandle | undefined
warning()
warning(
title,message?,options?):NotificationHandle|undefined
محدد في: ui/Notifier.ts:230
المعلمات
title
string
message?
string
options?
Pick<Notification, "action" | "duration">
المرتجعات
NotificationHandle | undefined