UNPKG

@sitecore/sc-contenthub-blok

Version:

A UI library for [Sitecore Content Hub](https://doc.sitecore.com/ch/).

39 lines (38 loc) 1.81 kB
import { ColorName } from "./colors"; export declare const documentStyle: CSSStyleDeclaration; export declare const normalizeColor: (color: string) => string; export declare const getStyle: (className: string) => string; export declare const normalizeFontNames: (fonts: string | null) => string; export declare const transparentize: (color: string, amount: number) => string; export declare const capitalizeString: (str: string) => string; export declare const isFunction: (f: unknown) => f is (...args: never[]) => never; export declare const copyToClipboard: (text: string) => Promise<void>; export declare const EMPTY_IMMUTABLE_ARRAY: readonly []; /** * Helper function returning an empty immutable array. * This can for example be used as a default value for array props when so desired. * Note: Errors will be thrown at runtime when code tries to modify the returned array. * @returns An empty immutable array */ export declare const getEmptyImmutableArray: <T = readonly unknown[]>() => NonNullable<T>; export declare const EMPTY_IMMUTABLE_OBJECT: Readonly<{}>; /** * Helper function returning an empty immutable object. * This can for example be used as a default value for object props when so desired. * Note: Errors will be thrown at runtime when code tries to modify the returned object. * @returns An empty immutable array */ export declare const getEmptyImmutableObject: <T = Readonly<unknown>>() => NonNullable<T>; export type Nullable<T> = T | null; export type Optional<T> = T | undefined; export interface LabelValuePair<T> { value: T; label: string; } export interface KeyValuePair<T, K> { key: T; value: K; } export declare const isValidColorName: (color?: string) => color is ColorName; export declare const isLTR: boolean; export declare const isRTL: boolean;