forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal.d.ts
More file actions
93 lines (90 loc) · 3.39 KB
/
global.d.ts
File metadata and controls
93 lines (90 loc) · 3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import * as preact from 'preact';
// also modified
// node_modules/preact/src/index.d.ts
/*
export interface VNode<P = {}> {
type: ComponentType<P> | string;
props: P & any;
export function cloneElement(
vnode: ComponentChild,
props?: any,
...children: ComponentChildren[]
): VNode<any>;
*/
// node_modules/preact/compat/src/index.d.ts
/*
export function createPortal(
vnode: preact.ComponentChild,
container: Element | DocumentFragment
): preact.VNode<any>;
*/
declare module 'react' {
// // https://github.com/preactjs/preact/issues/4114#issuecomment-1690930689
interface HTMLProps<T> extends preact.JSX.HTMLAttributes<T> {
icon?: string | undefined | preact.SignalLike<string | undefined> | preact.ComponentChild;
role?: preact.JSX.AriaRole | undefined | preact.SignalLike<preact.JSX.AriaRole | undefined>;
};
type AriaRole = preact.JSX.AriaRole;
type JSXElementConstructor<P> =
| ((props: P) => ReactElement<any, any> | null)
| (new (props: P) => Component<any, any>);
interface ButtonHTMLAttributes<T = any> extends preact.JSX.HTMLAttributes<T> {};
interface ImgHTMLAttributes<T = any> extends preact.JSX.HTMLAttributes<T> {};
interface InputHTMLAttributes<T = any> extends preact.JSX.HTMLAttributes<T> {};
interface OlHTMLAttributes<T> extends HTMLAttributes<T> {
reversed?: boolean | undefined;
start?: number | undefined;
type?: '1' | 'a' | 'A' | 'i' | 'I' | undefined;
};
interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
value?: string | ReadonlyArray<string> | number | undefined;
}
type ReactText = string | number;
type ComponentType<P = {}> = preact.ComponentType<P>;
type ElementType<P = any> =
{
[K in keyof preact.JSX.IntrinsicElements]: P extends preact.JSX.IntrinsicElements[K] ? K : never
}[keyof preact.JSX.IntrinsicElements] |
ComponentType<P>;
// interface VNode<P = {}> extends preact.VNode<P> {
// props: P & {
// children: preact.ComponentChildren;
// className: string;
// };
// }
type LegacyRef<T> = string | Ref<T>;
// interface ReactElement<P = any, T = any> extends preact.VNode<P> {};
interface ReactElement<P = any, T extends string | JSXElementConstructor<any> = string | JSXElementConstructor<any>> {
type: T;
props: P;
key: Key | null;
}
type MouseEvent<T = any, E = any> = any;
type KeyboardEvent<T = any, E = any> = any;
type DragEvent<T = any, E = any> = any;
type FormEvent<T = any> = any;
type TouchEvent<T = any> = any;
type FocusEvent<T = any> = any;
type SyntheticEvent<T = any> = any;
type TransitionEvent<T = any> = any;
type ClipboardEvent<T = any> = any;
type TargetedEvent<
Target extends EventTarget = EventTarget,
TypedEvent extends Event = Event
> = preact.JSX.TargetedEvent & {
nativeEvent: any;
}
type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>;
type TargetedTransitionEvent<Target extends EventTarget> =
TargetedEvent<Target, TransitionEvent> & {
nativeEvent: any;
};
type TransitionEventHandler<T = Element> = EventHandler<TransitionEvent<T>>;
type SetStateAction<S> = S | ((prevState: S) => S);
type HTMLAttributeAnchorTarget =
| '_self'
| '_blank'
| '_parent'
| '_top'
| (string & {});
}