/** * LINKURIOUS CONFIDENTIAL * Copyright Linkurious SAS 2012 - 2026 * * - Created on 2026-04-15. */ import * as z from 'zod'; import { EntityType } from '../graphSchema'; import { ZoomLevel } from '../visualization'; export declare const FRONTEND_API_KIND: 'LinkuriousFrontendApiCall'; export type SelectedVisualizationEntities = { entityIds: string[]; entityType: EntityType; }; export type VisualizationCameraEntities = { nodeIds: string[]; edgeIds: string[]; }; export type VisualizationItemTypeFilter = z.infer; /** Values must be non-empty and contain only strings, booleans or finite numbers. */ export type VisualizationPropertyValuesFilter = z.infer; /** * Hides numeric values outside [min, max], both inclusive. * At least one bound is required. Bounds must be finite, with min <= max when both are given. */ export type VisualizationPropertyRangeFilter = z.infer; export type VisualizationPropertyStateFilter = z.infer; export type VisualizationFilter = z.infer; /** A range is removed as a whole, so its target carries no bounds. */ export type VisualizationFilterTarget = z.infer; /** * Requires at least one filter across node and edge, with non-empty itemType names * and, where applicable, property names. * Each entity type accepts at most one propertyRange per itemType and property. */ export type VisualizationAddFiltersParams = z.infer; /** * Requires at least one target across node and edge, with non-empty itemType names * and, where applicable, property names. * Property values follow the same constraints as when adding filters; range targets accept no bounds. */ export type VisualizationRemoveFiltersParams = z.infer; /** Requires node, edge or both to be true. Timeline filters are not affected. */ export type VisualizationResetFiltersParams = z.infer; /** A single date. One date property places the item type in time. */ export type VisualizationTimelineSingleDate = z.infer; /** A lifespan. Two different date properties place the item type in time, from start to end. */ export type VisualizationTimelineLifespan = z.infer; /** How an item type is placed in time: a single date or a lifespan. */ export type VisualizationTimelineEntry = z.infer; /** * The whole timeline: single dates, lifespans, zoom level and mode. * - `node` and `edge` list single dates and lifespans, each with its itemType. * - At least one single date or lifespan, and at most one per itemType in each entity type. * - Range mode (the default) needs start, end or both, with start <= end. Both are inclusive. * - asAt mode needs `at` and at least one lifespan. A lifespan that starts or ends at `at` is kept. * - Dates are finite epoch milliseconds. * - Other keys are rejected. */ export type VisualizationSetTimelineFilterParams = z.infer; export interface BaseFrontendApiCall { kind: typeof FRONTEND_API_KIND; method: string; methodVersion: number; methodParams?: Record; } export interface FrontendApiRefreshSavedQueries extends BaseFrontendApiCall { method: 'SavedQueries.refresh'; methodVersion: 1; } export interface FrontendApiCloseModal extends BaseFrontendApiCall { method: 'Modal.close'; methodVersion: 1; } export interface FrontendApiVisualizationHighlightEntities extends BaseFrontendApiCall { method: 'Visualization.highlightEntities'; methodVersion: 1; methodParams: { entities: Array<{ id: string; entityType: EntityType; }>; }; } export interface FrontendApiVisualizationEntitiesSelection extends BaseFrontendApiCall { method: 'Visualization.entitiesSelection'; methodVersion: 1; methodParams: SelectedVisualizationEntities; } export interface FrontendApiVisualizationSetNodeGrouping extends BaseFrontendApiCall { method: 'Visualization.setNodeGrouping'; methodVersion: 1; methodParams: { ruleId: number | null; }; } export interface FrontendApiVisualizationSetEdgeGrouping extends BaseFrontendApiCall { method: 'Visualization.setEdgeGrouping'; methodVersion: 1; methodParams: { edgeGrouping: Record; }; } export interface FrontendApiVisualizationCamera extends BaseFrontendApiCall { method: 'Visualization.camera'; methodVersion: 1; methodParams: VisualizationCameraEntities; } export interface FrontendApiVisualizationAddFilters extends BaseFrontendApiCall { method: 'Visualization.addFilters'; methodVersion: 1; methodParams: VisualizationAddFiltersParams; } export interface FrontendApiVisualizationRemoveFilters extends BaseFrontendApiCall { method: 'Visualization.removeFilters'; methodVersion: 1; methodParams: VisualizationRemoveFiltersParams; } export interface FrontendApiVisualizationResetFilters extends BaseFrontendApiCall { method: 'Visualization.resetFilters'; methodVersion: 1; methodParams: VisualizationResetFiltersParams; } export interface FrontendApiVisualizationSetTimelineFilter extends BaseFrontendApiCall { method: 'Visualization.setTimelineFilter'; methodVersion: 1; methodParams: VisualizationSetTimelineFilterParams; } /** * Naming convention for a wire method `Namespace.action`: * - type: `FrontendApi` + PascalCase(`NamespaceAction`) * - static params builder: camelCase(`namespaceAction`) + `Params` * - instance sender method: camelCase(`namespaceAction`) */ export type FrontendApiCall = FrontendApiRefreshSavedQueries | FrontendApiCloseModal | FrontendApiVisualizationHighlightEntities | FrontendApiVisualizationEntitiesSelection | FrontendApiVisualizationSetNodeGrouping | FrontendApiVisualizationSetEdgeGrouping | FrontendApiVisualizationCamera | FrontendApiVisualizationAddFilters | FrontendApiVisualizationRemoveFilters | FrontendApiVisualizationResetFilters | FrontendApiVisualizationSetTimelineFilter; export declare function isFrontendApiCall(o: unknown): o is FrontendApiCall; export declare function checkMethodVersion(call: T, expectedVersion: T['methodVersion']): void; declare const ITEM_TYPE_FILTER_SCHEMA: z.ZodObject<{ kind: z.ZodLiteral<"itemType">; itemType: z.ZodString; }, z.core.$strip>; declare const PROPERTY_VALUES_FILTER_SCHEMA: z.ZodObject<{ kind: z.ZodLiteral<"propertyValues">; itemType: z.ZodString; property: z.ZodString; values: z.ZodArray>; }, z.core.$strip>; declare const PROPERTY_RANGE_FILTER_SCHEMA: z.ZodObject<{ kind: z.ZodLiteral<"propertyRange">; itemType: z.ZodString; property: z.ZodString; min: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>; declare const PROPERTY_STATE_FILTER_SCHEMA: z.ZodObject<{ kind: z.ZodEnum<{ propertyInvalid: "propertyInvalid"; propertyMissing: "propertyMissing"; }>; itemType: z.ZodString; property: z.ZodString; }, z.core.$strip>; declare const FILTER_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"itemType">; itemType: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"propertyValues">; itemType: z.ZodString; property: z.ZodString; values: z.ZodArray>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"propertyRange">; itemType: z.ZodString; property: z.ZodString; min: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodEnum<{ propertyInvalid: "propertyInvalid"; propertyMissing: "propertyMissing"; }>; itemType: z.ZodString; property: z.ZodString; }, z.core.$strip>], "kind">; declare const FILTER_TARGET_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"itemType">; itemType: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"propertyValues">; itemType: z.ZodString; property: z.ZodString; values: z.ZodArray>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"propertyRange">; itemType: z.ZodString; property: z.ZodString; min: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodEnum<{ propertyInvalid: "propertyInvalid"; propertyMissing: "propertyMissing"; }>; itemType: z.ZodString; property: z.ZodString; }, z.core.$strip>], "kind">; declare const ADD_FILTERS_PARAMS_SCHEMA: z.ZodObject<{ node: z.ZodOptional; itemType: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"propertyValues">; itemType: z.ZodString; property: z.ZodString; values: z.ZodArray>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"propertyRange">; itemType: z.ZodString; property: z.ZodString; min: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodEnum<{ propertyInvalid: "propertyInvalid"; propertyMissing: "propertyMissing"; }>; itemType: z.ZodString; property: z.ZodString; }, z.core.$strip>], "kind">>>; edge: z.ZodOptional; itemType: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"propertyValues">; itemType: z.ZodString; property: z.ZodString; values: z.ZodArray>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"propertyRange">; itemType: z.ZodString; property: z.ZodString; min: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodEnum<{ propertyInvalid: "propertyInvalid"; propertyMissing: "propertyMissing"; }>; itemType: z.ZodString; property: z.ZodString; }, z.core.$strip>], "kind">>>; }, z.core.$strip>; declare const REMOVE_FILTERS_PARAMS_SCHEMA: z.ZodObject<{ node: z.ZodOptional; itemType: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"propertyValues">; itemType: z.ZodString; property: z.ZodString; values: z.ZodArray>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"propertyRange">; itemType: z.ZodString; property: z.ZodString; min: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodEnum<{ propertyInvalid: "propertyInvalid"; propertyMissing: "propertyMissing"; }>; itemType: z.ZodString; property: z.ZodString; }, z.core.$strip>], "kind">>>; edge: z.ZodOptional; itemType: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"propertyValues">; itemType: z.ZodString; property: z.ZodString; values: z.ZodArray>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"propertyRange">; itemType: z.ZodString; property: z.ZodString; min: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodEnum<{ propertyInvalid: "propertyInvalid"; propertyMissing: "propertyMissing"; }>; itemType: z.ZodString; property: z.ZodString; }, z.core.$strip>], "kind">>>; }, z.core.$strip>; declare const RESET_FILTERS_PARAMS_SCHEMA: z.ZodObject<{ node: z.ZodOptional; edge: z.ZodOptional; }, z.core.$strip>; declare const TIMELINE_SINGLE_DATE_SCHEMA: z.ZodObject<{ itemType: z.ZodString; property: z.ZodString; }, z.core.$strict>; declare const TIMELINE_LIFESPAN_SCHEMA: z.ZodObject<{ itemType: z.ZodString; start: z.ZodString; end: z.ZodString; }, z.core.$strict>; declare const TIMELINE_ENTRY_SCHEMA: z.ZodUnion, z.ZodObject<{ itemType: z.ZodString; start: z.ZodString; end: z.ZodString; }, z.core.$strict>]>; declare const SET_TIMELINE_FILTER_PARAMS_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{ node: z.ZodOptional, z.ZodObject<{ itemType: z.ZodString; start: z.ZodString; end: z.ZodString; }, z.core.$strict>]>>>; edge: z.ZodOptional, z.ZodObject<{ itemType: z.ZodString; start: z.ZodString; end: z.ZodString; }, z.core.$strict>]>>>; zoomLevel: z.ZodOptional>; mode: z.ZodOptional>; start: z.ZodOptional; end: z.ZodOptional; at: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ node: z.ZodOptional, z.ZodObject<{ itemType: z.ZodString; start: z.ZodString; end: z.ZodString; }, z.core.$strict>]>>>; edge: z.ZodOptional, z.ZodObject<{ itemType: z.ZodString; start: z.ZodString; end: z.ZodString; }, z.core.$strict>]>>>; zoomLevel: z.ZodOptional>; mode: z.ZodLiteral<"asAt">; at: z.ZodNumber; start: z.ZodOptional; end: z.ZodOptional; }, z.core.$strict>], "mode">; /** * Validates the structural constraints documented in {@link VisualizationAddFiltersParams}. * @throws If params or filters violate those constraints. */ export declare function checkVisualizationAddFiltersParams(params: unknown): asserts params is VisualizationAddFiltersParams; /** * Validates the structural constraints documented in {@link VisualizationRemoveFiltersParams}. * @throws If params or targets violate those constraints. */ export declare function checkVisualizationRemoveFiltersParams(params: unknown): asserts params is VisualizationRemoveFiltersParams; /** * Validates the structural constraints documented in {@link VisualizationResetFiltersParams}. * @throws If params are not an object with boolean flags and at least one flag set to true. */ export declare function checkVisualizationResetFiltersParams(params: unknown): asserts params is VisualizationResetFiltersParams; /** * Validates the structural constraints documented in {@link VisualizationSetTimelineFilterParams}. * Does not check whether properties exist in the schema or have a date or datetime type. * @throws If params, properties, lifespans, mode or dates violate those constraints. */ export declare function checkVisualizationSetTimelineFilterParams(params: unknown): asserts params is VisualizationSetTimelineFilterParams; export {};