Skip to content

Commit

Permalink
Add event documentation and disable ESLint rule
Browse files Browse the repository at this point in the history
Updated `SpecificEventMap` with comments describing new event key-value pairs, aiding comprehensibility of 'common-window-classes' and 'result'. Disabled ESLint naming convention rule to preserve compatibility with TypeScript configurations.
  • Loading branch information
PxaMMaxP committed Aug 18, 2024
1 parent 2bb5eb9 commit 469cc3e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/libs/DIComponent/types/EventTypes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { IDIComponent } from '../interfaces/IDIComponent';

/**
Expand Down Expand Up @@ -28,9 +29,17 @@ export type EventRegistry = Record<EventKey, (EventCallback | undefined)[]>;
export type InjectDelegate = (ctx: IDIComponent & unknown) => void;

export type SpecificEventMap = {
// eslint-disable-next-line @typescript-eslint/naming-convention
/**
* All indipendent Windows should have this classes.
* The parent will emit this event to all children
* after the parent and children are loaded.
*/
'common-window-classes': [string[]];
inject: [InjectDelegate];
/**
* A child can emit this event to the parent with the
* key of the result and the result itself.
*/
result: [string, unknown];
};

export type SpecificEventCallback<K extends keyof SpecificEventMap> = (
Expand Down

0 comments on commit 469cc3e

Please sign in to comment.