export declare const DEFAULT_TEAM_ID = "default";
export interface TeamMember {
    unionId?: string;
    openId?: string;
    email?: string;
    name?: string;
    addedAt: number;
    addedBy?: string;
}
export interface Team {
    id: string;
    name: string;
    members: TeamMember[];
    createdAt: number;
    updatedAt: number;
}
/** Identifiers a membership check can match on. Match succeeds on ANY non-empty hit. */
export interface MemberIdentity {
    unionId?: string;
    openId?: string;
    email?: string;
}
/** All teams (empty array if none materialized yet). */
export declare function listTeams(dataDir: string): Team[];
/** A team by id, or null. */
export declare function getTeam(dataDir: string, teamId: string): Team | null;
/** All teams the given identity belongs to (matches any identifier). */
export declare function listTeamsForMember(dataDir: string, id: MemberIdentity): Team[];
/**
 * The default (implicit single-deployment) team. Read-only: returns the first
 * persisted team, else a synthesized empty default that is NOT written. Use
 * `ensureDefaultTeam` when you intend to persist.
 */
export declare function getDefaultTeam(dataDir: string): Team;
/** Materialize (persist) the default team if no team exists yet; returns it. */
export declare function ensureDefaultTeam(dataDir: string, now?: number): Team;
/** Delete a team entirely (members + the team entry). Returns true if removed.
 *  Bots/connectors live at the deployment level (not per-team), so they are
 *  unaffected — only the membership/trust boundary is dropped. */
export declare function deleteTeam(dataDir: string, teamId: string): boolean;
/** Create a new explicit team. */
export declare function createTeam(dataDir: string, name: string, now?: number): Team;
/**
 * Add (or merge) a member into a team. Dedupes by any matching identifier and
 * fills in newly-known fields. Returns the updated team, or null if no such team.
 */
export declare function addMember(dataDir: string, teamId: string, member: Omit<TeamMember, 'addedAt'> & {
    addedAt?: number;
}, now?: number): Team | null;
/** Remove a member matching any identifier. Returns true if removed. */
export declare function removeMember(dataDir: string, teamId: string, id: MemberIdentity, now?: number): boolean;
/** Whether the given identity is a member of the team (matches any identifier). */
export declare function isMember(dataDir: string, teamId: string, id: MemberIdentity): boolean;
//# sourceMappingURL=team-store.d.ts.map