@rokoyfa/calendar 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/DEVELOPER_GUIDE.md +1045 -0
- package/README.md +41 -190
- package/api/openapi.yaml +395 -4
- package/demo/calendar.config.jsonc +183 -0
- package/demo/calendar.config.yaml +180 -0
- package/dist-lib/cdn/browser-BSbYkIQu.js +130 -0
- package/dist-lib/cdn/browser-BSbYkIQu.js.map +1 -0
- package/dist-lib/cdn/calendar-widget.js +14 -11
- package/dist-lib/cdn/calendar-widget.js.map +1 -1
- package/dist-lib/cdn/de-Dqga3QZG.js +2 -0
- package/dist-lib/cdn/de-Dqga3QZG.js.map +1 -0
- package/dist-lib/cdn/es-BWSfTMjh.js +2 -0
- package/dist-lib/cdn/es-BWSfTMjh.js.map +1 -0
- package/dist-lib/cdn/fr-N9gwLjVq.js +2 -0
- package/dist-lib/cdn/fr-N9gwLjVq.js.map +1 -0
- package/dist-lib/cdn/it-B5Ib2xLn.js +2 -0
- package/dist-lib/cdn/it-B5Ib2xLn.js.map +1 -0
- package/dist-lib/cdn/nl-CjI7Uc8l.js +2 -0
- package/dist-lib/cdn/nl-CjI7Uc8l.js.map +1 -0
- package/dist-lib/cdn/pl-FRu3yQhc.js +2 -0
- package/dist-lib/cdn/pl-FRu3yQhc.js.map +1 -0
- package/dist-lib/cdn/pt-DBKJ-3Is.js +2 -0
- package/dist-lib/cdn/pt-DBKJ-3Is.js.map +1 -0
- package/dist-lib/npm/{de-Cuz-uz3s.js → de-DhWrY8Ae.js} +111 -3
- package/dist-lib/npm/de-DhWrY8Ae.js.map +1 -0
- package/dist-lib/npm/{es-BnRzdU90.js → es-Bj8leuD5.js} +111 -3
- package/dist-lib/npm/es-Bj8leuD5.js.map +1 -0
- package/dist-lib/npm/{fr-B-nmvStg.js → fr-DzAFZ0jh.js} +111 -3
- package/dist-lib/npm/fr-DzAFZ0jh.js.map +1 -0
- package/dist-lib/npm/index.js +3876 -1400
- package/dist-lib/npm/index.js.map +1 -1
- package/dist-lib/npm/{it-DMTpE4GO.js → it-lEmGP5yo.js} +111 -3
- package/dist-lib/npm/it-lEmGP5yo.js.map +1 -0
- package/dist-lib/npm/{nl-DQkyEt9Z.js → nl-d1h63dvm.js} +111 -3
- package/dist-lib/npm/nl-d1h63dvm.js.map +1 -0
- package/dist-lib/npm/{pl-CcjU41yx.js → pl-DynFKadb.js} +111 -3
- package/dist-lib/npm/pl-DynFKadb.js.map +1 -0
- package/dist-lib/npm/{pt-Dulais2f.js → pt-foL7jDsE.js} +111 -3
- package/dist-lib/npm/pt-foL7jDsE.js.map +1 -0
- package/dist-lib/npm/types/components/Icons.d.ts +2 -0
- package/dist-lib/npm/types/config/routes.d.ts +1 -0
- package/dist-lib/npm/types/context/HostBridge.d.ts +38 -0
- package/dist-lib/npm/types/context/HostContext.d.ts +39 -2
- package/dist-lib/npm/types/data/restDataSource.d.ts +3 -1
- package/dist-lib/npm/types/data/tenantDataSource.d.ts +3 -1
- package/dist-lib/npm/types/data/types.d.ts +4 -1
- package/dist-lib/npm/types/features/attachments/components/AttachmentsField.d.ts +8 -0
- package/dist-lib/npm/types/features/attachments/hooks/useAttachments.d.ts +11 -0
- package/dist-lib/npm/types/features/attachments/index.d.ts +2 -0
- package/dist-lib/npm/types/features/authorization/components/account/DataExportSection.d.ts +1 -0
- package/dist-lib/npm/types/features/authorization/hooks/useAuth.d.ts +1 -0
- package/dist-lib/npm/types/features/authorization/index.d.ts +1 -0
- package/dist-lib/npm/types/features/authorization/repositories/HostTokenAuthRepository.d.ts +1 -0
- package/dist-lib/npm/types/features/authorization/repositories/RemoteAuthRepository.d.ts +1 -0
- package/dist-lib/npm/types/features/authorization/types/auth.d.ts +2 -0
- package/dist-lib/npm/types/features/calendar/components/Calendar.d.ts +7 -1
- package/dist-lib/npm/types/features/calendar/components/CalendarHeader.d.ts +3 -1
- package/dist-lib/npm/types/features/calendar/constants/views.d.ts +2 -2
- package/dist-lib/npm/types/features/calendar/hooks/useEventNavigation.d.ts +4 -0
- package/dist-lib/npm/types/features/calendar/hooks/useHostController.d.ts +2 -0
- package/dist-lib/npm/types/features/calendar/hooks/useLiveEvents.d.ts +11 -0
- package/dist-lib/npm/types/features/calendar/hooks/useSegmentAttributes.d.ts +2 -0
- package/dist-lib/npm/types/features/calendar/utils/eventLabels.d.ts +4 -0
- package/dist-lib/npm/types/features/calendars/components/settings/ShareSection.d.ts +4 -0
- package/dist-lib/npm/types/features/calendars/components/settings/TrashSection.d.ts +4 -0
- package/dist-lib/npm/types/features/calendars/index.d.ts +1 -1
- package/dist-lib/npm/types/features/calendars/repositories/RemoteCalendarRepository.d.ts +3 -0
- package/dist-lib/npm/types/features/calendars/types/calendar.d.ts +3 -0
- package/dist-lib/npm/types/features/calendars/utils/permissions.d.ts +4 -0
- package/dist-lib/npm/types/features/categories/components/CategoriesSection.d.ts +6 -0
- package/dist-lib/npm/types/features/categories/components/CategoryField.d.ts +9 -0
- package/dist-lib/npm/types/features/categories/components/CategoryFilterModal.d.ts +10 -0
- package/dist-lib/npm/types/features/categories/hooks/useCategories.d.ts +9 -0
- package/dist-lib/npm/types/features/categories/index.d.ts +4 -0
- package/dist-lib/npm/types/features/events/components/DeleteEventModal.d.ts +2 -1
- package/dist-lib/npm/types/features/events/components/EventModal.d.ts +11 -3
- package/dist-lib/npm/types/features/events/hooks/useEvents.d.ts +4 -1
- package/dist-lib/npm/types/features/events/index.d.ts +2 -2
- package/dist-lib/npm/types/features/events/utils/icalExchange.d.ts +4 -1
- package/dist-lib/npm/types/features/storage/index.d.ts +6 -1
- package/dist-lib/npm/types/features/storage/repositories/LocalCategoryRepository.d.ts +14 -0
- package/dist-lib/npm/types/features/storage/repositories/LocalEventRepository.d.ts +8 -2
- package/dist-lib/npm/types/features/storage/repositories/RemoteAttachmentRepository.d.ts +11 -0
- package/dist-lib/npm/types/features/storage/repositories/RemoteCategoryRepository.d.ts +10 -0
- package/dist-lib/npm/types/features/storage/repositories/RemoteChatRepository.d.ts +2 -1
- package/dist-lib/npm/types/features/storage/repositories/RemoteEventRepository.d.ts +9 -3
- package/dist-lib/npm/types/features/storage/repositories/RemoteSharedCalendarRepository.d.ts +9 -0
- package/dist-lib/npm/types/features/storage/types/storage.d.ts +30 -2
- package/dist-lib/npm/types/features/storage/utils/liveSocket.d.ts +10 -0
- package/dist-lib/npm/types/i18n/messages/en/calendar.d.ts +9 -0
- package/dist-lib/npm/types/i18n/messages/en/calendars.d.ts +44 -0
- package/dist-lib/npm/types/i18n/messages/en/core.d.ts +1 -0
- package/dist-lib/npm/types/i18n/messages/en/events.d.ts +37 -0
- package/dist-lib/npm/types/i18n/messages/en/index.d.ts +99 -1
- package/dist-lib/npm/types/i18n/messages/en/settings.d.ts +7 -0
- package/dist-lib/npm/types/i18n/messages/index.d.ts +99 -1
- package/dist-lib/npm/types/lib/CalendarWidget.d.ts +1 -1
- package/dist-lib/npm/types/lib/IsolatedRoot.d.ts +3 -1
- package/dist-lib/npm/types/lib/appearance.d.ts +3 -0
- package/dist-lib/npm/types/lib/config.d.ts +16 -27
- package/dist-lib/npm/types/lib/configFile.d.ts +6 -0
- package/dist-lib/npm/types/lib/defaults.d.ts +29 -1
- package/dist-lib/npm/types/lib/element.d.ts +15 -1
- package/dist-lib/npm/types/lib/handle.d.ts +15 -0
- package/dist-lib/npm/types/lib/index.d.ts +6 -2
- package/dist-lib/npm/types/lib/options.d.ts +47 -0
- package/dist-lib/npm/types/lib/useCalendarOptions.d.ts +11 -0
- package/dist-lib/npm/types/pages/SharedCalendarPage.d.ts +1 -0
- package/dist-lib/npm/types/utils/api.d.ts +1 -0
- package/dist-lib/npm/types/utils/appError.d.ts +1 -1
- package/dist-lib/npm/types/utils/attachment.d.ts +31 -0
- package/dist-lib/npm/types/utils/calendarView.d.ts +1 -0
- package/dist-lib/npm/types/utils/category.d.ts +18 -0
- package/dist-lib/npm/types/utils/conflict.d.ts +1 -0
- package/dist-lib/npm/types/utils/dataExport.d.ts +13 -0
- package/dist-lib/npm/types/utils/event.d.ts +6 -1
- package/dist-lib/npm/types/utils/eventChange.d.ts +13 -0
- package/dist-lib/npm/types/utils/ical.d.ts +6 -1
- package/dist-lib/npm/types/utils/sharedCalendar.d.ts +13 -0
- package/dist-lib/npm/types/utils/trash.d.ts +14 -0
- package/package.json +8 -2
- package/schema/calendar-config.schema.json +297 -0
- package/dist-lib/cdn/de-BjzK4Pgn.js +0 -2
- package/dist-lib/cdn/de-BjzK4Pgn.js.map +0 -1
- package/dist-lib/cdn/es-TA5DvEsw.js +0 -2
- package/dist-lib/cdn/es-TA5DvEsw.js.map +0 -1
- package/dist-lib/cdn/fr-Dx-nmhQ7.js +0 -2
- package/dist-lib/cdn/fr-Dx-nmhQ7.js.map +0 -1
- package/dist-lib/cdn/it-D_2eA3dT.js +0 -2
- package/dist-lib/cdn/it-D_2eA3dT.js.map +0 -1
- package/dist-lib/cdn/nl-dC1zae2Z.js +0 -2
- package/dist-lib/cdn/nl-dC1zae2Z.js.map +0 -1
- package/dist-lib/cdn/pl-9TYRPoy1.js +0 -2
- package/dist-lib/cdn/pl-9TYRPoy1.js.map +0 -1
- package/dist-lib/cdn/pt-CvBN-qx1.js +0 -2
- package/dist-lib/cdn/pt-CvBN-qx1.js.map +0 -1
- package/dist-lib/npm/de-Cuz-uz3s.js.map +0 -1
- package/dist-lib/npm/es-BnRzdU90.js.map +0 -1
- package/dist-lib/npm/fr-B-nmvStg.js.map +0 -1
- package/dist-lib/npm/it-DMTpE4GO.js.map +0 -1
- package/dist-lib/npm/nl-DQkyEt9Z.js.map +0 -1
- package/dist-lib/npm/pl-CcjU41yx.js.map +0 -1
- package/dist-lib/npm/pt-Dulais2f.js.map +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CalendarView } from '../utils/calendarView.js';
|
|
2
|
+
export type CalendarState = {
|
|
3
|
+
view: CalendarView;
|
|
4
|
+
date: string;
|
|
5
|
+
from: string;
|
|
6
|
+
to: string;
|
|
7
|
+
};
|
|
8
|
+
export type NewEventDraft = {
|
|
9
|
+
title?: string;
|
|
10
|
+
startDate?: string;
|
|
11
|
+
start?: string;
|
|
12
|
+
endDate?: string;
|
|
13
|
+
end?: string;
|
|
14
|
+
allDay?: boolean;
|
|
15
|
+
location?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
};
|
|
18
|
+
export type CalendarController = {
|
|
19
|
+
getState: () => CalendarState;
|
|
20
|
+
goToDate: (date: string) => void;
|
|
21
|
+
setView: (view: CalendarView) => boolean;
|
|
22
|
+
next: () => void;
|
|
23
|
+
previous: () => void;
|
|
24
|
+
today: () => void;
|
|
25
|
+
openEvent: (eventId: string, date: string) => void;
|
|
26
|
+
createEvent: (draft?: NewEventDraft) => boolean;
|
|
27
|
+
refresh: () => void;
|
|
28
|
+
};
|
|
29
|
+
type ControllerSource = () => CalendarController;
|
|
30
|
+
type ViewListener = (state: CalendarState) => void;
|
|
31
|
+
export declare class HostBridge {
|
|
32
|
+
#private;
|
|
33
|
+
get controller(): CalendarController | null;
|
|
34
|
+
attach(source: ControllerSource): () => void;
|
|
35
|
+
listen(listener: ViewListener | null): void;
|
|
36
|
+
report(state: CalendarState): void;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CalendarFeatures } from '../lib/defaults.js';
|
|
2
|
+
import { type CalendarView } from '../utils/calendarView.js';
|
|
3
|
+
import type { HostBridge } from './HostBridge.js';
|
|
2
4
|
export type HostTheme = 'light' | 'dark';
|
|
5
|
+
export type HostLinks = {
|
|
6
|
+
routing: 'memory' | 'browser';
|
|
7
|
+
basename?: string;
|
|
8
|
+
linkParam: string | false;
|
|
9
|
+
};
|
|
3
10
|
export type HostOptions = {
|
|
4
|
-
|
|
11
|
+
features: CalendarFeatures;
|
|
12
|
+
views: readonly CalendarView[];
|
|
13
|
+
readOnly?: boolean;
|
|
14
|
+
bridge?: HostBridge;
|
|
15
|
+
links?: HostLinks;
|
|
5
16
|
theme?: HostTheme;
|
|
6
17
|
initialView?: CalendarView;
|
|
7
18
|
timeZone?: string;
|
|
@@ -10,3 +21,29 @@ export type HostOptions = {
|
|
|
10
21
|
};
|
|
11
22
|
export declare const HostContext: import("react").Context<HostOptions>;
|
|
12
23
|
export declare const useHost: () => HostOptions;
|
|
24
|
+
export declare const useFeatures: () => {
|
|
25
|
+
auth: boolean;
|
|
26
|
+
teams: boolean;
|
|
27
|
+
chat: boolean;
|
|
28
|
+
attendees: boolean;
|
|
29
|
+
recurrence: boolean;
|
|
30
|
+
reminders: boolean;
|
|
31
|
+
links: boolean;
|
|
32
|
+
mapLinks: boolean;
|
|
33
|
+
holidays: boolean;
|
|
34
|
+
search: boolean;
|
|
35
|
+
undo: boolean;
|
|
36
|
+
duplicate: boolean;
|
|
37
|
+
shortcuts: boolean;
|
|
38
|
+
subscriptions: boolean;
|
|
39
|
+
importExport: boolean;
|
|
40
|
+
emailNotifications: boolean;
|
|
41
|
+
timeZones: boolean;
|
|
42
|
+
customColors: boolean;
|
|
43
|
+
categories: boolean;
|
|
44
|
+
publicLinks: boolean;
|
|
45
|
+
attachments: boolean;
|
|
46
|
+
liveUpdates: boolean;
|
|
47
|
+
trash: boolean;
|
|
48
|
+
dataExport: boolean;
|
|
49
|
+
};
|
|
@@ -9,6 +9,8 @@ export type RestDataSourceOptions = {
|
|
|
9
9
|
getAccessToken?: () => string | null;
|
|
10
10
|
getUserToken?: UserTokenProvider;
|
|
11
11
|
holidaySource?: HolidaySource;
|
|
12
|
+
chat?: boolean;
|
|
13
|
+
liveUpdates?: boolean;
|
|
12
14
|
chatSocketUrl?: string;
|
|
13
15
|
};
|
|
14
|
-
export declare function restDataSource({ baseUrl, timeoutMs, auth, headers, getAccessToken, getUserToken, holidaySource, chatSocketUrl, }: RestDataSourceOptions): CalendarDataSource;
|
|
16
|
+
export declare function restDataSource({ baseUrl, timeoutMs, auth, headers, getAccessToken, getUserToken, holidaySource, chat, liveUpdates, chatSocketUrl, }: RestDataSourceOptions): CalendarDataSource;
|
|
@@ -8,5 +8,7 @@ export type TenantDataSourceOptions = {
|
|
|
8
8
|
timeoutMs?: number;
|
|
9
9
|
getUserToken?: UserTokenProvider;
|
|
10
10
|
holidaySource?: HolidaySource;
|
|
11
|
+
chat?: boolean;
|
|
12
|
+
liveUpdates?: boolean;
|
|
11
13
|
};
|
|
12
|
-
export declare const tenantDataSource: ({ tenant, baseUrl, timeoutMs, getUserToken, holidaySource, }: TenantDataSourceOptions) => CalendarDataSource;
|
|
14
|
+
export declare const tenantDataSource: ({ tenant, baseUrl, timeoutMs, getUserToken, holidaySource, chat, liveUpdates, }: TenantDataSourceOptions) => CalendarDataSource;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AuthRepository } from '../features/authorization/index.js';
|
|
2
2
|
import type { CalendarRepository } from '../features/calendars/index.js';
|
|
3
|
-
import type { ColorRepository, EventRepository, ChatRepository, HolidayRepository, PreferencesRepository, StorageMode } from '../features/storage/index.js';
|
|
3
|
+
import type { ColorRepository, EventRepository, AttachmentRepository, CategoryRepository, ChatRepository, HolidayRepository, PreferencesRepository, SharedCalendarRepository, StorageMode } from '../features/storage/index.js';
|
|
4
4
|
export type DataRepositories = {
|
|
5
5
|
mode: StorageMode;
|
|
6
6
|
events: EventRepository;
|
|
@@ -9,6 +9,9 @@ export type DataRepositories = {
|
|
|
9
9
|
preferences: PreferencesRepository;
|
|
10
10
|
holidays?: HolidayRepository;
|
|
11
11
|
chat?: ChatRepository;
|
|
12
|
+
categories?: CategoryRepository;
|
|
13
|
+
shared?: SharedCalendarRepository;
|
|
14
|
+
attachments?: AttachmentRepository;
|
|
12
15
|
};
|
|
13
16
|
export type DataSourceContext = {
|
|
14
17
|
getLanguage: () => string | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type AttachmentsFieldProps = {
|
|
2
|
+
eventId: string | null;
|
|
3
|
+
canEdit: boolean;
|
|
4
|
+
pending: readonly File[];
|
|
5
|
+
onPendingChange: (files: File[]) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function AttachmentsField({ eventId, canEdit, pending, onPendingChange }: AttachmentsFieldProps): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Attachment } from '../../../utils/attachment.js';
|
|
2
|
+
export declare function useAttachmentRepository(): import("../../storage/index.ts").AttachmentRepository | null;
|
|
3
|
+
export declare function useAttachments(eventId: string | null): {
|
|
4
|
+
isAvailable: boolean;
|
|
5
|
+
attachments: Attachment[];
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
loadError: unknown;
|
|
8
|
+
upload: (files: readonly File[]) => Promise<void>;
|
|
9
|
+
remove: (attachment: Attachment) => Promise<void>;
|
|
10
|
+
download: (attachment: Attachment) => Promise<void>;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function DataExportSection(): import("react").JSX.Element | null;
|
|
@@ -11,6 +11,7 @@ export declare const useAuth: () => {
|
|
|
11
11
|
resendVerificationEmail: () => Promise<void>;
|
|
12
12
|
} & {
|
|
13
13
|
respondToEvent: (token: string, status: import("../../../utils/event.ts").EventReply) => Promise<import("../../../utils/event.ts").EventResponse>;
|
|
14
|
+
exportData: (() => Promise<Blob>) | null;
|
|
14
15
|
enabled: boolean;
|
|
15
16
|
method: import("../index.ts").AuthMethod;
|
|
16
17
|
status: import("../types/auth.ts").AuthStatus;
|
|
@@ -4,6 +4,7 @@ export { HostTokenAuthRepository } from './repositories/HostTokenAuthRepository.
|
|
|
4
4
|
export { RemoteAuthRepository } from './repositories/RemoteAuthRepository.js';
|
|
5
5
|
export { AccountMenu } from './components/AccountMenu.js';
|
|
6
6
|
export { AccountSettings } from './components/account/AccountSettings.js';
|
|
7
|
+
export { DataExportSection } from './components/account/DataExportSection.js';
|
|
7
8
|
export { AuthGate } from './components/AuthGate.js';
|
|
8
9
|
export { EmailVerificationBanner } from './components/EmailVerificationBanner.js';
|
|
9
10
|
export { ForgotPasswordPage } from './components/ForgotPasswordPage.js';
|
|
@@ -7,6 +7,7 @@ export declare class HostTokenAuthRepository implements AuthRepository {
|
|
|
7
7
|
constructor(api: ApiClient, getUserToken: UserTokenProvider);
|
|
8
8
|
getCurrentUser(): Promise<User | null>;
|
|
9
9
|
logout(): Promise<void>;
|
|
10
|
+
exportData(): Promise<Blob>;
|
|
10
11
|
login: () => Promise<never>;
|
|
11
12
|
register: () => Promise<never>;
|
|
12
13
|
updateProfile: () => Promise<never>;
|
|
@@ -12,6 +12,7 @@ export declare class RemoteAuthRepository implements AuthRepository {
|
|
|
12
12
|
updateProfile(input: ProfileInput): Promise<User>;
|
|
13
13
|
changePassword(input: PasswordChangeInput): Promise<void>;
|
|
14
14
|
deleteAccount(input: AccountDeletionInput): Promise<void>;
|
|
15
|
+
exportData(): Promise<Blob>;
|
|
15
16
|
requestPasswordReset(input: PasswordResetRequestInput): Promise<void>;
|
|
16
17
|
resetPassword(input: PasswordResetInput): Promise<void>;
|
|
17
18
|
verifyEmail(token: string): Promise<void>;
|
|
@@ -42,10 +42,12 @@ export interface AuthRepository {
|
|
|
42
42
|
verifyEmail(token: string): Promise<void>;
|
|
43
43
|
resendVerificationEmail(): Promise<void>;
|
|
44
44
|
respondToEvent?(token: string, status: EventReply): Promise<EventResponse>;
|
|
45
|
+
exportData?(): Promise<Blob>;
|
|
45
46
|
}
|
|
46
47
|
type AccountActions = Pick<AuthRepository, 'login' | 'register' | 'logout' | 'updateProfile' | 'changePassword' | 'deleteAccount' | 'requestPasswordReset' | 'resetPassword' | 'verifyEmail' | 'resendVerificationEmail'>;
|
|
47
48
|
export type AuthContextValue = AccountActions & {
|
|
48
49
|
respondToEvent: (token: string, status: EventReply) => Promise<EventResponse>;
|
|
50
|
+
exportData: (() => Promise<Blob>) | null;
|
|
49
51
|
enabled: boolean;
|
|
50
52
|
method: AuthMethod;
|
|
51
53
|
status: AuthStatus;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
+
import { type CalendarEvent } from '../../../utils/event.js';
|
|
2
3
|
import { type EventTab } from '../../events/index.js';
|
|
3
4
|
import { type ChatAccess } from '../../chat/index.js';
|
|
4
5
|
import { type AttendeeCandidateLoader } from '../hooks/useAttendeeCandidates.js';
|
|
@@ -8,6 +9,11 @@ type CalendarProps = {
|
|
|
8
9
|
calendarIds: readonly string[];
|
|
9
10
|
targetCalendarId: string;
|
|
10
11
|
canCreate?: boolean;
|
|
12
|
+
readOnly?: boolean;
|
|
13
|
+
calendarNames?: ReadonlyMap<string, string>;
|
|
14
|
+
canManageCategories?: (calendarId: string) => boolean;
|
|
15
|
+
canEditEvent?: (event: CalendarEvent) => boolean;
|
|
16
|
+
currentUserId?: string | null;
|
|
11
17
|
eventSources?: EventSources;
|
|
12
18
|
initialView?: CalendarView;
|
|
13
19
|
headerContext?: ReactNode;
|
|
@@ -23,5 +29,5 @@ export type OpenEventRequest = {
|
|
|
23
29
|
date: string;
|
|
24
30
|
tab?: EventTab;
|
|
25
31
|
};
|
|
26
|
-
export declare function Calendar({ calendarIds, targetCalendarId, canCreate, eventSources, initialView, headerContext, headerAccessory, currentUserEmail, loadAttendeeCandidates, chat, openEvent, onOpenEventDone, }: CalendarProps): import("react").JSX.Element;
|
|
32
|
+
export declare function Calendar({ calendarIds, targetCalendarId, canCreate: mayCreate, readOnly: forcedReadOnly, calendarNames, canManageCategories, canEditEvent, currentUserId, eventSources, initialView, headerContext, headerAccessory, currentUserEmail, loadAttendeeCandidates, chat, openEvent: linkedEvent, onOpenEventDone, }: CalendarProps): import("react").JSX.Element;
|
|
27
33
|
export {};
|
|
@@ -10,8 +10,10 @@ type CalendarHeaderProps = {
|
|
|
10
10
|
onToday: () => void;
|
|
11
11
|
onCreateEvent?: () => void;
|
|
12
12
|
onSearch?: () => void;
|
|
13
|
+
onFilter?: () => void;
|
|
14
|
+
isFiltered?: boolean;
|
|
13
15
|
context?: ReactNode;
|
|
14
16
|
accessory?: ReactNode;
|
|
15
17
|
};
|
|
16
|
-
export declare function CalendarHeader({ view, title, subtitle, onViewChange, onPrevious, onNext, onToday, onCreateEvent, onSearch, context, accessory, }: CalendarHeaderProps): import("react").JSX.Element;
|
|
18
|
+
export declare function CalendarHeader({ view, title, subtitle, onViewChange, onPrevious, onNext, onToday, onCreateEvent, onSearch, onFilter, isFiltered, context, accessory, }: CalendarHeaderProps): import("react").JSX.Element;
|
|
17
19
|
export {};
|
|
@@ -3,8 +3,8 @@ import { type CalendarView, type ViewDefinition } from '../types/view.js';
|
|
|
3
3
|
export declare const VIEW_DEFINITIONS: Record<CalendarView, ViewDefinition>;
|
|
4
4
|
export declare const VIEW_SHORTCUTS: Record<CalendarView, string>;
|
|
5
5
|
export declare const withShortcut: (label: string, key: string) => string;
|
|
6
|
-
export declare const getViewOptions: (m: Messages) => {
|
|
6
|
+
export declare const getViewOptions: (m: Messages, views?: readonly CalendarView[], shortcuts?: boolean) => {
|
|
7
7
|
value: "day" | "week" | "month" | "year";
|
|
8
8
|
label: string;
|
|
9
|
-
title: string;
|
|
9
|
+
title: string | undefined;
|
|
10
10
|
}[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
export declare const EVENT_NAVIGATION_KEYS = "ArrowUp ArrowDown ArrowLeft ArrowRight Home End";
|
|
3
|
+
export declare const findNextEvent: (targets: readonly HTMLElement[], current: HTMLElement, key: string, dayOf: (element: HTMLElement) => Element | null) => HTMLElement | null;
|
|
4
|
+
export declare function useEventNavigation(containerRef: RefObject<HTMLElement | null>): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { EventChange } from '../../../utils/eventChange.js';
|
|
2
|
+
type EventChanged = Extract<EventChange, {
|
|
3
|
+
type: 'event.changed';
|
|
4
|
+
}>;
|
|
5
|
+
type UseLiveEventsOptions = {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
calendarIds: readonly string[];
|
|
8
|
+
onChange?: (change: EventChanged) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function useLiveEvents({ enabled, calendarIds, onChange }: UseLiveEventsOptions): void;
|
|
11
|
+
export {};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { I18n } from '../../../i18n/index.js';
|
|
2
|
+
import { type AttendeeStatus, type EventOccurrence } from '../../../utils/event.js';
|
|
2
3
|
import type { ClassNameValue } from '../../../utils/classNames.js';
|
|
3
4
|
import type { EventSegment } from '../types/eventLayout.js';
|
|
4
5
|
import type { EventSource } from '../types/eventSource.js';
|
|
5
6
|
type LabelI18n = Pick<I18n, 'm' | 'format'>;
|
|
6
7
|
export declare const getSourceText: (source: EventSource, { m }: LabelI18n) => string;
|
|
8
|
+
export declare const getEventLabel: (event: EventOccurrence, source: EventSource | undefined, attendance: AttendeeStatus | undefined, i18n: LabelI18n) => string;
|
|
9
|
+
export declare const getEventDetails: (event: EventOccurrence, source: EventSource | undefined, attendance: AttendeeStatus | undefined, i18n: LabelI18n) => string;
|
|
10
|
+
export declare const getDayLabel: (date: string, isToday: boolean, holidays: readonly string[], i18n: LabelI18n) => string;
|
|
7
11
|
export declare const getSegmentAttributes: ({ event, continuesBefore, continuesAfter }: EventSegment, source: EventSource | undefined, i18n: LabelI18n, ...classNamesToMerge: ClassNameValue[]) => {
|
|
8
12
|
title: string;
|
|
9
13
|
'data-occurrence-key': string;
|
|
@@ -6,7 +6,7 @@ export { CalendarSettingsPage } from './components/settings/CalendarSettingsPage
|
|
|
6
6
|
export { CreateCalendarPage } from './components/create/CreateCalendarPage.js';
|
|
7
7
|
export { CalendarSwitcher } from './components/CalendarSwitcher.js';
|
|
8
8
|
export { ActiveCalendarIndicator } from './components/ActiveCalendarIndicator.js';
|
|
9
|
-
export { getSharedCalendars, hasPermission, isPersonalCalendar } from './utils/permissions.js';
|
|
9
|
+
export { canEditEntry, canManageCategories, getSharedCalendars, hasPermission, isPersonalCalendar } from './utils/permissions.js';
|
|
10
10
|
export { LocalCalendarRepository } from './repositories/LocalCalendarRepository.js';
|
|
11
11
|
export { RemoteCalendarRepository } from './repositories/RemoteCalendarRepository.js';
|
|
12
12
|
export type { CalendarChanges, CalendarDraft, CalendarRepository, CalendarSummary, Invitation, PendingInvitation, TeamChanges, TeamInvitation, TeamMember, TeamRole, } from './types/calendar.js';
|
|
@@ -23,4 +23,7 @@ export declare class RemoteCalendarRepository implements CalendarRepository {
|
|
|
23
23
|
getFeed(calendarId: string): Promise<string | null>;
|
|
24
24
|
createFeed(calendarId: string): Promise<string>;
|
|
25
25
|
deleteFeed(calendarId: string): Promise<void>;
|
|
26
|
+
getShare(calendarId: string): Promise<string | null>;
|
|
27
|
+
createShare(calendarId: string): Promise<string>;
|
|
28
|
+
deleteShare(calendarId: string): Promise<void>;
|
|
26
29
|
}
|
|
@@ -72,6 +72,9 @@ export interface CalendarRepository {
|
|
|
72
72
|
getFeed?(calendarId: string): Promise<string | null>;
|
|
73
73
|
createFeed?(calendarId: string): Promise<string>;
|
|
74
74
|
deleteFeed?(calendarId: string): Promise<void>;
|
|
75
|
+
getShare?(calendarId: string): Promise<string | null>;
|
|
76
|
+
createShare?(calendarId: string): Promise<string>;
|
|
77
|
+
deleteShare?(calendarId: string): Promise<void>;
|
|
75
78
|
}
|
|
76
79
|
export type CalendarsContextValue = {
|
|
77
80
|
repository: CalendarRepository;
|
|
@@ -4,6 +4,10 @@ export declare const isPersonalCalendar: ({ kind }: CalendarSummary) => boolean;
|
|
|
4
4
|
export declare const canLeaveCalendar: (calendar: CalendarSummary) => boolean;
|
|
5
5
|
export declare const getVisibleCalendarIds: (calendars: readonly CalendarSummary[], active: CalendarSummary) => string[];
|
|
6
6
|
export declare const hasPermission: (calendar: CalendarSummary, permission: Permission) => boolean;
|
|
7
|
+
export declare const canEditEntry: (calendar: CalendarSummary, createdBy: string | null, userId: string | null) => boolean;
|
|
8
|
+
export declare const canDeleteEntry: (calendar: CalendarSummary, createdBy: string | null, userId: string | null) => boolean;
|
|
9
|
+
export declare const canUseTrash: (calendar: CalendarSummary) => boolean;
|
|
10
|
+
export declare const canManageCategories: (calendar: CalendarSummary) => boolean;
|
|
7
11
|
export declare const getSharedCalendars: (calendars: readonly CalendarSummary[], active: CalendarSummary) => CalendarSummary[];
|
|
8
12
|
export declare const outranks: (actor: TeamRole, target: TeamRole) => boolean;
|
|
9
13
|
export declare const getAssignableRoles: (actor: TeamRole) => ("owner" | "admin" | "manager" | "editor" | "member" | "contributor" | "viewer")[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Category } from '../../../utils/category.js';
|
|
2
|
+
type CategoryFieldProps = {
|
|
3
|
+
categories: readonly Category[];
|
|
4
|
+
value: readonly string[];
|
|
5
|
+
onChange: (categoryIds: string[]) => void;
|
|
6
|
+
onCreate?: (name: string) => Promise<Category>;
|
|
7
|
+
};
|
|
8
|
+
export declare function CategoryField({ categories, value, onChange, onCreate }: CategoryFieldProps): import("react").JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Category, type CategoryFilter } from '../../../utils/category.js';
|
|
2
|
+
type CategoryFilterModalProps = {
|
|
3
|
+
categories: readonly Category[];
|
|
4
|
+
calendarNames: ReadonlyMap<string, string>;
|
|
5
|
+
value: CategoryFilter;
|
|
6
|
+
onChange: (filter: CategoryFilter) => void;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function CategoryFilterModal({ categories, calendarNames, value, onChange, onClose }: CategoryFilterModalProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Category } from '../../../utils/category.js';
|
|
2
|
+
export declare function useCategories(calendarIds: readonly string[]): {
|
|
3
|
+
isAvailable: boolean;
|
|
4
|
+
categories: Category[];
|
|
5
|
+
error: string | null;
|
|
6
|
+
create: (calendarId: string, name: string) => Promise<Category>;
|
|
7
|
+
rename: (id: string, name: string) => Promise<void>;
|
|
8
|
+
remove: (id: string) => Promise<void>;
|
|
9
|
+
};
|
|
@@ -3,6 +3,7 @@ type DeleteEventModalProps = {
|
|
|
3
3
|
occurrence: EventOccurrence;
|
|
4
4
|
onConfirm: (scope: EditScope) => Promise<void>;
|
|
5
5
|
onClose: () => void;
|
|
6
|
+
movesToTrash?: boolean;
|
|
6
7
|
};
|
|
7
|
-
export declare function DeleteEventModal({ occurrence, onConfirm, onClose }: DeleteEventModalProps): import("react").JSX.Element;
|
|
8
|
+
export declare function DeleteEventModal({ occurrence, onConfirm, onClose, movesToTrash }: DeleteEventModalProps): import("react").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type EditScope, type EventInput, type EventOccurrence, type AttendeeStatus } from '../../../utils/event.js';
|
|
2
2
|
import { type AttendeeCandidate } from './AttendeesField.js';
|
|
3
|
+
import type { Category } from '../../../utils/category.js';
|
|
4
|
+
import type { SaveOptions } from '../hooks/useEvents.js';
|
|
3
5
|
import type { ChatKey } from '../../../utils/chat.js';
|
|
4
|
-
export type EventTab = 'general' | 'recurrence' | 'attendees' | 'details' | 'chat';
|
|
6
|
+
export type EventTab = 'general' | 'appearance' | 'recurrence' | 'attendees' | 'details' | 'chat';
|
|
5
7
|
export type AttendeeOptions = {
|
|
6
8
|
candidates: readonly AttendeeCandidate[];
|
|
7
9
|
ownEmail: string | null;
|
|
@@ -12,7 +14,9 @@ type EventModalProps = {
|
|
|
12
14
|
attendeeOptions?: AttendeeOptions;
|
|
13
15
|
occurrence?: EventOccurrence | null;
|
|
14
16
|
notice?: string;
|
|
15
|
-
onSave: (input: EventInput, scope: EditScope) => Promise<void>;
|
|
17
|
+
onSave: (input: EventInput, scope: EditScope, attachments: readonly File[], options?: SaveOptions) => Promise<void>;
|
|
18
|
+
onReload?: () => void;
|
|
19
|
+
remoteChange?: 'updated' | 'deleted' | null;
|
|
16
20
|
onDelete?: () => void | Promise<void>;
|
|
17
21
|
onDuplicate?: (input: EventInput) => void;
|
|
18
22
|
onRemindersChange?: (reminders: number[]) => Promise<void>;
|
|
@@ -21,7 +25,11 @@ type EventModalProps = {
|
|
|
21
25
|
calendarId: string;
|
|
22
26
|
};
|
|
23
27
|
initialTab?: EventTab;
|
|
28
|
+
categories?: readonly Category[];
|
|
29
|
+
onCreateCategory?: (name: string) => Promise<Category>;
|
|
30
|
+
readOnly?: boolean;
|
|
31
|
+
canEditAttachments?: boolean;
|
|
24
32
|
onClose: () => void;
|
|
25
33
|
};
|
|
26
|
-
export declare function EventModal({ initialValue, attendeeOptions, occurrence, notice, onSave, onDelete, onDuplicate, onRemindersChange, chat, initialTab, onClose, }: EventModalProps): import("react").JSX.Element;
|
|
34
|
+
export declare function EventModal({ initialValue, attendeeOptions, occurrence, notice, onSave, onReload, remoteChange, onDelete, onDuplicate, onRemindersChange, chat, initialTab, categories, onCreateCategory, readOnly, canEditAttachments, onClose, }: EventModalProps): import("react").JSX.Element;
|
|
27
35
|
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type AttendeeStatus, type CalendarEvent, type EditScope, type EventInput, type EventOccurrence } from '../../../utils/event.js';
|
|
2
2
|
import { type EventQuery } from '../../storage/index.js';
|
|
3
3
|
import { type Undo } from '../utils/undo.js';
|
|
4
|
+
export type SaveOptions = {
|
|
5
|
+
force?: boolean;
|
|
6
|
+
};
|
|
4
7
|
type UseEventsOptions = EventQuery & {
|
|
5
8
|
targetCalendarId: string;
|
|
6
9
|
};
|
|
@@ -10,7 +13,7 @@ export declare function useEvents({ from, to, calendarIds, targetCalendarId }: U
|
|
|
10
13
|
isLoading: boolean;
|
|
11
14
|
reload: () => void;
|
|
12
15
|
createEvent: (input: EventInput) => Promise<CalendarEvent>;
|
|
13
|
-
updateEvent: (occurrence: EventOccurrence, input: EventInput, scope: EditScope) => Promise<Undo | null>;
|
|
16
|
+
updateEvent: (occurrence: EventOccurrence, input: EventInput, scope: EditScope, { force }?: SaveOptions) => Promise<Undo | null>;
|
|
14
17
|
deleteEvent: (occurrence: EventOccurrence, scope: EditScope) => Promise<Undo | null>;
|
|
15
18
|
respond: ((occurrence: EventOccurrence, status: AttendeeStatus) => Promise<void>) | undefined;
|
|
16
19
|
setReminders: ((occurrence: EventOccurrence, reminders: number[]) => Promise<void>) | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { useEvents } from './hooks/useEvents.js';
|
|
1
|
+
export { useEvents, type SaveOptions } from './hooks/useEvents.js';
|
|
2
2
|
export { EventModal, type AttendeeOptions, type EventTab } from './components/EventModal.js';
|
|
3
3
|
export type { AttendeeCandidate } from './components/AttendeesField.js';
|
|
4
4
|
export { DeleteEventModal } from './components/DeleteEventModal.js';
|
|
@@ -6,4 +6,4 @@ export { RecurrenceScopeModal } from './components/RecurrenceScopeModal.js';
|
|
|
6
6
|
export { getScopeOptions } from './utils/scopeOptions.js';
|
|
7
7
|
export { CustomColorSettings } from './components/CustomColorSettings.js';
|
|
8
8
|
export { ColorPicker } from './components/ColorPicker.js';
|
|
9
|
-
export { importEvents, listAllEvents } from './utils/icalExchange.js';
|
|
9
|
+
export { createCategoryResolver, importEvents, listAllEvents } from './utils/icalExchange.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Messages } from '../../../i18n/index.js';
|
|
2
2
|
import { type CalendarEvent } from '../../../utils/event.js';
|
|
3
|
+
import { type Category } from '../../../utils/category.js';
|
|
3
4
|
import type { ImportedEvent } from '../../../utils/ical.js';
|
|
4
5
|
import type { EventRepository } from '../../storage/index.js';
|
|
5
6
|
export declare const listAllEvents: (repository: EventRepository, calendarId: string) => Promise<CalendarEvent[]>;
|
|
@@ -8,4 +9,6 @@ export type ImportSummary = {
|
|
|
8
9
|
updated: number;
|
|
9
10
|
skipped: number;
|
|
10
11
|
};
|
|
11
|
-
export
|
|
12
|
+
export type CategoryResolver = (names: readonly string[]) => Promise<string[]>;
|
|
13
|
+
export declare function createCategoryResolver(existing: readonly Category[], create: ((name: string) => Promise<Category>) | null): CategoryResolver;
|
|
14
|
+
export declare function importEvents(repository: EventRepository, calendarId: string, imported: readonly ImportedEvent[], m: Messages, resolveCategories?: CategoryResolver): Promise<ImportSummary>;
|
|
@@ -8,5 +8,10 @@ export { RemoteColorRepository } from './repositories/RemoteColorRepository.js';
|
|
|
8
8
|
export { RemoteEventRepository } from './repositories/RemoteEventRepository.js';
|
|
9
9
|
export { RemotePreferencesRepository } from './repositories/RemotePreferencesRepository.js';
|
|
10
10
|
export { RemoteHolidayRepository } from './repositories/RemoteHolidayRepository.js';
|
|
11
|
+
export { LocalCategoryRepository } from './repositories/LocalCategoryRepository.js';
|
|
12
|
+
export { RemoteCategoryRepository } from './repositories/RemoteCategoryRepository.js';
|
|
13
|
+
export { RemoteAttachmentRepository } from './repositories/RemoteAttachmentRepository.js';
|
|
14
|
+
export { RemoteSharedCalendarRepository } from './repositories/RemoteSharedCalendarRepository.js';
|
|
11
15
|
export { RemoteChatRepository } from './repositories/RemoteChatRepository.js';
|
|
12
|
-
export
|
|
16
|
+
export { LiveSocket, type LiveMessage } from './utils/liveSocket.js';
|
|
17
|
+
export type { AttachmentRepository, CategoryRepository, ColorRepository, EventQuery, EventRepository, EventSearchQuery, ChatRepository, HolidayQuery, HolidayRepository, PreferencesRepository, SharedCalendarRepository, StorageMode, } from './types/storage.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Category } from '../../../utils/category.js';
|
|
2
|
+
import type { CategoryRepository } from '../types/storage.js';
|
|
3
|
+
export declare class LocalCategoryRepository implements CategoryRepository {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(storageKey?: string);
|
|
6
|
+
list(calendarIds: readonly string[]): Promise<Category[]>;
|
|
7
|
+
create(calendarId: string, name: string): Promise<Category>;
|
|
8
|
+
rename(id: string, name: string): Promise<{
|
|
9
|
+
name: string;
|
|
10
|
+
id: string;
|
|
11
|
+
calendarId: string;
|
|
12
|
+
}>;
|
|
13
|
+
remove(id: string): Promise<void>;
|
|
14
|
+
}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { type CalendarEvent, type EventInput } from '../../../utils/event.js';
|
|
2
|
+
import { type TrashedEvent } from '../../../utils/trash.js';
|
|
3
|
+
import { type EventChange } from '../../../utils/eventChange.js';
|
|
2
4
|
import type { EventQuery, EventRepository, EventSearchQuery } from '../types/storage.js';
|
|
3
5
|
export declare class LocalEventRepository implements EventRepository {
|
|
4
6
|
#private;
|
|
5
7
|
constructor(storageKey?: string);
|
|
8
|
+
subscribe(listener: (change: EventChange) => void): () => void;
|
|
6
9
|
list({ from, to, calendarIds }: EventQuery): Promise<CalendarEvent[]>;
|
|
7
10
|
search({ text, calendarIds }: EventSearchQuery): Promise<CalendarEvent[]>;
|
|
8
11
|
listAll(): Promise<CalendarEvent[]>;
|
|
9
12
|
clear(): Promise<void>;
|
|
10
13
|
listSeries(seriesId: string): Promise<CalendarEvent[]>;
|
|
11
14
|
create(calendarId: string, input: EventInput): Promise<CalendarEvent>;
|
|
12
|
-
update(id: string, input: EventInput): Promise<CalendarEvent>;
|
|
13
|
-
remove(id: string): Promise<void>;
|
|
15
|
+
update(id: string, input: EventInput, version?: number): Promise<CalendarEvent>;
|
|
16
|
+
remove(id: string, version?: number): Promise<void>;
|
|
17
|
+
listTrash(calendarId: string): Promise<TrashedEvent[]>;
|
|
18
|
+
restore(id: string): Promise<CalendarEvent>;
|
|
19
|
+
purge(id: string): Promise<void>;
|
|
14
20
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ApiClient } from '../../../utils/api.js';
|
|
2
|
+
import { type Attachment } from '../../../utils/attachment.js';
|
|
3
|
+
import type { AttachmentRepository } from '../types/storage.js';
|
|
4
|
+
export declare class RemoteAttachmentRepository implements AttachmentRepository {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(api: ApiClient);
|
|
7
|
+
list(eventId: string): Promise<Attachment[]>;
|
|
8
|
+
upload(eventId: string, file: File): Promise<Attachment>;
|
|
9
|
+
download(attachment: Attachment): Promise<Blob>;
|
|
10
|
+
remove(id: string): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ApiClient } from '../../../utils/api.js';
|
|
2
|
+
import type { CategoryRepository } from '../types/storage.js';
|
|
3
|
+
export declare class RemoteCategoryRepository implements CategoryRepository {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(api: ApiClient);
|
|
6
|
+
list(calendarIds: readonly string[]): Promise<import("../../../utils/category.ts").Category[]>;
|
|
7
|
+
create(calendarId: string, name: string): Promise<import("../../../utils/category.ts").Category>;
|
|
8
|
+
rename(id: string, name: string): Promise<import("../../../utils/category.ts").Category>;
|
|
9
|
+
remove(id: string): Promise<void>;
|
|
10
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type ApiClient } from '../../../utils/api.js';
|
|
2
2
|
import { type ChatEvent, type ChatKey, type ChatMessage } from '../../../utils/chat.js';
|
|
3
3
|
import type { ChatRepository } from '../types/storage.js';
|
|
4
|
+
import { LiveSocket } from '../utils/liveSocket.js';
|
|
4
5
|
type Listener = (event: ChatEvent) => void;
|
|
5
6
|
export declare class RemoteChatRepository implements ChatRepository {
|
|
6
7
|
#private;
|
|
7
|
-
constructor(api: ApiClient,
|
|
8
|
+
constructor(api: ApiClient, socket: LiveSocket | string);
|
|
8
9
|
list(key: ChatKey, { before }?: {
|
|
9
10
|
before?: string;
|
|
10
11
|
}): Promise<import("../../../utils/chat.ts").ChatPage>;
|