diff --git a/packages/upscalerjs/src/shared/index.ts b/packages/upscalerjs/src/shared/index.ts index c8c31d130..431ad5efd 100644 --- a/packages/upscalerjs/src/shared/index.ts +++ b/packages/upscalerjs/src/shared/index.ts @@ -1,5 +1,5 @@ export { getUpscaler, } from './upscaler'; export { getPatchesFromImage, } from './image-utils'; export { AbortError, } from './errors-and-warnings'; -export type { ModelDefinition, } from '@upscalerjs/core'; +export type { ModelDefinition, } from '../../../shared/src/types'; export * from './types'; diff --git a/packages/upscalerjs/src/shared/makeTick.test.ts b/packages/upscalerjs/src/shared/makeTick.test.ts index cc52f41c2..416050eca 100644 --- a/packages/upscalerjs/src/shared/makeTick.test.ts +++ b/packages/upscalerjs/src/shared/makeTick.test.ts @@ -2,16 +2,16 @@ import { vi, expect, } from 'vitest'; import * as tf from '@tensorflow/tfjs-node'; import { isTensor, -} from '@upscalerjs/core'; +} from '../../../shared/src/constants'; import { AbortError, } from './errors-and-warnings.js'; import { makeTick } from './makeTick.js'; -import type * as core from '@upscalerjs/core'; +import type * as sharedConstants from '../../../shared/src/constants'; -vi.mock('@upscalerjs/core', async () => { - const { isTensor, ...rest} = await vi.importActual('@upscalerjs/core') as typeof core; +vi.mock('../../../shared/src/constants', async () => { + const { isTensor, ...rest} = await vi.importActual('../../../shared/src/constants') as typeof sharedConstants; return { ...rest, isTensor: vi.fn(isTensor), diff --git a/packages/upscalerjs/src/shared/makeTick.ts b/packages/upscalerjs/src/shared/makeTick.ts index 1033693c1..a765cc500 100644 --- a/packages/upscalerjs/src/shared/makeTick.ts +++ b/packages/upscalerjs/src/shared/makeTick.ts @@ -1,6 +1,7 @@ import { YieldedIntermediaryValue, } from './types'; import { isAborted, } from './utils'; -import { isTensor, TF, } from '@upscalerjs/core'; +import { isTensor, } from '../../../shared/src/constants'; +import type { TF, } from '../../../shared/src/types'; import { AbortError, } from './errors-and-warnings'; type TickFunction = (result?: YieldedIntermediaryValue) => Promise; diff --git a/packages/upscalerjs/src/shared/types.ts b/packages/upscalerjs/src/shared/types.ts index dc5d0fa9a..acfad2710 100644 --- a/packages/upscalerjs/src/shared/types.ts +++ b/packages/upscalerjs/src/shared/types.ts @@ -1,6 +1,7 @@ import type { Tensor3D, Tensor4D, } from '@tensorflow/tfjs-core'; import type { LayersModel, layers, } from '@tensorflow/tfjs-layers'; import type { TF, GraphModel, ModelDefinitionObjectOrFn, ModelDefinition, } from '@upscalerjs/core'; +export type { ProcessFn, } from '@upscalerjs/core'; export type WarmupSizesByPatchSize = { patchSize: number; @@ -109,7 +110,6 @@ export type Patch = { post: PatchCoordinates; }; -export type { ProcessFn, } from '@upscalerjs/core'; export interface Internals extends InternalConfig { tf: T; getUpscaleOptions: GetUpscaleOptions; diff --git a/packages/upscalerjs/src/shared/upscaler.test.ts b/packages/upscalerjs/src/shared/upscaler.test.ts index 7ff6ffcee..fdb0ffab5 100644 --- a/packages/upscalerjs/src/shared/upscaler.test.ts +++ b/packages/upscalerjs/src/shared/upscaler.test.ts @@ -5,7 +5,7 @@ import { getModel } from './model-utils'; import { cancellableWarmup } from './warmup'; import { cancellableUpscale } from './upscale'; import { WarmupSizes } from './types'; -import { ModelDefinition } from '@upscalerjs/core'; +import type { ModelDefinition } from '../../../shared/src/types'; import * as _tf from '@tensorflow/tfjs-node'; import * as tfn from '@tensorflow/tfjs-node';