import { random , range } from "lodash" ; import { ExcalidrawElement , PrintableArea , Slide } from "../../src" ; export function makeRandomExcalidrawElement ( ) { return { id : makeRandomId ( ) , versionNonce : makeRandomNonce ( ) } ; } export function makeRandomExcalidrawElements ( length = 10 ) { return range ( 0 , length ) . map ( makeRandomExcalidrawElement ) ; } export function makeRandomSlide ( ) { return { id : makeRandomId ( ) , shouldRender : makeRandomBoolean ( ) , shouldRenderWithCommonExcalidrawElements : makeRandomBoolean ( ) , excalidrawElements : makeRandomExcalidrawElements ( ) , } ; } export function makeRandomSlides ( length = 10 ) { return range ( 0 , length ) . map ( makeRandomSlide ) ; } export function makeRandomPrintableArea ( ) { return { width : makeRandomInteger ( ) , height : makeRandomInteger ( ) } ; } function makeRandomId ( ) { return String ( makeRandomInteger ( ) ) ; } function makeRandomNonce ( ) { return makeRandomInteger ( ) ; } function makeRandomInteger ( ) { return random ( 1e5 , 1e6 , false ) ; } function makeRandomBoolean ( ) { return Math . random ( ) > 0.5 ; }