/** * The shared "this DB-backed feature is not configured" client idiom — one helper, * every consumer. * * A deployment leaves a database-backed feature cleanly OFF by configuring no store * for it. The skeleton then answers that feature's WRITES with an HTTP 501 * `NotSupportedError` carrying a machine code ending `-not-configured` * (`-not-configured`); collection reads stay 200-empty and named reads * 404, so only a write (or a terminal read stream) reveals the OFF state. `OFF is a * state, not an error`: a consumer keys on this predicate to hide or disable the * write affordance and show the muted `FeatureDisabled` note, whose remediation line * is the SERVER's own message — never a loud red ErrorState or a retry loop, and * never a client-composed env-var string. * * The predicate DUCK-TYPES the error (a numeric `status` / string `code`) rather * than `instanceof ApiError`: this package is the leaf of the plugin boundary and * must not import `@tai42/api-client` at runtime — the same reason `useSse` matches * `ApiUnauthorizedError` by name. */ import type { ReactNode } from 'react'; /** * True when `error` is a disabled-feature refusal from the skeleton: an HTTP 501, or * a `code` ending `-not-configured`. The `code` is authoritative; the 501 status is * the fallback signal — either alone is enough. */ export declare function isFeatureDisabled(error: unknown): boolean; /** * The remediation line for a refusal: the skeleton's own `message` (which names the * missing configuration), else its machine `code`. The client NEVER composes this — * a refusal carrying neither is a contract breach and raises. */ export declare function featureDisabledMessage(error: unknown): string; export interface FeatureDisabledProps { /** The human name of the OFF feature, e.g. `Interactions`. */ readonly feature: string; /** The server's own remediation line, shown verbatim (never a client-composed string). */ readonly message: string; } /** * The muted, honest OFF state for a feature whose store this deployment has not * configured. A `role="status"` EmptyState (never the loud alert ErrorState): the * feature is not broken, it is simply off, and the copy shows the server's own * remediation message. */ export declare function FeatureDisabled({ feature, message }: FeatureDisabledProps): ReactNode; //# sourceMappingURL=feature-disabled.d.ts.map