Skip to content

Commit

Permalink
Improve typing
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Apr 18, 2024
1 parent 4c183bd commit 6a58170
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions packages/interactivity/src/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ const getGlobalEventDirective =
} );
};

/**
* @augments {Component<import('./hooks').DirectiveArgs>}
*/
class IgnoredComponent extends Component {
shouldComponentUpdate() {
return false;
Expand Down Expand Up @@ -461,8 +464,8 @@ export default () => {
} );

// data-wp-ignore
directive( 'ignore', ( props ) => {
return <IgnoredComponent { ...props } />;
directive( 'ignore', ( args ) => {
return <IgnoredComponent { ...args } />;
} );

// data-wp-text
Expand Down
4 changes: 2 additions & 2 deletions packages/interactivity/src/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface DirectiveEntry {

type DirectiveEntries = Record< string, DirectiveEntry[] >;

interface DirectiveArgs {
export interface DirectiveArgs {
/**
* Object map with the defined directives of the element being evaluated.
*/
Expand Down Expand Up @@ -347,7 +347,7 @@ const Directives = ( {
);

const props = { ...originalProps, children };
const directiveArgs = {
const directiveArgs: DirectiveArgs = {
directives,
props,
element,
Expand Down

0 comments on commit 6a58170

Please sign in to comment.