import { AxiosStatic, AxiosRequestConfig } from 'axios'; import * as react from 'react'; import react__default, { Component as Component$1, ReactNode, ErrorInfo, Dispatch, SetStateAction, RefObject, ElementType } from 'react'; import { NavigateOptions, RouteObject } from 'react-router-dom'; import * as react_router from 'react-router'; /** * @file container.ts implementation and configuration. * @module fragment-ux/src/container.ts * @author Jesse Oyofo Dan-Amuda * @company Digitwhale Innovations LTD * @copyright Copyright (c) 2026 Digitwhale Innovations LTD. All rights reserved. * @license MIT * @since 0.1.0 */ /** Constructor accepted by the dependency container. */ type InjectableClass = abstract new (...args: never[]) => T; /** Store and resolve application-wide service instances. */ declare class Container { private readonly instances; private readonly constructing; /** * Return the existing singleton or construct the requested service. * @param type - Injectable class to resolve. * @returns The singleton instance for the class. * @throws {FragmentError} `FRAGMENT_INJECT_CYCLE` for circular dependencies. */ get(type: InjectableClass): T; /** * Register an existing service instance. * @param type - Class key used for later lookups. * @param instance - Existing instance to store. */ provide(type: InjectableClass, instance: T): void; /** Clear every registered singleton. */ reset(): void; } /** Shared singleton container used by `inject()`. */ declare const container: Container; /** Return a read-only copy of the currently instantiated dependency singletons. */ /** * Return a read-only copy of the currently instantiated dependency singletons. * @returns Container keys and instances in insertion order. */ declare function getContainerEntries(): ReadonlyArray, object]>; /** @internal Callable facade used to combine injection and field decorator syntax. */ type InjectDecorator = (value: undefined, context: ClassFieldDecoratorContext) => (this: This, initialValue: Value) => Value; /** Value that works both as a service reference and a standard field decorator. */ type Injectable = T & InjectDecorator; /** * Resolve a service singleton or decorate a field for singleton injection. * * Context kind: field decorator or direct function call. * @typeParam T - Service instance shape requested from the container. * @param type - Service class to resolve from the shared container. * @returns The service instance and decorator-compatible callable facade. * @example * ```ts * @inject(TodosStore) todos!: TodosStore * ``` */ declare function inject(type: InjectableClass): Injectable; /** * @file Registry of stable framework error codes and user fixes. * @module fragment-ux/errors/codes * @author Jesse Oyofo Dan-Amuda * @company Digitwhale Innovations LTD * @copyright Copyright (c) 2026 Digitwhale Innovations LTD. All rights reserved. * @license MIT * @since 0.1.0 */ /** Actionable description for a framework error code. */ interface FragmentErrorDescription { /** Short title shown in the debug view. */ title: string; /** Suggested fix shown with the error. */ hint: string; } /** Stable error codes emitted by Fragment-ux. */ declare const FRAGMENT_ERROR_CODES: { readonly FRAGMENT_API_MISSING_PARAM: { readonly title: "Missing API parameter"; readonly hint: "Pass every path parameter in the endpoint input, for example api.get({ id: \"42\" })."; }; readonly FRAGMENT_API_NO_API_DECORATOR: { readonly title: "API decorator missing"; readonly hint: "Add @api('/prefix') to the class that declares this HTTP endpoint."; }; readonly FRAGMENT_API_REQUEST_FAILED: { readonly title: "API request failed"; readonly hint: "Check the response status and response body, then correct the request or server behavior."; }; readonly FRAGMENT_API_NETWORK: { readonly title: "API network error"; readonly hint: "Check whether the device is offline, the server URL is wrong, or the browser blocked the request with CORS."; }; readonly FRAGMENT_API_TIMEOUT: { readonly title: "API request timed out"; readonly hint: "Increase the request timeout in defineApp({ api: { timeout } }) or check the server response time."; }; readonly FRAGMENT_INJECT_FAILED: { readonly title: "Dependency construction failed"; readonly hint: "Check the dependency chain and make sure each injected class has a usable zero argument constructor."; }; readonly FRAGMENT_INJECT_CYCLE: { readonly title: "Dependency cycle"; readonly hint: "Break the circular injection chain shown in the dependency trace."; }; readonly FRAGMENT_PAGE_NO_RENDER: { readonly title: "Page render() missing"; readonly hint: "Add a render() method to the @page class and return a React node."; }; readonly FRAGMENT_PAGE_LOAD_FAILED: { readonly title: "Page load failed"; readonly hint: "Check the route parameters and the request made by load(); handle or report the rejected error."; }; readonly FRAGMENT_GUARD_FAILED: { readonly title: "Route guard failed"; readonly hint: "Check the guard class and ensure canEnter() returns a boolean or redirect path."; }; readonly FRAGMENT_ROUTE_NOT_FOUND: { readonly title: "Route not found"; readonly hint: "Check the URL and add a matching @page route."; }; readonly FRAGMENT_METADATA_POLYFILL: { readonly title: "Decorator metadata unavailable"; readonly hint: "Import '@digitwhale_innovations/fragment-ux' first in main.tsx so Symbol.metadata is available before decorated classes load."; }; readonly FRAGMENT_STORE_RENDER_UNTRACKED: { readonly title: "Untracked store method call"; readonly hint: "Anything render() reads must be a field or getter; read the store field directly instead of calling a method."; }; readonly FRAGMENT_RENDER: { readonly title: "Render error"; readonly hint: "Use the component stack to find the failing component and correct the value or operation it uses."; }; readonly FRAGMENT_UNHANDLED: { readonly title: "Unhandled error"; readonly hint: "Handle the rejected promise or thrown error at its source, or report it with context."; }; }; /** One supported Fragment error code. */ type FragmentErrorCode = keyof typeof FRAGMENT_ERROR_CODES; /** * @file Structured framework error with safe serialization. * @module fragment-ux/errors/FragmentError * @author Jesse Oyofo Dan-Amuda * @company Digitwhale Innovations LTD * @copyright Copyright (c) 2026 Digitwhale Innovations LTD. All rights reserved. * @license MIT * @since 0.1.0 */ /** A framework error with a stable code, actionable hint, and support reference. */ declare class FragmentError extends Error { /** Stable machine readable error code. */ readonly code: FragmentErrorCode; /** Action a developer can take to resolve the error. */ readonly hint?: string; /** Documentation URL for this error code. */ readonly docs?: string; /** HTTP status when the error came from an HTTP response. */ readonly status?: number; /** Diagnostic data, redacted when serialized. */ details?: Record; /** Short reference safe to quote in support requests. */ readonly id: string; /** Unix time in milliseconds when the error was created. */ readonly at: number; /** Backwards compatible response data field. */ data?: unknown; /** Create a structured framework error. */ constructor(message: string, options?: { code?: FragmentErrorCode; hint?: string; docs?: string; status?: number; details?: Record; data?: unknown; cause?: unknown; }); /** Wrap an unknown thrown value while preserving existing Fragment errors. */ static from(value: unknown): FragmentError; /** Return a secret-safe JSON representation. */ toJSON(): Record; } /** * @file config.ts implementation and configuration. * @module fragment-ux/src/http/config.ts * @author Jesse Oyofo Dan-Amuda * @company Digitwhale Innovations LTD * @copyright Copyright (c) 2026 Digitwhale Innovations LTD. All rights reserved. * @license MIT * @since 0.1.0 */ interface ApiConfig { baseURL?: string; headers?: Record | (() => Record); retry?: number; onError?: (error: FragmentError) => void; } interface ApiOptions extends ApiConfig { axios?: AxiosStatic; } declare function setGlobalApiConfig(config?: ApiConfig): void; /** * @file api.ts implementation and configuration. * @module fragment-ux/src/http/api.ts * @author Jesse Oyofo Dan-Amuda * @company Digitwhale Innovations LTD * @copyright Copyright (c) 2026 Digitwhale Innovations LTD. All rights reserved. * @license MIT * @since 0.1.0 */ /** * Typed API operation produced by an HTTP verb decorator. * * @typeParam I - Input values for route parameters, query string, or JSON body. * @typeParam O - Parsed response body returned by the endpoint. */ type Endpoint, O = unknown> = ((input?: I, config?: AxiosRequestConfig) => Promise) & { /** Observe values returned by this endpoint and refetch when the input changes. */ query(getInput: () => I): ApiQuery; }; /** Observable result and lifecycle methods returned by `Endpoint.query()`. */ interface ApiQuery { /** Latest successful endpoint result. */ data: T | undefined; /** Whether the first or most recent request is running. */ loading: boolean; /** Latest endpoint error. */ error: FragmentError | undefined; /** Fetch again with the current input or an explicit input object. */ refetch(): Promise; /** Stop input tracking and abort any pending request. */ dispose(): void; } /** Mark a field as a GET endpoint. Context kind: field decorator. @example `@Get('/:id') get!: Endpoint<{ id: string }, Todo>`. */ declare const Get: (path: string) => (_value: undefined, context: ClassFieldDecoratorContext) => (this: This) => Value; /** Mark a field as a POST endpoint. Context kind: field decorator. @example `@Post('/') create!: Endpoint<{ title: string }, Todo>`. */ declare const Post: (path: string) => (_value: undefined, context: ClassFieldDecoratorContext) => (this: This) => Value; /** Mark a field as a PUT endpoint. Context kind: field decorator. @example `@Put('/:id') update!: Endpoint<{ id: string }, Todo>`. */ declare const Put: (path: string) => (_value: undefined, context: ClassFieldDecoratorContext) => (this: This) => Value; /** Mark a field as a PATCH endpoint. Context kind: field decorator. @example `@Patch('/:id') patch!: Endpoint<{ id: string }, Todo>`. */ declare const Patch: (path: string) => (_value: undefined, context: ClassFieldDecoratorContext) => (this: This) => Value; /** Mark a field as a DELETE endpoint. Context kind: field decorator. @example `@Delete('/:id') remove!: Endpoint<{ id: string }, void>`. */ declare const Delete: (path: string) => (_value: undefined, context: ClassFieldDecoratorContext) => (this: This) => Value; /** * Set a shared URL prefix and optional request defaults for an API class. * * Context kind: class decorator. * @param prefix - URL prefix added to every endpoint path. * @param options - Optional axios defaults and error handler. * @returns A standard class decorator that configures HTTP endpoint fields. * @example * ```ts * @api('/todos') class TodosApi { @Get('/') list!: Endpoint<{}, Todo[]> } * ``` */ declare function api(prefix: string, options?: ApiOptions): object>(_value: Class, context: ClassDecoratorContext) => void; /** * @file Keep a bounded history of recent framework activity. * @module fragment-ux/debug/breadcrumbs * @author Jesse Oyofo Dan-Amuda * @company Digitwhale Innovations LTD * @copyright Copyright (c) 2026 Digitwhale Innovations LTD. All rights reserved. * @license MIT * @since 0.1.0 */ /** Supported framework activity types. */ type BreadcrumbType = 'api' | 'action' | 'route' | 'guard' | 'console' | 'error'; /** A compact record of an event that happened before an error. */ interface Breadcrumb { /** Unix time in milliseconds when the event was recorded. */ t: number; /** Event category. */ type: BreadcrumbType; /** Short human readable event summary. */ label: string; /** Optional redacted event details. */ data?: unknown; } /** Bounded recorder for the 100 most recent events. */ declare const breadcrumbs: { /** Enable or disable recording, usually from application debug settings. */ /** * Enable or disable recording, usually from application debug settings. * @param value - True when new events should be kept. */ setEnabled(value: boolean): void; /** Record a new event, dropping the oldest entry when full. */ /** * Record a new event, dropping the oldest entry when full. * @param type - Event category. * @param label - Short human readable event summary. * @param data - Optional safe details for the event. */ add(type: BreadcrumbType, label: string, data?: unknown): void; /** Copy the current breadcrumb history. */ /** Return a copy of the current history. @returns Recent breadcrumbs in chronological order. */ snapshot(): Breadcrumb[]; /** Remove every recorded event. */ clear(): void; /** Capture and later restore the console's warning and error methods. */ /** * Capture and later restore the console's warning and error methods. * @returns A function that restores the original console methods. */ captureConsole(): () => void; }; /** * @file Normalize, enrich, deduplicate, and publish errors. * @module fragment-ux/errors/report * @author Jesse Oyofo Dan-Amuda * @company Digitwhale Innovations LTD * @copyright Copyright (c) 2026 Digitwhale Innovations LTD. All rights reserved. * @license MIT * @since 0.1.0 */ /** Structured context supplied to the application error hook. */ interface ErrorReport { /** Normalized framework error. */ error: FragmentError; /** Recent framework activity. */ breadcrumbs: ReturnType; /** Observable store state when enabled. */ stores?: Record; /** Current browser route, when available. */ route?: string; /** Runtime environment label. */ env: string; /** React component stack, when available. */ componentStack?: string; /** Time the report was assembled. */ generatedAt: string; } /** Application callback for captured errors. */ type ErrorHandler = (error: FragmentError, report: ErrorReport) => void; /** Create a report for an error and deliver it to the configured callback. */ declare function reportError(error: unknown, context?: { componentStack?: string; origin?: string; }): ErrorReport; /** * @file Capture React render failures for the Fragment reporter. * @module fragment-ux/errors/FragmentErrorBoundary * @author Jesse Oyofo Dan-Amuda * @company Digitwhale Innovations LTD * @copyright Copyright (c) 2026 Digitwhale Innovations LTD. All rights reserved. * @license MIT * @since 0.1.0 */ /** @internal Props for the framework error boundary. */ interface Props { children?: ReactNode; } /** @internal State tracked by the framework error boundary. */ interface State { failed: boolean; } /** Bridge React render failures to the isolated Fragment error display. */ declare class FragmentErrorBoundary extends Component$1 { state: State; /** Mark the tree failed so React stops rendering it. */ static getDerivedStateFromError(): State; /** Capture the component stack and report the original render exception. */ componentDidCatch(error: Error, info: ErrorInfo): void; /** Render no app content after failure while the independent view remains available. */ render(): ReactNode; } /** Suggest up to three registered routes close to the current path. */ declare function closestRoutes(path: string): string[]; /** Show a framework 404 page with route suggestions while developing. */ declare function NotFoundView({ path }: { path: string; }): react.JSX.Element; /** * @file mount.tsx implementation and configuration. * @module fragment-ux/src/mount.tsx * @author Jesse Oyofo Dan-Amuda * @company Digitwhale Innovations LTD * @copyright Copyright (c) 2026 Digitwhale Innovations LTD. All rights reserved. * @license MIT * @since 0.1.0 */ /** Props accepted by the production error view. */ interface ErrorViewProps { /** Safe error with a support reference. */ error: FragmentError; /** Reset the failed UI and try the page again. */ reset: () => void; /** Diagnostic report, intentionally unavailable in production views. */ report?: undefined; } /** Framework error view and telemetry settings. */ interface FragmentErrorConfig { /** Select the detailed development view or calm production fallback. */ mode?: 'dev' | 'prod'; /** Replace the default production fallback. */ view?: React.ComponentType; /** Replace the default route not found view. */ notFound?: React.ComponentType<{ path: string; }>; /** Receive a redacted report for every captured error. */ onError?: ErrorHandler; /** Choose which diagnostic sections are attached in production. */ attach?: { breadcrumbs?: boolean; stores?: boolean; }; /** Add a project-specific key pattern to secret redaction. */ redact?: RegExp; /** Editor used by development open-in-editor links. */ editor?: 'vscode' | 'cursor' | 'webstorm' | 'idea' | 'zed' | string; } interface FragmentConfig { /** Optional API request defaults for the application. */ api?: ApiConfig; /** Optional motion timing and reduced-motion settings. */ motion?: { duration?: number; ease?: string; reduced?: 'system' | 'always' | 'never'; }; /** Author and company names added to files generated by Fragment. */ meta?: { author?: string; company?: string; }; /** Error display, report callback, and production attachment options. */ errors?: FragmentErrorConfig; /** Enable grouped request, action, and route diagnostics. */ debug?: boolean | { api?: boolean; actions?: boolean; routes?: boolean; }; } /** * Configure global Fragment-ux services and return the supplied app settings. * @typeParam T - Specific application configuration type. * @param config - API, motion, metadata, error, and debug configuration. * @returns The same configuration object for default export usage. * @example * ```ts * export default defineApp({ api: { baseURL: '/api' } }) * ``` */ declare function defineApp(config: T): T; declare function mount(selector: string, config: FragmentConfig, modules?: Record): void; /** Show a friendly production error without exposing diagnostics. */ declare function ProdErrorView({ error, reset }: ErrorViewProps): react.JSX.Element; /** * @file Build a bounded safe snapshot of container stores. * @module fragment-ux/debug/snapshot * @author Jesse Oyofo Dan-Amuda * @company Digitwhale Innovations LTD * @copyright Copyright (c) 2026 Digitwhale Innovations LTD. All rights reserved. * @license MIT * @since 0.1.0 */ /** Return bounded, redacted snapshots for currently instantiated stores. */ declare function snapshotStores(extra?: RegExp): Record; /** * @file Remove sensitive values from debug output. * @module fragment-ux/debug/redact * @author Jesse Oyofo Dan-Amuda * @company Digitwhale Innovations LTD * @copyright Copyright (c) 2026 Digitwhale Innovations LTD. All rights reserved. * @license MIT * @since 0.1.0 */ /** Redact sensitive keys and bearer tokens recursively. */ declare function redact(value: T, extra?: RegExp, seen?: WeakSet): T; /** * @file Provide small React hooks for common application state and browser tasks. * @module fragment-ux/hooks * @author Jesse Oyofo Dan-Amuda * @company Digitwhale Innovations LTD * @copyright Copyright (c) 2026 Digitwhale Innovations LTD. All rights reserved. * @license MIT * @since 0.1.0 */ /** Store a boolean with a setter and a one-step toggle. * @param initial - Starting value, defaulting to `false`. * @returns Current value, toggle action, and React state setter. */ declare function useToggle(initial?: boolean): readonly [boolean, () => void, Dispatch>]; /** Manage open and closed state with named actions. * @param initial - Whether the item begins open. * @returns Open state and `open`, `close`, and `toggle` actions. */ declare function useDisclosure(initial?: boolean): { isOpen: boolean; open: () => void; close: () => void; toggle: () => void; }; /** Return a value after it has stayed unchanged for the requested delay. * @typeParam T - Value type being delayed. * @param value - Latest value from the current render. * @param delayMs - Quiet period in milliseconds, defaulting to 250. * @returns The most recent value after its quiet period. */ declare function useDebouncedValue(value: T, delayMs?: number): T; /** Return the value from the previous committed render. * @typeParam T - Value type retained between renders. * @param value - Current render's value. * @returns Previous committed value, or `undefined` on the first render. */ declare function usePrevious(value: T): T | undefined; /** Persist React state in local storage and synchronize other tabs. * @typeParam T - JSON-serializable value stored for the key. * @param key - Browser storage key to read and update. * @param initial - Fallback value when no valid stored value exists. * @returns Stored value, React setter, and a removal action. */ declare function useLocalStorage(key: string, initial: T): readonly [T, Dispatch>, () => void]; /** Track whether a media query currently matches the browser viewport. * @param query - CSS media query passed to `window.matchMedia`. * @returns Whether the query matches the current browser environment. */ declare function useMediaQuery(query: string): boolean; /** Copy text and expose the latest success or failure state. * @param resetAfterMs - Delay before the copied flag clears. * @returns Copy action, success state, and the most recent copy error. */ declare function useClipboard(resetAfterMs?: number): { copied: boolean; error: unknown; copy: (text: string) => Promise; }; /** Run an async operation on mount and expose its result and a rerun action. * @typeParam T - Successful result type returned by the operation. * @param operation - Async work to perform on mount or when `run` is called. * @param immediate - Whether to start the operation after the first render. * @returns Current result, error, loading state, and rerun action. */ declare function useAsync(operation: () => Promise, immediate?: boolean): { data: T | undefined; error: unknown; loading: boolean; run: () => Promise; }; /** Keep a callback running on an interval, or pause it with a null delay. * @param callback - Latest callback to invoke for each interval tick. * @param delayMs - Tick interval in milliseconds, or `null` to pause. */ declare function useInterval(callback: () => void, delayMs: number | null): void; /** Listen for an event on a browser target while keeping the latest handler. * @param type - DOM event name to listen for. * @param handler - Callback invoked with the latest event. * @param target - Event target, defaulting to `window` when available. */ declare function useEventListener(type: string, handler: (event: Event) => void, target?: EventTarget | null): void; /** Call a handler when a pointer press lands outside the referenced element. * @typeParam T - HTML element referenced by the caller. * @param ref - Element reference that defines the inside area. * @param handler - Action to run when the pointer is outside the element. * @param enabled - Whether the outside listener is active. */ declare function useOnClickOutside(ref: RefObject, handler: (event: PointerEvent) => void, enabled?: boolean): void; /** Derive paged items and navigation actions from an array. * @typeParam T - Item type in the source collection. * @param items - Complete collection to split into pages. * @param pageSize - Maximum number of items included on each page. * @returns Current page data, navigation state, and page actions. */ declare function usePagination(items: readonly T[], pageSize: number): { items: T[]; page: number; pageCount: number; hasNext: boolean; hasPrevious: boolean; next: () => void; previous: () => void; reset: () => void; }; /** Read and update a bounded numeric counter. * @param initial - Starting counter value. * @param bounds - Optional inclusive minimum and maximum values. * @returns Counter value, setter, bounded step actions, and reset action. */ declare function useCounter(initial?: number, bounds?: { min?: number; max?: number; }): { count: number; setCount: (value: number) => void; increment: (step?: number) => void; decrement: (step?: number) => void; reset: () => void; }; /** * @file store.ts implementation and configuration. * @module fragment-ux/src/store.ts * @author Jesse Oyofo Dan-Amuda * @company Digitwhale Innovations LTD * @copyright Copyright (c) 2026 Digitwhale Innovations LTD. All rights reserved. * @license MIT * @since 0.1.0 */ /** * Make class fields observable and bind methods as MobX actions. * * Injected fields stay outside the observable state. Any value read by a page's `render()` must be a field or getter because actions do not collect reactions. * * Context kind: class decorator. * @param target - Class constructor being decorated. * @param context - Standard decorator context containing injection metadata. * @returns The wrapped class that initializes MobX annotations after fields are set. * @example * ```ts * @store class CartStore { items: Item[] = [] } * ``` * @since 0.1.0 */ declare function store object>(target: Class, context: ClassDecoratorContext): Class; /** * @file component.tsx implementation and configuration. * @module fragment-ux/src/component * @author Jesse Oyofo Dan-Amuda * @company Digitwhale Innovations LTD * @copyright Copyright (c) 2026 Digitwhale Innovations LTD. All rights reserved. * @license MIT * @since 0.1.0 */ /** Base class for reusable Fragment class components. */ declare class Component, State = Record> extends react__default.Component { } /** Constructor type accepted by `@component()`. */ type FragmentComponentClass = new (...args: any[]) => Component; /** * Make a custom class component's fields observable and track observables read by render(). * React props, state, and lifecycle methods continue to work as usual. * * @returns A class decorator for Fragment components. * @example * ```tsx * @component() * class Greeting extends Component<{ name: string }> { * render() { return

Hello, {this.props.name}

} * } * ``` * @since 0.1.0 */ declare function component(): (Target: Class, context: ClassDecoratorContext) => Class; /** * @file guard.ts implementation and configuration. * @module fragment-ux/src/guard.ts * @author Jesse Oyofo Dan-Amuda * @company Digitwhale Innovations LTD * @copyright Copyright (c) 2026 Digitwhale Innovations LTD. All rights reserved. * @license MIT * @since 0.1.0 */ interface GuardContext { params: Record; query: Record; } declare abstract class Guard { abstract canEnter(context: GuardContext): boolean | string | Promise; } /** * @file page.tsx implementation and configuration. * @module fragment-ux/src/page.tsx * @author Jesse Oyofo Dan-Amuda * @company Digitwhale Innovations LTD * @copyright Copyright (c) 2026 Digitwhale Innovations LTD. All rights reserved. * @license MIT * @since 0.1.0 */ /** React component that wraps page content. */ type LayoutComponent = React.ComponentType<{ children?: ReactNode; }>; /** Options that control a registered page. */ interface PageOptions { /** Guard class evaluated before rendering the page. */ guard?: new (...args: never[]) => Guard; /** Layout component that wraps this page. */ layout?: LayoutComponent; /** Motion preset used while entering and leaving this page. */ transition?: string; } /** Router state provided to guards and page instances. */ interface PageContext { /** Dynamic values captured from the route path. */ params: Record; /** Search string values from the current URL. */ query: Record; } /** Constructor type accepted by page routing. */ type PageClass = new () => Page; /** Registered route and its page class. */ /** Registered route and its page class. */ interface PageDefinition { /** Route path pattern. */ path: string; /** Options associated with the route. */ options: PageOptions; /** Page constructor used when this route matches. */ PageClass: PageClass; } /** Return the registered page definitions in declaration order. */ declare function getPageDefinitions(): readonly PageDefinition[]; /** Clear the page registry, primarily for tests and hot reload. */ declare function clearPageDefinitions(): void; /** * Register a class as a route and make its local fields observable. * * Context kind: class decorator. `render()` stays unwrapped so MobX can track the fields and getters it reads. * * @param path - URL pattern matched by React Router. * @param options - Optional guard, layout, and transition settings. * @returns A standard class decorator that registers the page. * @example * ```ts * @page('/todos') class TodosPage extends Page { render() { return

Todos

} } * ``` * @since 0.1.0 */ declare function page(path: string, options?: PageOptions): (PageClass: Class) => Class; /** Base class for route pages with observable loading and error state. */ declare abstract class Page { params: Record; query: Record; nav: (to: string, options?: NavigateOptions) => void; loading: boolean; error: unknown; constructor(); load?(): void | Promise; skeleton?(): ReactNode; abstract render(): ReactNode; } declare function pageRoutes(definitions?: readonly PageDefinition[]): RouteObject[]; declare function createFragmentRouter(definitions?: readonly PageDefinition[]): react_router.DataRouter; /** * @file presets.ts implementation and configuration. * @module fragment-ux/src/fx/presets.ts * @author Jesse Oyofo Dan-Amuda * @company Digitwhale Innovations LTD * @copyright Copyright (c) 2026 Digitwhale Innovations LTD. All rights reserved. * @license MIT * @since 0.1.0 */ declare const presets: { fade: { initial: { opacity: number; }; animate: { opacity: number; }; exit: { opacity: number; }; }; 'fade-up': { initial: { opacity: number; y: number; }; animate: { opacity: number; y: number; }; exit: { opacity: number; y: number; }; }; 'fade-down': { initial: { opacity: number; y: number; }; animate: { opacity: number; y: number; }; exit: { opacity: number; y: number; }; }; scale: { initial: { opacity: number; scale: number; }; animate: { opacity: number; scale: number; }; exit: { opacity: number; scale: number; }; }; 'slide-left': { initial: { opacity: number; x: number; }; animate: { opacity: number; x: number; }; exit: { opacity: number; x: number; }; }; 'slide-right': { initial: { opacity: number; x: number; }; animate: { opacity: number; x: number; }; exit: { opacity: number; x: number; }; }; }; type FxPreset = keyof typeof presets; interface FxProps { enter?: FxPreset; exit?: FxPreset; duration?: number; delay?: number; as?: ElementType; children?: ReactNode; className?: string; } declare function Fx({ enter, exit, duration, delay, as, children, ...props }: FxProps): react.JSX.Element; declare namespace Fx { interface ListProps { children?: ReactNode; stagger?: boolean; delay?: number; duration?: number; className?: string; } function List({ children, stagger, delay, duration, className }: ListProps): react.JSX.Element; } export { type ApiConfig, type ApiOptions, type ApiQuery, type Breadcrumb, type BreadcrumbType, Component, Container, Delete, type Endpoint, type ErrorHandler, type ErrorReport, type ErrorViewProps, FRAGMENT_ERROR_CODES, type FragmentComponentClass, type FragmentConfig, FragmentError, FragmentErrorBoundary, type Props as FragmentErrorBoundaryProps, type State as FragmentErrorBoundaryState, type FragmentErrorCode, type FragmentErrorConfig, type FragmentErrorDescription, Fx, type FxPreset, type FxProps, Get, Guard, type GuardContext, type InjectDecorator, type Injectable, type InjectableClass, type LayoutComponent, NotFoundView, Page, type PageClass, type PageContext, type PageDefinition, type PageOptions, Patch, Post, ProdErrorView, Put, api, breadcrumbs, clearPageDefinitions, closestRoutes, component, container, createFragmentRouter, defineApp, getContainerEntries, getPageDefinitions, inject, mount, page, pageRoutes, presets, redact, reportError, setGlobalApiConfig, snapshotStores, store, useAsync, useClipboard, useCounter, useDebouncedValue, useDisclosure, useEventListener, useInterval, useLocalStorage, useMediaQuery, useOnClickOutside, usePagination, usePrevious, useToggle };