/** A camera animation track. Only the first track in a settings file is played. */ type AnimTrack = { name: string; duration: number; frameRate: number; loopMode: 'none' | 'repeat' | 'pingpong'; interpolation: 'step' | 'spline'; smoothness: number; keyframes: { times: number[]; values: { position: number[]; target: number[]; fov: number[]; }; }; }; /** A camera position, look-at target and vertical field of view in degrees. */ type CameraPose = { position: [number, number, number]; target: [number, number, number]; fov: number; }; /** A camera. Only the first camera in a settings file is used. */ type Camera = { initial: CameraPose; }; /** A point of interest in the scene, with the camera framing used to view it. */ type Annotation = { position: [number, number, number]; title: string; text: string; extras?: unknown; camera: Camera; }; /** Post-processing applied to the rendered image. Each effect is independently toggled. */ type PostEffectSettings = { sharpness: { enabled: boolean; amount: number; }; bloom: { enabled: boolean; intensity: number; blurLevel: number; }; grading: { enabled: boolean; brightness: number; contrast: number; saturation: number; tint: [number, number, number]; }; vignette: { enabled: boolean; intensity: number; inner: number; outer: number; curvature: number; }; fringing: { enabled: boolean; intensity: number; }; }; /** * A published experience: what is in the scene and how it is presented. * * This is the wire format of `settings.json`. Read it with {@link importSettings}, which * migrates older versions forward. */ type ExperienceSettings = { version: 2; tonemapping: 'none' | 'linear' | 'filmic' | 'hejl' | 'aces' | 'aces2' | 'neutral'; highPrecisionRendering: boolean; soundUrl?: string; background: { color: [number, number, number]; skyboxUrl?: string; }; postEffectSettings: PostEffectSettings; animTracks: AnimTrack[]; cameras: Camera[]; annotations: Annotation[]; startMode: 'default' | 'animTrack' | 'annotation'; }; /** An inclusive numeric bound. `step` is UI granularity, not a constraint. */ type NumericRange = { readonly min: number; readonly max: number; readonly step: number; }; /** * Bounds for each post-processing parameter, taken from the PlayCanvas engine's documented * ranges (`CameraFrame`, and `RenderPassBloom` for `blurLevel`). */ type PostEffectRanges = { readonly sharpness: { readonly amount: NumericRange; }; readonly bloom: { readonly intensity: NumericRange; readonly blurLevel: NumericRange; }; readonly grading: { readonly brightness: NumericRange; readonly contrast: NumericRange; readonly saturation: NumericRange; }; readonly vignette: { readonly intensity: NumericRange; readonly inner: NumericRange; readonly outer: NumericRange; readonly curvature: NumericRange; }; readonly fringing: { readonly intensity: NumericRange; }; }; /** Bounds for a camera's vertical field of view, in degrees. */ declare const CAMERA_FOV_RANGE: NumericRange; /** Bounds for each post-processing parameter. */ declare const POST_EFFECT_RANGES: PostEffectRanges; /** An inclusive bound with no UI step. */ type Bounds = { readonly min: number; readonly max: number; }; /** Bounds and size limits for camera animation tracks. */ type AnimTrackLimits = { readonly duration: Bounds; readonly frameRate: Bounds; readonly smoothness: Bounds; readonly maxKeyframes: number; readonly nameMax: number; readonly maxTracks: number; }; /** Size limits for annotations. */ type AnnotationLimits = { readonly maxCount: number; readonly titleMax: number; readonly textMax: number; }; /** Bounds and size limits for camera animation tracks. Intentionally tight for now. */ declare const ANIM_TRACK_LIMITS: AnimTrackLimits; /** Size limits for annotations. Intentionally tight for now. */ declare const ANNOTATION_LIMITS: AnnotationLimits; /** * Test a field of view against {@link CAMERA_FOV_RANGE}. * * @param fov - Vertical field of view in degrees. * @returns Whether the value is within the authoring bounds. */ declare const isCameraFovInRange: (fov: number) => boolean; /** Default page and scene background, as normalized 0..1 rgb components. */ declare const DEFAULT_BACKGROUND_COLOR: readonly [number, number, number]; /** Default tonemapping curve. */ declare const DEFAULT_TONEMAPPING: ExperienceSettings['tonemapping']; /** Default vertical field of view, in degrees. */ declare const DEFAULT_CAMERA_FOV: number; /** * How the default camera is placed: `environment` frames a captured space from inside it, * `object` frames a subject from outside. */ type CameraFit = 'environment' | 'object'; /** * Default post-processing settings, with every effect disabled. * * @returns A fresh object; callers may mutate it freely. */ declare const defaultPostEffectSettings: () => PostEffectSettings; /** * Default experience settings, shared by every tool that writes a settings file. * * @param fit - How to place the default camera. Defaults to `environment`. * @returns A fresh object; callers may mutate it freely. */ declare const defaultSettings: (fit?: CameraFit) => ExperienceSettings; /** * Migrate settings of any supported version to the latest schema. * * Assumes valid input — call {@link validateSettings} first if the source is untrusted. Does * not mutate the object passed in. * * @param settings - Parsed contents of a settings file. * @returns The settings at the latest version. * @throws If the version is not supported. */ declare const importSettings: (settings: unknown) => ExperienceSettings; /** Options for {@link validateSettings}. */ type ValidateOptions = { /** * Also check the exported authoring bounds. Off by default: those bounds are stricter * than what the viewer will render, and some settings in the wild fail them. Producers * writing new settings should turn this on. */ limits?: boolean; }; /** * Validate unknown data against any supported settings schema version. * * @param settings - Data to validate. * @param options - See {@link ValidateOptions}. * @throws If the data is not valid settings, with a message naming the offending field. */ declare const validateSettings: (settings: unknown, options?: ValidateOptions) => void; export { ANIM_TRACK_LIMITS, ANNOTATION_LIMITS, CAMERA_FOV_RANGE, DEFAULT_BACKGROUND_COLOR, DEFAULT_CAMERA_FOV, DEFAULT_TONEMAPPING, POST_EFFECT_RANGES, defaultPostEffectSettings, defaultSettings, importSettings, isCameraFovInRange, validateSettings }; export type { AnimTrack, AnimTrackLimits, Annotation, AnnotationLimits, Bounds, Camera, CameraFit, CameraPose, ExperienceSettings, NumericRange, PostEffectRanges, PostEffectSettings, ValidateOptions };