Skip to content

Commit

Permalink
fix: add typings for the htmx preload extension
Browse files Browse the repository at this point in the history
  • Loading branch information
garrappachc committed Dec 10, 2024
1 parent 53e9053 commit b9fbf18
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/angry-news-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@kitajs/html': patch
---

add typings for the htmx preload extension
23 changes: 23 additions & 0 deletions packages/html/htmx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,15 @@ declare namespace Htmx {
* @see https://htmx.org/extensions/morphdom-swap/
*/
morphdom: 'morphdom';

/**
* Support for the [preload](https://htmx.org/extensions/preload/) extension.
*
* CDN: https://unpkg.com/htmx-ext-preload@2.0.1/preload.js
*
* @see https://htmx.org/extensions/preload/
*/
preload: 'preload';
}

/** Definitions for htmx attributes up to 1.9.3. */
Expand Down Expand Up @@ -521,6 +530,20 @@ declare namespace Htmx {
*/
'hx-head'?: 'merge' | 'append' | 're-eval';

/**
* Configures strategy of preloading the given resource.
*
* @see https://htmx.org/extensions/preload/
*/
preload?: 'mousedown' | 'mouseover' | 'preload:init' | AnyStr;

/**
* Enables preloading linked image resources.
*
* @see https://htmx.org/extensions/preload/
*/
'preload-images'?: boolean;

/**
* Hyperscript expression
*
Expand Down

0 comments on commit b9fbf18

Please sign in to comment.