import { type AbilityBuilder } from '@casl/ability';
import { type MemberAbility } from '../authorization/types';
import { type AnyType } from './any';
import { type OpenIdIdentityIssuerType } from './openIdIdentity';
import { type OrganizationMemberRole } from './organizationMemberProfile';
export type AccountUser = {
    id: string;
    email: string | undefined;
    isActive: boolean;
    abilityRules: AbilityBuilder<MemberAbility>['rules'];
    ability: MemberAbility;
    type: 'registered' | 'anonymous';
};
export interface LightdashUser {
    userUuid: string;
    firstName: string;
    lastName: string;
    organizationUuid?: string;
    organizationName?: string;
    organizationCreatedAt?: Date;
    userId: number;
    role?: OrganizationMemberRole;
    roleUuid?: string;
    isTrackingAnonymized: boolean;
    isMarketingOptedIn: boolean;
    isSetupComplete: boolean;
    email: string | undefined;
    isActive: boolean;
    createdAt: Date;
    updatedAt: Date;
    isPending?: boolean;
}
export interface LightdashSessionUser extends AccountUser {
    type: 'registered';
    userUuid: string;
    userId: number;
    firstName: string;
    lastName: string;
    role?: OrganizationMemberRole;
    isTrackingAnonymized: boolean;
    isMarketingOptedIn: boolean;
    isSetupComplete: boolean;
    createdAt: Date;
    updatedAt: Date;
    isPending?: boolean;
}
export interface ExternalUser extends AccountUser {
    type: 'anonymous';
}
export type LightdashUserWithOrg = Required<LightdashUser>;
export declare const isUserWithOrg: (user: LightdashUser) => user is LightdashUserWithOrg;
export interface LightdashUserWithAbilityRules extends LightdashUser {
    abilityRules: AbilityBuilder<MemberAbility>['rules'];
}
export interface SessionUser extends LightdashUserWithAbilityRules {
    ability: MemberAbility;
}
export interface UpdatedByUser {
    userUuid: string;
    firstName: string;
    lastName: string;
}
export interface OpenIdUser {
    openId: {
        subject: string;
        issuer: string;
        issuerType: OpenIdIdentityIssuerType;
        email: string;
        firstName: string | undefined;
        lastName: string | undefined;
        groups?: string[] | undefined;
        teamId?: string | undefined;
    };
}
export declare const isOpenIdUser: (user: AnyType) => user is OpenIdUser;
export type UserAllowedOrganization = {
    organizationUuid: string;
    name: string;
    membersCount: number;
};
export type ApiUserAllowedOrganizationsResponse = {
    status: 'ok';
    results: UserAllowedOrganization[];
};
/**
 * Shows the authenticated user
 */
export type ApiGetAuthenticatedUserResponse = {
    status: 'ok';
    results: LightdashUser;
};
export type ApiRegisterUserResponse = {
    status: 'ok';
    results: LightdashUser;
};
export declare enum LocalIssuerTypes {
    EMAIL = "email",
    API_TOKEN = "apiToken"
}
export type LoginOptionTypes = OpenIdIdentityIssuerType | LocalIssuerTypes;
export type LoginOptions = {
    showOptions: LoginOptionTypes[];
    forceRedirect?: boolean;
    redirectUri?: string;
};
export type ApiGetLoginOptionsResponse = {
    status: 'ok';
    results: LoginOptions;
};
export type IntrinsicUserAttributes = {
    email?: string;
};
export declare const getIntrinsicUserAttributes: (user: Pick<LightdashUser, "email">) => IntrinsicUserAttributes;
//# sourceMappingURL=user.d.ts.map