Skip to content

[Docs] Link WindowEventMap definition in window events docs#9777

Open
MannXo wants to merge 3 commits into
elastic:mainfrom
MannXo:docs/9729-window-event-map-link
Open

[Docs] Link WindowEventMap definition in window events docs#9777
MannXo wants to merge 3 commits into
elastic:mainfrom
MannXo:docs/9729-window-event-map-link

Conversation

@MannXo

@MannXo MannXo commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #9729

The EuiWindowEvent event prop is typed as keyof WindowEventMap, so the props table only ever showed that raw type name without explaining what it means or where to find the valid values. This adds a short sentence linking WindowEventMap to its actual definition so readers can find the exact accepted event names.

Note: WindowEventMap is a TypeScript-only interface (not a documented Web API), so there's no MDN page for it — the link points to the interface definition in the TypeScript repo, pinned to the typescript version EUI currently depends on (5.8.3) so the link stays accurate.

API Changes

N/A — docs-only change.

Screenshots

Before After
before-full after-9729-working

Impact Assessment

  • 🔴 Breaking changes
  • 💅 Visual changes
  • 🧪 Test impact
  • 🔧 Hard to integrate

Impact level: 🟢 None

Release Readiness

  • Documentation: Window events
  • Figma
  • Migration guide
  • Adoption plan

QA instructions for reviewer

  • Open the Window events docs page and confirm the new sentence renders correctly under "Basic example: closing a modal on escape"
  • Confirm the WindowEventMap link resolves to the TypeScript interface definition

Checklist before marking Ready for Review

  • Filled out all sections above
  • QA: Tested light/dark modes, high contrast, mobile, Chrome/Safari/Edge/Firefox, keyboard-only, screen reader
  • QA: Tested in CodeSandbox and Kibana
  • QA: Tested docs changes
  • Tests: Added/updated Jest, Cypress, and VRT
  • Changelog: Added changelog entry (docs-only change per changelogs.mdskip-changelog label requested, see comment below; I don't have permission to self-apply it)
  • Breaking changes

Reviewer checklist

  • Approved Impact Assessment — Acceptable to merge given the consumer impact.
  • Approved Release Readiness — Docs, Figma, and migration info are sufficient to ship.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

👋 Since this is a community submitted pull request, a Buildkite build has not been started automatically. Would an Elastic organization member please verify the contents of this pull request and kick off a build manually?

@github-actions github-actions Bot added the community contribution (Don't delete - used for automation) label Jul 3, 2026
@MannXo MannXo marked this pull request as ready for review July 3, 2026 09:53
@MannXo MannXo requested a review from a team as a code owner July 3, 2026 09:53
@MannXo

MannXo commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

This is a documentation-only change to packages/website/docs/, which per changelogs.md doesn't need a changelog entry. Could a maintainer add the skip-changelog label to bypass the CI check? I don't have permission to add labels myself as a community contributor.

@weronikaolejniczak weronikaolejniczak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MannXo Instead of adding the link directly in the content, I would add a JSDoc comment for event which will automatically propagate to the prop table in the documentation.

interface Props<Ev extends EventNames> {
event: Ev;
handler: (this: Window, ev: WindowEventMap[Ev]) => any;
}

MannXo and others added 2 commits July 3, 2026 22:21
Replace markdown link syntax with plain text to avoid docgen parser issues.
The docgen tool automatically creates links for recognized TypeScript types
like WindowEventMap without needing explicit markdown syntax.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@MannXo

MannXo commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@MannXo Instead of adding the link directly in the content, I would add a JSDoc comment for event which will automatically propagate to the prop table in the documentation.

interface Props<Ev extends EventNames> {
event: Ev;
handler: (this: Window, ev: WindowEventMap[Ev]) => any;
}

Reflected. see updated screenshot in the PR description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community contribution (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs] Add a link to the definition of WindowEventMap

2 participants