///
// Defines a basic HTMLInputElement wrapper.
///
// Defines a basic HTMLTextAreaElement wrapper.
///
// Defines a basic content-editable wrapper.
///
// Defines a basic design-mode IFrame wrapper.
///
namespace com.keyman.dom.targets {
export function wrapElement(e: HTMLElement): OutputTarget {
// Complex type scoping is implemented here so that kmwutils.ts is not a dependency for test compilations.
if(Utils.instanceof(e, "HTMLInputElement")) {
return new Input( e);
} else if(Utils.instanceof(e, "HTMLTextAreaElement")) {
return new TextArea( e);
} else if(Utils.instanceof(e, "HTMLIFrameElement")) {
let iframe = e;
if(iframe.contentWindow && iframe.contentWindow.document && iframe.contentWindow.document.designMode == "on") {
return new DesignIFrame(iframe);
} else if (e.isContentEditable) {
// Do content-editable