pivotick / Melder
Interface: Notifier
Gedefinieerd in: ui/Notifier.ts:197
Beheert en toont meldingsberichten in de grafische gebruikersinterface.
Gebruik dit onderdeel om succes-, waarschuwings-, fout- of infoberichten weer te geven aan de gebruiker.
Voorbeelden
graph.notifier.warning('This is a warning', 'Content of the message goes here.')Een melding kan ook één actie uitvoeren en de standaard vier seconden overleven, en dat is hoe een uitkomst zichzelf ongedaan kan maken:
const toast = graph.notifier.success('Ingested 12 nodes', undefined, {
action: { label: 'Undo', onClick: (t) => { undo(); t.update({ title: 'Undone' }) } },
})Methoden
error()
error(
title,message?,options?):NotificationHandle|undefined
Gedefinieerd in: ui/Notifier.ts:234
Parameters
title
string
message?
string
options?
Pick<Notification, "action" | "duration">
Retouren
NotificationHandle | undefined
info()
info(
title,message?,options?):NotificationHandle|undefined
Gedefinieerd in: ui/Notifier.ts:238
Parameters
title
string
message?
string
options?
Pick<Notification, "action" | "duration">
Retouren
NotificationHandle | undefined
notify()
notify(
level,title,message?,options?):NotificationHandle|undefined
Gedefinieerd in: ui/Notifier.ts:216
Stuur een melding naar de UIManager.
Parameters
level
Het ernstniveau van de melding.
title
string
De titel die in de melding moet worden weergegeven.
message?
string
Optioneel gedetailleerd bericht voor de melding.
options?
Pick<Notification, "action" | "duration">
Een actie om aan te bieden, en hoe lang je moet blijven.
Retouren
NotificationHandle | undefined
Een handvat op de toast, of undefined waar je nergens heen kunt laat er één zien (een UI-modus zonder notificatieslot).
success()
success(
title,message?,options?):NotificationHandle|undefined
Gedefinieerd in: ui/Notifier.ts:226
Parameters
title
string
message?
string
options?
Pick<Notification, "action" | "duration">
Retouren
NotificationHandle | undefined
warning()
warning(
title,message?,options?):NotificationHandle|undefined
Gedefinieerd in: ui/Notifier.ts:230
Parameters
title
string
message?
string
options?
Pick<Notification, "action" | "duration">
Retouren
NotificationHandle | undefined