import type { ApiContext } from './_shared';
import type { UiTheme, UiPreset, UserUiPermissions, UiThemeScope } from '@/types/theme';
import type { ThemeExportEnvelope, ImportThemeResult } from '@/types/themeExport';
export type { UiTheme, UiPreset, UserUiPermissions, UiThemeScope };
export type { ThemeExportEnvelope, ImportThemeResult } from '@/types/themeExport';
export interface PublicBrandingDto {
    logoUrl: string | null;
    faviconUrl: string | null;
    displayName: string | null;
}
export interface CustomAccentColorDto {
    key: string;
    name: string;
    baseHex: string;
}
export interface PlatformUiConfigDto {
    id: string;
    displayName: string | null;
    tagline: string | null;
    subdomain: string | null;
    logoUrl: string | null;
    faviconUrl: string | null;
    logoWidth: number | null;
    logoHeight: number | null;
    faviconWidth: number | null;
    faviconHeight: number | null;
    defaultThemeId: string;
    defaultPresetId: string | null;
    userPermissions: UserUiPermissions;
    customAccentColors: CustomAccentColorDto[];
    updatedAt: string | null;
    updatedBy: string | null;
}
export interface UpdatePlatformIdentityRequest {
    displayName: string | null;
    tagline: string | null;
    subdomain: string | null;
}
export interface UpdatePlatformDefaultsRequest {
    defaultThemeId: string;
    defaultPresetId: string | null;
}
export interface UpdateUserPermissionsRequest {
    canUsersChangeTheme: boolean;
    canUsersChangePreset: boolean;
    canUsersCreatePresets: boolean;
    allowedThemeIds: string[] | null;
    allowedPresetIds: string[] | null;
    allowUserCustomization: boolean;
}
export interface UpdateCustomAccentColorsRequest {
    customAccentColors: CustomAccentColorDto[];
}
export interface TenantBrandingDto {
    tenantId: string;
    hasConfiguration: boolean;
    displayName: string | null;
    logoUrl: string | null;
    faviconUrl: string | null;
    logoWidth: number | null;
    logoHeight: number | null;
    faviconWidth: number | null;
    faviconHeight: number | null;
    defaultThemeId: string | null;
    defaultPresetId: string | null;
    userPermissions: UserUiPermissions | null;
    customAccentColors: CustomAccentColorDto[] | null;
    updatedAt: string | null;
    updatedBy: string | null;
}
export interface UpdateTenantBrandingIdentityRequest {
    displayName: string | null;
}
export interface UpdateTenantDefaultsRequest {
    defaultThemeId: string | null;
    defaultPresetId: string | null;
}
export interface UpdateTenantUserPermissionsRequest {
    permissions: UserUiPermissions | null;
}
export interface EffectiveUiConfigDto {
    logoUrl: string | null;
    faviconUrl: string | null;
    displayName: string;
    selectedTheme: UiTheme;
    selectedPreset: UiPreset | null;
    availableThemes: UiTheme[];
    availablePresets: UiPreset[];
    permissions: UserUiPermissions;
    customAccentColors: CustomAccentColorDto[];
}
export interface CreateUiThemeRequest {
    name: string;
    description: string | null;
    icon: string | null;
    backgroundsJson: string;
    textColorsJson: string;
    borderColorsJson: string;
    statusColorsJson: string;
    dataVizColorsJson: string;
    categoryColorsJson: string;
    defaultTypographyJson: string;
    defaultBorderRadiusJson: string;
    defaultItemPaletteKey: string;
    defaultAccentColorKey: string;
    sortOrder: number;
    generatorSeedJson: string | null;
    isPublic: boolean;
}
export type UpdateUiThemeRequest = CreateUiThemeRequest;
export interface CreateUiPresetRequest {
    themeId: string;
    scope: UiThemeScope;
    tenantId: string | null;
    name: string;
    description: string | null;
    icon: string | null;
    sortOrder: number;
    accentColorKey: string;
    itemPaletteKey: string | null;
    typographyJson: string | null;
    borderRadiusJson: string | null;
    backgroundOverrideJson: string | null;
    dataVizColorsJson: string | null;
    categoryColorsJson: string | null;
}
export interface UpdateUiPresetRequest {
    name: string;
    description: string | null;
    icon: string | null;
    sortOrder: number;
    accentColorKey: string;
    itemPaletteKey: string | null;
    typographyJson: string | null;
    borderRadiusJson: string | null;
    backgroundOverrideJson: string | null;
    dataVizColorsJson: string | null;
    categoryColorsJson: string | null;
}
export interface DuplicatePresetRequest {
    sourcePresetId: string;
    newName: string;
    scope: UiThemeScope;
    tenantId: string | null;
}
export type BrandingAssetKind = 'logo' | 'favicon';
declare const _createPlatformUiConfigApi: (api: ApiContext) => {
    get: () => Promise<PlatformUiConfigDto>;
    updateIdentity: (req: UpdatePlatformIdentityRequest) => Promise<PlatformUiConfigDto>;
    updateDefaults: (req: UpdatePlatformDefaultsRequest) => Promise<PlatformUiConfigDto>;
    updateUserPermissions: (req: UpdateUserPermissionsRequest) => Promise<PlatformUiConfigDto>;
    updateCustomColors: (req: UpdateCustomAccentColorsRequest) => Promise<PlatformUiConfigDto>;
    uploadAsset: (kind: BrandingAssetKind, file: File, width: number | null, height: number | null) => Promise<PlatformUiConfigDto>;
    deleteAsset: (kind: BrandingAssetKind) => Promise<PlatformUiConfigDto>;
    getPublicBranding: (tenantSlug?: string) => Promise<PublicBrandingDto>;
};
export type PlatformUiConfigApi = ReturnType<typeof _createPlatformUiConfigApi>;
export declare const createPlatformUiConfigApi: (api: ApiContext) => PlatformUiConfigApi;
declare const _createTenantBrandingApi: (api: ApiContext) => {
    get: (tenantId: string) => Promise<TenantBrandingDto>;
    updateIdentity: (tenantId: string, req: UpdateTenantBrandingIdentityRequest) => Promise<TenantBrandingDto>;
    updateDefaults: (tenantId: string, req: UpdateTenantDefaultsRequest) => Promise<TenantBrandingDto>;
    updateUserPermissions: (tenantId: string, req: UpdateTenantUserPermissionsRequest) => Promise<TenantBrandingDto>;
    uploadAsset: (tenantId: string, kind: BrandingAssetKind, file: File, width: number | null, height: number | null) => Promise<TenantBrandingDto>;
    deleteAsset: (tenantId: string, kind: BrandingAssetKind) => Promise<TenantBrandingDto>;
    getAvailableThemes: (tenantId: string) => Promise<TenantAvailableThemeDto[]>;
    publishTheme: (tenantId: string, themeId: string) => Promise<void>;
    unpublishTheme: (tenantId: string, themeId: string) => Promise<void>;
    setThemeEnabled: (tenantId: string, themeId: string, enabled: boolean) => Promise<void>;
};
export type TenantBrandingApi = ReturnType<typeof _createTenantBrandingApi>;
export declare const createTenantBrandingApi: (api: ApiContext) => TenantBrandingApi;
export interface UiThemeTenantAssignmentDto {
    tenantId: string;
    tenantName: string;
    tenantSlug: string;
    tenantType: string;
    tenantStatus: string;
    tenantTemplateCode: string | null;
    tenantTemplateName: string | null;
    isAssigned: boolean;
    /** True when the tenant inherits access from a template-level publication
     *  (not a direct per-tenant publication). Used by the UI to render a visual
     *  distinction and disable the per-tenant checkbox. */
    isAssignedViaTemplate: boolean;
}
export interface UiThemeTenantTemplateAssignmentDto {
    tenantTemplateId: string;
    tenantTemplateCode: string;
    tenantTemplateName: string;
    targetTenantType: string;
    isActive: boolean;
    tenantCount: number;
    isAssigned: boolean;
}
export interface TenantAvailableThemeDto {
    theme: UiTheme;
    /** Visibility reason: 'Builtin' | 'Public' | 'Direct' | 'Template'. */
    assignmentReason: 'Builtin' | 'Public' | 'Direct' | 'Template';
    /** True when the theme is enabled for users of this tenant (via AllowedThemeIds
     *  whitelist or implicit default). Managers can toggle this without altering
     *  the publication state. */
    isEnabled: boolean;
}
declare const _createUiThemesApi: (api: ApiContext) => {
    list: (includeDisabled?: boolean) => Promise<UiTheme[]>;
    getById: (id: string) => Promise<UiTheme>;
    create: (req: CreateUiThemeRequest) => Promise<string>;
    update: (id: string, req: UpdateUiThemeRequest) => Promise<void>;
    remove: (id: string) => Promise<void>;
    setDisabled: (id: string, disabled: boolean) => Promise<void>;
    setVisibility: (id: string, isPublic: boolean) => Promise<void>;
    getTenantAssignments: (id: string) => Promise<UiThemeTenantAssignmentDto[]>;
    setTenantAssignments: (id: string, tenantIds: string[]) => Promise<void>;
    getTemplateAssignments: (id: string) => Promise<UiThemeTenantTemplateAssignmentDto[]>;
    setTemplateAssignments: (id: string, tenantTemplateIds: string[]) => Promise<void>;
    uploadAsset: (themeId: string, kind: BrandingAssetKind, file: File, width: number | null, height: number | null) => Promise<UiTheme>;
    deleteAsset: (themeId: string, kind: BrandingAssetKind) => Promise<UiTheme>;
    /**
     * Download the theme (with its presets and binary assets) as a self-contained JSON
     * envelope. Caller is responsible for triggering the browser download — see
     * `triggerThemeDownload` in `@/utils/themeExport`.
     */
    exportTheme: (id: string) => Promise<Blob>;
    /**
     * Import a theme from a previously exported JSON envelope. Returns the new
     * theme id and the final stored name (which may carry a "(imported)" suffix
     * if the original name conflicted on the target instance).
     */
    importTheme: (envelope: ThemeExportEnvelope) => Promise<ImportThemeResult>;
};
export type UiThemesApi = ReturnType<typeof _createUiThemesApi>;
export declare const createUiThemesApi: (api: ApiContext) => UiThemesApi;
declare const _createUiPresetsApi: (api: ApiContext) => {
    list: (opts?: {
        themeId?: string;
        includeDisabled?: boolean;
    }) => Promise<UiPreset[]>;
    getById: (id: string) => Promise<UiPreset>;
    create: (req: CreateUiPresetRequest) => Promise<string>;
    duplicate: (req: DuplicatePresetRequest) => Promise<string>;
    update: (id: string, req: UpdateUiPresetRequest) => Promise<void>;
    remove: (id: string) => Promise<void>;
    setDisabled: (id: string, disabled: boolean) => Promise<void>;
};
export type UiPresetsApi = ReturnType<typeof _createUiPresetsApi>;
export declare const createUiPresetsApi: (api: ApiContext) => UiPresetsApi;
//# sourceMappingURL=uiConfiguration.d.ts.map