@fe6/water-pro
Version:
An enterprise-class UI design language and Vue-based implementation
252 lines (251 loc) • 6.4 kB
TypeScript
export default Pickr;
declare class Pickr {
static utils: typeof _;
static version: string;
static I18N_DEFAULTS: {
'ui:dialog': string;
'btn:toggle': string;
'btn:swatch': string;
'btn:last-color': string;
'btn:save': string;
'btn:cancel': string;
'btn:clear': string;
'aria:btn:save': string;
'aria:btn:cancel': string;
'aria:btn:clear': string;
'aria:input': string;
'aria:palette': string;
'aria:hue': string;
'aria:opacity': string;
};
static DEFAULT_OPTIONS: {
appClass: any;
theme: string;
useAsButton: boolean;
padding: number;
disabled: boolean;
comparison: boolean;
closeOnScroll: boolean;
outputPrecision: number;
lockOpacity: boolean;
autoReposition: boolean;
container: string;
components: {
interaction: {};
};
i18n: {};
swatches: any;
inline: boolean;
sliders: any;
default: string;
defaultRepresentation: any;
position: string;
adjustableNumbers: boolean;
showAlways: boolean;
closeWithKey: string;
};
static create: (options: any) => Pickr;
constructor(opt: any);
_initializingActive: boolean;
_recalc: boolean;
_nanopop: any;
_root: any;
_color: {
h: number;
s: number;
v: number;
a: number;
toHSVA(): number[];
toHSLA(): number[];
toRGBA(): number[];
toCMYK(): number[];
toHEXA(): string[];
clone: () => any;
};
_lastColor: {
h: number;
s: number;
v: number;
a: number;
toHSVA(): number[];
toHSLA(): number[];
toRGBA(): number[];
toCMYK(): number[];
toHEXA(): string[];
clone: () => any;
};
_swatchColors: any[];
_setupAnimationFrame: any;
_eventListener: {
init: any[];
save: any[];
hide: any[];
show: any[];
clear: any[];
change: any[];
changestop: any[];
cancel: any[];
swatchselect: any[];
};
options: any;
_preBuild(): void;
_finalBuild(): void;
_buildComponents(): void;
_components: {
palette: {
options: any;
_keyboard(e: any): void;
_tapstart(evt: any): void;
_tapmove(evt: any): any;
_tapstop(): void;
trigger(): void;
update(x?: number, y?: number): void;
destroy(): void;
};
hue: {
options: any;
_keyboard(e: any): void;
_tapstart(evt: any): void;
_tapmove(evt: any): any;
_tapstop(): void;
trigger(): void;
update(x?: number, y?: number): void;
destroy(): void;
};
opacity: {
options: any;
_keyboard(e: any): void;
_tapstart(evt: any): void;
_tapmove(evt: any): any;
_tapstop(): void;
trigger(): void;
update(x?: number, y?: number): void;
destroy(): void;
};
selectable: {
destroy: () => any;
};
};
_bindEvents(): void;
_eventBindings: any[];
_rePositioningPicker(): void;
_updateOutput(eventSource: any): void;
_clearColor(silent?: boolean): void;
_parseLocalColor(str: any): {
values: any;
type: any;
};
_t(key: any): any;
_emit(event: any, ...args: any[]): void;
on(event: any, cb: any): Pickr;
off(event: any, cb: any): Pickr;
/**
* Appends a color to the swatch palette
* @param color
* @returns {boolean}
*/
addSwatch(color: any): boolean;
/**
* Removes a swatch color by it's index
* @param index
* @returns {boolean}
*/
removeSwatch(index: any): boolean;
applyColor(silent?: boolean): Pickr;
/**
* Destroy's all functionalitys
*/
destroy(): void;
/**
* Destroy's all functionalitys and removes
* the pickr element.
*/
destroyAndRemove(): void;
/**
* Hides the color-picker ui.
*/
hide(): boolean;
/**
* Shows the color-picker ui.
*/
show(): false | Pickr;
/**
* @return {boolean} If the color picker is currently open
*/
isOpen(): boolean;
/**
* Set a specific color.
* @param h Hue
* @param s Saturation
* @param v Value
* @param a Alpha channel (0 - 1)
* @param silent If the button should not change the color
* @return boolean if the color has been accepted
*/
setHSVA(h?: number, s?: number, v?: number, a?: number, silent?: boolean): boolean;
/**
* Tries to parse a string which represents a color.
* Examples: #fff
* rgb 10 10 200
* hsva 10 20 5 0.5
* @param string
* @param silent
*/
setColor(string: any, silent?: boolean): boolean;
/**
* Changes the color _representation.
* Allowed values are HEX, RGB, HSV, HSL and CMYK
* @param type
* @returns {boolean} if the selected type was valid.
*/
setColorRepresentation(type: any): boolean;
/**
* Returns the current color representaion. See setColorRepresentation
* @returns {*}
*/
getColorRepresentation(): any;
/**
* @returns HSVaColor Current HSVaColor object.
*/
getColor(): {
h: number;
s: number;
v: number;
a: number;
toHSVA(): number[];
toHSLA(): number[];
toRGBA(): number[];
toCMYK(): number[];
toHEXA(): string[];
clone: () => any;
};
/**
* Returns the currently selected color.
* @returns {{a, toHSVA, toHEXA, s, v, h, clone, toCMYK, toHSLA, toRGBA}}
*/
getSelectedColor(): {
a;
toHSVA;
toHEXA;
s;
v;
h;
clone;
toCMYK;
toHSLA;
toRGBA;
};
/**
* @returns The root HTMLElement with all his components.
*/
getRoot(): any;
/**
* Disable pickr
*/
disable(): Pickr;
/**
* Enable pickr
*/
enable(): Pickr;
}
import * as _ from "./utils/utils";