
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
I couldn't find a framework-agnostic version of typed-htmx, so I made this one!
Exposes types for all of the HTMX attributes and event handlers.
Also populates the global htmx object with all of its top-level functions and config.
Create a types.d.ts or shims.d.ts (or add to your existing one) and override your framework HTML types.
import type { HtmxAttributes, HtmxEvents } from "htmx-types";
type MarkoHtmxEvents = { [K in keyof HtmxEvents as `on-${K}`]: HtmxEvents[K] };
declare global {
namespace Marko {
interface HTMLAttributes extends HtmxAttributes, MarkoHtmxEvents {}
}
}
[!NOTE] Since Astro templates are server-only they don't have event handling attributes built-in
import type { HtmxAttributes } from "htmx-types";
declare global {
namespace astroHTML.JSX {
interface HTMLAttributes extends HtmxAttributes {}
}
}
[!NOTE] I couldn't get
on:htmx:footo work in Solid so I left it out. Is this a parser bug?
import type { HtmxAttributes } from "htmx-types";
declare module "solid-js" {
namespace JSX {
interface HTMLAttributes<T> extends HtmxAttributes {}
}
}
I didn't test with any other frameworks, but this should work with anything you plug it in to! Please send a PR if you end up using it for something else 😁.
FAQs
TypeScript definitions for HTMX attributes and event handlers
The npm package htmx-types receives a total of 115 weekly downloads. As such, htmx-types popularity was classified as not popular.
We found that htmx-types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.