// Copyright 2026 Synnax Labs, Inc. // // Use of this software is governed by the Business Source License included in the file // licenses/BSL.txt. // // As of the Change Date specified in that file, in accordance with the Business Source // License, use of this software will be governed by the Apache License, Version 2.0, // included in the file licenses/APL.txt. // Code generated by Oracle. DO NOT EDIT. import { z } from "zod"; import { type numeric } from "@/numeric"; export const X_LOCATIONS = ["left", "right"] as const; export const xLocationZ = z.enum(X_LOCATIONS); export type XLocation = z.infer; export const Y_LOCATIONS = ["top", "bottom"] as const; export const yLocationZ = z.enum(Y_LOCATIONS); export type YLocation = z.infer; export const STICKY_UNITS = ["px", "decimal"] as const; export const stickyUnitZ = z.enum(STICKY_UNITS); export type StickyUnit = z.infer; export const OUTER_LOCATIONS = ["top", "right", "bottom", "left"] as const; export const outerLocationZ = z.enum(OUTER_LOCATIONS); export type OuterLocation = z.infer; export const DIRECTIONS = ["x", "y"] as const; export const directionZ = z.enum(DIRECTIONS); export type Direction = z.infer; export const ANGULAR_DIRECTIONS = ["clockwise", "counterclockwise"] as const; export const angularDirectionZ = z.enum(ANGULAR_DIRECTIONS); export type AngularDirection = z.infer; export const CENTER_LOCATIONS = ["center"] as const; export const centerLocationZ = z.enum(CENTER_LOCATIONS); export type CenterLocation = z.infer; export const LOCATIONS = ["top", "right", "bottom", "left", "center"] as const; export const locationZ = z.enum(LOCATIONS); export type Location = z.infer; export const ALIGNMENTS = ["start", "center", "end"] as const; export const alignmentZ = z.enum(ALIGNMENTS); export type Alignment = z.infer; export const ORDERS = ["first", "last"] as const; export const orderZ = z.enum(ORDERS); export type Order = z.infer; export const DIMENSIONS = ["width", "height"] as const; export const dimensionZ = z.enum(DIMENSIONS); export type Dimension = z.infer; export const SIGNED_DIMENSIONS = ["signedWidth", "signedHeight"] as const; export const signedDimensionZ = z.enum(SIGNED_DIMENSIONS); export type SignedDimension = z.infer; /** * XY is a 2D coordinate point with x and y values. Used for positioning * elements in two-dimensional space. */ export const xyZ = z.object({ /** x is the horizontal coordinate. */ x: z.number(), /** y is the vertical coordinate. */ y: z.number(), }); export interface XY extends z.infer {} /** CornerLocation is an anchor corner for positioning. */ export const cornerLocationZ = z.object({ /** x is the horizontal anchor. */ x: xLocationZ, /** y is the vertical anchor. */ y: yLocationZ, }); export interface CornerLocation extends z.infer {} /** StickyUnits specifies the measurement units for sticky positioning. */ export const stickyUnitsZ = z.object({ /** x is the horizontal unit. */ x: stickyUnitZ, /** y is the vertical unit. */ y: stickyUnitZ, }); export interface StickyUnits extends z.infer {} /** Dimensions is a 2D size with width and height values. */ export const dimensionsZ = z.object({ /** width is the width in pixels. */ width: z.number(), /** height is the height in pixels. */ height: z.number(), }); export interface Dimensions extends z.infer {} /** * SignedDimensions is a 2D size whose width and height components carry sign, allowing * negative values to express direction. */ export const signedDimensionsZ = z.object({ /** signedWidth is the signed width. */ signedWidth: z.number(), /** signedHeight is the signed height. */ signedHeight: z.number(), }); export interface SignedDimensions extends z.infer {} /** * ClientXY is a 2D coordinate point expressed in client (viewport) space, matching * the shape of DOM mouse events. */ export const clientXYZ = z.object({ /** clientX is the horizontal coordinate in client (viewport) space. */ clientX: z.number(), /** clientY is the vertical coordinate in client (viewport) space. */ clientY: z.number(), }); export interface ClientXY extends z.infer {} /** * Bounds is a closed-open interval [lower, upper) over an ordered numeric value * space. The TypeScript binding is generic over T so callers can express * bounds over either number or bigint values; other languages emit a * concrete float64-based type. */ export const boundsZ = (t?: z.ZodType) => z.object({ /** lower is the inclusive lower bound. */ lower: t ?? z.number(), /** upper is the exclusive upper bound. */ upper: t ?? z.number(), }); export interface Bounds { lower: T; upper: T; } /** Viewport is the camera state of a viewport. */ export const viewportZ = z.object({ /** zoom is the zoom level where 1.0 equals 100%. */ zoom: z.number().default(1), /** position is the (x, y) pan offset of the viewport. */ position: xyZ, }); export interface Viewport extends z.infer {} /** * StickyXY is a position that can be anchored to different corners of a * container with configurable units (pixels or decimal fractions). */ export const stickyXYZ = z.object({ /** x is the horizontal coordinate. */ x: z.number(), /** y is the vertical coordinate. */ y: z.number(), /** root is the optional anchor corner for the position. */ root: cornerLocationZ.optional(), /** units is the optional unit specification for the coordinates. */ units: stickyUnitsZ.optional(), }); export interface StickyXY extends z.infer {}