-
Notifications
You must be signed in to change notification settings - Fork 0
/
env.d.ts
43 lines (38 loc) · 961 Bytes
/
env.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
/// <reference types="vite/client" />
/// <reference types="@remix-run/node" />
import { type Env } from 'onnxruntime-web';
import { type O } from 'ts-toolbelt';
// Add custom CSS properties
// @see https://github.com/frenic/csstype#what-should-i-do-when-i-get-type-errors
declare module 'csstype' {
interface Properties {
// Allow any CSS variable
[index: `--${string}`]: any;
}
}
// declare type Env for `window.onnx`
declare global {
interface Window {
onnx?: O.Partial<
{
env: Env;
},
'deep'
>;
ENV: {
URL: string;
VERCEL_URL: string;
};
}
}
type Getters = {
[Property in keyof Getters as `data-${K}`]: DataAttributes[K];
};
type DataAttributes = {
[K in keyof DataAttributes as `data-${K}`]: DataAttributes[K];
};
declare module 'react' {
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
[key: `data-${string}`]: boolean | string | undefined;
}
}