1
0
Fork 0
mirror of https://github.com/Findus23/RadioStats.git synced 2024-09-19 16:03:48 +02:00

WIP typescript

This commit is contained in:
Lukas Winkler 2023-08-19 22:15:36 +02:00
parent 16e7b90d44
commit e12beb778d
Signed by: lukas
GPG key ID: 54DE4D798D244853
13 changed files with 58 additions and 15 deletions

13
web/custom.d.ts vendored Normal file
View file

@ -0,0 +1,13 @@
import "vite/client"
declare module "*.svg" {
const content: string;
export default content;
}
declare module "*.png" {
const content: string;
export default content;
}
declare module '*.vue';

3
web/env.d.ts vendored Normal file
View file

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

View file

@ -7,6 +7,6 @@
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/index.js"></script>
<script type="module" src="/src/index.ts"></script>
</body>
</html>

7
web/package-lock.json generated
View file

@ -20,6 +20,7 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.0.0",
"@vue/tsconfig": "^0.4.0",
"sass": "^1.58.0",
"typescript": "^4.9.5",
"vite": "^4.1.1",
@ -814,6 +815,12 @@
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.47.tgz",
"integrity": "sha512-BHGyyGN3Q97EZx0taMQ+OLNuZcW3d37ZEVmEAyeoA9ERdGvm9Irc/0Fua8SNyOtV1w6BS4q25wbMzJujO9HIfQ=="
},
"node_modules/@vue/tsconfig": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/@vue/tsconfig/-/tsconfig-0.4.0.tgz",
"integrity": "sha512-CPuIReonid9+zOG/CGTT05FXrPYATEqoDGNrEaqS4hwcw5BUNM2FguC0mOwJD4Jr16UpRVl9N0pY3P+srIbqmg==",
"dev": true
},
"node_modules/any-base": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/any-base/-/any-base-1.1.0.tgz",

View file

@ -22,6 +22,7 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.0.0",
"@vue/tsconfig": "^0.4.0",
"sass": "^1.58.0",
"typescript": "^4.9.5",
"vite": "^4.1.1",

View file

@ -4,13 +4,14 @@
</div>
</template>
<script>
<script lang="ts">
// import "./node_modules/normalize.css/normalize.css"
import {defineComponent} from 'vue'
export default {
export default defineComponent({
name: 'app',
props: ["language"],
};
});
</script>
<style lang="scss">

View file

@ -28,10 +28,11 @@
</div>
</template>
<script>
<script lang="ts">
import axios from "axios";
import moment from "moment";
import "moment/locale/de-at";
import {defineComponent} from 'vue'
if (import.meta.env.PROD) {
axios.defaults.headers.common['X-Requested-With'] = "XMLHttpRequest";
@ -39,7 +40,7 @@
const baseURL = "/api/";
export default {
export default defineComponent({
name: "detailview",
data() {
return {
@ -77,7 +78,7 @@
return this.songs[this.$route.params.songId];
},
}
};
});
</script>
<style lang="scss">

View file

@ -6,12 +6,13 @@
</footer>
</template>
<script>
export default {
<script lang="ts">
import {defineComponent} from 'vue'
export default defineComponent({
name: "info",
props: ["color"],
};
});
</script>
<style lang="scss">

View file

@ -96,7 +96,7 @@
</div>
</template>
<script>
<script lang="ts">
import axios from "axios";
import moment from "moment";
import "moment/locale/de-at";
@ -104,6 +104,7 @@ import Datepicker from 'vue3-datepicker';
import { deAT } from 'date-fns/locale'
import Info from "./Info.vue";
import {icon} from "./utils";
import {defineComponent} from 'vue'
if (import.meta.env.PROD) {
axios.defaults.headers.common['X-Requested-With'] = "XMLHttpRequest";
@ -111,7 +112,7 @@ if (import.meta.env.PROD) {
const baseURL = "/api/";
export default {
export default defineComponent({
components: {Datepicker, Info},
name: 'list',
data() {
@ -310,7 +311,7 @@ export default {
this.getChannels();
this.updateSelection();
}
};
});
</script>
<style lang="scss">

View file

@ -17,7 +17,7 @@ import vbg from "./icons/vbg.png"
import wie from "./icons/wie.png"
export function icon(id) {
export function icon(id:string) {
switch (id) {
case "886":
return aas

15
web/tsconfig.json Normal file
View file

@ -0,0 +1,15 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
// this enables stricter inference for data properties on `this`
"strict": true,
"jsx": "preserve",
"moduleResolution": "node",
"isolatedModules": true,
"types": [
"vite/client"
],
"skipLibCheck": true
}
}