mirror of
https://github.com/tuna/mirror-web.git
synced 2025-12-25 20:32:46 +00:00
Add ts typing shims for vite virtual modules
Signed-off-by: Harry Chen <i@harrychen.xyz>
This commit is contained in:
parent
a623fb07e0
commit
a6abff588d
|
|
@ -1,5 +1,4 @@
|
|||
import "../styles/global.scss";
|
||||
// @ts-ignore
|
||||
import { suffix as siteSuffix } from "virtual:jekyll-config";
|
||||
import { load as loadWebFont } from "webfontloader";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
import {
|
||||
hide_mirrorz as HideMirrorZ,
|
||||
hostname as SiteHostname,
|
||||
mirrorz_help_link as MirrorzHelpLink, // @ts-ignore
|
||||
mirrorz_help_link as MirrorzHelpLink,
|
||||
} from "virtual:jekyll-config";
|
||||
// @ts-ignore
|
||||
import { options as globalOptions } from "virtual:jekyll-data";
|
||||
import hljs from "../lib/hljs";
|
||||
import Mark from "markup-js";
|
||||
|
|
@ -59,8 +58,8 @@ Array.from(document.querySelectorAll("select.content-select")).map((el) => {
|
|||
});
|
||||
|
||||
document.getElementById("help-select").addEventListener("change", (ev) => {
|
||||
let help_url =
|
||||
(ev.target as Element).querySelector("option:checked").attributes["data-help-url"].value;
|
||||
let help_url = (ev.target as Element).querySelector("option:checked")
|
||||
.attributes["data-help-url"].value;
|
||||
window.location.assign(
|
||||
`${window.location.protocol}//${window.location.host}${help_url}`,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import "./default";
|
||||
import "../styles/notfound.scss";
|
||||
// @ts-ignore
|
||||
import { issue_tag as IssueTag } from "virtual:jekyll-config";
|
||||
|
||||
const tag = `[${IssueTag}]`;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { TUNASYNC_JSON_PATH } from "../lib/consts";
|
||||
// @ts-ignore
|
||||
import { options as globalOptions } from "virtual:jekyll-data";
|
||||
import { ref, Ref, onMounted, nextTick } from "vue";
|
||||
import processingHandlers from "../lib/mirrorListDataProcessing";
|
||||
|
|
@ -7,7 +6,9 @@ import { MirrorInfo } from "./types";
|
|||
|
||||
const { postProcessStatusData } = processingHandlers(globalOptions);
|
||||
|
||||
export const useMirrorList = (additional: MirrorInfo[] = []): Ref<MirrorInfo[]> => {
|
||||
export const useMirrorList = (
|
||||
additional: MirrorInfo[] = [],
|
||||
): Ref<MirrorInfo[]> => {
|
||||
const mirrorList = ref([] as MirrorInfo[]);
|
||||
let refreshTimer = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
declare module "virtual:jekyll-data" {
|
||||
export const options: import("../types").GlobalOptions;
|
||||
}
|
||||
|
||||
declare module "virtual:jekyll-config" {
|
||||
export const suffix: string;
|
||||
export const hostname: string;
|
||||
export const mirrorz_help_link: string;
|
||||
export const hide_mirrorz: boolean;
|
||||
export const issue_tag: string;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
declare module "*.vue" {
|
||||
import Vue from "vue";
|
||||
const SFC: Vue.Component;
|
||||
export default SFC;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
declare module '*.vue' {
|
||||
import Vue from 'vue';
|
||||
const SFC: Vue.Component;
|
||||
export default SFC;
|
||||
}
|
||||
|
|
@ -3,7 +3,8 @@
|
|||
"files": [
|
||||
"../node_modules/njs-types/ngx_http_js_module.d.ts",
|
||||
"components.d.ts",
|
||||
"shims-vue.d.ts"
|
||||
"lib/shims/vue.d.ts",
|
||||
"lib/shims/jekyll.d.ts",
|
||||
],
|
||||
"compilerOptions": {
|
||||
"isolatedModules": true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue