// Copyright © 2022-2026 Partium, Inc. DBA Partium import { Observable } from 'rxjs'; import { BaseService, ServiceProvider } from '../../core'; import { Announcement, AnnouncementRecipient } from '../models/announcement'; export interface AnnouncementService { /** * Retrieves the current announcements. * @returns An Observable that emits an array of Announcement objects. */ getAnnouncement(): Observable; /** * Publishes a new announcement. * @returns An Observable that emits the published Announcement. */ publish(): Observable; /** * Updates the current draft announcement with the provided details. * * @param title - The new title of the announcement. * @param contents - The new contents of the announcement. * @param terminatesAt - An optional parameter representing the termination date of the announcement. * @param recipients - An optional array of recipients for the announcement. * @param includeSubOrgs - An optional boolean indicating whether to include sub-organizations. * @param sendEmails - An optional boolean indicating whether to send emails to recipients. * * @returns An Observable that emits the updated Announcement. * * @remarks * This function sends a PUT request to the backend service to update the draft announcement. * If the `terminatesAt`, `recipients`, `includeSubOrgs`, or `sendEmails` parameters are not provided, * the corresponding fields in the announcement will not be updated. */ updateDraft(title: string, contents: string, terminatesAt?: string, recipients?: string[], includeSubOrgs?: boolean, sendEmails?: boolean): Observable; /** * Unpublishes the current announcement. * @returns An Observable that emits the unpublished Announcement. */ unpublish(): Observable; /** * Retrieves the current draft announcement. * @returns An Observable that emits the draft Announcement. */ getDraft(): Observable; /** * Retrieves all recipients of announcements. * * @param pageSize - The number of recipients to retrieve per page. Defaults to 3 if not specified. * @returns An Observable that emits an array of AnnouncementRecipient objects. * * @remarks * This method uses cursor-based pagination to retrieve all recipients. It sends a GET request to the backend service * and handles pagination by making subsequent requests with the cursor until all recipients are retrieved. * */ getRecipients(pageSize?: number): Observable; } export declare class AnnouncementServiceImpl extends BaseService implements AnnouncementService { private httpsService; private PAGINATION_PAGE_SIZE; constructor(serviceProvider: ServiceProvider); onCreate(): void; publish(): Observable; unpublish(): Observable; getRecipients(pageSize: number): Observable; getDraft(): Observable; updateDraft(title: string, contents: string, terminatesAt?: string, recipients?: string[], includeSubOrgs?: boolean, sendEmails?: boolean): Observable; getAnnouncement(): Observable; }