Variable preferencesSchemaConst
preferencesSchema: ZodObject<
{
fontSettings: ZodOptional<
ZodObject<
{
family: ZodOptional<ZodEnum<["reading", "ui"]>>;
lineSpacing: ZodOptional<ZodNumber>;
margins: ZodOptional<ZodNumber>;
size: ZodOptional<ZodNumber>;
},
"passthrough",
ZodTypeAny,
objectOutputType<
{
family: ZodOptional<ZodEnum<["reading", "ui"]>>;
lineSpacing: ZodOptional<ZodNumber>;
margins: ZodOptional<ZodNumber>;
size: ZodOptional<ZodNumber>;
},
ZodTypeAny,
"passthrough",
>,
objectInputType<
{
family: ZodOptional<ZodEnum<["reading", "ui"]>>;
lineSpacing: ZodOptional<ZodNumber>;
margins: ZodOptional<ZodNumber>;
size: ZodOptional<ZodNumber>;
},
ZodTypeAny,
"passthrough",
>,
>,
>;
pageMode: ZodOptional<ZodEnum<["paged", "scroll"]>>;
theme: ZodOptional<ZodEnum<["light", "sepia", "dark"]>>;
tocSidebarOpen: ZodOptional<ZodBoolean>;
},
"passthrough",
ZodTypeAny,
objectOutputType<
{
fontSettings: ZodOptional<
ZodObject<
{
family: ZodOptional<ZodEnum<["reading", "ui"]>>;
lineSpacing: ZodOptional<ZodNumber>;
margins: ZodOptional<ZodNumber>;
size: ZodOptional<ZodNumber>;
},
"passthrough",
ZodTypeAny,
objectOutputType<
{
family: ZodOptional<ZodEnum<["reading", "ui"]>>;
lineSpacing: ZodOptional<ZodNumber>;
margins: ZodOptional<ZodNumber>;
size: ZodOptional<ZodNumber>;
},
ZodTypeAny,
"passthrough",
>,
objectInputType<
{
family: ZodOptional<ZodEnum<["reading", "ui"]>>;
lineSpacing: ZodOptional<ZodNumber>;
margins: ZodOptional<ZodNumber>;
size: ZodOptional<ZodNumber>;
},
ZodTypeAny,
"passthrough",
>,
>,
>;
pageMode: ZodOptional<ZodEnum<["paged", "scroll"]>>;
theme: ZodOptional<ZodEnum<["light", "sepia", "dark"]>>;
tocSidebarOpen: ZodOptional<ZodBoolean>;
},
ZodTypeAny,
"passthrough",
>,
objectInputType<
{
fontSettings: ZodOptional<
ZodObject<
{
family: ZodOptional<ZodEnum<["reading", "ui"]>>;
lineSpacing: ZodOptional<ZodNumber>;
margins: ZodOptional<ZodNumber>;
size: ZodOptional<ZodNumber>;
},
"passthrough",
ZodTypeAny,
objectOutputType<
{
family: ZodOptional<ZodEnum<["reading", "ui"]>>;
lineSpacing: ZodOptional<ZodNumber>;
margins: ZodOptional<ZodNumber>;
size: ZodOptional<ZodNumber>;
},
ZodTypeAny,
"passthrough",
>,
objectInputType<
{
family: ZodOptional<ZodEnum<["reading", "ui"]>>;
lineSpacing: ZodOptional<ZodNumber>;
margins: ZodOptional<ZodNumber>;
size: ZodOptional<ZodNumber>;
},
ZodTypeAny,
"passthrough",
>,
>,
>;
pageMode: ZodOptional<ZodEnum<["paged", "scroll"]>>;
theme: ZodOptional<ZodEnum<["light", "sepia", "dark"]>>;
tocSidebarOpen: ZodOptional<ZodBoolean>;
},
ZodTypeAny,
"passthrough",
>,
> = ...
The
profiles.preferencesJSON blob (the profiles work's spec, revising D9 for preferences only): theme, font settings, page mode and TOC sidebar, stored server-side so they follow a person to another device.Every field is optional and unknown keys pass through — both are load-bearing, and the instinct to tighten this into a strict schema would break the feature twice over:
preferencesis NULL until the first PATCH), and the migration deliberately does not write one.{}must parse..passthrough()carries the unknown key through the round trip.