import { TimeUnit } from "./typings"; export declare type Dictionary = { [key: string]: any; }; /** * @returns Whether the given `value` is a "dictionary object". */ export declare const isDictionary: (value: unknown) => value is Dictionary; /** * @returns Whether the given `value` is considered *falsy* by CertLogic. * Note: the notions of both falsy and truthy are narrower than those of JavaScript, and even of JsonLogic. * Truthy and falsy values can be used for conditional logic, e.g. the guard of an `if`-expression. * Values that are neither truthy nor falsy (many of which exist) can't be used for that. */ export declare const isFalsy: (value: unknown) => boolean; /** * @returns Whether the given `value` is considered *truthy* by CertLogic. * @see isFalsy */ export declare const isTruthy: (value: unknown) => boolean; /** * Type to encode truthy/falsy/neither (AKA “boolsiness”): * * * `true` ↔ truthy * * `false` ↔ falsy * * `undefined` ↔ neither */ export declare type Boolsiness = boolean | undefined; /** * Determines boolsiness of the given JSON value. */ export declare const boolsiness: (value: unknown) => Boolsiness; /** * @returns Whether the given value is an integer number. */ export declare const isInt: (value: unknown) => value is number; /** * A type for all CertLogic single-value literals. */ export declare type CertLogicLiteral = string | number | boolean; /** * Determine whether the given value is a valid CertLogic literal expression, * meaning: a string, an integer number, or a boolean. */ export declare const isCertLogicLiteral: (expr: any) => expr is CertLogicLiteral; /** * Named function to check whether something is a {@link Date}. * @deprecated from 2.0.0 onwards (planned) - use `value instanceof Date` instead. */ export declare const isDate: (value: unknown) => value is Date; /** * @returns A JavaScript {@see Date} object representing the date or date-time given as a string. * @throws An {@see Error} in case the string couldn't be parsed as a date or date-time. */ export declare const dateFromString: (str: string) => Date; /** * @returns A {@link Date} that's the result of parsing a partial date `str` given in format `YYYY` or `YYYY-MM`, * and “rounding that up” to (midnight +0 UTC of) the latest day consistent with that data. */ export declare const roundUpPartialDate: (str: string) => Date | undefined; /** * @returns A {@link Date} that's the result of parsing `dateTimeLikeStr` as an ISO 8601 string using {@link dateFromString}, * with the indicated number of time units added to it. * This treats partial dates in the format YYYY or YYYY-MM by “rounding up” to (midnight +0 UTC of) the latest day consistent * with that data. */ export declare const plusTime: (dateTimeLikeStr: string, amount: number, unit: TimeUnit) => Date; /** * @returns: A JavaScript {@see Date} representing the given date that may be partial (YYYY[-MM[-DD]]). * See [the CertLogic specification](https://github.com/ehn-dcc-development/dgc-business-rules/blob/main/certlogic/specification/README.md) for details. */ export declare const dccDateOfBirth: (str: string) => Date; /** * @returns The fragment with given index from the UVCI string * (see Annex 2 in the [UVCI specification](https://ec.europa.eu/health/sites/default/files/ehealth/docs/vaccination-proof_interoperability-guidelines_en.pdf)), * or `null` when that fragment doesn't exist. */ export declare const extractFromUVCI: (uvci: string | null, index: number) => string | null; /** * @returns The value found within `data` at the given `path` * - this is the semantics of CertLogic's "var" operation. */ export declare const access: (data: any, path: string) => any;