feat: export isLinearElement and getNonDeletedElements (#4072)
* feat: export isLinearElement and getNonDeletedElements * fix
This commit is contained in:
parent
bc88cf5002
commit
6eecadce60
@ -17,6 +17,8 @@ Please add the latest change on the top under the correct section.
|
||||
|
||||
### Features
|
||||
|
||||
- Export [`isLinearElement`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#isLinearElement) and [`getNonDeletedElements`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#getNonDeletedElements).
|
||||
|
||||
- Support [`renderTopRightUI`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#renderTopRightUI) in mobile UI.
|
||||
|
||||
- Export `THEME` constant from the package so host can use this when passing the theme.
|
||||
|
@ -910,6 +910,38 @@ getFreeDrawSvgPath(element: <a href="https://github.com/excalidraw/excalidraw/bl
|
||||
|
||||
This function returns the free draw svg path for the element.
|
||||
|
||||
#### `isLinearElement`
|
||||
|
||||
**How to use**
|
||||
|
||||
```js
|
||||
import { isLinearElement } from "@excalidraw/excalidraw-next";
|
||||
```
|
||||
|
||||
**Signature**
|
||||
|
||||
<pre>
|
||||
isLinearElement(elementType?: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L80">ExcalidrawElement</a>): boolean
|
||||
</pre>
|
||||
|
||||
This function returns true if the element is linear type (`arrow` |`line`) else returns false.
|
||||
|
||||
#### `getNonDeletedElements`
|
||||
|
||||
**How to use**
|
||||
|
||||
```js
|
||||
import { getNonDeletedElements } from "@excalidraw/excalidraw-next";
|
||||
```
|
||||
|
||||
**Signature**
|
||||
|
||||
<pre>
|
||||
getNonDeletedElements(elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L80"> readonly ExcalidrawElement[]</a>): as readonly <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L90">NonDeletedExcalidrawElement[]</a>
|
||||
</pre>
|
||||
|
||||
This function returns an array of deleted elements.
|
||||
|
||||
### Exported constants
|
||||
|
||||
#### `FONT_FAMILY`
|
||||
|
@ -171,6 +171,7 @@ export {
|
||||
getSceneVersion,
|
||||
getElementMap,
|
||||
isInvisiblySmallElement,
|
||||
getNonDeletedElements,
|
||||
} from "../../element";
|
||||
export { defaultLang, languages } from "../../i18n";
|
||||
export { restore, restoreAppState, restoreElements } from "../../data/restore";
|
||||
@ -183,4 +184,6 @@ export {
|
||||
loadFromBlob,
|
||||
getFreeDrawSvgPath,
|
||||
} from "../../packages/utils";
|
||||
export { isLinearElement } from "../../element/typeChecks";
|
||||
|
||||
export { FONT_FAMILY, THEME } from "../../constants";
|
||||
|
Loading…
x
Reference in New Issue
Block a user