import type { Brand } from "./branded-ids.js";
export type TeamId = Brand<string, "TeamId">;
export type TeamSlug = Brand<string, "TeamSlug">;
export type TeamStatus = "active" | "archived";
export type KnownMemberRole = "lead" | "member" | "oncall";
export type MemberRole = KnownMemberRole | (string & {});
export type KnownEventType = "eval.failed" | "eval.completed" | "eval.threshold-breached" | "eval.score-regressed" | "task.created" | "task.archived" | "area.unowned-tasks";
export type EventType = KnownEventType | (string & {});
export type NotificationChannelType = "slack" | "email" | "webhook";
/**
 * How often a channel receives matching reports. An absent `delivery` is
 * treated as `immediate` by consumers: one message per matching report.
 * `daily` / `weekly` roll-ups are posted on a schedule by the notify sweep.
 */
export type NotificationDelivery = "immediate" | "daily" | "weekly";
export interface TeamMember {
    email?: string;
    sanityUserId?: string;
    githubUsername?: string;
    displayName?: string;
    role?: MemberRole;
    lastVerifiedAt?: string;
}
export interface BaseChannel {
    _key: string;
    type: NotificationChannelType;
    purpose?: string;
    events?: EventType[];
    scope?: ChannelScope;
    delivery?: NotificationDelivery;
}
export interface SlackChannel extends BaseChannel {
    type: "slack";
    channelId: string;
    channelName?: string;
}
export interface EmailChannel extends BaseChannel {
    type: "email";
    addresses: string[];
}
export interface WebhookChannel extends BaseChannel {
    type: "webhook";
    logicalName: string;
}
export type NotificationChannel = SlackChannel | EmailChannel | WebhookChannel;
export type ChannelScope = {
    type: "owned";
} | {
    type: "all";
} | {
    type: "areas";
    areas: string[];
} | {
    type: "repos";
    repos: string[];
} | {
    type: "tags";
    tags: string[];
};
export interface Team {
    id: TeamId;
    slug: TeamSlug;
    displayName: string;
    description?: string;
    status: TeamStatus;
    members: TeamMember[];
    repos?: string[];
    notifications?: NotificationChannel[];
}
export type TeamRef = {
    _ref: string;
};
