import { TinyColor, Numberify } from '@ctrl/tinycolor';
import * as _angular_forms from '@angular/forms';
import { ControlValueAccessor, ValidatorFn, FormGroup, FormControl } from '@angular/forms';
import * as i0 from '@angular/core';
import { OnInit, OnChanges, TemplateRef, EventEmitter, SimpleChanges } from '@angular/core';
import { NzSizeLDSType, NzSafeAny } from 'ng-zorro-antd/core/types';

/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */

interface HSB {
    h: number | string;
    s: number | string;
    b: number | string;
}
interface RGB {
    r: number | string;
    g: number | string;
    b: number | string;
}
interface HSBA extends HSB {
    a: number;
}
interface RGBA extends RGB {
    a: number;
}
type ColorGenInput<T = Color> = string | number | RGB | RGBA | HSB | HSBA | T;

/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */

declare class Color extends TinyColor {
    constructor(color: ColorGenInput);
    toHsbString(): string;
    toHsb(): Numberify<HSBA>;
}

/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */

type NzColorPickerFormatType = 'rgb' | 'hex' | 'hsb';
type NzColorPickerTriggerType = 'click' | 'hover';
interface ValidForm {
    isFormat: NzColorPickerFormatType | null;
    hex: string | null;
    hsbH: number;
    hsbS: number;
    hsbB: number;
    rgbR: number;
    rgbG: number;
    rgbB: number;
    roundA: number;
}
type ValidFormKey = keyof ValidForm;
interface NzColor extends Color {
}

declare class NzColorPickerComponent implements OnInit, OnChanges, ControlValueAccessor {
    private cdr;
    private destroyRef;
    private formBuilder;
    nzFormat: NzColorPickerFormatType | null;
    nzValue: string | NzColor;
    nzSize: NzSizeLDSType;
    nzDefaultValue: string | NzColor;
    nzTrigger: NzColorPickerTriggerType;
    nzTitle: TemplateRef<void> | string;
    nzFlipFlop: TemplateRef<void> | null;
    nzShowText: boolean;
    nzOpen: boolean;
    nzAllowClear: boolean;
    nzDisabled: boolean;
    nzDisabledAlpha: boolean;
    readonly nzOnChange: EventEmitter<{
        color: NzColor;
        format: string;
    }>;
    readonly nzOnFormatChange: EventEmitter<NzColorPickerFormatType>;
    readonly nzOnClear: EventEmitter<boolean>;
    readonly nzOnOpenChange: EventEmitter<boolean>;
    private isNzDisableFirstChange;
    blockColor: string;
    clearColor: boolean;
    showText: string;
    formControl: _angular_forms.FormControl<string | null>;
    onChange: (value: string) => void;
    writeValue(value: string): void;
    registerOnChange(fn: NzSafeAny): void;
    registerOnTouched(): void;
    setDisabledState(isDisabled: boolean): void;
    ngOnInit(): void;
    ngOnChanges(changes: SimpleChanges): void;
    clearColorHandle(): void;
    getBlockColor(): void;
    colorChange(value: {
        color: NzColor;
    }): void;
    formatChange(value: {
        color: string;
        format: NzColorPickerFormatType;
    }): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<NzColorPickerComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<NzColorPickerComponent, "nz-color-picker", ["nzColorPicker"], { "nzFormat": { "alias": "nzFormat"; "required": false; }; "nzValue": { "alias": "nzValue"; "required": false; }; "nzSize": { "alias": "nzSize"; "required": false; }; "nzDefaultValue": { "alias": "nzDefaultValue"; "required": false; }; "nzTrigger": { "alias": "nzTrigger"; "required": false; }; "nzTitle": { "alias": "nzTitle"; "required": false; }; "nzFlipFlop": { "alias": "nzFlipFlop"; "required": false; }; "nzShowText": { "alias": "nzShowText"; "required": false; }; "nzOpen": { "alias": "nzOpen"; "required": false; }; "nzAllowClear": { "alias": "nzAllowClear"; "required": false; }; "nzDisabled": { "alias": "nzDisabled"; "required": false; }; "nzDisabledAlpha": { "alias": "nzDisabledAlpha"; "required": false; }; }, { "nzOnChange": "nzOnChange"; "nzOnFormatChange": "nzOnFormatChange"; "nzOnClear": "nzOnClear"; "nzOnOpenChange": "nzOnOpenChange"; }, never, never, true, never>;
    static ngAcceptInputType_nzShowText: unknown;
    static ngAcceptInputType_nzOpen: unknown;
    static ngAcceptInputType_nzAllowClear: unknown;
    static ngAcceptInputType_nzDisabled: unknown;
    static ngAcceptInputType_nzDisabledAlpha: unknown;
}

/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */

declare class NzColorBlockComponent {
    nzColor: string;
    nzSize: NzSizeLDSType;
    readonly nzOnClick: EventEmitter<boolean>;
    static ɵfac: i0.ɵɵFactoryDeclaration<NzColorBlockComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<NzColorBlockComponent, "nz-color-block", ["nzColorBlock"], { "nzColor": { "alias": "nzColor"; "required": false; }; "nzSize": { "alias": "nzSize"; "required": false; }; }, { "nzOnClick": "nzOnClick"; }, never, never, true, never>;
}

/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */

declare class NzColorFormatComponent implements OnChanges, OnInit {
    private destroyRef;
    private formBuilder;
    format: NzColorPickerFormatType | null;
    colorValue: string;
    clearColor: boolean;
    nzDisabledAlpha: boolean;
    readonly formatChange: EventEmitter<{
        color: string;
        format: NzColorPickerFormatType;
    }>;
    readonly nzOnFormatChange: EventEmitter<NzColorPickerFormatType>;
    validatorFn(): ValidatorFn;
    validateForm: FormGroup<{
        isFormat: FormControl<NzColorPickerFormatType | null>;
        hex: FormControl<string | null>;
        hsbH: FormControl<number>;
        hsbS: FormControl<number>;
        hsbB: FormControl<number>;
        rgbR: FormControl<number>;
        rgbG: FormControl<number>;
        rgbB: FormControl<number>;
        roundA: FormControl<number>;
    }>;
    formatterPercent: (value: number) => string;
    parserPercent: (value: string) => number;
    ngOnInit(): void;
    ngOnChanges(changes: SimpleChanges): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<NzColorFormatComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<NzColorFormatComponent, "nz-color-format", ["nzColorFormat"], { "format": { "alias": "format"; "required": false; }; "colorValue": { "alias": "colorValue"; "required": false; }; "clearColor": { "alias": "clearColor"; "required": false; }; "nzDisabledAlpha": { "alias": "nzDisabledAlpha"; "required": false; }; }, { "formatChange": "formatChange"; "nzOnFormatChange": "nzOnFormatChange"; }, never, never, true, never>;
    static ngAcceptInputType_clearColor: unknown;
    static ngAcceptInputType_nzDisabledAlpha: unknown;
}

declare class NzColorPickerModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<NzColorPickerModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<NzColorPickerModule, never, [typeof NzColorPickerComponent, typeof NzColorBlockComponent, typeof NzColorFormatComponent], [typeof NzColorPickerComponent, typeof NzColorBlockComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<NzColorPickerModule>;
}

export { NzColorBlockComponent, NzColorPickerComponent, NzColorPickerModule };
export type { NzColor, NzColorPickerFormatType, NzColorPickerTriggerType, ValidForm, ValidFormKey };
