@omnia/fx
Version:
Provide Omnia Fx typings and tooling for clientside Omnia development.
26 lines (25 loc) • 1.52 kB
TypeScript
import { IPropertyConfigurationRenderer, PropertyDefinition, PropertyDisplaySettingsBase, PropertyValue } from "@omnia/fx-models";
export declare enum PropertyLockStatus {
open = 1,
locked = 2,
rollback = 3
}
export declare class PropertyLockStatusHelper {
static get(status: PropertyLockStatus | undefined, defaultValue?: PropertyLockStatus): PropertyLockStatus;
}
export type PropertyLockStatusType<T> = T extends object ? {
[K in keyof T]?: PropertyLockStatusType<T[K]>;
} : PropertyLockStatus;
export declare function createDefaultLockStatus<T extends object>(type: T): PropertyLockStatusType<T>;
export declare function removeLockStatus<T extends object>(instance: T, value: PropertyLockStatus): Partial<T>;
export declare function keepOnlyLockStatus<T extends object>(instance: T, value: PropertyLockStatus): Partial<T>;
export declare function updateWithLocked<A extends {
[key: string]: any;
}, B extends {
[key: string]: any;
}>(toUpdate: A, lockedProperties: B): A;
export type LockStatusExcludeChildren<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>> & Record<K, PropertyLockStatus>;
export type LockingPropertyDisplaySettings = {
locks?: PropertyLockStatusType<LockStatusExcludeChildren<Omit<LockingPropertyDisplaySettings, "locks">, "label">>;
} & PropertyDisplaySettingsBase;
export declare function getAllowRollback(props: IPropertyConfigurationRenderer<PropertyDefinition<PropertyValue, LockingPropertyDisplaySettings, any>>, value: any, defaultValue: any): boolean;