backend/source/logic/types.ts
Fenris Wolf 762f3ba3d6 [mod]
2024-09-11 20:19:13 +02:00

104 lines
1.2 KiB
TypeScript

/**
*/
namespace _zeitbild.frontend
{
/**
*/
type type_role = (
"editor"
|
"viewer"
);
/**
*/
type type_user_id = int;
/**
*/
type type_user_object = {
name : string;
};
/**
*/
export type type_event = {
name : string;
begin : _zeitbild.frontend.helpers.type_datetime;
end : (
null
|
_zeitbild.frontend.helpers.type_datetime
);
location : (
null
|
string
);
description : (
null
|
string
);
};
/**
*/
export type type_calendar_id = int;
/**
* @todo bei "collection" Kreise vermeiden
*/
export type type_calendar_object = (
{
kind : "concrete";
data : {
name : string;
private : boolean;
users : Array<
{
id : type_user_id;
role : type_role;
}
>;
events : Array<type_event>;
};
}
|
{
kind : "caldav";
data : {
name : string;
private : boolean;
read_only : boolean;
source_url : string;
}
}
);
/**
*/
export type type_datamodel = {
users : Array<
{
id : type_user_id;
object : type_user_object;
}
>;
calendars : Array<
{
id : type_calendar_id;
object : type_calendar_object;
}
>;
};
}