blob: 43871b441d6b2fc600a1de58de74acb1d2304817 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import type { Mask, MaskDefaultContext, MaskType } from "@/lib/masks/types";
import { masksRegistry } from "./registry";
import { generateUUID } from "@/utils/id";
export { masksRegistry } from "./registry";
export { registerDefaultMasks } from "./definitions";
export function buildDefaultMaskInstance({
maskType,
elementSize,
}: {
maskType: MaskType;
elementSize?: { width: number; height: number };
}): Mask {
const definition = masksRegistry.get(maskType);
const context: MaskDefaultContext = { elementSize };
return { ...definition.buildDefault(context), id: generateUUID() } as Mask;
}
|