feat: Add types for partial attributes (#1862)

This commit is contained in:
Marvin Hagemeister
2023-10-05 11:02:47 +02:00
committed by GitHub
parent fd235e877c
commit fd4a2b99ef
5 changed files with 25 additions and 2 deletions
+21
View File
@@ -0,0 +1,21 @@
export interface SignalLike<T> {
value: T;
peek(): T;
subscribe(fn: (value: T) => void): () => void;
}
declare global {
namespace preact.createElement.JSX {
interface HTMLAttributes {
/**
* Alternative url to fetch partials from on `<a>` or `<form>` tags
*/
"f-partial"?: string | SignalLike<string>;
/**
* Enable or disable client side navigation and partials for this
* particular node and its children.
*/
"f-client-nav"?: boolean | SignalLike<boolean>;
}
}
}