import type { LicenseLifecycle, LicenseGrants, LicenseChannels } from '../utils/entitlementLicenseKey'; /** * Converts any value to string. * * @param {*} value The value to stringify. * @returns {string} */ export declare function stringify(value: unknown): string; /** * Checks if given variable is defined. * * @param {*} variable Variable to check. * @returns {boolean} */ export declare function isDefined(variable: unknown): boolean; /** * Checks if given variable is undefined. * * @param {*} variable Variable to check. * @returns {boolean} */ export declare function isUndefined(variable: unknown): boolean; /** * Check if given variable is null, empty string or undefined. * * @param {*} variable Variable to check. * @returns {boolean} */ export declare function isEmpty(variable: unknown): boolean; /** * Check if given variable is a regular expression. * * @param {*} variable Variable to check. * @returns {boolean} */ export declare function isRegExp(variable: unknown): boolean; /** * Builds the "expires ..." clause of a trial message from a day count. Shared with the badge * popover (`utils/licenseBranding/content.ts`), which prints the same sentence. * * Two counts need their own wording. `1` takes the singular unit, so the message does not read * "expires in 1 days". `0` is the LAST LICENSED DAY - the named day is licensed in full - and it * reads "expires today", because "expires in 0 days" describes a license that has already lapsed. * The specification pins the wording for the general case only; the two edges are ours. * * @param {number|null|undefined} days The whole days left until the last licensed day. * @returns {string} */ export declare function _formatExpiryClause(days: number | null | undefined): string; /** * License sentences the specification repeats verbatim across surfaces - the bottom bar (here), the * badge popover, and the hard-stop lock screen (`utils/licenseBranding/content.ts`). Keeping one * constant per sentence means a legal or marketing wording change lands on every surface at once, * instead of drifting when only one copy is updated. */ export declare const _LICENSE_EXPIRED_TITLE = "Your Handsontable license key has expired."; export declare const _PURCHASE_LICENSE_TEXT = "To continue using Handsontable, you need to purchase a license."; /** * The states that render the Core-owned blocking modal (`utils/licenseBranding/lockScreen.ts`) * INSTEAD of a bottom bar: a lapsed trial, a key that cannot be read, and a key that was never set. * The last two spellings are shared by the legacy emitter's own state vocabulary below and by * `LicenseStateKey`, so one list governs both paths. * * MUST list every key of `LOCK_CONTENT` (`utils/licenseBranding/content.ts`), the routing table for * the modal - `licenseBranding.unit.js` asserts the two agree. `trial_hard_stop` shows no bar today * only because `entitlementDomMessages` happens to have no entry for it; naming it here makes the * withdrawal deliberate, so adding hard-stop bar copy later cannot put a bar underneath a * non-dismissable lock. The list is NOT imported from `content.ts`: that module imports the shared * copy constants from here, and the dependency must not become a cycle. * * The console message is unaffected - it still prints for these states. Only the bottom bar is * withdrawn, because the modal now carries its sentences and two license surfaces saying the same * thing at once would be noise. * * Frozen, and underscore-prefixed like every other license symbol here: `index.ts` copies every * non-underscore export of this module onto the public `Handsontable.helper`, and a live array * there could be emptied from a console to switch the blocking off at runtime. * * @type {readonly string[]} */ export declare const _BLOCKING_MODAL_STATES: readonly string[]; export declare function _injectProductInfo({ className, key, element, releaseDate }: { className?: string; key?: string; element?: HTMLElement; releaseDate?: string; }): HTMLElement | null; /** * Formats an epoch-millisecond timestamp as the bare "YYYY-MM-DD" UTC calendar date every license * message prints. An entitlement key carries its dates as such strings already - this is only used * for the one date the legacy path derives from a timestamp. * * @param {number} timestamp The time to format, in epoch milliseconds. * @returns {string} */ export declare function _formatIsoDate(timestamp: number): string; /** * The states outside the entitlement format: the legacy 25-character family classified the same way * the frozen legacy emitter classifies it (valid, expired, missing, non-commercial), plus "invalid" * (a broken legacy key, or an entitlement key that cannot be read). */ type NonEntitlementLifecycleState = 'legacy_valid' | 'legacy_expired' | 'missing' | 'non_commercial' | 'invalid'; /** * The lifecycle facet a consumer reads: the entitlement states plus the states outside the format. * The entitlement-only fields fall back to `false`/`null` for the latter (except `licensedUntil`, * which a legacy-expired key carries too), so a caller can read `.state` uniformly. */ export interface LicenseLifecycleFacet { state: LicenseLifecycle['state'] | NonEntitlementLifecycleState; isTrial: boolean; daysRemaining: number | null; licensedUntil: string | null; } /** * Every lifecycle state a state-keyed table can hold an entry for. The console/DOM notification * tables here and the badge/lock content tables in `utils/licenseBranding/content.ts` are keyed by * this union rather than `string`, so the compiler rejects a typoed or unknown state key - a * `string` key would compile fine and silently drop that state's entry. */ export type LicenseStateKey = LicenseLifecycleFacet['state']; /** * The resolved license state handed to the UI and (later) the feature gates: the lifecycle facet * (what the license IS right now), the channels it leaves open (where it may say so), and the * grants facet (what it UNLOCKS). `grants` is never null - the same query API serves legacy keys * (unlock everything) and entitlement keys (unlock what the payload lists). */ export interface LicenseStateDescriptor { lifecycle: LicenseLifecycleFacet; channels: LicenseChannels; grants: LicenseGrants; } /** * Resolves the full license state (lifecycle + channels + grants) of a license key. This is the * single entry point shared by the console/DOM notification and the branding UI, so the key is * classified once. A key outside the entitlement format, and an unreadable one, resolve to * UNRESTRICTED grants on purpose: introducing capability gating must never take a feature away from * an existing customer, and an invalid key nags - it does not strip features. * * @param {string} [rawKey] The license key from the grid settings, trimmed here before any classification. * @param {string} [releaseDate] The build release date ("dd/mm/yyyy"). * @returns {LicenseStateDescriptor} */ export declare function _getLicenseState(rawKey?: string, releaseDate?: string): LicenseStateDescriptor; export {};