/*! * * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import { z } from 'zod'; /** * A literal value used in style-rule where clauses, converter return values, * and cell data. Temporal wrappers resolve to numbers at evaluation time. */ export declare const DataGridStyleRuleLiteralSchema: z.ZodUnion]>, z.ZodBoolean, z.ZodNull, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>; export type DataGridStyleRuleLiteral = z.infer; /** A JSON-safe bigint literal represented by a signed decimal string. */ export declare const DataGridBigintLiteralSchema: z.ZodObject<{ bigint: z.ZodString; }, z.core.$strip>; export type DataGridBigintLiteral = z.infer; /** A number, native bigint, or JSON-safe bigint literal. */ export declare const DataGridNumericLiteralSchema: z.ZodUnion]>; export type DataGridNumericLiteral = z.infer; /** A numeric, datetime, localdatetime, or time literal used as a range boundary. */ export declare const DataGridRangeLiteralSchema: z.ZodUnion]>, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>; export type DataGridRangeLiteral = z.infer; /** A reference to a column whose cell value is resolved at evaluation time. */ export declare const DataGridColumnRefSchema: z.ZodObject<{ column: z.ZodString; }, z.core.$strip>; export type DataGridColumnRef = z.infer; /** * An ISO 8601 or RFC 9557 datetime literal that resolves to a Unix millisecond * timestamp at evaluation time. Wraps the shared `DatetimeLiteralSchema` with a * DataGrid-specific name. Supported formats: * - RFC 9557 with IANA timezone: `"2024-06-15T14:00:00[Europe/Stockholm]"` (offset * inferred) or `"2024-06-15T14:00:00+02:00[Europe/Stockholm]"` (offset explicit) * - UTC or offset datetime: `"2024-01-01T00:00:00Z"`, `"2024-01-01T00:00:00+02:00"` * - Plain datetime (treated as UTC): `"2024-01-01T14:30:00"` * - Date-only (treated as UTC midnight): `"2024-01-01"` * * Unzoned datetimes without `Z` or an offset are treated as UTC wall-clock time. */ export declare const DataGridDatetimeLiteralSchema: z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>; export type DataGridDatetimeLiteral = z.infer; /** * A plain (unzoned) ISO 8601 date or datetime literal that resolves to a Unix * millisecond timestamp in the browser's local timezone at evaluation time. * Wraps the shared `LocalDatetimeLiteralSchema` with a DataGrid-specific name. * * Only plain date/datetime strings without timezone qualifiers are accepted: * - Plain datetime: `"2024-01-01T14:30:00"` * - Date-only (treated as local midnight): `"2024-01-01"` * * Strings with `Z`, a UTC offset, or an IANA bracket are rejected — use * `{ datetime }` for timezone-aware instants. */ export declare const DataGridLocalDatetimeLiteralSchema: z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>; export type DataGridLocalDatetimeLiteral = z.infer; /** * An ISO 8601 time literal that resolves to milliseconds since UTC midnight at * evaluation time. Wraps the shared `TimeLiteralSchema` with a DataGrid-specific * name. Supported formats: * - Local time (treated as UTC): `"14:30:00"`, `"14:30:00.500"` * - Offset time (UTC-normalised): `"14:30:00+02:00"` */ export declare const DataGridTimeLiteralSchema: z.ZodObject<{ time: z.ZodString; }, z.core.$strip>; export type DataGridTimeLiteral = z.infer; /** An operand in a style-rule where clause -- either a literal value or a column reference. */ export declare const DataGridStyleRuleOperandSchema: z.ZodUnion, z.ZodUnion]>, z.ZodBoolean, z.ZodNull, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>]>; export type DataGridStyleRuleOperand = z.infer; /** * Recursive WHERE clause for conditional expressions. * Inspired by the graph visualization style rule system but adapted for tabular data. * * The type is manually defined for the export, since zod doesn't support * exporting inferred recursive types. */ export type DataGridStyleRuleWhere = { not: DataGridStyleRuleWhere; } | { and: DataGridStyleRuleWhere[]; } | { or: DataGridStyleRuleWhere[]; } | { equal: [DataGridStyleRuleOperand, DataGridStyleRuleOperand]; } | { lessThan: [DataGridStyleRuleOperand, DataGridStyleRuleOperand]; } | { lessThanOrEqual: [DataGridStyleRuleOperand, DataGridStyleRuleOperand]; } | { greaterThan: [DataGridStyleRuleOperand, DataGridStyleRuleOperand]; } | { greaterThanOrEqual: [DataGridStyleRuleOperand, DataGridStyleRuleOperand]; } | { contains: [DataGridStyleRuleOperand, DataGridStyleRuleOperand]; } | { startsWith: [DataGridStyleRuleOperand, DataGridStyleRuleOperand]; } | { endsWith: [DataGridStyleRuleOperand, DataGridStyleRuleOperand]; } | { isNull: DataGridStyleRuleOperand; }; export declare const DataGridStyleRuleWhereSchema: z.ZodType; /** * Gradient coloring based on a continuous orderable column value. * Colors should be hex strings (#rrggbb). * Temporal range boundaries resolve to numbers before interpolation. * If the column value is missing or non-orderable, the colorRange is ignored. */ export declare const DataGridColorRangeSchema: z.ZodObject<{ isDisabled: z.ZodOptional; maxColor: z.ZodString; maxValue: z.ZodUnion]>, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>; midColor: z.ZodOptional; midValue: z.ZodOptional]>, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>>; minColor: z.ZodString; minValue: z.ZodUnion]>, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>; onColumn: z.ZodString; }, z.core.$strip>; export type DataGridColorRange = z.infer; /** A disable-able static color value. */ export declare const DataGridDisableableColorSchema: z.ZodObject<{ isDisabled: z.ZodOptional; value: z.ZodString; }, z.core.$strip>; export type DataGridDisableableColor = z.infer; /** Visual properties that a style rule can apply to a cell or row. */ export declare const DataGridCellStyleSchema: z.ZodObject<{ color: z.ZodOptional; value: z.ZodString; }, z.core.$strip>>; colorRange: z.ZodOptional; maxColor: z.ZodString; maxValue: z.ZodUnion]>, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>; midColor: z.ZodOptional; midValue: z.ZodOptional]>, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>>; minColor: z.ZodString; minValue: z.ZodUnion]>, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>; onColumn: z.ZodString; }, z.core.$strip>>; textColor: z.ZodOptional; value: z.ZodString; }, z.core.$strip>>; textColorRange: z.ZodOptional; maxColor: z.ZodString; maxValue: z.ZodUnion]>, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>; midColor: z.ZodOptional; midValue: z.ZodOptional]>, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>>; minColor: z.ZodString; minValue: z.ZodUnion]>, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>; onColumn: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>; export type DataGridCellStyle = z.infer; /** * A function that converts a complex or non-scalar cell value into a * `DataGridStyleRuleLiteral` so it can participate in where-clause evaluation * and color-range interpolation. * * The function receives the raw cell value (`unknown`) and must return a scalar * (`string | number | bigint | { bigint: string } | boolean | null`) or a * temporal wrapper (`{ datetime: string }`, `{ localdatetime: string }`, * `{ time: string }`). The engine parses temporal wrappers to milliseconds. * Return `null` or `undefined` to signal that the value is missing or cannot * be represented. * * Note: converter functions are TypeScript-only — they cannot be serialized as * JSON, so no Zod schema is provided. */ export type DataGridStyleRuleValueConverter = (value: unknown) => DataGridStyleRuleLiteral | undefined; /** * A map of column id → converter function. * Pass this as the `styleRuleValueConverters` prop on `DataGrid` to teach the * style-rule engine how to interpret complex cell values for specific columns. * * @example * ```ts * const converters: DataGridStyleRuleValueConverters = { * priority: (v) => { * const s = v as { min: number; max: number }; * return s.max - s.min; * }, * }; * ``` */ export type DataGridStyleRuleValueConverters = Record; /** A single declarative rule that conditionally applies styles to DataGrid cells. */ export declare const DataGridStyleRuleSchema: z.ZodObject<{ apply: z.ZodObject<{ color: z.ZodOptional; value: z.ZodString; }, z.core.$strip>>; colorRange: z.ZodOptional; maxColor: z.ZodString; maxValue: z.ZodUnion]>, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>; midColor: z.ZodOptional; midValue: z.ZodOptional]>, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>>; minColor: z.ZodString; minValue: z.ZodUnion]>, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>; onColumn: z.ZodString; }, z.core.$strip>>; textColor: z.ZodOptional; value: z.ZodString; }, z.core.$strip>>; textColorRange: z.ZodOptional; maxColor: z.ZodString; maxValue: z.ZodUnion]>, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>; midColor: z.ZodOptional; midValue: z.ZodOptional]>, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>>; minColor: z.ZodString; minValue: z.ZodUnion]>, z.ZodObject<{ datetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ localdatetime: z.ZodString; }, z.core.$strip>, z.ZodObject<{ time: z.ZodString; }, z.core.$strip>]>; onColumn: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>; column: z.ZodNullable; isDisabled: z.ZodOptional; metaData: z.ZodOptional>; priority: z.ZodOptional; where: z.ZodOptional>>; }, z.core.$strip>; export type DataGridStyleRule = z.infer; /** * Runtime type guard for {@link DataGridStyleRule}, backed by the internal Zod * schema. Narrows an `unknown` value to `DataGridStyleRule` when it is a valid * style rule. * * This lets consumers validate values without taking a dependency on Zod or on * our schema export. For example, it can be passed to another validation * library's custom check: * * @example * ```ts * import { z } from 'zod'; * import { isDataGridStyleRule, type DataGridStyleRule } from '@neo4j-ndl/react'; * * const formSchema = z.object({ * rule: z.custom(isDataGridStyleRule), * notes: z.string(), * }); * ``` */ export declare const isDataGridStyleRule: (value: unknown) => value is DataGridStyleRule; //# sourceMappingURL=types.d.ts.map