@hestia-earth/json-schema
Version:
HESTIA JSON Schema
27 lines (26 loc) • 1.33 kB
TypeScript
import { definitions, definition } from './types';
export declare const keyType: (schema: definition, key: string) => string;
/**
* Check whether the field should be selected by default or not while exporting as CSV.
*
* @param schemas {definitions} List of definitions loaded with `loadSchemas`.
* @param key {string} The full key of the field, such as `cycle.inputs.0.value`.
* @returns true if it should be selected by default, false otherwise.
*/
export declare const isDefaultCSVSelected: (schemas: definitions) => (key: string) => boolean;
/**
* Check wether the field should be included while exporting as CSV.
*
* @param schemas {definitions} List of definitions loaded with `loadSchemas`.
* @param key {string} The full key of the field, such as `cycle.inputs.0.value`.
* @returns true if it should be included, false otherwise.
*/
export declare const isCSVIncluded: (schemas: definitions) => (key: string) => boolean;
/**
* Get the schema definition associated with a certain key. Can be `undefined` if key is unknown.
*
* @param schemas {definitions} List of definitions loaded with `loadSchemas`.
* @param key {string} The full key of the field, such as `cycle.inputs.0.value`.
* @returns The definition if found.
*/
export declare const schemaFromKey: (schemas: definitions, key: string) => definition;