-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
43 lines (38 loc) · 1.21 KB
/
index.d.ts
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
import { SetupWorker } from 'msw';
import 'solid-js';
import { MyCounterProps } from './src/lib/wc/MyCounter.constant';
import { ClickOutsideDirectiveParams } from './src/modules/shared/directives/clickOutside.directive';
declare global {
interface Window {
msw: {
worker: SetupWorker;
};
}
interface HTMLElementTagNameMap {
'my-counter': MyCounterProps;
}
}
declare module 'solid-js' {
namespace JSX {
interface Directives {
form: true;
clickOutside: ClickOutsideDirectiveParams;
// autoAnimate: Partial<AutoAnimateOptions> | AutoAnimationPlugin | true;
}
// add custom element to global elements list
// interface IntrinsicElements {
// 'my-counter': HTMLAttributes<HTMLDivElement> & {
// 'initial-count': string;
// };
// }
// Prefixes all properties with `attr:` to match Solid's property setting syntax
type Props<T> = {
[K in keyof T as `attr:${string & K}`]?: T[K];
};
type ElementProps<T> = {
// Add both the element's prefixed properties and the attributes
[K in keyof T]: Props<T[K]> & HTMLAttributes<T[K]>;
};
interface IntrinsicElements extends ElementProps<HTMLElementTagNameMap> {}
}
}