import { ComponentType, FunctionComponent } from 'react'; import { ISystem } from './system'; import { IThemeSettings } from './theme'; export interface IComponentOptions extends IStylingOptions { passthrough?: boolean; } export interface IComponentFactoryOptions extends IStylingOptions { style?: TStyle | StylingFn; } export interface IComponentStylesRegistry { [componentName: string]: Array>; } export interface IDSComponent extends FunctionComponent { $$nprdds: boolean; } export declare type IDSProps = { as?: string | ComponentType | IDSComponent; } & TStylerProps; export interface IStyleCache { get(name: string): T | void; set(name: string, value: T): T; } export interface IStylingOptions { cacheProps?: string[]; styles?: Array>; stripProps?: string[]; } export interface IStyler { apply: StylingFn; propNames: Array; stripProps: Array; } export declare type extractStylerProps = Type extends IStyler ? x : object; export interface IInternalDSProps { compPath?: string[]; stripProps?: string[]; stylers?: Array>; } export interface IStyleApplicator { apply(componentName: string, props: Partial & TStyleProps> & TProps, system: ISystem, componentOptions: IComponentOptions): IInternalDSProps & TStyleProps & TProps; } export interface ITheme { color(valueOrName: string, defaultValueOrName?: string): string; get(attributeName: keyof IThemeSettings, defaultValue?: any): any; } export declare type ComponentFactory = (componentName: string, component: string | ComponentType | IDSComponent, options?: IComponentFactoryOptions) => IDSComponent & TStyleProps & { [key: string]: any; }>; export declare type StyleCacheKeyFn = (props: object, cacheProps: string[], viewport: number, compPath?: string[], componentName?: string) => string; export declare type StyleApplicatorFactory = (options: { cache: IStyleCache; cacheKeyFn?: StyleCacheKeyFn; componentStyles: IComponentStylesRegistry; globalStyles: Array>; }) => IStyleApplicator; export declare type StylerCreatorFn = (propNames: string[], style: TStyle | StylingFn, stripProps?: string[]) => IStyler; export declare type StylingFn = (props: TProps, designSystem: ISystem) => TStyle;