core/source/logic/notification_kinds/_base.ts

85 lines
1.6 KiB
TypeScript
Raw Permalink Normal View History

2024-07-02 15:02:35 +02:00
/*
Copyright 2016-2024 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
<info@greenscale.de>
»heimdall« is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
»heimdall« is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with »heimdall«. If not, see <http://www.gnu.org/licenses/>.
*/
2023-08-03 08:34:33 +02:00
namespace _heimdall.notification_kinds
{
/**
*/
export type type_notification_kind = {
parameters_schema : (
()
=>
_heimdall.helpers.json_schema.type_schema
);
normalize_order_node : (
(node : any)
=>
any
);
notify : (
(
parameters : any,
name : string,
data : type_check,
state : type_item_state,
info : any
)
=>
Promise<void>
);
};
/**
*/
var _implementations : Record<string, type_notification_kind> = {};
/**
*/
export function register_implementation(
name : string,
notification_kind : type_notification_kind
) : void
{
_implementations[name] = notification_kind;
}
/**
*/
export function get_implementation(
name : string
) : type_notification_kind
{
return _implementations[name];
}
/**
*/
export function get_implementations(
) : Record<string, type_notification_kind>
{
return _implementations;
}
}