feat: Add types for partial attributes (#1862)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import "./src/types.ts";
|
||||
export * from "./src/runtime/utils.ts";
|
||||
export * from "./src/runtime/head.ts";
|
||||
export * from "./src/runtime/csp.ts";
|
||||
|
||||
@@ -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>;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ export default function AppLayout({ Component }: AppProps) {
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>fresh title</title>
|
||||
</head>
|
||||
<body f-client-nav="true">
|
||||
<body f-client-nav>
|
||||
<Partial name="body">
|
||||
<Fader>
|
||||
<Component />
|
||||
|
||||
@@ -10,7 +10,7 @@ export default function AppLayout({ Component }: AppProps) {
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>fresh title</title>
|
||||
</head>
|
||||
<body f-client-nav="false">
|
||||
<body f-client-nav={false}>
|
||||
<Partial name="body">
|
||||
<Fader>
|
||||
<Component />
|
||||
|
||||
Reference in New Issue
Block a user