Add TypeScript definitions and documentation for injected plugin libraries #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Plugin developers and AI assistants lack visibility into libraries automatically injected by the FDO host (
plugin_host.htmlandPluginPage.jsx). This causes developers to miss available functionality and re-implement existing features.Changes
Type Definitions (
src/index.ts)Added complete TypeScript interfaces for injected libraries:
NotyfConstructor,Notyf,NotyfOptions,NotyfNotificationHighlightJS,HighlightResultAceAjax.Ace,AceAjax.Editor,AceAjax.EditSessionWindow helpers already had types; now library globals are also typed.
Documentation
docs/INJECTED_LIBRARIES.md- API reference for all injected CSS/JS libraries and window helpers with examplesdocs/QUICK_REFERENCE.md- Quick lookup for common patternsexamples/07-injected-libraries-demo.ts- Live demo of all injected functionalityLibraries Documented
CSS: Pure CSS, Highlight.js, Notyf
JavaScript: FontAwesome, Split Grid, Highlight.js, Notyf, ACE Editor, Goober
Window Helpers:
createBackendReq,waitForElement,executeInjectedScript,addGlobalEventListener,removeGlobalEventListener,applyClassToSelectorExample Usage
Developers now get IntelliSense for all injected globals and can reference docs to discover available functionality.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.