How to use @wordpress/dom - 10 common examples

To help you get started, we’ve selected a few @wordpress/dom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / wordpress__dom / wordpress__dom-tests.ts View on Github external
dom.documentHasSelection();

// $ExpectType Element[]
dom.focus.focusable.find(element);

// $ExpectType Element[]
dom.focus.tabbable.find(element);

// $ExpectType boolean
dom.focus.tabbable.isTabbableIndex(element);

// $ExpectType Element | null
dom.getOffsetParent(node);

// $ExpectType DOMRect
dom.getRectangleFromRange(range);

// $ExpectType Element | undefined
dom.getScrollContainer(element);

// $ExpectType void
dom.insertAfter(node, node);

// $ExpectType boolean
dom.isEntirelySelected(element);

// $ExpectType boolean
dom.isHorizontalEdge(element, true);

// $ExpectType boolean
dom.isTextField(element);
github DefinitelyTyped / DefinitelyTyped / types / wordpress__dom / wordpress__dom-tests.ts View on Github external
dom.insertAfter(node, node);

// $ExpectType boolean
dom.isEntirelySelected(element);

// $ExpectType boolean
dom.isHorizontalEdge(element, true);

// $ExpectType boolean
dom.isTextField(element);

// $ExpectType boolean
dom.isVerticalEdge(element, false);

// $ExpectType void
dom.placeCaretAtHorizontalEdge(element, true);

// $ExpectType void
dom.placeCaretAtHorizontalEdge(undefined, false);

// $ExpectType void
dom.placeCaretAtVerticalEdge(element, true);

// $ExpectType void
dom.placeCaretAtVerticalEdge(undefined, false);

// $ExpectType void
dom.remove(node);

// $ExpectType void
dom.replace(node, node);
github DefinitelyTyped / DefinitelyTyped / types / wordpress__dom / wordpress__dom-tests.ts View on Github external
dom.isEntirelySelected(element);

// $ExpectType boolean
dom.isHorizontalEdge(element, true);

// $ExpectType boolean
dom.isTextField(element);

// $ExpectType boolean
dom.isVerticalEdge(element, false);

// $ExpectType void
dom.placeCaretAtHorizontalEdge(element, true);

// $ExpectType void
dom.placeCaretAtHorizontalEdge(undefined, false);

// $ExpectType void
dom.placeCaretAtVerticalEdge(element, true);

// $ExpectType void
dom.placeCaretAtVerticalEdge(undefined, false);

// $ExpectType void
dom.remove(node);

// $ExpectType void
dom.replace(node, node);

// $ExpectType HTMLParagraphElement
dom.replaceTag(node, 'p');
github DefinitelyTyped / DefinitelyTyped / types / wordpress__dom / wordpress__dom-tests.ts View on Github external
dom.getOffsetParent(node);

// $ExpectType DOMRect
dom.getRectangleFromRange(range);

// $ExpectType Element | undefined
dom.getScrollContainer(element);

// $ExpectType void
dom.insertAfter(node, node);

// $ExpectType boolean
dom.isEntirelySelected(element);

// $ExpectType boolean
dom.isHorizontalEdge(element, true);

// $ExpectType boolean
dom.isTextField(element);

// $ExpectType boolean
dom.isVerticalEdge(element, false);

// $ExpectType void
dom.placeCaretAtHorizontalEdge(element, true);

// $ExpectType void
dom.placeCaretAtHorizontalEdge(undefined, false);

// $ExpectType void
dom.placeCaretAtVerticalEdge(element, true);
github DefinitelyTyped / DefinitelyTyped / types / wordpress__dom / wordpress__dom-tests.ts View on Github external
dom.getRectangleFromRange(range);

// $ExpectType Element | undefined
dom.getScrollContainer(element);

// $ExpectType void
dom.insertAfter(node, node);

// $ExpectType boolean
dom.isEntirelySelected(element);

// $ExpectType boolean
dom.isHorizontalEdge(element, true);

// $ExpectType boolean
dom.isTextField(element);

// $ExpectType boolean
dom.isVerticalEdge(element, false);

// $ExpectType void
dom.placeCaretAtHorizontalEdge(element, true);

// $ExpectType void
dom.placeCaretAtHorizontalEdge(undefined, false);

// $ExpectType void
dom.placeCaretAtVerticalEdge(element, true);

// $ExpectType void
dom.placeCaretAtVerticalEdge(undefined, false);
github DefinitelyTyped / DefinitelyTyped / types / wordpress__dom / wordpress__dom-tests.ts View on Github external
dom.isHorizontalEdge(element, true);

// $ExpectType boolean
dom.isTextField(element);

// $ExpectType boolean
dom.isVerticalEdge(element, false);

// $ExpectType void
dom.placeCaretAtHorizontalEdge(element, true);

// $ExpectType void
dom.placeCaretAtHorizontalEdge(undefined, false);

// $ExpectType void
dom.placeCaretAtVerticalEdge(element, true);

// $ExpectType void
dom.placeCaretAtVerticalEdge(undefined, false);

// $ExpectType void
dom.remove(node);

// $ExpectType void
dom.replace(node, node);

// $ExpectType HTMLParagraphElement
dom.replaceTag(node, 'p');

// $ExpectType HTMLSpanElement
dom.replaceTag(node, 'span');
github DefinitelyTyped / DefinitelyTyped / types / wordpress__dom / wordpress__dom-tests.ts View on Github external
dom.isTextField(element);

// $ExpectType boolean
dom.isVerticalEdge(element, false);

// $ExpectType void
dom.placeCaretAtHorizontalEdge(element, true);

// $ExpectType void
dom.placeCaretAtHorizontalEdge(undefined, false);

// $ExpectType void
dom.placeCaretAtVerticalEdge(element, true);

// $ExpectType void
dom.placeCaretAtVerticalEdge(undefined, false);

// $ExpectType void
dom.remove(node);

// $ExpectType void
dom.replace(node, node);

// $ExpectType HTMLParagraphElement
dom.replaceTag(node, 'p');

// $ExpectType HTMLSpanElement
dom.replaceTag(node, 'span');

// $ExpectType void
dom.unwrap(node);
github DefinitelyTyped / DefinitelyTyped / types / wordpress__dom / wordpress__dom-tests.ts View on Github external
dom.isVerticalEdge(element, false);

// $ExpectType void
dom.placeCaretAtHorizontalEdge(element, true);

// $ExpectType void
dom.placeCaretAtHorizontalEdge(undefined, false);

// $ExpectType void
dom.placeCaretAtVerticalEdge(element, true);

// $ExpectType void
dom.placeCaretAtVerticalEdge(undefined, false);

// $ExpectType void
dom.remove(node);

// $ExpectType void
dom.replace(node, node);

// $ExpectType HTMLParagraphElement
dom.replaceTag(node, 'p');

// $ExpectType HTMLSpanElement
dom.replaceTag(node, 'span');

// $ExpectType void
dom.unwrap(node);

// $ExpectType void
dom.wrap(node, node);
github DefinitelyTyped / DefinitelyTyped / types / wordpress__dom / wordpress__dom-tests.ts View on Github external
dom.placeCaretAtHorizontalEdge(undefined, false);

// $ExpectType void
dom.placeCaretAtVerticalEdge(element, true);

// $ExpectType void
dom.placeCaretAtVerticalEdge(undefined, false);

// $ExpectType void
dom.remove(node);

// $ExpectType void
dom.replace(node, node);

// $ExpectType HTMLParagraphElement
dom.replaceTag(node, 'p');

// $ExpectType HTMLSpanElement
dom.replaceTag(node, 'span');

// $ExpectType void
dom.unwrap(node);

// $ExpectType void
dom.wrap(node, node);
github DefinitelyTyped / DefinitelyTyped / types / wordpress__dom / wordpress__dom-tests.ts View on Github external
dom.placeCaretAtVerticalEdge(element, true);

// $ExpectType void
dom.placeCaretAtVerticalEdge(undefined, false);

// $ExpectType void
dom.remove(node);

// $ExpectType void
dom.replace(node, node);

// $ExpectType HTMLParagraphElement
dom.replaceTag(node, 'p');

// $ExpectType HTMLSpanElement
dom.replaceTag(node, 'span');

// $ExpectType void
dom.unwrap(node);

// $ExpectType void
dom.wrap(node, node);