chore(refactor): move and re-organise types folder

This commit is contained in:
Paul Makles
2022-06-10 14:11:38 +01:00
parent ebcbe4bd4b
commit e0ca1681bd
53 changed files with 78 additions and 102 deletions

View File

@@ -1,4 +0,0 @@
import { VNode } from "preact";
export type Child = VNode | string | number | boolean | undefined | null;
export type Children = Child | Child[] | Children[];

10
src/types/env.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
interface ImportMetaEnv {
DEV: boolean;
VITE_API_URL: string;
VITE_THEMES_URL: string;
BASE_URL: string;
}
interface ImportMeta {
env: ImportMetaEnv;
}

30
src/types/native.d.ts vendored Normal file
View File

@@ -0,0 +1,30 @@
type Build = "stable" | "nightly" | "dev";
type NativeConfig = {
frame: boolean;
build: Build;
discordRPC: boolean;
minimiseToTray: boolean;
hardwareAcceleration: boolean;
};
declare interface Window {
isNative?: boolean;
nativeVersion: string;
native: {
min();
max();
close();
reload();
relaunch();
getConfig(): NativeConfig;
set(key: keyof NativeConfig, value: unknown);
getAutoStart(): Promise<boolean>;
enableAutoStart(): Promise<void>;
disableAutoStart(): Promise<void>;
};
}
declare const Fragment = preact.Fragment;

13
src/types/preact.d.ts vendored Normal file
View File

@@ -0,0 +1,13 @@
/* eslint-disable */
import JSX = preact.JSX;
declare type Child =
| JSX.Element
| preact.VNode
| string
| number
| boolean
| undefined
| null;
declare type Children = Child | Child[] | Children[];

1
src/types/vite-env.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
/// <reference types="vite/client" />