import { EntityType } from "@trackunit/iris-app-api"; import { FragmentType } from "./generated/graphql-api/fragment-masking"; import { CustomFieldValueAndDefinitionFragment, CustomFieldValueAndDefinitionFragmentDoc, SystemOfMeasurement } from "./generated/graphql-api/graphql"; export type AllCustomFieldValueAndDefinition = CustomFieldValueAndDefinitionFragment; export type AllSupportedEntityTypes = Extract; type CustomFieldValueAndDefinitionNode = FragmentType; /** * A function used to get the CustomFieldValueAndDefinition from a node of CustomFieldValueAndDefinition. * * @param node - The node containing the CustomFieldValueAndDefinition, which may be null or undefined. * @returns {CustomFieldValueAndDefinitionNode} The CustomFieldValueAndDefinition if it exists, or undefined otherwise. */ export declare const getAllCustomFieldValueAndDefinitionFromRelevantNode: (node?: CustomFieldValueAndDefinitionNode | null) => AllCustomFieldValueAndDefinition | null | undefined; export interface UseAllCustomFieldsValueAndDefinitionProps { entityId?: string; entityType?: AllSupportedEntityTypes; systemOfMeasurement: SystemOfMeasurement | null; } export interface UseAllCustomFieldsValueAndDefinitionReturnValue { loading: boolean; fields: Array; refetch: () => Promise; } /** * Custom hook to fetch custom fields and definitions for a specified entity. * This only returns the values that are filled out. If the value is null or undefined, it will not be returned. * It does return all custom fields, even if they are not filled out. * * @param {UseAllCustomFieldsValueAndDefinitionProps} props - The properties for the custom fields query. * @param {string} [props.entityId] - The ID of the entity for which custom fields are fetched. Can be either an asset or a site. * @param {AllSupportedEntityTypes} [props.entityType] - The type of the entity (e.g., 'ASSET' or 'SITE'). Determines which query to execute. * @param {SystemOfMeasurement} props.systemOfMeasurement - The system of measurement to be used in the custom fields. * @returns {UseAllCustomFieldsValueAndDefinitionReturnValue} An object containing a loading state and an array of custom fields and definitions. */ export declare const useAllCustomFieldsValueAndDefinition: ({ entityId, entityType, systemOfMeasurement, }: UseAllCustomFieldsValueAndDefinitionProps) => UseAllCustomFieldsValueAndDefinitionReturnValue; /** * Utility function that given a {CustomFieldValueAndDefinition} can tell if it contains a value or not * * @param {AllCustomFieldValueAndDefinition} field - the custom field that might contain a value. * @returns {boolean} true if the field contains a value. */ export declare const allCustomFieldHasValue: (field: AllCustomFieldValueAndDefinition) => boolean; export {};