Skip to main content
Version: 2.1.4

IAppContext

3p-core v2.1.4


3p-core / IAppContext

Interface: IAppContext

Application-level context shared across the component tree using React Context API. Includes utilities, state, user/group info, and SPFI client.

Properties

PropertyTypeDescription
addToLoadingQueue<T>(promise) => Promise<T>[Synchronious] Add a promise to a queue. As long as the queue is not empty, a loading animation will be rendered.
currentUserISiteUserInfoCurrent SharePoint user info.
currentUserGroupsISiteGroupInfo[]SharePoint groups the current user is a member of.
customContextanyCustom context object that can be passed through the framework for extensibility.
debugModeOnbooleanDebug mode flag controlled via localStorage.
error(...args) => void[Synchronous] Logs an error. Always logs regardless of debug mode.
isAdminbooleanIndicates whether the current user has site admin permissions.
isMemberOf(groupName) => boolean[Synchronous] Checks if the current user is a member of the specified group.
log(...args) => void[Synchronous] Logs a message if debug mode is enabled. Replaces console.log.
report(message) => Promise<void>[Asynchronous] Logs an error message to a centralized SharePoint list (stubbed).
setDebugMode(debugModeOn) => void[Synchronous] Enables or disables debug mode and persists the setting in local storage.
spSPFIPnPjs SPFI instance.
try(action, options?) => Promise<any>[Asynchronous] Executes an action inside a try/catch/finally block with automatic error handling and optional loading UI.
warn(...args) => void[Synchronous] Logs a warning if debug mode is enabled. Replaces console.warn.
webPartContextWebPartContextCurrent Web Part context from SPFx.