mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2024-12-22 16:26:28 +00:00
enforce strict typescript
This commit is contained in:
parent
f185ccee03
commit
728ad56b33
@ -7,7 +7,7 @@ export class Files {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
static fromString(s: string): Promise<Blob> {
|
static async fromString(s: string): Promise<Blob> {
|
||||||
return fetch(s).then((r) => r.blob())
|
return fetch(s).then((r) => r.blob())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
async function onInput(e: Event) {
|
async function onInput(e: Event) {
|
||||||
const input = e.target as HTMLInputElement
|
const input = e.target as HTMLInputElement
|
||||||
if (input.files.length) {
|
if (input?.files?.length) {
|
||||||
files = Array.from(input.files)
|
files = Array.from(input.files)
|
||||||
const data: FileDTO[] = await Promise.all(
|
const data: FileDTO[] = await Promise.all(
|
||||||
files.map(async (file) => ({
|
files.map(async (file) => ({
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
import Icon from './Icon.svelte'
|
import Icon from './Icon.svelte'
|
||||||
|
|
||||||
export let label: string = ''
|
export let label: string = ''
|
||||||
export let value: string | number
|
export let value: any
|
||||||
|
|
||||||
export let copy: boolean = false
|
export let copy: boolean = false
|
||||||
export let random: boolean = false
|
export let random: boolean = false
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
message = $t('home.explanation', {
|
message = $t('home.explanation', {
|
||||||
values: {
|
values: {
|
||||||
type: $t(timeExpiration ? 'common.minutes' : 'common.views', {
|
type: $t(timeExpiration ? 'common.minutes' : 'common.views', {
|
||||||
values: { n: timeExpiration ? note.expiration : note.views },
|
values: { n: (timeExpiration ? note.expiration : note.views) ?? '?' },
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { registerAll } from '$locales'
|
import { registerAll } from '$locales'
|
||||||
registerAll()
|
registerAll()
|
||||||
init({ initialLocale: getLocaleFromNavigator(), fallbackLocale: 'en' })
|
init({ initialLocale: getLocaleFromNavigator() ?? undefined, fallbackLocale: 'en' })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<script context="module" lang="ts">
|
<script context="module" lang="ts">
|
||||||
export async function load({ params }) {
|
import type { Load } from '@sveltejs/kit'
|
||||||
|
|
||||||
|
export const load: Load = async ({ params }) => {
|
||||||
return {
|
return {
|
||||||
props: params,
|
props: params,
|
||||||
}
|
}
|
||||||
@ -7,13 +9,14 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { onMount } from 'svelte'
|
||||||
|
import { t } from 'svelte-intl-precompile'
|
||||||
|
|
||||||
import type { NotePublic } from '$lib/api'
|
import type { NotePublic } from '$lib/api'
|
||||||
import { get, info } from '$lib/api'
|
import { get, info } from '$lib/api'
|
||||||
import { decrypt, getKeyFromString } from '$lib/crypto'
|
import { decrypt, getKeyFromString } from '$lib/crypto'
|
||||||
import Button from '$lib/ui/Button.svelte'
|
import Button from '$lib/ui/Button.svelte'
|
||||||
import ShowNote from '$lib/ui/ShowNote.svelte'
|
import ShowNote from '$lib/ui/ShowNote.svelte'
|
||||||
import { onMount } from 'svelte'
|
|
||||||
import { t } from 'svelte-intl-precompile'
|
|
||||||
|
|
||||||
export let id: string
|
export let id: string
|
||||||
|
|
||||||
@ -27,7 +30,7 @@
|
|||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
try {
|
try {
|
||||||
loading = true
|
loading = true
|
||||||
error = null
|
error = false
|
||||||
password = window.location.hash.slice(1)
|
password = window.location.hash.slice(1)
|
||||||
await info(id)
|
await info(id)
|
||||||
exists = true
|
exists = true
|
||||||
|
@ -24,7 +24,8 @@
|
|||||||
"checkJs": true,
|
"checkJs": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"$lib/*": ["src/lib/*"]
|
"$lib/*": ["src/lib/*"]
|
||||||
}
|
},
|
||||||
|
"strict": true
|
||||||
},
|
},
|
||||||
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts", "src/**/*.svelte"]
|
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts", "src/**/*.svelte"]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user