move all interfaces to utils.ts

This commit is contained in:
Spedon
2023-03-14 01:57:56 +08:00
parent dc32f66f2c
commit 38d1a8ab38
3 changed files with 14 additions and 12 deletions

View File

@@ -1,9 +1,4 @@
interface ImageData {
index: string
url: string
imgH: string
imgW: string
}
import { type ImageData } from './utils'
// fetch images info from JSON
const imageArrayElement = document.getElementById('images_array') as HTMLScriptElement

View File

@@ -1,14 +1,9 @@
import { overlayEnable } from './overlay'
import { posCache, FIFO, layersPosSet, center } from './utils'
import { posCache, FIFO, layersPosSet, center, type position } from './utils'
import { thresholdSensitivityArray, thresholdIndex } from './thresholdCtl'
import { imgIndexSpanUpdate } from './indexDisp'
import { imagesArrayLen, imagesArray } from './dataFetch'
export interface position {
x: number
y: number
}
// get layer divs
const layer5 = document.getElementById('layer5') as HTMLDivElement
const layer4 = document.getElementById('layer4') as HTMLDivElement

View File

@@ -1,3 +1,15 @@
export interface ImageData {
index: string
url: string
imgH: string
imgW: string
}
export interface position {
x: number
y: number
}
// cache a xy position to array
export const posCache = (x: number, y: number, xyArray: string[][]): void => {
// pop element if length surpass limitation