// Generated single-file type definitions for generic-ui-core declare module 'generic-ui-core' { /* From index.d.ts */ /* From src/constants/FieldTypes.d.ts */ /* export default FieldTypes */ /** * @file Frozen map of all field type string constants used in generic UI templates. * @module FieldTypes * @example * import { FieldTypes } from 'generic-ui-core'; * * if (field.type === FieldTypes.F_SELECT) { ... } */ /** * String constants identifying every supported field type in a generic UI template. * * **Deletion marker types** (used internally by the template editor): * - `DEL_LAYER`, `DEL_FIELD`, `DEL_SELECT`, `DEL_OPTION` * * **Input field types** (`F_*`): * - `F_CHECKBOX` — Boolean checkbox * - `F_DATE` — Date picker * - `F_DATETIME` — Date + time picker * - `F_DATETIME_RANGE` — Date/time range * - `F_DRAG` — Generic drag target * - `F_DRAG_ELEMENT` — Drag target for elements * - `F_DRAG_MOLECULE` — Drag target for molecules * - `F_DRAG_SAMPLE` — Drag target for samples * - `F_DRAG_REACTION` — Drag target for reactions * - `F_DUMMY` — Placeholder / spacer * - `F_FORMULA_FIELD` — Computed formula field * - `F_INPUT_GROUP` — Group of fields rendered inline * - `F_INTEGER` — Integer number input (deprecated) * - `F_LABEL` — Read-only label/text * - `F_NUMBER` — Decimal number input * - `F_ONTOLOGY_SELECT` — Ontology term selector * - `F_SELECT` — Single-value dropdown select * - `F_SELECT_MULTI` — Multi-value dropdown select * - `F_SYS_REACTION` — System-managed reaction field * - `F_SYSTEM_DEFINED` — System-defined read-only field * - `F_TABLE` — Tabular data * - `F_TEXT` — Single-line text * - `F_TEXTAREA` — Multi-line text * - `F_TEXT_FORMULA` — Combined Text with optional separator * - `F_UPLOAD` — File upload * - `F_WF_NEXT` — Workflow "Next Step" * * **Virtual value types** (`V_*`): * - `V_BOOLEAN` — Represents a boolean value type * - `V_UNDEFINED` — Represents an explicitly undefined value type * * @type {Readonly<{ * DEL_LAYER: 'Layer', DEL_FIELD: 'Field', DEL_SELECT: 'Select', DEL_OPTION: 'Option', * F_CHECKBOX: 'checkbox', F_DATE: 'date', F_DATETIME: 'datetime', * F_DATETIME_RANGE: 'datetime-range', F_DRAG: 'drag', F_DRAG_ELEMENT: 'drag_element', * F_DRAG_MOLECULE: 'drag_molecule', F_DRAG_SAMPLE: 'drag_sample', * F_DRAG_REACTION: 'drag_reaction', F_DUMMY: 'dummy', F_FORMULA_FIELD: 'formula-field', * F_INPUT_GROUP: 'input-group', F_INTEGER: 'integer', F_LABEL: 'label', * F_NUMBER: 'number', F_ONTOLOGY_SELECT: 'ontology-select', F_SELECT: 'select', * F_SELECT_MULTI: 'select-multi', F_SYS_REACTION: 'sys-reaction', * F_SYSTEM_DEFINED: 'system-defined', F_TABLE: 'table', F_TEXT: 'text', * F_TEXTAREA: 'textarea', F_TEXT_FORMULA: 'text-formula', F_UPLOAD: 'upload', * F_WF_NEXT: 'wf-next', V_BOOLEAN: 'boolean', V_UNDEFINED: 'undefined' * }>} */ declare const FieldTypes: Readonly<{ DEL_LAYER: "Layer"; DEL_FIELD: "Field"; DEL_SELECT: "Select"; DEL_OPTION: "Option"; F_CHECKBOX: "checkbox"; F_DATE: "date"; F_DATETIME: "datetime"; F_DATETIME_RANGE: "datetime-range"; F_DRAG: "drag"; F_DRAG_ELEMENT: "drag_element"; F_DRAG_MOLECULE: "drag_molecule"; F_DRAG_SAMPLE: "drag_sample"; F_DRAG_REACTION: "drag_reaction"; F_DUMMY: "dummy"; F_FORMULA_FIELD: "formula-field"; F_INPUT_GROUP: "input-group"; F_INTEGER: "integer"; F_LABEL: "label"; F_NUMBER: "number"; F_ONTOLOGY_SELECT: "ontology-select"; F_SELECT: "select"; F_SELECT_MULTI: "select-multi"; F_SYS_REACTION: "sys-reaction"; F_SYSTEM_DEFINED: "system-defined"; F_TABLE: "table"; F_TEXT: "text"; F_TEXTAREA: "textarea"; F_TEXT_FORMULA: "text-formula"; F_UPLOAD: "upload"; F_WF_NEXT: "wf-next"; V_BOOLEAN: "boolean"; V_UNDEFINED: "undefined"; }>; /* From src/constants/OptionMaps.d.ts */ /* export default OptionMaps */ /** * @file Frozen map of option lists for molecule and sample table column selectors. * @module OptionMaps * @example * import { OptionMaps } from 'generic-ui-core'; * * const moleculeCols = OptionMaps.TBL_OPTS_MOLECULE; */ /** * Predefined column option lists for table fields that reference molecules or samples. * Each entry in an option list is a `{ label, value }` pair suitable for a select control. * * - **`TBL_OPTS_MOLECULE`** — Column options when a table field is linked to a molecule: * `InChiKey`, `SMILES`, `IUPAC`, `Mass` * - **`TBL_OPTS_SAMPLE`** — Column options when a table field is linked to a sample: * `Name`, `Ext. Label`, `Mass` * * @type {Readonly<{ * TBL_OPTS_MOLECULE: Array<{label: string, value: string}>, * TBL_OPTS_SAMPLE: Array<{label: string, value: string}> * }>} */ declare const OptionMaps: Readonly<{ TBL_OPTS_MOLECULE: Array<{ label: string; value: string; }>; TBL_OPTS_SAMPLE: Array<{ label: string; value: string; }>; }>; /* From src/constants/WorkflowTypes.d.ts */ /* export default WorkflowTypes */ /** * @file Frozen map of node type string constants for generic UI workflow graphs. * @module WorkflowTypes * @example * import { WorkflowTypes } from 'generic-ui-core'; * * if (node.type === WorkflowTypes.ND_DEFAULT) { ... } */ /** * String constants identifying the supported node types in a generic UI workflow graph. * * - **`ND_INPUT`** (`"input"`) — The workflow entry/start node. * - **`ND_OUTPUT`** (`"output"`) — The workflow exit/end node. * - **`ND_DEFAULT`** (`"default"`) — A regular workflow step node, typically associated * with a layer via its `data.lKey` property. * * @type {Readonly<{ ND_INPUT: 'input', ND_OUTPUT: 'output', ND_DEFAULT: 'default' }>} */ declare const WorkflowTypes: Readonly<{ ND_INPUT: "input"; ND_OUTPUT: "output"; ND_DEFAULT: "default"; }>; /* From src/kits/common.d.ts */ export function downloadFile(_file: FileDescriptor): void; export function swapAryEls(_ary: T[], idx1: number, idx2: number): T[]; export function buildTS(_ontology: OntologyTerm): string | null; export function buildTSS(_q: string): string | null; /* From src/kits/cond-util.d.ts */ /** * @file Condition operator constants and helpers. * @module cond-util * @example * import { defaultCondOperator, condOperatorOptions, getCondOperator } from 'generic-ui-core'; * * const label = getCondOperator[1]; // "Match One" */ /** * The default condition operator value used when none is specified. * Corresponds to "Match One" (ANY) semantics. * * @type {number} */ export const defaultCondOperator: number; /** * Ordered list of condition operator options, suitable for use in a select/dropdown. * Each entry contains a human-readable `label` and the numeric `value` used internally. * * | Value | Label | Semantics | * |-------|-------------|------------------------------------| * | `1` | Match One | At least one condition must match | * | `9` | Match All | Every condition must match | * | `0` | Match None | No condition must match | * * @type {Array<{label: string, value: number}>} */ export const condOperatorOptions: Array<{ label: string; value: number; }>; /** * A lookup map from condition operator numeric value to its human-readable label. * * @type {Record} * @example * getCondOperator[1]; // "Match One" * getCondOperator[9]; // "Match All" * getCondOperator[0]; // "Match None" */ export const getCondOperator: Record; /* From src/kits/order-util.d.ts */ export function moveLayer(layers: LayerMap, sourceKey: string, targetKey: string): LayerMap; export function moveField(fields: Field[], sourceKey: string, targetKey: string): Field[]; /* From src/kits/template.d.ts */ /** * Clears the text values of all `text` fields inside every `input-group` field * in the element's template. Mutates the element in place and returns it. * * @param {GenericElement | null | undefined} el - The generic UI element to process. * @returns {GenericElement | null | undefined} The same element with cleared input-group's fields, * or the original value if `el` is falsy. */ export function clsInputGroup(el: GenericElement | null | undefined): GenericElement | null | undefined; /** * Returns `data` if it is a non-empty string, otherwise returns the fallback. * * @param {*} data - The value to check. * @param {string} [spec=''] - The fallback value to use when `data` is absent or blank. * @returns {string} Either `data` (when it is a non-empty string) or `spec`. */ export function replaceData(data: any, spec?: string): string; export function resetProperties(_props: PropertiesTemplate | null | undefined): PropertiesTemplate | null | undefined; export function absOlsTermId(val: string | null | undefined): string; export function absOlsTermLabel(val: string | null | undefined): string | undefined; export function showProperties(dataObj: { cond_fields?: CondField[]; cond_operator?: number; }, layers: LayerMap, source?: any): [boolean, string]; export function orgLayerObject(_layers?: Layer[]): LayerMap; export function isLayerVisible(layer: Layer, layers: LayerMap): boolean; /* From src/kits/unit.d.ts */ /** * Converts a value between compatible units. * * @type {typeof convert} */ export const convertUnits: typeof convert; export function getUnitSystem(externalUnits?: Record): object; export function normalizeValue(measure: string, unit: string, value: string | number | null | undefined): number; export { genUnit, genUnits, unitConversion, reUnit }; /* From src/kits/vis-util.d.ts */ export function isFieldEffectivelyVisible(field: Field, layer: Layer, allLayers: LayerMap, checkedFields?: Set, refElement?: any): VisibilityResult; export function isItemEffectivelyVisible(item: { cond_fields?: CondField[]; cond_operator?: number; cond?: Array<{ eq?: any; value?: any; [key: string]: any; }>; op?: number; }, allLayers: LayerMap, refElement?: any): VisibilityResult; /* From src/kits/workflow.d.ts */ /** * Checks whether a layer is referenced as a node in the element's workflow graph. * Reads `flowObject.nodes` when the template has a `flowObject`, otherwise the * legacy `flow.elements`. A node matches by `data.lKey` or `data.layer.key`. * * @param {GenericElement} _element - The generic UI element containing the workflow. * @param {string} _layerKey - The layer key to look for in the workflow. * @returns {boolean} `true` if the layer appears as a default workflow node, `false` otherwise. */ export function isLayerInWF(_element: GenericElement, _layerKey: string): boolean; /** * Serialises the workflow elements for storage by stripping transient display * properties (`label`, `layer`) from default-type nodes. * * @param {{ elements: object[] }} props - An object containing the workflow `elements` array. * @returns {object[]} A deep-cloned array of workflow elements with display properties removed. */ export function storeFlow(props: { elements: object[]; }): object[]; /* From src/types.d.ts */ /** * A single visibility/restriction condition that references another field. */ type CondField = { /** * - Key of the layer that owns the dependency field. */ layer: string; /** * - Key of the dependency field to evaluate. */ field: string; /** * - Expected value to match against the dependency field's current value. */ value: any; /** * - Optional alternative label surfaced when this condition is met. */ label?: string; }; /** * A generic UI field definition within a layer. */ type Field = { /** * - Unique field key within its layer. */ field: string; /** * - Field type string (see {@link FieldTypes}). */ type: string; /** * - Human-readable display label. */ label?: string; /** * - Current runtime value of the field. */ value?: any; /** * - Render order (assigned in multiples of 10). */ position?: number; /** * - Conditions that control this field's visibility. */ cond_fields?: CondField[]; /** * - How conditions are combined: 1=ANY, 9=ALL, 0=NONE. */ cond_operator?: number; /** * - Nested fields, used by the `input-group` type. */ sub_fields?: Field[]; /** * - Row data, used by the `table` type. */ sub_values?: any[]; }; /** * A layer (section/group) in a generic UI template. */ type Layer = { /** * - Unique layer key within the template. */ key: string; /** * - Human-readable display label. */ label?: string; /** * - Ordered list of fields within this layer. */ fields: Field[]; /** * - Render order (assigned in multiples of 10). */ position?: number; /** * - Conditions that control the layer's own visibility. */ cond_fields?: CondField[]; /** * - How layer conditions are combined: 1=ANY, 9=ALL, 0=NONE. */ cond_operator?: number; /** * - AI-generated suggestions; reset to `[]` on element clone. */ ai?: any[]; /** * - Legacy group-restriction conditions (older data shape). */ cond?: any[]; /** * - Legacy group-restriction operator (older data shape). */ op?: number; }; /** * A map of layers keyed by their layer key string. */ type LayerMap = Record; /** * The full properties template attached to a generic UI element. */ type PropertiesTemplate = { /** * - All layers in the template, keyed by layer key. */ layers: LayerMap; /** * - Legacy workflow graph data (`elements`). */ flow?: any; /** * - Workflow graph data (`nodes`, `edges`, `viewport`). */ flowObject?: any; }; /** * A generic UI element (e.g. a sample, reaction, or research item). */ type GenericElement = { /** * - The UI template attached to this element. */ properties_template: PropertiesTemplate; }; /** * An ontology term reference used to build Terminology Service URLs. */ type OntologyTerm = { /** * - Full IRI of the ontology term. */ iri: string; /** * - Short ontology prefix (e.g. `"CHEBI"`, `"OBI"`). */ ontology_prefix: string; /** * - Term class: `"class"`, `"property"`, or `"individual"`. */ type: string; }; /** * A file descriptor used by {@link downloadFile}. */ type FileDescriptor = { /** * - Desired filename for the downloaded file. */ name: string; /** * - Data URL or object URL representing the file content. */ contents: string; }; /** * - Index 0: `true` if the item is visible, `false` if it should be hidden. * - Index 1: An alternative label string (empty string when not applicable). */ type VisibilityResult = [boolean, string]; }