@thangk/easythemer
Version:
Easily generate shades from a colour palette for use in your app
104 lines (103 loc) • 2.14 kB
TypeScript
import { RawChannelParams, RawShadeOption, RawHSL, RawShadesSet, RawShadeFactorsSet, RawUseThemerProp } from "./interfaces";
declare type Prettify<T> = {
[K in keyof T]: T[K];
} & {};
export declare type ValidateTypes = "options" | "shades";
export declare type Hex = string;
/**
* @example
* ```
* [
* {
* ...defaultChannelParams,
* channel: "h",
* },
* {
* ...defaultChannelParams,
* channel: "s",
* },
* {
* ...defaultChannelParams,
* useBounds: true,
* channel: "l",
* },
* ]
* ```
*/
export declare type ChannelParams = Prettify<RawChannelParams>;
/**
* @example
* ```
* [
* {
* type: "ShadeOption",
* optionName: "orange",
* hex: "#ff670f",
* generateShades: true,
* channelParams: [
* {
* ...defaultChannelParams,
* channel: "h",
* },
* {
* ...defaultChannelParams,
* channel: "s",
* },
* {
* ...defaultChannelParams,
* useBounds: true,
* channel: "l",
* },
* ]
* }
* ]
*
* ```
*/
export declare type ShadeOption = Prettify<RawShadeOption>;
/**
* @example
* ```
* {
* h: 0,
* s: 100,
* l: 50,
* }
* ```
*/
export declare type HSL = Prettify<RawHSL>;
/**
* @example
* ```
* {
* type: TYPE.SHADES_SET,
* setName: "red",
* shades: {
* "light": "hexCode",
* "normal": "hexCode",
* "dark": "hexCode"
* }
* }
* ```
*/
export declare type ShadesSet = Prettify<RawShadesSet>;
/**
* @example
* ```
* {
* type: TYPE.SHADE_FACTORS_SET,
* setName: "red",
* shadeFactors: {
* "light": 1,
* "normal": 0,
* "dark": -1
* }
* }
* ```
*/
export declare type ShadeFactorsSet = Prettify<RawShadeFactorsSet>;
/**
* @description the final complete object to be used by useThemer
*/
export declare type UseThemerProp = Prettify<RawUseThemerProp>;
export {};