UNPKG

1.16 kBTypeScriptView Raw
1import { IStyleSet, IProcessedStyleSet, IStyleFunctionOrObject } from '@uifabric/merge-styles';
2export interface IClassNamesFunctionOptions {
3 /**
4 * Disables class caching for scenarios where styleProp parts mutate frequently.
5 */
6 disableCaching?: boolean;
7 /**
8 * Size of the cache. It overwrites default cache size when defined.
9 */
10 cacheSize?: number;
11 /**
12 * Set to true if component base styles are implemented in scss instead of css-in-js.
13 */
14 useStaticStyles?: boolean;
15}
16/**
17 * Creates a getClassNames function which calls getStyles given the props, and injects them
18 * into mergeStyleSets.
19 *
20 * Note that the props you pass in on every render should be in the same order and
21 * immutable (numbers, strings, and booleans). This will allow the results to be memoized. Violating
22 * these will cause extra recalcs to occur.
23 */
24export declare function classNamesFunction<TStyleProps extends {}, TStyleSet extends IStyleSet<TStyleSet>>(options?: IClassNamesFunctionOptions): (getStyles: IStyleFunctionOrObject<TStyleProps, TStyleSet> | undefined, styleProps?: TStyleProps) => IProcessedStyleSet<TStyleSet>;