snapshot of https://github.com/excalidraw/excalidraw.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Tests / test (push) Has been cancelled
Some checks failed
Tests / test (push) Has been cancelled
This commit is contained in:
15
packages/excalidraw/actions/register.ts
Normal file
15
packages/excalidraw/actions/register.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { Action } from "./types";
|
||||
|
||||
export let actions: readonly Action[] = [];
|
||||
|
||||
export const register = <
|
||||
TData extends any,
|
||||
T extends Action<TData> = Action<TData>,
|
||||
>(
|
||||
action: T,
|
||||
) => {
|
||||
actions = actions.concat(action);
|
||||
return action as T & {
|
||||
keyTest?: unknown extends T["keyTest"] ? never : T["keyTest"];
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user