Skip to content

Commit e650efa

Browse files
committed
Clean up import
1 parent d8a0a36 commit e650efa

File tree

6 files changed

+21
-15
lines changed

6 files changed

+21
-15
lines changed

src/app.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Result } from './result'
55
import { processMatrix, processTargets, threshold } from './utils'
66
import { UAParser } from 'ua-parser-js'
77
import { Upload } from './upload'
8-
import appBorder from '../assets/app-border.svg'
98

109
const defaultOcrProgress = { matrixProgress: 0, targetsProgress: 0, status: '' }
1110
const defaultOcrResult: {
@@ -127,12 +126,8 @@ export default function App() {
127126
flexDirection: 'column',
128127
marginBottom: 2,
129128
height: 'calc(100% - 14px)',
130-
borderImageSource: `url(${appBorder})`,
131-
borderImageSlice: 69,
132-
borderImageWidth: 'auto',
133-
boxSizing: 'border-box',
134129
}}
135-
className="border"
130+
className="app-border"
136131
>
137132
{showInputPage ? (
138133
isMobile ? (

src/camera.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { PointerEvent, useCallback, useEffect, useRef, useState } from 'react'
2-
// @ts-ignore
32
import exampleImg from '../assets/example.jpg'
43
import { threshold, useStorage } from './utils'
54

src/main.css

+7-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ body {
3535
}
3636

3737
/* For unknown reason, inlining border will overwrite borderImage */
38-
.border {
39-
border: solid 1px;
38+
.app-border {
39+
border-width: 1px;
40+
border-style: solid;
41+
border-image-source: url(../assets/app-border.svg);
42+
border-image-slice: 69;
43+
border-image-width: auto;
44+
box-sizing: border-box;
4045
}
4146

4247
button {

src/ocr.ts

-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import {
77
WorkerParams,
88
Worker,
99
} from 'tesseract.js'
10-
// @ts-ignore
1110
import workerPath from '../lib/worker.min.js'
12-
// @ts-ignore
1311
import corePath from '../lib/tesseract-core.wasm.js'
1412

1513
export type Logger = (packet: {

src/types/file.d.ts

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
declare module '*.svg' {
2-
const content: string
3-
export default content
1+
declare module '*.jpg' {
2+
const path: string
3+
export default path
4+
}
5+
6+
declare module '*/worker.min.js' {
7+
const path: string
8+
export default path
9+
}
10+
11+
declare module '*/tesseract-core.wasm.js' {
12+
const path: string
13+
export default path
414
}

src/upload.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useState } from 'react'
2-
// @ts-ignore
32
import exampleImg from '../assets/crop-example.jpg'
43

54
export const Upload = ({

0 commit comments

Comments
 (0)