import { type SpaceDashboard } from './dashboard';
import { type OrganizationMemberRole } from './organizationMemberProfile';
import { type ProjectMemberRole } from './projectMemberRole';
import { type SpaceQuery } from './savedCharts';
export declare enum DirectSpaceAccessOrigin {
    USER_ACCESS = "user_access",
    GROUP_ACCESS = "group_access"
}
export type DirectSpaceAccess = {
    userUuid: string;
    spaceUuid: string;
    groupUuid: string | null;
    role: SpaceMemberRole;
    from: DirectSpaceAccessOrigin;
};
export type OrganizationSpaceAccess = {
    userUuid: string;
    spaceUuid: string;
    role: OrganizationMemberRole;
};
export declare enum ProjectSpaceAccessOrigin {
    PROJECT_MEMBERSHIP = "project_membership",
    GROUP_MEMBERSHIP = "group_membership"
}
export type ProjectSpaceAccess = {
    userUuid: string;
    spaceUuid: string;
    role: ProjectMemberRole;
    from: ProjectSpaceAccessOrigin;
};
export type ChainSpaceDirectAccess = {
    spaceUuid: string;
    directAccess: DirectSpaceAccess[];
};
export type SpaceAccessWithInheritanceInput = {
    spaceUuid: string;
    inheritsFromOrgOrProject: boolean;
    chainDirectAccess: ChainSpaceDirectAccess[];
    projectAccess: ProjectSpaceAccess[];
    organizationAccess: OrganizationSpaceAccess[];
};
export type Space = {
    organizationUuid: string;
    uuid: string;
    name: string;
    inheritsFromOrgOrProject: boolean;
    queries: SpaceQuery[];
    projectUuid: string;
    dashboards: SpaceDashboard[];
    access: SpaceShare[];
    groupsAccess: SpaceGroup[];
    pinnedListUuid: string | null;
    pinnedListOrder: number | null;
    slug: string;
    childSpaces: SpaceSummaryBase[];
    parentSpaceUuid: string | null;
    inheritParentPermissions: boolean;
    projectMemberAccessRole: SpaceMemberRole | null;
    colorPaletteUuid: string | null;
    path: string;
    breadcrumbs?: {
        name: string;
        uuid: string;
        hasAccess: boolean;
    }[];
};
export type SpaceSummaryBase = Pick<Space, 'organizationUuid' | 'projectUuid' | 'uuid' | 'name' | 'inheritParentPermissions' | 'projectMemberAccessRole' | 'pinnedListUuid' | 'pinnedListOrder' | 'slug' | 'parentSpaceUuid' | 'path'> & {
    chartCount: number;
    dashboardCount: number;
    childSpaceCount: number;
    appCount: number;
    deletedAt?: Date;
    deletedBy?: {
        userUuid: string;
        firstName: string;
        lastName: string;
    };
};
export type SpaceSummary = SpaceSummaryBase & {
    inheritsFromOrgOrProject: boolean;
    userAccess: SpaceAccess | undefined;
    access: string[];
};
export type CreateSpace = {
    name: string;
    inheritParentPermissions?: boolean;
    access?: Pick<SpaceShare, 'userUuid' | 'role'>[];
    parentSpaceUuid?: string;
};
export type UpdateSpace = {
    name: string;
    inheritParentPermissions?: boolean;
    /** When set, all project members get this role on the space */
    projectMemberAccessRole?: SpaceMemberRole | null;
    colorPaletteUuid?: string | null;
};
export type SpaceAccessUserMetadata = {
    firstName: string;
    lastName: string;
    email: string;
    isInternal: boolean;
};
export type SpaceInheritanceChainItem = {
    spaceUuid: string;
    spaceName: string;
    inheritParentPermissions: boolean;
};
export type SpaceInheritanceChain = {
    /** Spaces from leaf to the first inherit=false ancestor (or root). */
    chain: SpaceInheritanceChainItem[];
    /** True if the chain reaches a root space that inherits from the project/org. */
    inheritsFromOrgOrProject: boolean;
};
export type SpaceAccess = {
    userUuid: string;
    role: SpaceMemberRole;
    hasDirectAccess: boolean;
    projectRole: ProjectMemberRole | undefined;
    inheritedRole: OrganizationMemberRole | ProjectMemberRole | undefined;
    inheritedFrom: 'organization' | 'project' | 'group' | 'space_group' | 'parent_space' | undefined;
};
export type SpaceShare = SpaceAccess & SpaceAccessUserMetadata;
export type SpaceGroup = {
    groupUuid: string;
    groupName: string;
    spaceRole: SpaceMemberRole;
};
export declare enum SpaceMemberRole {
    VIEWER = "viewer",
    EDITOR = "editor",
    ADMIN = "admin"
}
export type ApiSpaceSummaryListResponse = {
    status: 'ok';
    results: SpaceSummary[];
};
export type ApiSpaceResponse = {
    status: 'ok';
    results: Space;
};
export type SpaceDeleteImpact = {
    spaces: {
        uuid: string;
        name: string;
        parentSpaceUuid: string | null;
        chartCount: number;
        dashboardCount: number;
        appCount: number;
    }[];
    charts: {
        uuid: string;
        name: string;
        spaceUuid: string;
    }[];
    dashboards: {
        uuid: string;
        name: string;
        spaceUuid: string;
    }[];
    apps: {
        uuid: string;
        spaceUuid: string | null;
    }[];
    chartCount: number;
    dashboardCount: number;
    appCount: number;
};
export type ApiSpaceDeleteImpactResponse = {
    status: 'ok';
    results: SpaceDeleteImpact;
};
export type AddSpaceUserAccess = {
    userUuid: string;
    spaceRole: SpaceMemberRole;
};
export type AddSpaceGroupAccess = {
    groupUuid: string;
    spaceRole: SpaceMemberRole;
};
//# sourceMappingURL=space.d.ts.map