Skip to content

Commit

Permalink
Switch to inline type imports
Browse files Browse the repository at this point in the history
  • Loading branch information
axelboc committed Jan 15, 2025
1 parent 3c8ea6d commit 746f43f
Show file tree
Hide file tree
Showing 299 changed files with 1,151 additions and 1,095 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.preferences.preferTypeOnlyAutoImports": true,
"typescript.preferences.autoImportSpecifierExcludeRegexes": [
"^(node:)?(console|util)$",
"^three/.*$"
Expand Down
5 changes: 2 additions & 3 deletions apps/demo/src/h5wasm/DropZone.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type { PropsWithChildren } from 'react';
import { useCallback } from 'react';
import { type PropsWithChildren, useCallback } from 'react';
import { useDropzone } from 'react-dropzone';

import styles from './DropZone.module.css';
import type { RemoteFile } from './models';
import { type RemoteFile } from './models';
import UrlForm from './UrlForm';

const EXT = ['.h5', '.hdf5', '.hdf', '.nx', '.nx5', '.nexus', '.nxs', '.cxi'];
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/src/h5wasm/H5WasmApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useSearch } from 'wouter';

import { getFeedbackURL } from '../utils';
import DropZone from './DropZone';
import type { RemoteFile } from './models';
import { type RemoteFile } from './models';
import { getPlugin } from './plugin-utils';

function H5WasmApp() {
Expand Down
5 changes: 2 additions & 3 deletions apps/demo/src/h5wasm/UrlForm.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import useAxios from 'axios-hooks';
import type { FormEvent } from 'react';
import { useCallback, useEffect } from 'react';
import { type FormEvent, useCallback, useEffect } from 'react';
import { FiLoader } from 'react-icons/fi';
import { useLocation, useSearch } from 'wouter';

import type { RemoteFile } from './models';
import { type RemoteFile } from './models';
import styles from './UrlForm.module.css';

interface Props {
Expand Down
3 changes: 1 addition & 2 deletions apps/demo/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { FeedbackContext } from '@h5web/app';
import { getFeedbackMailto } from '@h5web/app';
import { type FeedbackContext, getFeedbackMailto } from '@h5web/app';

export function getFeedbackURL(context: FeedbackContext): string {
const email = import.meta.env.VITE_FEEDBACK_EMAIL as string;
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { StorybookConfig } from '@storybook/react-vite';
import { type StorybookConfig } from '@storybook/react-vite';
import remarkGfm from 'remark-gfm';

const config: StorybookConfig = {
Expand Down
6 changes: 3 additions & 3 deletions apps/storybook/src/Annotation.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { CanvasEvent } from '@h5web/lib';
import {
Annotation,
type CanvasEvent,
DefaultInteractions,
useCanvasEvent,
VisCanvas,
} from '@h5web/lib';
import { useRafState } from '@react-hookz/web';
import type { Meta, StoryObj } from '@storybook/react';
import type { ReactNode } from 'react';
import { type Meta, type StoryObj } from '@storybook/react';
import { type ReactNode } from 'react';

import FillHeight from './decorators/FillHeight';
import { formatCoord } from './utils';
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/AxialSelectToZoom.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
VisCanvas,
Zoom,
} from '@h5web/lib';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { range } from 'd3-array';

import FillHeight from './decorators/FillHeight';
Expand Down
4 changes: 2 additions & 2 deletions apps/storybook/src/AxialSelectionTool.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import type { Selection } from '@h5web/lib';
import {
AxialSelectionTool,
Box,
Pan,
ResetZoomButton,
type Selection,
SvgElement,
SvgRect,
VisCanvas,
Zoom,
} from '@h5web/lib';
import { useThrottledState } from '@react-hookz/web';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';

import FillHeight from './decorators/FillHeight';
import { getTitleForSelection } from './utils';
Expand Down
5 changes: 2 additions & 3 deletions apps/storybook/src/ColorBar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { ColorBarProps } from '@h5web/lib';
import { ColorBar, ScaleType } from '@h5web/lib';
import { ColorBar, type ColorBarProps, ScaleType } from '@h5web/lib';
import { COLOR_SCALE_TYPES } from '@h5web/shared/vis-utils';
import type { Meta, StoryFn, StoryObj } from '@storybook/react';
import { type Meta, type StoryFn, type StoryObj } from '@storybook/react';

import FillHeight from './decorators/FillHeight';

Expand Down
8 changes: 5 additions & 3 deletions apps/storybook/src/ColorBarHorizontal.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';

import type { StoryProps } from './ColorBar.stories';
import ColorBarStoriesMeta, { Default } from './ColorBar.stories';
import ColorBarStoriesMeta, {
Default,
type StoryProps,
} from './ColorBar.stories';

const meta = {
...ColorBarStoriesMeta,
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/DataCurve.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
VisCanvas,
} from '@h5web/lib';
import { assertDefined } from '@h5web/shared/guards';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { range } from 'd3-array';
import { useState } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/DefaultInteractions.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
useDomain,
VisCanvas,
} from '@h5web/lib';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';

import FillHeight from './decorators/FillHeight';

Expand Down
4 changes: 2 additions & 2 deletions apps/storybook/src/DomainControls.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DomainControls } from '@h5web/lib';
import type { Domain } from '@h5web/shared/vis-models';
import { type Domain } from '@h5web/shared/vis-models';
import { useToggle } from '@react-hookz/web';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { useEffect, useState } from 'react';

const meta = {
Expand Down
6 changes: 3 additions & 3 deletions apps/storybook/src/DomainSlider.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { CustomDomain } from '@h5web/lib';
import {
type CustomDomain,
DomainSlider,
ScaleType,
useSafeDomain,
useVisDomain,
} from '@h5web/lib';
import type { Domain } from '@h5web/shared/vis-models';
import { type Domain } from '@h5web/shared/vis-models';
import { COLOR_SCALE_TYPES } from '@h5web/shared/vis-utils';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { useEffect, useState } from 'react';

import styles from './DomainSlider.stories.module.css';
Expand Down
5 changes: 2 additions & 3 deletions apps/storybook/src/DomainWidget.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { CustomDomain } from '@h5web/lib';
import { DomainWidget, ScaleType } from '@h5web/lib';
import { type CustomDomain, DomainWidget, ScaleType } from '@h5web/lib';
import { COLOR_SCALE_TYPES } from '@h5web/shared/vis-utils';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { useState } from 'react';

import DomainWidgetDecorator from './decorators/DomainWidgetDecorator';
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/ErrorBars.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '@h5web/lib';
import { assertDefined } from '@h5web/shared/guards';
import { ScaleType } from '@h5web/shared/vis-models';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { range } from 'd3-array';

import FillHeight from './decorators/FillHeight';
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/FloatingControl.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DefaultInteractions, FloatingControl, VisCanvas } from '@h5web/lib';
import { useToggle } from '@react-hookz/web';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';

import FillHeight from './decorators/FillHeight';

Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/Glyphs.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@h5web/lib';
import { assertDefined } from '@h5web/shared/guards';
import { ScaleType } from '@h5web/shared/vis-models';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { range } from 'd3-array';

import FillHeight from './decorators/FillHeight';
Expand Down
4 changes: 2 additions & 2 deletions apps/storybook/src/HeatmapMesh.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Domain } from '@h5web/lib';
import {
DefaultInteractions,
type Domain,
getDomain,
HeatmapMesh,
mockValues,
Expand All @@ -9,7 +9,7 @@ import {
import { assertDefined } from '@h5web/shared/guards';
import { ScaleType } from '@h5web/shared/vis-models';
import { COLOR_SCALE_TYPES, toTypedNdArray } from '@h5web/shared/vis-utils';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { range } from 'd3-array';
import ndarray from 'ndarray';
import { LinearFilter, NearestFilter } from 'three';
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/HeatmapVis.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '@h5web/lib';
import { assertDefined } from '@h5web/shared/guards';
import { COLOR_SCALE_TYPES, toTypedNdArray } from '@h5web/shared/vis-utils';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import ndarray from 'ndarray';

import FillHeight from './decorators/FillHeight';
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/HeatmapVisDisplay.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
mockValues,
} from '@h5web/lib';
import { formatTooltipVal } from '@h5web/shared/vis-utils';
import type { Meta, StoryFn, StoryObj } from '@storybook/react';
import { type Meta, type StoryFn, type StoryObj } from '@storybook/react';

import HeatmapVisStoriesMeta from './HeatmapVis.stories';

Expand Down
11 changes: 8 additions & 3 deletions apps/storybook/src/HeatmapVisScales.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import type { HeatmapVisProps } from '@h5web/lib';
import { getDomain, HeatmapVis, mockValues, ScaleType } from '@h5web/lib';
import type { Meta, StoryObj } from '@storybook/react';
import {
getDomain,
HeatmapVis,
type HeatmapVisProps,
mockValues,
ScaleType,
} from '@h5web/lib';
import { type Meta, type StoryObj } from '@storybook/react';

import HeatmapVisStoriesMeta from './HeatmapVis.stories';

Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/Histogram.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Histogram, ScaleType } from '@h5web/lib';
import { COLOR_SCALE_TYPES } from '@h5web/shared/vis-utils';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { useState } from 'react';

const meta = {
Expand Down
5 changes: 2 additions & 3 deletions apps/storybook/src/Html.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import {
VisCanvas,
} from '@h5web/lib';
import { useToggle } from '@react-hookz/web';
import type { Meta, StoryObj } from '@storybook/react';
import type { PropsWithChildren } from 'react';
import { useState } from 'react';
import { type Meta, type StoryObj } from '@storybook/react';
import { type PropsWithChildren, useState } from 'react';
import { createPortal } from 'react-dom';

import FillHeight from './decorators/FillHeight';
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/Line.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '@h5web/lib';
import { assertDefined } from '@h5web/shared/guards';
import { ScaleType } from '@h5web/shared/vis-models';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { range } from 'd3-array';

import FillHeight from './decorators/FillHeight';
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/LineVis.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
createArrayFromView,
toTypedNdArray,
} from '@h5web/shared/vis-utils';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import ndarray from 'ndarray';

import FillHeight from './decorators/FillHeight';
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/LineVisDisplay.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
mockValues,
} from '@h5web/lib';
import { formatTooltipVal } from '@h5web/shared/vis-utils';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';

import LineVisStoriesMeta, { Default } from './LineVis.stories';

Expand Down
5 changes: 2 additions & 3 deletions apps/storybook/src/LineVisScales.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { LineVis } from '@h5web/lib';
import { mockValues, ScaleType } from '@h5web/lib';
import type { Meta, StoryObj } from '@storybook/react';
import { type LineVis, mockValues, ScaleType } from '@h5web/lib';
import { type Meta, type StoryObj } from '@storybook/react';

import LineVisStoriesMeta, { Default } from './LineVis.stories';

Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/MatrixVis.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
createComplexFormatter,
toTypedNdArray,
} from '@h5web/shared/vis-utils';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { format } from 'd3-format';

import FillHeight from './decorators/FillHeight';
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/Overlay.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Overlay, Pan, ResetZoomButton, VisCanvas, Zoom } from '@h5web/lib';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';

import FillHeight from './decorators/FillHeight';

Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/Pan.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MouseButton, Pan, ResetZoomButton, VisCanvas, Zoom } from '@h5web/lib';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';

import FillHeight from './decorators/FillHeight';

Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/RgbVis.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ImageType, mockValues, RgbVis } from '@h5web/lib';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';

import FillHeight from './decorators/FillHeight';

Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/ScatterVis.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getDomain, INTERPOLATORS, ScatterVis } from '@h5web/lib';
import { assertDefined } from '@h5web/shared/guards';
import { ScaleType } from '@h5web/shared/vis-models';
import { COLOR_SCALE_TYPES } from '@h5web/shared/vis-utils';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import ndarray from 'ndarray';
import { useState } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/SelectToZoom.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
Zoom,
} from '@h5web/lib';
import { ScaleType } from '@h5web/shared/vis-models';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';

import FillHeight from './decorators/FillHeight';

Expand Down
5 changes: 3 additions & 2 deletions apps/storybook/src/SelectionTool.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { Rect, Selection } from '@h5web/lib';
import {
Box,
DataToHtml,
Pan,
type Rect,
ResetZoomButton,
type Selection,
SelectionTool,
SvgElement,
SvgLine,
Expand All @@ -12,7 +13,7 @@ import {
Zoom,
} from '@h5web/lib';
import { useThrottledState } from '@react-hookz/web';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { useState } from 'react';

import FillHeight from './decorators/FillHeight';
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/Stacking.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
TooltipMesh,
VisCanvas,
} from '@h5web/lib';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { Vector3 } from 'three';

import FillHeight from './decorators/FillHeight';
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/SurfaceVis.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getDomain, mockValues, SurfaceVis } from '@h5web/lib';
import { assertDefined } from '@h5web/shared/guards';
import { createArrayFromView } from '@h5web/shared/vis-utils';
import { OrbitControls } from '@react-three/drei';
import type { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';

import FillHeight from './decorators/FillHeight';

Expand Down
Loading

0 comments on commit 746f43f

Please sign in to comment.