UNPKG

@mikezimm/fps-core-v7

Version:

Library of reusable core interfaces, types and constants migrated from fps-library-v2

65 lines (50 loc) 2 kB
/** * 2024-09-07: Migrated from the same folder in fps-library-v2/banner/features/WebPartHistory/... */ /** * To use this feature: * Apply these changes * * ## Copy this to main WebpartProperties import { IWebpartHistory } from '@mikezimm/npmfunctions/dist/Services/PropPane/WebPartHistory'; //ADDED FOR WEBPART HISTORY: webpartHistory: IWebpartHistory; ## Copy this to main WebpartProperties //Add this to MAIN WEBPART.ts import { IWebpartHistory, IWebpartHistoryItem, createWebpartHistory, updateWebpartHistory } from '@mikezimm/npmfunctions/dist/Services/PropPane/WebPartHistory'; //ADDED FOR WEBPART HISTORY: - // === TO main webpart class private thisHistoryInstance: IWebpartHistoryItem = null; //ADDED FOR WEBPART HISTORY: This sets the webpartHistory - // === TO END OF onInit function this.thisHistoryInstance = createWebpartHistory( 'onInit' , 'new', this.context.pageContext.user.displayName ); let priorHistory : IWebpartHistoryItem[] = this.properties.webpartHistory ? this.properties.webpartHistory.history : []; this.properties.webpartHistory = { thisInstance: this.thisHistoryInstance, history: priorHistory, }; //ADDED FOR WEBPART HISTORY: This sets the webpartHistory // === TO PropertyPaneChanged this.properties.webpartHistory = updateWebpartHistory( this.properties.webpartHistory , propertyPath , newValue, this.context.pageContext.user.displayName ); */ export interface IPropChange { prop: string; value: string; } export interface IWebpartHistoryItem2 { time: string; user: string; changes: IPropChange[]; } export interface IWebpartHistoryItem1 { time: string; user: string; fields: string[]; newValues: string[]; } export interface IWebpartHistory { thisInstance: IWebpartHistoryItem2; history: IWebpartHistoryItem2[]; } //# sourceMappingURL=Interface.d.ts.map