API models into own TS module

This commit is contained in:
Jörn-Michael Miehe 2023-09-12 16:39:18 +00:00
parent 4e1a9fa10d
commit d1e2648f5f
2 changed files with 29 additions and 29 deletions

View file

@ -137,39 +137,11 @@
</template>
<script lang="ts">
import { ConfigModel, DayPartModel } from "@/lib/api";
import { Options, Vue } from "vue-class-component";
import BulmaDrawer from "./bulma/Drawer.vue";
interface ConfigModel {
puzzle: {
solution: string;
begin: string;
end: string;
closing: string;
seed: string;
};
calendar: {
config_file: string;
background: string;
};
image: {
size: number;
border: number;
fonts: { file: string; size: number }[];
};
webdav: {
url: string;
cache_ttl: number;
config_file: string;
};
}
interface DayPartModel {
day: number;
part: string;
}
@Options({
components: {
BulmaDrawer,

28
ui/src/lib/api.ts Normal file
View file

@ -0,0 +1,28 @@
export interface ConfigModel {
puzzle: {
solution: string;
begin: string;
end: string;
closing: string;
seed: string;
};
calendar: {
config_file: string;
background: string;
};
image: {
size: number;
border: number;
fonts: { file: string; size: number }[];
};
webdav: {
url: string;
cache_ttl: number;
config_file: string;
};
}
export interface DayPartModel {
day: number;
part: string;
}