@tldraw/utils
Version:
tldraw infinite canvas SDK (private utilities).
211 lines (210 loc) • 5.11 kB
JavaScript
import { registerTldrawLibraryVersion } from "./lib/version.mjs";
import { default as default2 } from "lodash.isequal";
import { default as default3 } from "lodash.isequalwith";
import { default as default4 } from "lodash.throttle";
import { default as default5 } from "lodash.uniq";
import {
areArraysShallowEqual,
compact,
dedupe,
last,
maxBy,
mergeArraysAndReplaceDefaults,
minBy,
partition,
rotateArray
} from "./lib/array.mjs";
import { bind } from "./lib/bind.mjs";
import { WeakCache } from "./lib/cache.mjs";
import {
assert,
assertExists,
exhaustiveSwitchError,
promiseWithResolve,
Result,
sleep
} from "./lib/control.mjs";
import { debounce } from "./lib/debounce.mjs";
import { annotateError, getErrorAnnotations } from "./lib/error.mjs";
import { ExecutionQueue } from "./lib/ExecutionQueue.mjs";
import { FileHelpers } from "./lib/file.mjs";
import { noop, omitFromStackTrace } from "./lib/function.mjs";
import { getHashForBuffer, getHashForObject, getHashForString, lns } from "./lib/hash.mjs";
import { mockUniqueId, restoreUniqueId, uniqueId } from "./lib/id.mjs";
import { getFirstFromIterable } from "./lib/iterable.mjs";
import {
DEFAULT_SUPPORT_VIDEO_TYPES,
DEFAULT_SUPPORTED_IMAGE_TYPES,
DEFAULT_SUPPORTED_MEDIA_TYPE_LIST,
DEFAULT_SUPPORTED_MEDIA_TYPES,
MediaHelpers
} from "./lib/media/media.mjs";
import { PngHelpers } from "./lib/media/png.mjs";
import { fetch, Image } from "./lib/network.mjs";
import { invLerp, lerp, modulate, rng } from "./lib/number.mjs";
import {
areObjectsShallowEqual,
filterEntries,
getChangedKeys,
getOwnProperty,
groupBy,
hasOwnProperty,
isEqualAllowingForFloatingPointErrors,
mapObjectMapValues,
objectMapEntries,
objectMapEntriesIterable,
objectMapFromEntries,
objectMapKeys,
objectMapValues,
omit
} from "./lib/object.mjs";
import { measureAverageDuration, measureCbDuration, measureDuration } from "./lib/perf.mjs";
import { PerformanceTracker } from "./lib/PerformanceTracker.mjs";
import {
getIndexAbove,
getIndexBelow,
getIndexBetween,
getIndices,
getIndicesAbove,
getIndicesBelow,
getIndicesBetween,
sortByIndex,
sortByMaybeIndex,
validateIndexKey,
ZERO_INDEX_KEY
} from "./lib/reordering.mjs";
import { retry } from "./lib/retry.mjs";
import { sortById } from "./lib/sort.mjs";
import {
clearLocalStorage,
clearSessionStorage,
deleteFromLocalStorage,
deleteFromSessionStorage,
getFromLocalStorage,
getFromSessionStorage,
setInLocalStorage,
setInSessionStorage
} from "./lib/storage.mjs";
import { stringEnum } from "./lib/stringEnum.mjs";
import { fpsThrottle, throttleToNextFrame } from "./lib/throttle.mjs";
import { Timers } from "./lib/timers.mjs";
import { safeParseUrl } from "./lib/url.mjs";
import {
isDefined,
isNativeStructuredClone,
isNonNull,
isNonNullish,
STRUCTURED_CLONE_OBJECT_PROTOTYPE,
structuredClone
} from "./lib/value.mjs";
import { registerTldrawLibraryVersion as registerTldrawLibraryVersion2 } from "./lib/version.mjs";
import { warnDeprecatedGetter, warnOnce } from "./lib/warn.mjs";
registerTldrawLibraryVersion(
"@tldraw/utils",
"4.2.1",
"esm"
);
export {
DEFAULT_SUPPORTED_IMAGE_TYPES,
DEFAULT_SUPPORTED_MEDIA_TYPES,
DEFAULT_SUPPORTED_MEDIA_TYPE_LIST,
DEFAULT_SUPPORT_VIDEO_TYPES,
ExecutionQueue,
FileHelpers,
Image,
MediaHelpers,
PerformanceTracker,
PngHelpers,
Result,
STRUCTURED_CLONE_OBJECT_PROTOTYPE,
Timers,
WeakCache,
ZERO_INDEX_KEY,
annotateError,
areArraysShallowEqual,
areObjectsShallowEqual,
assert,
assertExists,
bind,
clearLocalStorage,
clearSessionStorage,
compact,
debounce,
dedupe,
deleteFromLocalStorage,
deleteFromSessionStorage,
exhaustiveSwitchError,
fetch,
filterEntries,
fpsThrottle,
getChangedKeys,
getErrorAnnotations,
getFirstFromIterable,
getFromLocalStorage,
getFromSessionStorage,
getHashForBuffer,
getHashForObject,
getHashForString,
getIndexAbove,
getIndexBelow,
getIndexBetween,
getIndices,
getIndicesAbove,
getIndicesBelow,
getIndicesBetween,
getOwnProperty,
groupBy,
hasOwnProperty,
invLerp,
isDefined,
default2 as isEqual,
isEqualAllowingForFloatingPointErrors,
default3 as isEqualWith,
isNativeStructuredClone,
isNonNull,
isNonNullish,
last,
lerp,
lns,
mapObjectMapValues,
maxBy,
measureAverageDuration,
measureCbDuration,
measureDuration,
mergeArraysAndReplaceDefaults,
minBy,
mockUniqueId,
modulate,
noop,
objectMapEntries,
objectMapEntriesIterable,
objectMapFromEntries,
objectMapKeys,
objectMapValues,
omit,
omitFromStackTrace,
partition,
promiseWithResolve,
registerTldrawLibraryVersion2 as registerTldrawLibraryVersion,
restoreUniqueId,
retry,
rng,
rotateArray,
safeParseUrl,
setInLocalStorage,
setInSessionStorage,
sleep,
sortById,
sortByIndex,
sortByMaybeIndex,
stringEnum,
structuredClone,
default4 as throttle,
throttleToNextFrame,
default5 as uniq,
uniqueId,
validateIndexKey,
warnDeprecatedGetter,
warnOnce
};
//# sourceMappingURL=index.mjs.map