Space Configuration
type FidgetInstanceConfig = {
editable: boolean;
// Both size and settings type values are actually constrained
// by the related FidgetEditConfig
size: {
height: NumericRange<1,36>;
width: NumericRange<1,36>;
};
// Settings are the Fidget specific config
settings: {
[key: string]: any;
};
}
type FidgetFieldConfig = {
readonly fieldName: string;
readonly validator?: (value) => boolean;
// InputSelectorComponent is any component in the valid
// set of allowed input types
readonly inputSelector: InputSelectorComponent;
readonly default?: any;
readonly required: boolean;
}
type FidgetEditConfig = {
fields: FidgetFieldConfig[];
size: {
// NumericRange is a helper type that generates a set of valid
// values in the range inclusive on both ends
minHeight: NumericRange<1,36>;
maxHeight: NumericRange<1,36>;
minWidth: NumericRange<1,36>;
maxWidth: NumericRange<1,36>;
}
}
type FigdgetConfig = {
editConfig: FidgetEditConfig;
instanceConfig: FidgetInstanceConfig;
}
type LayoutConfig = {
[key: FidgetID]: {
x: NumericRange<1,36>;
y: NumericRange<1,36>;
};
}
type FidgetId = string;
type SpaceConfig = {
readonly ID: FidgetID;
fidgetConfig: FidgetConfig[];
layout: LayoutConfig;
editable: boolean;
}Last updated