munin/source/sources/_functions.ts

49 lines
1.2 KiB
TypeScript
Raw Normal View History

2025-04-25 12:50:13 +02:00
/*
This file is part of »munin«.
Copyright 2025 'Fenris Wolf' <fenris@folksprak.org>
»munin« is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
»munin« 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with »munin«. If not, see <http://www.gnu.org/licenses/>.
*/
namespace _munin.sources
2025-04-25 00:48:05 +02:00
{
/**
*/
export function factory(
description : {
kind : string,
data : any
}
2025-04-25 12:50:13 +02:00
) : _munin.type_source
2025-04-25 00:48:05 +02:00
{
switch (description.kind) {
default: {
throw (new Error("unhandled source kind: " + description.kind));
break;
}
case "kalender_digital": {
2025-04-25 12:50:13 +02:00
return _munin.sources.kalender_digital.implementation_source(
description.data as _munin.sources.kalender_digital.type_parameters
2025-04-25 00:48:05 +02:00
);
return
}
}
}
}