aboutsummaryrefslogtreecommitdiff
path: root/src/preact.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/preact.d.ts')
-rw-r--r--src/preact.d.ts21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/preact.d.ts b/src/preact.d.ts
index 2dd8299a9..784844152 100644
--- a/src/preact.d.ts
+++ b/src/preact.d.ts
@@ -4,8 +4,14 @@ declare namespace preact {
key?:string;
}
+ interface DangerouslySetInnerHTML {
+ __html: string;
+ }
+
interface PreactHTMLAttributes {
+ dangerouslySetInnerHTML?:DangerouslySetInnerHTML;
key?:string;
+ ref?:(el?: Element) => void;
}
interface VNode {
@@ -51,8 +57,8 @@ declare namespace preact {
abstract render(props:PropsType & ComponentProps, state:any):JSX.Element;
}
- function h<PropsType>(node:ComponentConstructor<PropsType, any>, params:PropsType, ...children:(JSX.Element|string)[]):JSX.Element;
- function h(node:string, params:JSX.HTMLAttributes&JSX.SVGAttributes, ...children:(JSX.Element|string)[]):JSX.Element;
+ function h<PropsType>(node:ComponentConstructor<PropsType, any>, params:PropsType, ...children:(JSX.Element|JSX.Element[]|string)[]):JSX.Element;
+ function h(node:string, params:JSX.HTMLAttributes&JSX.SVGAttributes&{[propName: string]: any}, ...children:(JSX.Element|JSX.Element[]|string)[]):JSX.Element;
function render(node:JSX.Element, parent:Element, merge?:boolean):Element;
@@ -72,6 +78,11 @@ declare module "preact" {
export = preact;
}
+declare module "preact/devtools" {
+ // Empty. This module initializes the React Developer Tools integration
+ // when imported.
+}
+
declare namespace JSX {
interface Element extends preact.VNode {
@@ -277,8 +288,8 @@ declare namespace JSX {
charSet?:string;
challenge?:string;
checked?:boolean;
- class?:string;
- className?:string;
+ class?:string | { [key:string]: boolean };
+ className?:string | { [key:string]: boolean };
cols?:number;
colSpan?:number;
content?:string;
@@ -551,4 +562,4 @@ declare namespace JSX {
tspan:SVGAttributes;
use:SVGAttributes;
}
-}
+} \ No newline at end of file