UNPKG

rmwc

Version:

A thin React wrapper for Material Design (Web) Components

54 lines (53 loc) 2.19 kB
import * as React from 'react'; import * as PropTypes from 'prop-types'; declare type IconStrategyT = 'auto' | 'ligature' | 'className' | 'url' | 'component' | 'custom'; export declare type RMWCProviderOptionsT = { /** Set the buttons ripple effect globally */ buttonDefaultRipple?: boolean; /** Set the listItems ripple effect globally */ listItemDefaultRipple?: boolean; /** Set the iconClassNameBase. Read the icon docs for more info. */ iconClassNameBase?: string; /** Set the iconClassNamePrefix. Read the icon docs for more info. */ iconClassNamePrefix?: string; /** Set the default iconStrategy. Read the icon docs for more info. */ iconStrategy?: IconStrategyT; /** Sets a default render function to be used when the iconStrategy is custom */ iconRender?: (props: { content: React.ReactNode; className: string; }) => any; /** Children to render */ children?: React.ReactNode; }; export declare const getProviderOptions: (context: any) => RMWCProviderOptionsT; /** * Provides default options for children * Prop override options in providerDefaults with the same name */ export declare class RMWCProvider extends React.Component<RMWCProviderOptionsT> { static defaultProps: RMWCProviderOptionsT; constructor(props: RMWCProviderOptionsT); getChildContext(): { RMWCOptions: RMWCProviderOptionsT; }; componentWillUpdate(nextProps: RMWCProviderOptionsT): void; options: RMWCProviderOptionsT; static childContextTypes: { RMWCOptions: PropTypes.Requireable<any>; }; buildOptions(props: RMWCProviderOptionsT): { buttonDefaultRipple?: boolean | undefined; listItemDefaultRipple?: boolean | undefined; iconClassNameBase?: string | undefined; iconClassNamePrefix?: string | undefined; iconStrategy?: "auto" | "custom" | "ligature" | "className" | "url" | "component" | undefined; iconRender?: ((props: { content: React.ReactNode; className: string; }) => any) | undefined; children?: React.ReactNode; }; render(): React.ReactNode; } export default RMWCProvider;