Add any types for getContext data

This commit is contained in:
2022-09-01 10:57:45 +02:00
parent 7e46350106
commit 945d7f09d7
13 changed files with 44 additions and 44 deletions

View File

@@ -25,10 +25,10 @@
"tweakpane": "^3.1.0"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^1.0.0-next.70",
"@sveltejs/adapter-auto": "^1.0.0-next.71",
"@sveltejs/adapter-node": "^1.0.0-next.88",
"@sveltejs/adapter-vercel": "^1.0.0-next.72",
"@sveltejs/kit": "^1.0.0-next.457",
"@sveltejs/kit": "^1.0.0-next.460",
"@typescript-eslint/eslint-plugin": "^5.36.1",
"@typescript-eslint/parser": "^5.36.1",
"browserslist": "^4.21.3",
@@ -40,7 +40,7 @@
"postcss-normalize": "^10.0.1",
"postcss-preset-env": "^7.8.0",
"postcss-sort-media-queries": "^4.2.1",
"sass": "^1.54.7",
"sass": "^1.54.8",
"svelte": "^3.49.0",
"svelte-check": "^2.9.0",
"svelte-preprocess": "^4.10.7",

58
pnpm-lock.yaml generated
View File

@@ -2,10 +2,10 @@ lockfileVersion: 5.4
specifiers:
'@studio-freight/lenis': ^0.1.18
'@sveltejs/adapter-auto': ^1.0.0-next.70
'@sveltejs/adapter-auto': ^1.0.0-next.71
'@sveltejs/adapter-node': ^1.0.0-next.88
'@sveltejs/adapter-vercel': ^1.0.0-next.72
'@sveltejs/kit': ^1.0.0-next.457
'@sveltejs/kit': ^1.0.0-next.460
'@typescript-eslint/eslint-plugin': ^5.36.1
'@typescript-eslint/parser': ^5.36.1
browserslist: ^4.21.3
@@ -23,7 +23,7 @@ specifiers:
postcss-preset-env: ^7.8.0
postcss-sort-media-queries: ^4.2.1
sanitize.css: ^13.0.0
sass: ^1.54.7
sass: ^1.54.8
svelte: ^3.49.0
svelte-check: ^2.9.0
svelte-preprocess: ^4.10.7
@@ -44,10 +44,10 @@ dependencies:
tweakpane: 3.1.0
devDependencies:
'@sveltejs/adapter-auto': 1.0.0-next.70
'@sveltejs/adapter-auto': 1.0.0-next.71
'@sveltejs/adapter-node': 1.0.0-next.88
'@sveltejs/adapter-vercel': 1.0.0-next.72
'@sveltejs/kit': 1.0.0-next.457_fhgkwirxvgjw2igda6zmhiisma
'@sveltejs/kit': 1.0.0-next.460_fhgkwirxvgjw2igda6zmhiisma
'@typescript-eslint/eslint-plugin': 5.36.1_lbwfnm54o3pmr3ypeqp3btnera
'@typescript-eslint/parser': 5.36.1_yqf6kl63nyoq5megxukfnom5rm
browserslist: 4.21.3
@@ -59,14 +59,14 @@ devDependencies:
postcss-normalize: 10.0.1_mu2kzpkteq3ketk6piffleamkq
postcss-preset-env: 7.8.0_postcss@8.4.16
postcss-sort-media-queries: 4.2.1_postcss@8.4.16
sass: 1.54.7
sass: 1.54.8
svelte: 3.49.0
svelte-check: 2.9.0_c6x723yp7pdz7iha3ksnylcgzy
svelte-preprocess: 4.10.7_2lciotjd6bilkiadfxmz6rz2jm
svelte-check: 2.9.0_f5urgkboyys3wbiivxj4sltznu
svelte-preprocess: 4.10.7_pxxiereockejw5abpwoddd4ivy
swell-node: 4.0.10
tslib: 2.4.0
typescript: 4.8.2
vite: 3.1.0-beta.1_sass@1.54.7
vite: 3.1.0-beta.1_sass@1.54.8
packages:
@@ -422,11 +422,11 @@ packages:
virtual-scroll: 2.2.1
dev: false
/@sveltejs/adapter-auto/1.0.0-next.70:
resolution: {integrity: sha512-FJlDO6oUqbuFJjQoguGb4gdBj3iCSM3evFXkBpQ7hvwu3y2gKbcdzsxdn9tZ5LzkHh79CeJcwiszXFQ8usKk/A==}
/@sveltejs/adapter-auto/1.0.0-next.71:
resolution: {integrity: sha512-Qsl82HcehWJbZztXgmU/nTPDeeIaB4jrOQpSvy3Pi8octs+rEf/CO87Wk06EP+M/zUzEHDNENMOx0DgWuHpj7Q==}
dependencies:
'@sveltejs/adapter-cloudflare': 1.0.0-next.32
'@sveltejs/adapter-netlify': 1.0.0-next.75
'@sveltejs/adapter-netlify': 1.0.0-next.76
'@sveltejs/adapter-vercel': 1.0.0-next.72
transitivePeerDependencies:
- encoding
@@ -441,8 +441,8 @@ packages:
worktop: 0.8.0-next.14
dev: true
/@sveltejs/adapter-netlify/1.0.0-next.75:
resolution: {integrity: sha512-1zTR/U/ceEAyqIGJ74v54G+JbIR+fSmTN9qfqGOM0gBwVoBVRUujGm4tDFJQNYzvuGzVnC7br/rhYMLZd2JluQ==}
/@sveltejs/adapter-netlify/1.0.0-next.76:
resolution: {integrity: sha512-XC33i13N+zkDP1rKrssQ55TPzt4DkLjKux6g1xW2MB+5KxnC9PP2rIkocKxFw/pK2XU8cUIgmOJ1y5PQrHaiKg==}
dependencies:
'@iarna/toml': 2.2.5
esbuild: 0.14.54
@@ -466,8 +466,8 @@ packages:
- supports-color
dev: true
/@sveltejs/kit/1.0.0-next.457_fhgkwirxvgjw2igda6zmhiisma:
resolution: {integrity: sha512-4cVVSKj6r70iifUkqQNK0aTkgoY6O8evi9SazECeLXTCFBM4TvproLQhgXys+kkXmyvdS48NK0JBD8hJnD7A7Q==}
/@sveltejs/kit/1.0.0-next.460_fhgkwirxvgjw2igda6zmhiisma:
resolution: {integrity: sha512-bwDkwzEN72+1K5FXqBQGrYOwyA6V5sSSec/A6qXMTfh4uycFTiIQh/e2ki3pxfG0SwijrUo43FEbdKLyBiuDgQ==}
engines: {node: '>=16.14'}
hasBin: true
requiresBuild: true
@@ -488,7 +488,7 @@ packages:
svelte: 3.49.0
tiny-glob: 0.2.9
undici: 5.10.0
vite: 3.1.0-beta.1_sass@1.54.7
vite: 3.1.0-beta.1_sass@1.54.8
transitivePeerDependencies:
- diff-match-patch
- supports-color
@@ -512,7 +512,7 @@ packages:
magic-string: 0.26.3
svelte: 3.49.0
svelte-hmr: 0.14.12_svelte@3.49.0
vite: 3.1.0-beta.1_sass@1.54.7
vite: 3.1.0-beta.1_sass@1.54.8
transitivePeerDependencies:
- supports-color
dev: true
@@ -823,7 +823,7 @@ packages:
hasBin: true
dependencies:
caniuse-lite: 1.0.30001387
electron-to-chromium: 1.4.237
electron-to-chromium: 1.4.239
node-releases: 2.0.6
update-browserslist-db: 1.0.5_browserslist@4.21.3
dev: true
@@ -1154,8 +1154,8 @@ packages:
domhandler: 4.3.1
dev: true
/electron-to-chromium/1.4.237:
resolution: {integrity: sha512-vxVyGJcsgArNOVUJcXm+7iY3PJAfmSapEszQD1HbyPLl0qoCmNQ1o/EX3RI7Et5/88In9oLxX3SGF8J3orkUgA==}
/electron-to-chromium/1.4.239:
resolution: {integrity: sha512-XbhfzxPIFzMjJm17T7yUGZEyYh5XuUjrA/FQ7JUy2bEd4qQ7MvFTaKpZ6zXZog1cfVttESo2Lx0ctnf7eQOaAQ==}
dev: true
/embla-carousel/7.0.2:
@@ -2955,8 +2955,8 @@ packages:
/sanitize.css/13.0.0:
resolution: {integrity: sha512-ZRwKbh/eQ6w9vmTjkuG0Ioi3HBwPFce0O+v//ve+aOq1oeCy7jMV2qzzAlpsNuqpqCBjjriM1lbtZbF/Q8jVyA==}
/sass/1.54.7:
resolution: {integrity: sha512-3q7MQz7sCpVG6TLhUfZwGOcd2/sm2ghYN2JEdRjNiW04ILdvahdo9GuAs+bxsxZ3hDCKv+wUT5w0iFWGU0CxlA==}
/sass/1.54.8:
resolution: {integrity: sha512-ib4JhLRRgbg6QVy6bsv5uJxnJMTS2soVcCp9Y88Extyy13A8vV0G1fAwujOzmNkFQbR3LvedudAMbtuNRPbQww==}
engines: {node: '>=12.0.0'}
hasBin: true
dependencies:
@@ -3107,7 +3107,7 @@ packages:
engines: {node: '>= 0.4'}
dev: true
/svelte-check/2.9.0_c6x723yp7pdz7iha3ksnylcgzy:
/svelte-check/2.9.0_f5urgkboyys3wbiivxj4sltznu:
resolution: {integrity: sha512-9AVrtP7WbfDgCdqTZNPdj5CCCy1OrYMxFVWAWzNw7fl93c9klFJFtqzVXa6fovfQ050CcpUyJE2dPFL9TFAREw==}
hasBin: true
peerDependencies:
@@ -3120,7 +3120,7 @@ packages:
picocolors: 1.0.0
sade: 1.8.1
svelte: 3.49.0
svelte-preprocess: 4.10.7_2lciotjd6bilkiadfxmz6rz2jm
svelte-preprocess: 4.10.7_pxxiereockejw5abpwoddd4ivy
typescript: 4.8.2
transitivePeerDependencies:
- '@babel/core'
@@ -3144,7 +3144,7 @@ packages:
svelte: 3.49.0
dev: true
/svelte-preprocess/4.10.7_2lciotjd6bilkiadfxmz6rz2jm:
/svelte-preprocess/4.10.7_pxxiereockejw5abpwoddd4ivy:
resolution: {integrity: sha512-sNPBnqYD6FnmdBrUmBCaqS00RyCsCpj2BG58A1JBswNF7b0OKviwxqVrOL/CKyJrLSClrSeqQv5BXNg2RUbPOw==}
engines: {node: '>= 9.11.2'}
requiresBuild: true
@@ -3190,7 +3190,7 @@ packages:
detect-indent: 6.1.0
magic-string: 0.25.9
postcss: 8.4.16
sass: 1.54.7
sass: 1.54.8
sorcery: 0.10.0
strip-indent: 3.0.0
svelte: 3.49.0
@@ -3335,7 +3335,7 @@ packages:
tiny-emitter: 2.1.0
dev: false
/vite/3.1.0-beta.1_sass@1.54.7:
/vite/3.1.0-beta.1_sass@1.54.8:
resolution: {integrity: sha512-JGEnWSC0hfarcduTCQr6wnRjPLbT62iLCK59HBJXYt9oyWSUMtrvcnDqzvLFC+lHV6KGFQkmWlZucyIQmgUnLA==}
engines: {node: ^14.18.0 || >=16.0.0}
hasBin: true
@@ -3358,7 +3358,7 @@ packages:
postcss: 8.4.16
resolve: 1.22.1
rollup: 2.78.1
sass: 1.54.7
sass: 1.54.8
optionalDependencies:
fsevents: 2.3.2
dev: true

View File

@@ -11,7 +11,7 @@
export let isOver: boolean = false
const { settings: { switcher_links } } = getContext('global')
const { settings: { switcher_links }}: any = getContext('global')
let switcherEl: HTMLElement
let isOpen = false

View File

@@ -22,7 +22,7 @@
$: globeResolution = innerWidth > 1440 && window.devicePixelRatio > 1 ? '4k' : '2k'
const { continents, locations } = getContext('global')
const { continents, locations }: any = getContext('global')
const randomContinent: any = getRandomItem(continents.filter((cont: any) => cont.countries))
const markers = locations.map(({ name, slug, country, globe_close: isClose, coordinates: { coordinates }}: any) => ({
name,

View File

@@ -27,7 +27,7 @@
$: globeResolution = innerWidth > 1440 && window.devicePixelRatio > 1 ? '4k' : '2k'
const { continents, locations } = getContext('global')
const { continents, locations }: any = getContext('global')
const randomContinent: any = getRandomItem(continents)
const markers = locations.map(({ name, slug, country, coordinates: { coordinates }}): Marker => ({
name,

View File

@@ -16,7 +16,7 @@
export let locations: any[]
const { continents, settings: { explore_list }} = getContext('global')
const { continents, settings: { explore_list }}: any = getContext('global')
// Continents filtering logic
let currentContinent: string = undefined

View File

@@ -18,7 +18,7 @@
let currentSlide = 0
let carouselDots = []
const { shopProducts } = getContext('shop')
const { shopProducts }: any = getContext('shop')
/** Navigate to specific slide */

View File

@@ -17,7 +17,7 @@
export let product: any = undefined
const { shop, shopLocations } = getContext('shop')
const { shop, shopLocations }: any = getContext('shop')
let navObserver: IntersectionObserver
let introEl: HTMLElement

View File

@@ -8,7 +8,7 @@
import Button from '$components/atoms/Button.svelte'
import Image from '$components/atoms/Image.svelte'
const { locations, shop } = getContext('global')
const { locations, shop }: any = getContext('global')
const locationsWithPoster = locations
// Filter locations with posters only
.filter((loc: Location) => loc.has_poster)

View File

@@ -6,7 +6,7 @@
import { navigating } from '$app/stores'
import { onMount, afterUpdate } from 'svelte'
import type { PageData } from './$types'
import { scroll, animate, inView, type ScrollOptions, timeline, stagger } from 'motion'
import { scroll, animate, inView, type ScrollOptions, timeline } from 'motion'
import { map } from '$utils/functions'
import { getAssetUrlKey } from '$utils/api'
import { DELAY } from '$utils/contants'

View File

@@ -7,7 +7,7 @@
import ShopHeader from '$components/organisms/ShopHeader.svelte'
import PostersGrid from '$components/organisms/PostersGrid.svelte'
const { posters } = getContext('shop')
const { posters }: any = getContext('shop')
const errors = {
404: {
title: 'Product not found',

View File

@@ -11,8 +11,8 @@
export let data: PageData
const { product, shopProduct } = data
const { posters } = getContext('shop')
const { product, shopProduct }: { product: any, shopProduct: any } = data
const { posters }: any = getContext('shop')
// Update current random product slug
$shopCurrentProductSlug = product.location.slug

View File

@@ -12,7 +12,7 @@
export let data: PageData
const { posters } = getContext('shop')
const { posters }: any = getContext('shop')
$shopCurrentProductSlug = data.product.location.slug
</script>