Type Guard checking for properties to exist. Workaround for
microsoft/TypeScript#21732 to help to implement type guards
checking subsequent property value types.
constisEditorWithUI = <TextendsEditor>(value: T): valueisT & EditorWithUI=> { // first see, if required keys are available if (isRaw<EditorWithUI>(value, "ui")) { // then check these keys if they pass the type-guard returntypeofvalue.ui === "object"; } returnfalse; };
Type Guard checking for properties to exist. Workaround for
microsoft/TypeScript#21732to help to implement type guards checking subsequent property value types.