mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-12-24 13:33:00 +00:00
remove ": void"
This commit is contained in:
parent
2052efedd9
commit
4fe8bf1847
5 changed files with 13 additions and 13 deletions
|
@ -48,7 +48,7 @@ export default class App extends Vue {
|
|||
image_modal: ImageModal;
|
||||
};
|
||||
|
||||
public mounted(): void {
|
||||
public mounted() {
|
||||
this.$advent22.api_get_string("days/date", (date: string) => {
|
||||
this.date = date;
|
||||
});
|
||||
|
@ -61,7 +61,7 @@ export default class App extends Vue {
|
|||
);
|
||||
}
|
||||
|
||||
private open_calendar_door(image_src: string): void {
|
||||
private open_calendar_door(image_src: string) {
|
||||
this.$refs.image_modal.show_src(image_src);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ export default class CalendarDoor extends Vue {
|
|||
return this.$advent22.api_url("days/image/" + this.day);
|
||||
}
|
||||
|
||||
private on_click(): void {
|
||||
private on_click() {
|
||||
this.$advent22.api_get_blob("days/image/" + this.day, (data) => {
|
||||
this.$emit("openDoor", data);
|
||||
});
|
||||
|
|
|
@ -17,17 +17,17 @@ export default class ImageModal extends Vue {
|
|||
private active = false;
|
||||
public image_src = "";
|
||||
|
||||
public created(): void {
|
||||
public created() {
|
||||
window.addEventListener("keydown", (e) => {
|
||||
if (e.key == "Escape") this.set_active(false);
|
||||
});
|
||||
}
|
||||
|
||||
public set_active(state: boolean): void {
|
||||
public set_active(state: boolean) {
|
||||
this.active = state;
|
||||
}
|
||||
|
||||
public show_src(src: string): void {
|
||||
public show_src(src: string) {
|
||||
this.image_src = src;
|
||||
this.set_active(true);
|
||||
}
|
||||
|
|
|
@ -44,20 +44,20 @@ export default class LoginModal extends Vue {
|
|||
private username = "";
|
||||
private password = "";
|
||||
|
||||
public created(): void {
|
||||
public created() {
|
||||
window.addEventListener("keydown", (e) => {
|
||||
if (e.key == "Escape") this.set_active(false);
|
||||
});
|
||||
}
|
||||
|
||||
public set_active(state: boolean): void {
|
||||
public set_active(state: boolean) {
|
||||
this.active = state;
|
||||
|
||||
this.username = "";
|
||||
this.password = "";
|
||||
}
|
||||
|
||||
private submit(): void {
|
||||
private submit() {
|
||||
this.$advent22.set_api_auth(this.username, this.password);
|
||||
this.set_active(false);
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ export class Advent22 {
|
|||
endpoint: string,
|
||||
on_success: (data: T) => void,
|
||||
responseType: ResponseType = "json",
|
||||
): void {
|
||||
) {
|
||||
const req_data = {
|
||||
auth: this.api_auth,
|
||||
responseType: responseType,
|
||||
|
@ -60,7 +60,7 @@ export class Advent22 {
|
|||
public api_get_blob(
|
||||
endpoint: string,
|
||||
on_success: (data: string) => void,
|
||||
): void {
|
||||
) {
|
||||
this.api_get<Blob>(
|
||||
endpoint,
|
||||
(data: Blob) => {
|
||||
|
@ -81,7 +81,7 @@ export class Advent22 {
|
|||
public api_get_string(
|
||||
endpoint: string,
|
||||
on_success: (data: string) => void,
|
||||
): void {
|
||||
) {
|
||||
this.api_get<string>(
|
||||
endpoint,
|
||||
(data: string) => {
|
||||
|
@ -93,7 +93,7 @@ export class Advent22 {
|
|||
public api_get_number(
|
||||
endpoint: string,
|
||||
on_success: (data: number) => void,
|
||||
): void {
|
||||
) {
|
||||
this.api_get<number>(
|
||||
endpoint,
|
||||
(data: number) => {
|
||||
|
|
Loading…
Reference in a new issue