@resistdesign/voltra
    Preparing search index...

    Module app

    Build front-end applications with React and TypeScript utilities, including layout/state helpers and form generation support.

    Import from the app subpath only:

    import {
    createFormRenderer,
    useApplicationStateLoader,
    useApplicationStateValueStructure,
    type RemoteProcedureCall,
    } from "@resistdesign/voltra/app";

    useApplicationStateValueStructure and useApplicationStateLoader for good starting points.

    Reference examples:

    • examples/README.md
    • examples/routing/app-routing.ts
    import {
    useApplicationStateLoader,
    useApplicationStateValueStructure,
    type RemoteProcedureCall,
    } from "@resistdesign/voltra/app";
    import { useCallback } from "react";

    const APP_STATE_IDENTIFIERS = {
    LOGIN: {
    USERNAME: {},
    PASSWORD: {},
    LOGGED_IN: {},
    },
    };

    const LOGIN_SERVICE_CONFIG = {
    protocol: "https",
    domain: "example.com",
    basePath: "/api",
    };

    const LOGIN_RPC: RemoteProcedureCall = {
    serviceConfig: LOGIN_SERVICE_CONFIG,
    path: "/login",
    args: [],
    };

    export const LoginController = () => {
    const {
    valueStructure: {
    username: username = "",
    password: password = "",
    loggedIn: loggedIn = false,
    },
    onChangeStructure: {
    username: setUsername,
    password: setPassword,
    loggedIn: setLoggedIn,
    },
    } = useApplicationStateValueStructure<{
    username: string;
    password: string;
    loggedIn: boolean;
    }>({
    username: APP_STATE_IDENTIFIERS.LOGIN.USERNAME,
    password: APP_STATE_IDENTIFIERS.LOGIN.PASSWORD,
    loggedIn: APP_STATE_IDENTIFIERS.LOGIN.LOGGED_IN,
    });

    const { loading: loadingLogin, makeRemoteProcedureCall } =
    useApplicationStateLoader({
    identifier: APP_STATE_IDENTIFIERS.LOGIN.LOGGED_IN,
    remoteProcedureCall: LOGIN_RPC,
    manual: true,
    });

    const onSubmit = useCallback(() => {
    makeRemoteProcedureCall(username, password);
    }, [username, password, makeRemoteProcedureCall]);

    return { username, password, loggedIn, setUsername, setPassword, onSubmit, loadingLogin };
    };

    See also: @resistdesign/voltra/web and @resistdesign/voltra/native for runtime-specific UI helpers.

    Classes

    TypeInfoORMClient

    Interfaces

    ApplicationStateIdentifier
    AutoFieldProps
    PrimitiveInputProps

    Type Aliases

    ApplicationState
    ApplicationStateContextType
    ApplicationStateIdentifierSubStateType
    ApplicationStateLoader
    ApplicationStateLoaderConfig
    ApplicationStateModificationState
    ApplicationStateProviderProps
    ApplicationStateValue
    ApplicationStateValueController
    ApplicationStateValueStructureController
    AreaBounds
    BaseTypeInfoORMAPIRequestState
    ComponentMap
    ComponentSuite
    ComputeTrackPixelsInput
    CreateUniversalAdapterOptions
    CustomTypeAction
    CustomTypeActionPayload
    EasyLayoutCore
    EasyLayoutFactoryConfig
    EasyLayoutParsed
    EasyLayoutSpacing
    EasyLayoutTemplate
    FCWithChildren
    FieldKind
    FieldRenderContext
    FieldRenderer
    FieldValue
    FormController
    FormFieldController
    FormValue
    FormValues
    HistoryController
    HistoryEntry
    HistoryListener
    HistoryLocation
    HistoryPathParts
    LayoutComponents
    PrimitiveComponent
    PrimitiveComponents
    RelationAction
    RelationActionPayload
    RemoteProcedureCall
    ResolvedSuite
    RouteAdapter
    RouteContextType
    RouteProps
    RouteProviderProps
    RouteQuery
    RouteQueryValue
    ServiceConfig
    SyncRequestHandler
    TrackSpec
    TrackUnit
    TypeInfoORMAPIController
    TypeInfoORMAPIRequestState
    TypeInfoORMAPIState
    TypeInfoORMServiceAPI
    UniversalRouteIngress
    UniversalRouteStrategy

    Functions - EasyLayout

    computeTrackPixels

    Functions - EasyLayout Supported syntax: - row lines: `<area area ...>, <row-track>` - column line: `\\ <col-track> <col-track> ...` - row track is optional for parity with current behavior.

    parseTemplate

    Functions - other

    buildHistoryPath
    buildQueryString
    buildRoutePath
    canUseBrowserHistory
    computeAreaBounds
    createAutoField
    createBrowserRouteAdapter
    createEasyLayout
    createFormRenderer
    createManualRouteAdapter
    createMemoryHistory
    createNativeRouteAdapter
    createRouteAdapterFromHistory
    createUniversalAdapter
    getApplicationStateIdentifier
    getApplicationStateModified
    getApplicationStateValue
    getApplicationStateValueStructure
    getChangedDependencyIndexes
    getEasyLayoutTemplateDetails
    getFieldKind
    getFullUrl
    getPascalCaseAreaName
    handleRequest
    mergeSuites
    parseHistoryPath
    requestHandlerFactory
    resolveSuite
    RouteProvider
    sendServiceRequest
    setApplicationStateModified
    setApplicationStateValue
    useApplicationStateLoader
    useApplicationStateValue
    useApplicationStateValueStructure
    useController
    useDebugDependencies
    useFormEngine
    useRouteContext
    useTypeInfoORMAPI
    validateAreas
    withRendererOverride

    Variables

    ApplicationStateContext
    ApplicationStateProvider
    RouteContext