import type { _IODataPageContextInfo } from '@microsoft/sp-odata-types'; import { type IDebugData } from '../debug/DebugManager'; import type { IMinimalPreloadedData, IPreloadedData } from '../interfaces/IPreloadedData'; import type { IAssemblyComponent } from '../interfaces/ISPComponentLoader'; /** * ExperimentalData key for whether to used the app id passed in the query string * @internal */ export declare const _INCLUDE_APP_WORKLOAD: string; /** * Query string key used for getting the value to appened to a workload * @internal */ export declare const _APP_WORKLOAD_QSP: string; /** * Error message returned from the frame used to evaluate assemblies * * @internal */ export declare const EVAL_FRAME_FLAG: string; /** * Provides information about a loader error. * Used with handleError() in order to present UI friendly error information. * @internal */ export interface IErrorInformation { /** * User friendly message for the error. * It should not include technical details, but a way for the user to work around the problem. * An example of that: "Please refresh the page" or "Please update your browser to the last version" */ message: string; /** * Original error. */ error?: Error; /** * Correlation id */ correlationId?: string; /** * Operation that failed. This is used by our diagnostics. */ operationName?: string; } /** * Bootstrapper for the application * @internal */ export default class SPStarter { /** * Value indicating if we should load scripts from the secondary CDN. */ static useSecondaryCdn: boolean; /** * Some legacy code uses this in its old `{ [id: string]: {...module...} }` format * * @internal */ static _bundledComponents: Record; private static _assemblyComponents; private static _isTelemetryDisabled; private static _isTelemetryLoggingInRealTime; private static _queryParams; private static _isKillSwitchAndFlightingInitialized; /** * Buffer of console log entries captured during the lifetime of the page. Each entry is a tuple of * timestamp (ISO string) and the arguments passed to console.log serialized best-effort. */ private static _consoleLogBuffer; private static _consoleErrorBuffer; /** Preserve the original console.log implementation so we can continue to emit to the real console. */ private static _originalConsoleLog; /** Preserve the original console.error implementation so we can continue to emit to the real console. */ private static _originalConsoleError; /** Whether we've already patched console.log */ private static _isTracePatched; /** SessionStorage key used when persisting buffered console logs for retrieval on error.aspx */ private static readonly _SESSION_STORAGE_LOG_KEY; private static readonly _SESSION_STORAGE_ERROR_KEY; private static readonly _SESSION_STORAGE_ERROR_INFO_KEY; /** * Takes an array of components included in the assembly. These components will be added to the component loader * during initialization, so they won't need to be loaded afterwards. * The array is of the form `[['id', 'version', { ... component ... }]]` * * @internal */ static _initializeAssembly(assemblyComponents: IAssemblyComponent[]): void; /** * Raise the `onSecondFlush` event to resume starting with the full set of preloaded data. * This is called by the page scripts to resume loading the framework. Do not call it from your own code. * * @param preloadedData - Full set of preloaded data for the current session. */ static startSecondFlush(preloadedData: IPreloadedData): void; /** * This is called by the page scripts to start loading the framework. Do not call it from your own code. * @param preloadedData - Data initialized on the page by the server. * @param handleFailure - Error handler function provided by the server to execute if there is SPFx can't be loaded. * It may redirect to an error page or log error data in the console. * @param debugData - This parameter is used when the loader initializes a debug loader and * should never be provided by any external callers. * @param isFirstFlush - Indicates whether the caller intends to call `startSecondFlush` to finish starting SPFx. */ static start(preloadedData: IMinimalPreloadedData, handleFailure: (errorInformation: IErrorInformation) => void, debugData?: IDebugData, isFirstFlush?: boolean): Promise; /** * Initializes the flights and killswitches. This should only ever be called during page load. It is broken out * so that we can initialize the killswitches before trying to do any work as that allows killswitches and flights * to be used before start is run. * * @internal */ static initializeFlightsAndKillswitches(spPageContextInfo: _IODataPageContextInfo): void; /** * Installs a lightweight wrapper around telemetry that appends messages to an in‑memory buffer. * The buffer is later written to sessionStorage when redirecting to errorNaut.aspx so diagnostics * can be surfaced there. This is intentionally minimal to avoid perf regressions. */ private static _overrideTraceMethodsForErrorPage; private static _overridenConsoleLogMethod; private static _overridenConsoleErrorMethod; private static _setTraceData; /** Writes buffered console logs to sessionStorage (best effort). */ private static _persistConsoleLogsForErrorPage; private static _logDataInRealTime; private static _initializeEnvironment; private static _initializeTelemetry; private static _isQueryParameterTrue; private static _isConsoleLogEnabled; private static _handleError; private static _isRedirectDisabled; private static _consoleErrorHandleFailure; private static _errornautAspxHandleFailure; private static _errorAspxHandleFailure; private static _getQueryParamValue; private static _getCookieValue; private static _monitorClientFlight; private static _checkForClientFlightParity; } //# sourceMappingURL=SPStarter.d.ts.map