/** * Best-effort version check that nudges integrators when a newer * `@augustdigital/sdk` is available on npm. * * Design constraints (all kept narrow on purpose): * - **No network call in production builds.** Most integrators ship the * SDK to end users in the browser; surprise registry pings on user page * loads are unacceptable. The check only fires when * `NODE_ENV !== 'production'` (i.e. local dev / CI environments). * - **Opt-out is supported in two places.** `AUGUST_SDK_DISABLE_VERSION_CHECK` * env var (set in CI to silence noise) or `versionCheck: { enabled: false }` * on the SDK constructor (programmatic opt-out, e.g. in your own libs * that wrap the SDK). * - **Fire-and-forget; never blocks construction.** The SDK constructor * must return synchronously. We schedule the check on the microtask * queue, abort after 5s, and swallow every error. * - **Once per session.** A module-level guard prevents repeated registry * hits when callers spin up multiple `AugustSDK` instances. * - **No new dependency.** Semver comparison is a tiny hand-rolled helper * rather than pulling in the `semver` package. */ /** * Compare two numeric-dotted version strings. Returns: * - positive integer if `a > b` * - negative integer if `a < b` * - 0 if equal * * Pre-release suffixes (`-beta`, `-rc.1`) are stripped before comparison — * we always treat any pre-release as equal to its base version. That keeps * the comparison logic small and avoids false positives where an integrator * on `4.27.4-beta.0` would otherwise be told to upgrade to the stable * `4.27.3` they pre-released past. */ export declare function compareSemver(a: string, b: string): number; /** * Configuration knob exposed on `IAugustBase.versionCheck`. Defaulting to * enabled keeps the nudge in front of integrators who haven't read the docs; * setting `enabled: false` is the explicit opt-out for libraries that wrap * the SDK and want their own update strategy. */ export interface IVersionCheckConfig { /** Set to `false` to disable the registry check entirely. Default: `true`. */ enabled?: boolean; } /** * Kick off a best-effort version check. Always returns synchronously. * * @param config - Optional config from `IAugustBase.versionCheck` */ export declare function runVersionCheck(config?: IVersionCheckConfig): void; /** * Testing hook — resets the module-level guard so the check can run again * in a fresh test case. Not part of the public API surface; kept here so * unit tests don't have to monkey-patch internals. * * @internal */ export declare function _resetVersionCheckForTests(): void;