A shared SDK Redux store, independent of the state shape.

This is the single declaration of the contract between client packages, and the type that travels between them: davinci() and journey() expose one, oidc() accepts one. It is deliberately state-agnostic so a handle typed with DaVinci's state is assignable to it without a cast — which is what lets the whole path stay cast-free.

An earlier design used a branded interface whose brand existed on no runtime object. That forced as unknown as on both sides — four unchecked casts to move one object across a package boundary, with no compile-time link between producer and consumer. A structural type gives real checking instead.

interface SdkStore {
    dynamicMiddleware: DynamicMiddleware;
    extra: SdkStoreRegistry;
    rootReducer: InjectableRootReducer;
    store: {
        dispatch: (action: never) => unknown;
        getState: () => unknown;
        subscribe: (listener: () => void) => () => void;
    };
}

Hierarchy (View Summary)

Properties

dynamicMiddleware: DynamicMiddleware
rootReducer: InjectableRootReducer
store: {
    dispatch: (action: never) => unknown;
    getState: () => unknown;
    subscribe: (listener: () => void) => () => void;
}

Type declaration

  • dispatch: (action: never) => unknown

    never parameter keeps any concrete dispatch assignable to this.

  • getState: () => unknown
  • subscribe: (listener: () => void) => () => void