import { IStyle } from './IStyle'; import { IStyleFunctionOrObject, IStyleFunction } from './IStyleFunction'; import type { ShadowConfig } from './shadowConfig'; /** * @deprecated Use `Exclude` provided by TypeScript instead. */ export type Diff = ({ [P in T]: P; } & { [P in U]: never; } & { [x: string]: never; })[T]; /** * @deprecated Use the version provided by TypeScript instead. */ type _Omit = Pick>; export type { _Omit as Omit }; /** * Helper function whose role is supposed to express that regardless if T is a style object or style function, * it will always map to a style function. */ export type __MapToFunctionType = Extract extends never ? (...args: any[]) => Partial : Extract; /** * Used for 'extends IStyleSetBase' type constraints when an IStyleSet type argument is needed. */ export interface IStyleSetBase { [key: string]: any; subComponentStyles?: any; } /** * A style set is a dictionary of display areas to IStyle objects. * It may optionally contain style functions for sub components in the special `subComponentStyles` * property. */ export type IStyleSet = { [P in keyof _Omit]: IStyle; } & { subComponentStyles?: { [P in keyof TStyleSet['subComponentStyles']]: IStyleFunctionOrObject; }; } & IShadowConfig; /** * A concatenated style set differs from `IStyleSet` in that subComponentStyles will always be a style function. */ export type IConcatenatedStyleSet = { [P in keyof _Omit]: IStyle; } & { subComponentStyles?: { [P in keyof TStyleSet['subComponentStyles']]: IStyleFunction; }; } & IShadowConfig; /** * A processed style set is one which the set of styles associated with each area has been converted * into a class name. Additionally, all subComponentStyles are style functions. */ export type IProcessedStyleSet = { [P in keyof _Omit]: string; } & { subComponentStyles: { [P in keyof TStyleSet['subComponentStyles']]: __MapToFunctionType; }; } & IShadowConfig; type IShadowConfig = { __shadowConfig__?: ShadowConfig; };