diff options
Diffstat (limited to 'packages/client/src/util')
-rw-r--r-- | packages/client/src/util/fetch.ts (renamed from packages/client/src/util/fetch.js) | 4 | ||||
-rw-r--r-- | packages/client/src/util/hljs-languages.ts (renamed from packages/client/src/util/hljs-languages.js) | 0 | ||||
-rw-r--r-- | packages/client/src/util/util.ts | 7 |
3 files changed, 10 insertions, 1 deletions
diff --git a/packages/client/src/util/fetch.js b/packages/client/src/util/fetch.ts index a6a43b0..54f5afd 100644 --- a/packages/client/src/util/fetch.js +++ b/packages/client/src/util/fetch.ts @@ -1,4 +1,6 @@ -export default async function(endpoint, fetch_failed, is_loading, data_name) { +import { Ref } from "vue"; + +export default async function(endpoint: string, fetch_failed: Ref<string | null>, is_loading: Ref<boolean>, data_name: string) { const fetch_timeout = setTimeout(() => { if(!fetch_failed.value) { fetch_failed.value = `Failed to fetch ${data_name} data.`; diff --git a/packages/client/src/util/hljs-languages.js b/packages/client/src/util/hljs-languages.ts index 2f50461..2f50461 100644 --- a/packages/client/src/util/hljs-languages.js +++ b/packages/client/src/util/hljs-languages.ts diff --git a/packages/client/src/util/util.ts b/packages/client/src/util/util.ts new file mode 100644 index 0000000..5f72c27 --- /dev/null +++ b/packages/client/src/util/util.ts @@ -0,0 +1,7 @@ +type Params = { + [key: string]: string | string[] +} + +export function getParam(params: Params, param: string): string { + return params[param].toString(); +} |