Files
photoreport/packages/contracts/src/controls.ts
sparkandClaude Opus 5.5 e563b24561
ci / rust (push) Successful in 1m46s
ci / typescript (push) Successful in 2m47s
feat(sdk): API client with single-flight refresh; contracts controls (10/10)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HT6iXLYUUp9pJz5Kza9xCW
2026-10-11 14:51:00 +01:00

44 lines
1.1 KiB
TypeScript

import controls from "./controls.generated.json" with { type: "json" };
/**
* Editor panels. Crop and Basic are shown by default; each user can enable the others and the choice syncs
* across their devices. Generated from `engine/core` so web, desktop and server agree on control ids.
*/
export const MODULES = [
"crop",
"basic",
"toneCurve",
"colorMixer",
"blackAndWhite",
"colorGrading",
"detail",
"optics",
"geometry",
"vignette",
"grain",
"calibration",
"hdr",
"advanced",
] as const;
export type Module = (typeof MODULES)[number];
export const DEFAULT_MODULES: readonly Module[] = ["crop", "basic"];
export interface ControlInfo {
id: string;
module: Module;
label: string;
min: number;
max: number;
default: number;
step: number;
}
export const CONTROLS: readonly ControlInfo[] = controls as ControlInfo[];
const byId = new Map(CONTROLS.map((c) => [c.id, c]));
export const getControl = (id: string): ControlInfo | undefined => byId.get(id);
export const controlsForModule = (module: Module): ControlInfo[] => CONTROLS.filter((c) => c.module === module);