Lime Web Components API Documentation - v7.4.0
    Preparing search index...

    Interface ContextMapBeta

    The catalog of context entries available to consumers.

    A context entry is ambient state available to consumers anywhere in the component tree, the current user, the object on screen, the action being filtered. Each key here is a context id; the value type is what ContextRegistry.get(key) (or any other lookup such as ContextScope.get) returns for it.

    Plugins add their own keys by extending this interface.

    Use namespaced keys (mypkg.foo, pluginx.bar) for plugin-added entries. Two plugins declaring the same key with different value types will collide at compile time. The built-in keys user, limeobject, action, coworker, limeobjectFormData, and scalarValue are first-party and intentionally use short, unnamespaced ids. The namespacing convention only applies to non-built-in keys.

    Example: Add a plugin context entry

    import { PlatformServiceName } from '@limetech/lime-web-components';

    // Written once, by the plugin that introduces the entry. TypeScript merges
    // these blocks, so each plugin declares only its own keys.

    interface PipelinePosition {
    stage: string;
    index: number;
    }

    declare module '@limetech/lime-web-components' {
    interface ContextMap {
    'pluginx.pipelinePosition': PipelinePosition;
    }
    }

    const registry = platform.get(PlatformServiceName.ContextRegistry);

    // The new key is now typed everywhere, so `position` is a PipelinePosition.
    const position = registry.get('pluginx.pipelinePosition');
    interface ContextMap {
        action: Action;
        context: LimeWebComponentContext;
        coworker: LimeObject;
        limeobject: LimeObject;
        limeobjectFormData: Record<string, unknown>;
        platform: LimeWebComponentPlatform;
        scalarValue: string | number | boolean | null;
        user: User;
    }
    Index

    Properties

    action: Action

    The Action currently in context.

    The component's LimeWebComponentContext, describing where it sits in the application. Subtree-scoped: descendants resolve the nearest enclosing value.

    coworker: LimeObject

    The current coworker, the business-side LimeObject row linked from User.coworker, distinct from the authentication-side User. Filter primitives substitute this value for $me placeholders.

    App-global in scope, one per session, supplied by the host. The provider returns undefined until the value has loaded; reads during that window are fail-closed.

    limeobject: LimeObject

    The LimeObject currently in context.

    limeobjectFormData: Record<string, unknown>

    The in-memory, possibly-edited version of limeobject, what is currently in the user's form state, distinct from the persisted row supplied via limeobject. Used by is-saved-shaped primitives to determine whether the user has unsaved changes by comparing field-by-field against limeobject.

    Surface-scoped: the form component contributes the value via provide. Reads outside a form surface fail closed (undefined).

    The application's LimeWebComponentPlatform. App-global in scope, one per session.

    scalarValue: string | number | boolean | null

    A single scalar value a component contributes for descendants to read, an info tile exposing the figure it displays, say, so a descendant can format, compare, or react to it.

    Subtree-scoped: descendants resolve the nearest enclosing value. The type is kept wide so any provider can contribute whatever scalar it has. A provider may set null as a present "no value" reading; an absent value reads as undefined, supplied by the read layer, so it is not part of this type.

    ContextRegistry.get for how absence reads as undefined.

    user: User

    The currently authenticated User.