import { OnInit } from '@angular/core'; import { BaseAngularComponent } from '@memberjunction/ng-base-types'; import * as i0 from "@angular/core"; /** * Invitations management UI (mockup 16). For a single List: * - Pending / Accepted / Expired / Revoked tabs. * - Send new invitation form (email + role + TTL). * - Revoke / Resend actions on Pending invites. * * Reads invitations directly via `RunView` (cheaper than going through * GraphQL — the entity is already accessible). Mutations route through * `GraphQLListsClient` so the audit-log + notification side effects * fire server-side. */ type InvitationStatus = 'Pending' | 'Accepted' | 'Expired' | 'Revoked'; interface InvitationRow { ID: string; Email: string; Role: 'Editor' | 'Viewer'; Status: InvitationStatus; ExpiresAt: Date; CreatedAt: Date; Token: string; } export declare class ListInvitationsComponent extends BaseAngularComponent implements OnInit { private readonly cdr; get ListID(): string | null; set ListID(value: string | null); private _listId; /** Optional display name for the list — used in the empty-state copy. */ ListName: string | null; activeTab: InvitationStatus; invitations: InvitationRow[]; /** * Precomputed list of invitations matching the active tab, recomputed only when * the source data ({@link invitations}) or {@link activeTab} changes (see * {@link recomputeVisibleInvitations}) — NOT on every change-detection cycle. * Bound directly as the @for source in the template, so a getter here would * allocate a fresh array (map + filter) every CD tick. */ visibleInvitations: InvitationRow[]; loading: boolean; errorMessage: string | null; submitting: boolean; newEmail: string; newRole: 'Editor' | 'Viewer'; newTtlHours: number; private initialized; ngOnInit(): Promise; setTab(tab: InvitationStatus): void; /** * Recompute the precomputed {@link visibleInvitations} array. Called only when * the source data or the active tab changes — keeping the per-row hydration * (map) + filter out of the per-CD-cycle hot path. * * We hydrate Status="Pending" rows whose ExpiresAt is in the past as Expired * on the client so users see them without waiting for a server-side flip. The * server's Accept path also lazily marks them. */ private recomputeVisibleInvitations; countFor(status: InvitationStatus): number; formatExpiry(d: Date): string; get canSend(): boolean; SendInvitation(): Promise; Revoke(invitationId: string): Promise; /** * "Resend" = create a fresh invitation for the same email + role. The * old one stays Pending until either accepted or expired; users see * both in the Pending tab until one is consumed. */ Resend(inv: InvitationRow): Promise; private loadInvitations; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export {}; //# sourceMappingURL=list-invitations.component.d.ts.map