export declare const APPEARANCE_SPEC_VERSION: 1;

declare type AppearanceColorToken = 'background' | 'foreground' | 'muted' | 'mutedForeground' | 'border' | 'input' | 'primary' | 'primaryForeground' | 'accent' | 'accentForeground' | 'card' | 'cardForeground' | 'positive' | 'negative' | 'warning' | 'info' | 'destructive' | 'destructiveForeground';

declare type AppearanceColorTokens = Partial<Record<AppearanceColorToken, string>>;

declare type AppearanceDensity = 'compact' | 'comfortable' | 'spacious';

export declare type AppearanceMode = 'light' | 'dark' | 'system';

declare type AppearanceResolutionLayers = {
    defaults?: NormalizedAppearanceSpec;
    organizationAppearance?: AppearanceSpec | null | undefined;
    tokenAppearance?: AppearanceSpec | null | undefined;
    reactAppearance?: AppearanceSpec | null | undefined;
};

declare type AppearanceScheme = {
    tokens?: AppearanceTokens;
    components?: {
        dashboard?: BaseSurfaceAppearance;
        card?: BaseSurfaceAppearance;
        interactive?: InteractiveSurfaceAppearance;
        chart?: ChartAppearance;
        table?: TableAppearance;
        pivotTable?: TableAppearance;
        aggregateTable?: TableAppearance;
        pagination?: BaseSurfaceAppearance;
    };
};

export declare type AppearanceSpec = {
    version: typeof APPEARANCE_SPEC_VERSION;
    mode?: AppearanceMode;
    schemes?: {
        light?: AppearanceScheme;
        dark?: AppearanceScheme;
    };
};

declare type AppearanceTokens = {
    color?: AppearanceColorTokens;
    typography?: {
        fontFamily?: string;
        headingFontFamily?: string;
        monoFontFamily?: string;
        baseFontSize?: number;
        density?: AppearanceDensity;
    };
    radius?: {
        control?: number;
        card?: number;
        table?: number;
        badge?: number;
    };
    spacing?: {
        dashboardPadding?: number;
        gridGap?: number;
        cardPadding?: number;
        controlGap?: number;
        tableCellX?: number;
        tableCellY?: number;
    };
    shadow?: {
        card?: string;
        popover?: string;
        focusRing?: string;
    };
};

export declare type AppearanceValidationIssue = {
    path: string;
    code: AppearanceValidationIssueCode;
    message: string;
};

export declare type AppearanceValidationIssueCode = 'invalid_type' | 'invalid_version' | 'invalid_value' | 'invalid_color' | 'unsupported_field';

export declare type AppearanceValidationResult = {
    success: true;
    value: AppearanceSpec;
    issues: [];
} | {
    success: false;
    issues: AppearanceValidationIssue[];
};

export declare function assertValidAppearanceSpec(input: unknown): asserts input is AppearanceSpec;

declare type BaseSurfaceAppearance = {
    background?: string;
    foreground?: string;
    borderColor?: string;
    borderRadius?: number;
    shadow?: string;
    padding?: number;
};

declare type ChartAppearance = {
    palette?: string[];
    background?: string;
    foreground?: string;
    gridColor?: string;
    axisColor?: string;
};

declare type InteractiveSurfaceAppearance = BaseSurfaceAppearance & {
    toolbarBackground?: string;
};

export declare function mergeAppearanceSpecs(base: NormalizedAppearanceSpec, override: AppearanceSpec): NormalizedAppearanceSpec;

export declare function normalizeAppearanceSpec(spec: AppearanceSpec, defaults?: NormalizedAppearanceSpec): NormalizedAppearanceSpec;

export declare type NormalizedAppearanceSpec = {
    version: typeof APPEARANCE_SPEC_VERSION;
    mode: AppearanceMode;
    schemes: {
        light: AppearanceScheme;
        dark: AppearanceScheme;
    };
};

export declare function resolveAppearance(layers?: AppearanceResolutionLayers): NormalizedAppearanceSpec;

declare type TableAppearance = {
    density?: AppearanceDensity;
    container?: {
        background?: string;
        borderColor?: string;
        borderRadius?: number;
        shadow?: string;
    };
    header?: {
        background?: string;
        foreground?: string;
        dividerColor?: string;
        fontWeight?: number;
        uppercase?: boolean;
        sticky?: boolean;
    };
    row?: {
        height?: number;
        dividerColor?: string;
        zebra?: boolean;
        zebraBackground?: string;
        hoverBackground?: string;
        selectedBackground?: string;
    };
    cell?: {
        paddingX?: number;
        paddingY?: number;
        verticalAlign?: 'top' | 'middle' | 'bottom';
        wrap?: 'wrap' | 'nowrap';
    };
    subtotal?: {
        background?: string;
        foreground?: string;
        fontWeight?: number;
    };
    grandTotal?: {
        background?: string;
        foreground?: string;
        fontWeight?: number;
        borderColor?: string;
    };
    pagination?: {
        background?: string;
        foreground?: string;
        borderColor?: string;
    };
};

export declare function validateAppearanceSpec(input: unknown): AppearanceValidationResult;

export { }
