0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-17 22:44:24 -05:00

Adds auto completion of astro: events when adding or removing event listeners on document (#10263)

This commit is contained in:
Martin Trapp 2024-02-28 16:52:08 +01:00 committed by GitHub
parent f6fc18cc61
commit 9bdbed723e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
"astro": patch
---
Adds auto completion for `astro:` event names when adding or removing event listeners on `document`.

View file

@ -36,6 +36,7 @@ import type {
import type { AstroComponentFactory, AstroComponentInstance } from '../runtime/server/index.js';
import type { DeepPartial, OmitIndexSignature, Simplify } from '../type-utils.js';
import type { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from './../core/constants.js';
import type { TransitionBeforePreparationEvent, TransitionBeforeSwapEvent } from '../transitions/events.js';
export { type AstroIntegrationLogger };
@ -2831,11 +2832,16 @@ declare global {
'astro-dev-overlay-icon': DevToolbarIcon;
'astro-dev-overlay-card': DevToolbarCard;
}
}
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Config {
type Database = Record<string, any>;
}
interface DocumentEventMap {
'astro:before-preparation': TransitionBeforePreparationEvent;
'astro:after-preparation': Event;
'astro:before-swap': TransitionBeforeSwapEvent;
'astro:after-swap': Event;
'astro:page-load': Event;
}
}