@omnia/fx-models
Version:
Provide Omnia Fx Models Stuffs.
50 lines (49 loc) • 2.63 kB
TypeScript
import { GuidValue } from "@omnia/fx-models/internal-do-not-import-from-here/shared/models";
import { IIcon } from "../Icon";
import { MultilingualString } from "../MultilingualString";
import { PropertyValue } from "./PropertyValue";
export type PropertyDisplaySettingsType<TPropDef extends PropertyDefinition<any, any, any, any>> = TPropDef extends PropertyDefinition<any, infer TPropertyDisplaySettings, any, any> ? TPropertyDisplaySettings : never;
export type PropertyEditorSettingsType<TPropDef extends PropertyDefinition<any, any, any, any>> = TPropDef extends PropertyDefinition<any, any, infer TPropertyEditorSettings, any> ? TPropertyEditorSettings : never;
export type PropertySetupSettingsType<TPropDef extends PropertyDefinition<any, any, any, any>> = TPropDef extends PropertyDefinition<any, any, any, infer TPropertySetupSettings> ? (TPropertySetupSettings extends UndefinedMirrorOfPropertySetupBase ? never : TPropertySetupSettings) : never;
export type PropertyValueType<TPropDef> = TPropDef extends PropertyDefinition<infer TPropertyValue, any, any, any> ? TPropertyValue : never;
export type PropertyDefinitionId = GuidValue;
export interface PropertyLabel {
text: string | MultilingualString;
icon?: IIcon;
}
export declare abstract class PropertyDisplaySettingsBase {
label?: PropertyLabel;
showLabelText?: boolean;
showLabelIcon?: boolean;
inline?: boolean;
}
/**
* The base for PropertySetup
*/
export declare abstract class PropertySetupBase {
}
declare abstract class UndefinedMirrorOfPropertySetupBase extends PropertySetupBase {
private uniquePropertyNameOfUndefinedMirrorOfPropertySetupBase?;
}
export declare abstract class PropertyDefinition<TPropertyValue extends PropertyValue, TPropertyDisplaySettings extends PropertyDisplaySettingsBase, TPropertyEditorSettings, TPropertySetupSettings extends PropertySetupBase = PropertySetupBase> {
abstract readonly id: PropertyDefinitionId;
abstract readonly typeName: string;
/**
* Dummy used to not make the compiler remove the generic type info from d.ts
* */
protected value?: TPropertyValue;
/**
* Dummy used to not make the compiler remove the generic type info from d.ts
* */
protected displaySettings?: TPropertyDisplaySettings;
/**
* Dummy used to not make the compiler remove the generic type info from d.ts
* */
protected editorSettings?: TPropertyEditorSettings;
/**
* Dummy used to not make the compiler remove the generic type info from d.ts
* */
protected setupSettings?: TPropertySetupSettings;
constructor();
}
export {};