UNPKG

2.1 kBSource Map (JSON)View Raw
1{"version":3,"file":"Customizer.types.js","sourceRoot":"../src/","sources":["customizations/Customizer.types.tsx"],"names":[],"mappings":"","sourcesContent":["import { IBaseProps } from '../BaseComponent.types';\nimport { ISettings, ISettingsFunction } from './Customizations';\nimport { ICustomizerContext } from './CustomizerContext';\n\nexport type ICustomizerProps = IBaseProps &\n Partial<{\n /**\n * Settings are used as general settings for the React tree below.\n * Components can subscribe to receive the settings by using `customizable`.\n *\n * @example\n * ```\n * // Settings can be represented by a plain object that contains the key value pairs.\n * <Customizer settings={{ color: 'red' }} />\n *\n * // or a function that receives the current settings and returns the new ones\n * <Customizer settings={(currentSettings) => ({ ...currentSettings, color: 'red' })} />\n * ```\n */\n settings: ISettings | ISettingsFunction;\n\n /**\n * Scoped settings are settings that are scoped to a specific scope. The\n * scope is the name that is passed to the `customizable` function when the\n * the component is customized.\n *\n * @example\n * ```\n * // Scoped settings can be represented by a plain object that contains the key value pairs.\n * const myScopedSettings = {\n * Button: { color: 'red' };\n * };\n * <Customizer scopedSettings={myScopedSettings} />\n *\n * // or a function that receives the current settings and returns the new ones\n * const myScopedSettings = {\n * Button: { color: 'red' };\n * };\n * <Customizer scopedSettings={(currentScopedSettings) => ({ ...currentScopedSettings, ...myScopedSettings })} />\n * ```\n */\n scopedSettings: ISettings | ISettingsFunction;\n }> & {\n /**\n * Optional transform function for context. Any implementations should take care to return context without\n * mutating it.\n */\n contextTransform?: (context: Readonly<ICustomizerContext>) => ICustomizerContext;\n };\n"]}
\No newline at end of file