/** * This file should contain all helpers that are meant for runtime functionality, such as defineBlokkli composable or . */ import { type RuntimeBlockOptions } from '#blokkli-build/runtime-options'; import type { FieldListItemTyped } from '#blokkli-build/generated-types'; import type { BlockOptionDefinition } from '#blokkli/types/blockOptions'; import type { RuntimeBlockOptionArray } from '../../../global/types/blockOptions.js'; import type { FieldListItem } from '#blokkli/types'; /** * Map all kinds of truthy values for a checkbox. * Returns our "internal" value of a checkbox state. */ export declare function mapCheckboxTrue(v?: unknown): '1' | '0'; export declare function isValidDatetimeLocalValue(value: string): boolean; /** * Get the runtime value for an option. * * Internally, all option values are stored as strings. This function maps the stored data to the runtime value. */ export declare function getRuntimeOptionValue(definition: Pick | RuntimeBlockOptionArray, value: string | string[] | boolean | undefined | null | number): string | string[] | boolean | number | undefined; /** * Determines whether an item is visible. */ export declare function isVisibleByOptions(item?: FieldListItemTyped | FieldListItem, language?: string): boolean; /** * Returns the runtime options for a block. * * If the provided item's bundle is 'from_library', the method will merge the * options defined in the reusable block with the options defined in the * from_library block. */ export declare function getRuntimeOptions(item: FieldListItemTyped & { bundle: K; }, context?: { parentType: string; } | { fieldListType: string; }, fromLibraryOptions?: Record): RuntimeBlockOptions[K]; /** * Get the actual block for reusable blocks. * * If the provided bundle is 'from_library', the method will merge the options * from both the from_library block and the actual block. */ export declare function getActualBlock(item: FieldListItemTyped): FieldListItemTyped | null; export declare function getItemsforBundles(items: FieldListItemTyped[], bundles: K[]): Extract[];