OptionsExpander: OptionsType[] | ((system, options?) => OptionsType[])

Options provider for configuration properties with enumerated values.

Can be either a static list of options or a dynamic function that generates options based on the current unit system. Useful for configuration properties that need different option sets based on regional settings.

Type declaration

Example: Static Options List

const staticOptions: OptionsExpander = [
{ label: 'Automatic', value: 'auto' },
{ label: 'Manual', value: 'manual' },
{ label: 'Disabled', value: 'disabled' }
];

Example: Dynamic System-Based Options

const dynamicOptions: OptionsExpander = (system: string, schemaOptions?: string[]) => {
const baseOptions = [
{ label: 'Automatic', value: 'auto' },
{ label: 'Manual', value: 'manual' }
];

// Add system-specific options
if (system === 'imperial') {
baseOptions.push({ label: 'Imperial Mode', value: 'imperial' });
} else if (system === 'metric') {
baseOptions.push({ label: 'Metric Mode', value: 'metric' });
}

return baseOptions;
};