flowbite-angular
Version:
<div align="center"> <h1>flowbite-angular</h1> <p> Build websites even faster with components on top of Angular and Tailwind CSS </p> <p> <a href="https://discord.com/invite/4eeurUVvTy"> <img src="https://img.shields.io/discord/90291
127 lines (115 loc) • 3.38 kB
TypeScript
interface FlowbiteBoolean {
off: string;
on: string;
}
interface ColorToTheme {
light: string;
dark: string;
}
interface FlowbiteStateColors {
default: ColorToTheme;
info: ColorToTheme;
failure: ColorToTheme;
success: ColorToTheme;
warning: ColorToTheme;
}
interface FlowbiteColors extends FlowbiteStateColors {
[key: string]: ColorToTheme;
primary: ColorToTheme;
dark: ColorToTheme;
light: ColorToTheme;
blue: ColorToTheme;
cyan: ColorToTheme;
gray: ColorToTheme;
green: ColorToTheme;
indigo: ColorToTheme;
lime: ColorToTheme;
pink: ColorToTheme;
purple: ColorToTheme;
red: ColorToTheme;
teal: ColorToTheme;
yellow: ColorToTheme;
}
interface FlowbiteGradientColors extends Omit<FlowbiteStateColors, 'warning'> {
[key: string]: ColorToTheme;
cyan: ColorToTheme;
lime: ColorToTheme;
pink: ColorToTheme;
purple: ColorToTheme;
teal: ColorToTheme;
}
interface FlowbiteGradientDuoToneColors {
cyanToBlue: ColorToTheme;
greenToBlue: ColorToTheme;
pinkToOrange: ColorToTheme;
purpleToBlue: ColorToTheme;
purpleToPink: ColorToTheme;
redToYellow: ColorToTheme;
tealToLime: ColorToTheme;
}
/**
* Type describing partial object from another, by getting every sub-child of provided type in itself.
*/
type DeepPartial<T> = T extends object ? {
[P in keyof T]?: DeepPartial<T[P]>;
} : T;
interface FlowbitePositions {
'bottom-left': string;
'bottom-right': string;
'bottom-center': string;
'top-left': string;
'top-center': string;
'top-right': string;
'center-left': string;
center: string;
'center-right': string;
}
interface FlowbiteSizes {
xs: string;
sm: string;
md: string;
lg: string;
xl: string;
'2xl': string;
'3xl': string;
'4xl': string;
'5xl': string;
'6xl': string;
'7xl': string;
}
/**
* Base definition of theme used in flowbite-angular.
*/
type FlowbiteThemes = 'dark' | 'light';
/**
* Function that return the cloned type of the provided generic type.
*
* @param source Generic object to be cloned.
* @returns The clone type of the provided type.
*/
declare function cloneDeep<T>(source: T): T;
declare function colorToTheme<TSet extends Partial<FlowbiteColors>>(set: TSet, key: keyof TSet): string;
/**
* This function is used to create themes for component's while keeping the intellisens up for TailwindCSS and other extensions.
*
* @param input Generic type to be created.
* @returns The generic type's definition.
*/
declare function createTheme<T>(input: T): T;
/**
* Check if the provided parameter is an object or not.
*
* @param item The unknown type parameter.
* @returns true if it's an ibject ; false otherwise.
*/
declare function isObject(item: unknown): item is Record<string, unknown>;
/**
* Merge two objects into one.
*
* @param target Object to be merged.
* @param source Object to be merged.
* @returns The merged object.
*/
declare function mergeDeep<T extends object, S extends object>(target: T, source: S): T & S;
export { cloneDeep, colorToTheme, createTheme, isObject, mergeDeep };
export type { ColorToTheme, DeepPartial, FlowbiteBoolean, FlowbiteColors, FlowbiteGradientColors, FlowbiteGradientDuoToneColors, FlowbitePositions, FlowbiteSizes, FlowbiteStateColors, FlowbiteThemes };