@nitrogenbuilder/client-core
Version:
Nitrogen Builder Core Client
27 lines • 1.51 kB
TypeScript
import type { BuilderModule, ComponentSettings, Module } from '@nitrogenbuilder/types';
import { BatchFetchContext, type BatchTransport } from './BatchFetchContext.js';
export declare class Nitrogen {
static instance: Nitrogen;
static modules: Map<string, Module>;
static moduleComponents: Map<string, any>;
static moduleDataFetchers: Map<string, (props: any, ctx?: BatchFetchContext) => Promise<any>>;
private static moduleEventQueued;
private static nitrogenInitializedListenerAdded;
static moduleData: Map<string, any>;
constructor();
getModule(moduleId: string | number): Module | undefined;
getModuleComponent(moduleId: string | number): any;
getModuleData(moduleId: string | number): any;
getModuleDataFetcher(moduleId: string | number): ((props: any, ctx?: BatchFetchContext | undefined) => Promise<any>) | undefined;
getRequestedData({ page, dynamicData, batchTransport, }: {
page: BuilderModule[];
dynamicData?: any;
batchTransport?: BatchTransport;
}): Promise<Record<string, any>>;
registerModuleDataFetcher(moduleId: string | number, getData: (props: any, ctx?: BatchFetchContext) => Promise<any>): void;
private dispatchModulesEvent;
private queueModulesEvent;
registerModule(moduleId: string | number, Component: any, module: ComponentSettings, getData?: (props: any, ctx?: BatchFetchContext) => Promise<any>): void;
}
export declare const nitrogen: Nitrogen;
//# sourceMappingURL=Nitrogen.d.ts.map