Separate out into files

This commit is contained in:
2026-07-22 11:37:46 +00:00
parent 6aed7606ad
commit 5a514906eb
11 changed files with 906 additions and 657 deletions
@@ -0,0 +1,38 @@
import type {
NativePresentationDefinition,
NativePresentationName,
} from "../types";
export function definePresentation(definition: NativePresentationDefinition) {
return definition;
}
const builtins: NativePresentationDefinition[] = [
{ name: "push", axis: "x" },
{ name: "reveal", axis: "x" },
{ name: "slide", axis: "x" },
{ name: "fade", axis: "x" },
{ name: "modal", axis: "y" },
{ name: "sheet", axis: "y" },
{ name: "none", axis: "x" },
];
export class PresentationRegistry {
private readonly definitions = new Map<
NativePresentationName,
NativePresentationDefinition
>();
constructor(custom: NativePresentationDefinition[] = []) {
for (const definition of [...builtins, ...custom])
this.register(definition);
}
register(definition: NativePresentationDefinition) {
this.definitions.set(definition.name, definition);
}
get(name: NativePresentationName) {
return this.definitions.get(name);
}
}