frontend-dali/source/base/types.ts

145 lines
1.7 KiB
TypeScript
Raw Normal View History

2024-09-12 00:02:12 +02:00
/**
*/
2025-09-25 17:54:20 +02:00
namespace _dali.type
2024-09-12 00:02:12 +02:00
{
/**
*/
2024-09-26 10:52:31 +02:00
export enum enum_access_level {
none,
view,
edit,
admin
}
2024-09-12 00:02:12 +02:00
/**
*/
export type user_id = int;
2024-09-12 00:02:12 +02:00
/**
*/
export type user_object = {
2024-09-12 00:02:12 +02:00
name : string;
email_address : (
null
|
string
);
2024-09-12 00:02:12 +02:00
};
2025-10-14 15:56:29 +02:00
/**
* @todo deprecate?
*/
export type local_resource_event_id = int;
/**
* info: das ist nicht deckungsgleich mit der Event-ID aus dem Backend; hiermit werden sowohl lokale als auch
* extern eingebundene Events kodiert
*
* @example "local:1234"
* @example "ics~2345"
2025-10-14 15:56:29 +02:00
*/
export type event_key = string;
2025-10-14 15:56:29 +02:00
2024-09-12 00:02:12 +02:00
/**
*/
export type event_object = {
2024-09-12 00:02:12 +02:00
name : string;
2024-09-26 16:47:01 +02:00
begin : lib_plankton.pit.type_datetime;
2024-09-12 00:02:12 +02:00
end : (
null
|
2024-09-26 16:47:01 +02:00
lib_plankton.pit.type_datetime
2024-09-12 00:02:12 +02:00
);
location : (
null
|
string
);
link : (
null
|
string
);
2024-09-12 00:02:12 +02:00
description : (
null
|
string
);
};
/**
*/
2025-10-14 15:56:29 +02:00
export type event_entry = {
id : (null | local_resource_event_id);
key : event_key;
2025-10-14 15:56:29 +02:00
object : event_object;
};
2024-09-12 00:02:12 +02:00
/**
*/
export type resource_id = int;
2024-09-12 00:02:12 +02:00
/**
*/
export type resource_object = (
2024-09-12 00:02:12 +02:00
{
kind : "local";
2024-09-12 00:02:12 +02:00
data : {
events : Array<
event_object
2024-09-12 00:02:12 +02:00
>;
};
}
|
{
kind : "caldav";
data : {
read_only : boolean;
url : string;
};
2024-09-12 00:02:12 +02:00
}
);
/**
*/
export type calendar_id = int;
/**
*/
export type calendar_object = {
name : string;
2025-10-13 13:22:53 +02:00
hue : float;
2024-09-26 10:52:31 +02:00
access : {
2024-10-10 23:00:51 +02:00
public : boolean;
2024-09-26 10:52:31 +02:00
default_level : enum_access_level;
attributed : lib_plankton.map.type_map<
user_id,
enum_access_level
>;
};
resource : resource_object;
2024-09-12 00:02:12 +02:00
};
/**
*/
export enum enum_view_mode
{
week,
list,
}
2024-09-12 00:02:12 +02:00
}