Export template source from e33714a5ca38429d1bdb77a961a14461697944f5:examples/local-first/packages/language-reader-runtime
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { configureOptions } from "./configuration.js";
|
||||
import { plan } from "./planning.js";
|
||||
import { archiveType } from "./type-archives.js";
|
||||
import { openDocument, selectSettings, attachReader } from "./navigation.js";
|
||||
import { createRegistry } from "./gen/qx.js";
|
||||
import { QxReject } from "@quixos/camino-replica-core";
|
||||
export const registry = createRegistry({
|
||||
configureOptions,
|
||||
archiveType,
|
||||
plan,
|
||||
openDocument,
|
||||
selectSettings,
|
||||
attachReader,
|
||||
setReadingView: async ({ input, ports }) => {
|
||||
if (!["pages", "scroll"].includes(input.displayMode)) throw new QxReject("INVALID_READING_VIEW");
|
||||
await ports.reading.set(input);
|
||||
return null;
|
||||
},
|
||||
setEnabled: async ({ input, ports }) => {
|
||||
const data = await ports.data.get();
|
||||
if (data.enabled !== input) await ports.data.set({ ...data, enabled: input });
|
||||
return null;
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user