Skip to content

Commit

Permalink
Interactivity API: Add types for warn helper. (#61687)
Browse files Browse the repository at this point in the history
* Add types

* Type constant file
  • Loading branch information
cbravobernal authored May 15, 2024
1 parent 9d62bde commit eb67023
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion packages/interactivity/src/constants.js

This file was deleted.

1 change: 1 addition & 0 deletions packages/interactivity/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const directivePrefix: string = 'wp';
4 changes: 2 additions & 2 deletions packages/interactivity/src/utils/warn.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const logged = new Set();
const logged: Set< string > = new Set();

export const warn = ( message ) => {
export const warn = ( message: string ): void => {
// @ts-expect-error
if ( typeof SCRIPT_DEBUG !== 'undefined' && SCRIPT_DEBUG === true ) {
if ( logged.has( message ) ) {
Expand Down

0 comments on commit eb67023

Please sign in to comment.