Skip to content

Commit e77e9c0

Browse files
committed
Cleanup unused exports
1 parent 8462727 commit e77e9c0

File tree

10 files changed

+15
-34
lines changed

10 files changed

+15
-34
lines changed

src/Panes/state.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export const variableOptionsState = atomFamily((variable: string) =>
137137
})
138138
)
139139

140-
export type TCheckboxGroupData = {
140+
type TCheckboxGroupData = {
141141
variable: string
142142
selectedOption: string | undefined
143143
suggestedOption: string | undefined
@@ -148,7 +148,7 @@ export type TCheckboxGroupData = {
148148
isDisabled: boolean
149149
}[]
150150
}[]
151-
export type TCheckboxMinimalGroupData = {
151+
type TCheckboxMinimalGroupData = {
152152
variable: string
153153
options: {
154154
value: string

src/Plot/XAxis.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const toFixed = (float: number, digits = 0) => {
99
return Math.round(float * padding) / padding
1010
}
1111

12-
export function formatTime(s: ohNoItIsAny) {
12+
function formatTime(s: ohNoItIsAny) {
1313
s = Number(s)
1414
if (!Number.isFinite(s)) return '--'
1515
if (s === 0) return '0'
@@ -30,7 +30,7 @@ export function formatTime(s: ohNoItIsAny) {
3030
if (m > 5) return toFixed(m, 0) + 'm' + toFixed(s % 60, 1) + 's'
3131
return toFixed(s, 0) + 's'
3232
}
33-
export function formatFreq(hz: ohNoItIsAny) {
33+
function formatFreq(hz: ohNoItIsAny) {
3434
hz = Number(hz)
3535
if (!Number.isFinite(hz)) return '--'
3636
if (hz === 0) return '0'

src/data/timers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const tsvConstraints = (str: string) => {
3131
.filter((row) => !Object.values(row).includes('-'))
3232
}
3333

34-
export const tsvRegisters = (str: string) => {
34+
const tsvRegisters = (str: string) => {
3535
const table = str
3636
.trim()
3737
.split('\n')

src/helpers/compareRegisterUtil.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { TRow } from './types'
22

3-
export type GenericCompRegName =
3+
type GenericCompRegName =
44
| 'OutputA'
55
| 'OutputB'
66
| 'OutputC'
@@ -110,7 +110,7 @@ const getIsDeadTime = (genericName: GenericCompRegName) =>
110110
DeadTimeB: true
111111
}[genericName])
112112

113-
export const compareRegs: GenericCompRegName[] = [
113+
const compareRegs: GenericCompRegName[] = [
114114
'OutputA',
115115
'OutputB',
116116
'OutputC',

src/helpers/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function isTruthy<TValue>(value: TValue | undefined): value is TValue {
3939
return !!value
4040
}
4141

42-
export const WILDCARD = '*'
42+
const WILDCARD = '*'
4343
export const getFullDomains = (tables: TTable[]): Record<string, string[]> => {
4444
const domains: Record<string, string[]> = {}
4545
for (const table of tables) {

src/helpers/simulator.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,5 +265,3 @@ export default function simTimer({
265265
})
266266
return results
267267
}
268-
269-
export type Simulation = ReturnType<typeof simTimer>

src/helpers/types.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,8 @@
1-
export type TTableNames = string
2-
31
export type TRow = {
42
[k: string]: string
53
}
64
export type TTable = TRow[]
7-
export type TTimerConfig = TTable[]
85

9-
export type TTimerRegisters = {
10-
[k: string]: string[]
11-
}
12-
export type TDescriptions = {
13-
[k: string]: string
14-
}
15-
16-
export type TDefaultState = TRow
17-
18-
export type TTimer = {
19-
configs: TTimerConfig
20-
registers: TTimerRegisters
21-
timerNr: number
22-
}
236
export enum PanelModes {
247
Normal = 'Normal',
258
Internal = 'With Internals',

src/preact-shim.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// react-shim.js
22
import { h, Fragment } from 'preact'
3-
export { h, Fragment }
3+
export { h, Fragment }

src/state/state.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ const defaultState: Record<string, string> = {
1212
timer: '0'
1313
}
1414

15-
export const RegisterHashWatcher = memo(() => {
15+
const RegisterHashWatcher = memo(() => {
1616
const set = useSetAtom(userConfigStateBulk)
1717
const params = useHashChangedExternally()
1818
set({ ...defaultState, ...params })
1919
return <></>
2020
})
2121

22-
export const RegisterHashUpdater = memo(() => {
22+
const RegisterHashUpdater = memo(() => {
2323
const obj = useAtomValue(userConfigStateBulk)
2424
setHashFromObject({ ...defaultState, ...obj })
2525
return <></>
@@ -41,11 +41,11 @@ export const userConfigState = atomFamily((variable: string) =>
4141
(get) => get(userConfigStateBulk)[variable],
4242
(get, set, value?: string) => {
4343
const was = get(userConfigStateBulk)
44-
if (value === undefined) {
44+
if (value) {
45+
set(userConfigStateBulk, { ...was, [variable]: value })
46+
} else {
4547
const { [variable]: _removedValue, ...without } = was
4648
set(userConfigStateBulk, without)
47-
} else {
48-
set(userConfigStateBulk, { ...was, [variable]: value })
4949
}
5050
}
5151
)

src/state/useHash.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const setHashFromObject = debounce(
2121
{ leading: false, trailing: true, maxWait: 100 }
2222
)
2323

24-
export const getHashParams = () => {
24+
const getHashParams = () => {
2525
const hash = window.location.hash.slice(1)
2626
return new URLSearchParams(hash)
2727
}

0 commit comments

Comments
 (0)