One optional Sheetwrite package. Each add-on package exports a factory
named <name>Addon that returns this object; hosts pass it to
initSheetwrite({ addons }).
setup runs once, in list order, after the engine loads. grid runs after
each later createGrid call, in the same order, and the cleanup it returns
runs when that grid is destroyed. Both hooks are synchronous and should
stay small: an add-on loads its heavy code on first use.
interface SheetwriteAddonContext {
charts(parts: SheetwriteChartParts): void;
xlsx(parts: SheetwriteXlsxParts): void;
}interfaceSheetwriteAddonContext{charts(parts:SheetwriteChartParts):void;xlsx(parts:SheetwriteXlsxParts):void;}interfaceSheetwriteAddonContext{charts(parts:SheetwriteChartParts,):void;xlsx(parts:SheetwriteXlsxParts,):void;}Page-wide registration methods. An add-on gets them in setup and may keep them, for example to replace a lazy part with the loaded one.API referenceinterface SheetwriteAddonGridContext<Settings> {
readonly grid: Grid;
readonly settings: Settings | undefined;
queryCommands(commands: QueryCommands): () => void;
historyCommand(command: (action: "open" | "save") => void): void;
formulaSuggestions(suggester: FormulaSuggester): () => void;
}interfaceSheetwriteAddonGridContext<Settings>{readonlygrid:Grid;readonlysettings:Settings|undefined;queryCommands(commands:QueryCommands):()=>void;historyCommand(command:(action:"open"|"save")=>void):void;formulaSuggestions(suggester:FormulaSuggester):()=>void;}interfaceSheetwriteAddonGridContext<Settings,>{readonlygrid:Grid;readonlysettings:Settings|undefined;queryCommands(commands:QueryCommands,):()=>void;historyCommand(command:(action:"open"|"save",)=>void,):void;formulaSuggestions(suggester:FormulaSuggester,):()=>void;}One new grid, with the settings it was created with for one add-on.API reference