/** * The DesignSystemProvider is a react component designed to provide design-system configurations to the * JSSManager. The provider accepts a single prop that it will make available to all child components through * react contexts. If given a design-language, the JSSManager will make the design-language object available * to all JSS rules defined as a function */ import React from "react"; import { DesignSystemMergingFunction } from "@microsoft/fast-jss-manager"; /** * @deprecated */ export declare type DesignSystem = T; /** * Describes the props that the DesignSystemProvider uses. It accepts a single prop "designSystem" * that gets exposed to all downstream components of the DesignSystemProvider */ export interface DesignSystemProviderProps { designSystem: T; designSystemMergingFunction?: DesignSystemMergingFunction; } export declare class DesignSystemProvider extends React.Component, { designSystem: T; }> { static contextType: React.Context; /** * We need to store a copy of the context object * because React doesn't give good tools to know * when the context has changed. */ private upstreamDesignSystem; /** * A copy of this.props.designSystem - * we need to store this as a property so that we can * determine if designSystem props have changed in the render method. * We need to determine if it has changed in render as opposed to componentDidUpdate * to avoid a re-render */ private designSystemOverrides; /** * The merged upstreamDesignSystem and designSystemOverrides - * store this so the object reference doesn't change between * renders if both props.designSystem and context don't change */ private downstreamDesignSystem; constructor(props: DesignSystemProviderProps, context: T); render(): React.ReactNode; /** * Updates the downstreamDesignSystem if either this.props.designSystem * or this.context has changed */ private updateDownstreamDesignSystem; /** * Merges locally stored context with designSystem props. * Returns a new object */ private createDesignSystem; }