Skip to content

Commit

Permalink
fix: fix up imports type
Browse files Browse the repository at this point in the history
  • Loading branch information
gioboa committed Nov 16, 2024
1 parent 0b452e0 commit a9e5de0
Show file tree
Hide file tree
Showing 22 changed files with 62 additions and 63 deletions.
6 changes: 3 additions & 3 deletions src/lib/sandbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { libPath, mainWindow } from './main-globals';
import { logMain } from '../log';
import { mainAccessHandler } from './main-access-handler';
import {
MessageFromWorkerToSandbox,
MessengerRequestCallback,
PartytownWebWorker,
type MessageFromWorkerToSandbox,
type MessengerRequestCallback,
type PartytownWebWorker,
WorkerMessageType,
} from '../types';
import { registerWindow } from './main-register-window';
Expand Down
12 changes: 6 additions & 6 deletions src/lib/sandbox/main-access-handler.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
ApplyPath,
type ApplyPath,
ApplyPathType,
MainAccessRequest,
MainAccessResponse,
MainAccessTask,
PartytownWebWorker,
WinId,
type MainAccessRequest,
type MainAccessResponse,
type MainAccessTask,
type PartytownWebWorker,
type WinId,
} from '../types';
import { debug, getConstructorName, isPromise, len } from '../utils';
import { defineCustomElement } from './main-custom-element';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/sandbox/main-custom-element.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomElementData, PartytownWebWorker, WinId, WorkerMessageType } from '../types';
import { type CustomElementData, type PartytownWebWorker, type WinId, WorkerMessageType } from '../types';
import { defineConstructorName } from '../utils';
import { getAndSetInstanceId } from './main-instances';
import { winCtxs } from './main-constants';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/sandbox/main-forward-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
len,
resolvePartytownForwardProperty,
} from '../utils';
import { MainWindow, PartytownWebWorker, WinId, WorkerMessageType } from '../types';
import { type MainWindow, type PartytownWebWorker, type WinId, WorkerMessageType } from '../types';
import { serializeForWorker } from './main-serialization';

export const mainForwardTrigger = (worker: PartytownWebWorker, $winId$: WinId, win: MainWindow) => {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/sandbox/main-instances.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CreatedKey, InstanceIdKey, instances, winCtxs, windowIds } from './main-constants';
import { InstanceId, MainWindowContext, WinDocId, WinId } from '../types';
import { type InstanceId, type MainWindowContext, WinDocId, type WinId } from '../types';
import { randomId } from '../utils';

export const getAndSetInstanceId = (instance: any, instanceId?: InstanceId) => {
Expand Down
6 changes: 3 additions & 3 deletions src/lib/sandbox/main-register-window.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { debug } from '../utils';
import { logMain, normalizedWinId } from '../log';
import {
MainWindow,
PartytownWebWorker,
WinId,
type MainWindow,
type PartytownWebWorker,
type WinId,
WorkerMessageType,
LocationUpdateType,
} from '../types';
Expand Down
14 changes: 7 additions & 7 deletions src/lib/sandbox/main-serialization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { getConstructorName, getNodeName, isValidMemberName, startsWith } from '
import { getInstance, getAndSetInstanceId } from './main-instances';
import { mainRefs } from './main-constants';
import {
PartytownWebWorker,
SerializedCSSRule,
SerializedInstance,
SerializedObject,
SerializedRefTransferData,
SerializedTransfer,
type PartytownWebWorker,
type SerializedCSSRule,
type SerializedInstance,
type SerializedObject,
type SerializedRefTransferData,
type SerializedTransfer,
SerializedType,
WinId,
type WinId,
WorkerMessageType,
} from '../types';

Expand Down
8 changes: 4 additions & 4 deletions src/lib/sandbox/on-messenge-from-worker.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { initializedWorkerScript, readNextScript } from './read-main-scripts';
import { mainWindow } from './main-globals';
import {
MainWindowContext,
MessageFromWorkerToSandbox,
PartytownWebWorker,
WinId,
type MainWindowContext,
type MessageFromWorkerToSandbox,
type PartytownWebWorker,
type WinId,
WorkerMessageType,
} from '../types';
import { randomId } from '../utils';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/sandbox/read-main-platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
serializeConfig,
} from '../utils';
import { config, docImpl, libPath, mainWindow } from './main-globals';
import { InterfaceType, InterfaceInfo, InterfaceMember, InitWebWorkerData } from '../types';
import { InterfaceType, type InterfaceInfo, type InterfaceMember, type InitWebWorkerData } from '../types';

export const readMainPlatform = () => {
const elm = docImpl.createElement('i');
Expand Down
8 changes: 4 additions & 4 deletions src/lib/sandbox/read-main-scripts.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { debug, SCRIPT_TYPE, SCRIPT_TYPE_EXEC } from '../utils';
import { getAndSetInstanceId } from './main-instances';
import {
InitializeScriptData,
InstanceId,
MainWindowContext,
PartytownWebWorker,
type InitializeScriptData,
type InstanceId,
type MainWindowContext,
type PartytownWebWorker,
WorkerMessageType,
} from '../types';
import { mainForwardTrigger } from './main-forward-trigger';
Expand Down
8 changes: 4 additions & 4 deletions src/lib/service-worker/sync-create-messenger-sw.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
MainAccessRequest,
MessageFromWorkerToSandbox,
Messenger,
PartytownWebWorker,
type MainAccessRequest,
type MessageFromWorkerToSandbox,
type Messenger,
type PartytownWebWorker,
WorkerMessageType,
} from '../types';
import { onMessageFromWebWorker } from '../sandbox/on-messenge-from-worker';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/web-worker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { callWorkerRefHandler } from './worker-serialization';
import { createEnvironment } from './worker-environment';
import { debug } from '../utils';
import { environments, webWorkerCtx } from './worker-constants';
import { ForwardMainTriggerData, MessageFromSandboxToWorker, WorkerMessageType } from '../types';
import { type ForwardMainTriggerData, type MessageFromSandboxToWorker, WorkerMessageType } from '../types';
import { initNextScriptsInWebWorker } from './worker-exec';
import { initWebWorker } from './init-web-worker';
import { logWorker, normalizedWinId } from '../log';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/web-worker/media/canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
randomId,
} from './bridge';
import { ContextKey, defineCstr, notImpl } from './utils';
import { CallType, WorkerConstructor, WorkerInstance, WorkerWindow } from '../../types';
import { CallType, type WorkerConstructor, type WorkerInstance, type WorkerWindow } from '../../types';

export const initCanvas = (WorkerBase: WorkerConstructor, win: WorkerWindow) => {
const HTMLCanvasDescriptorMap: PropertyDescriptorMap & ThisType<Node> = {
Expand Down
8 changes: 4 additions & 4 deletions src/lib/web-worker/media/media.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
CallType,
MediaSelf,
WebWorkerEnvironment,
WorkerConstructor,
WorkerWindow,
type MediaSelf,
type WebWorkerEnvironment,
type WorkerConstructor,
type WorkerWindow,
} from '../../types';
import {
defineCstr,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/web-worker/worker-anchor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { definePrototypePropertyDescriptor, isValidUrl } from '../utils';
import { getInstanceStateValue, setInstanceStateValue } from './worker-state';
import { getter, setter } from './worker-proxy';
import { resolveToUrl } from './worker-exec';
import { StateProp, WebWorkerEnvironment, WorkerNode } from '../types';
import { StateProp, type WebWorkerEnvironment, type WorkerNode } from '../types';

export const patchHTMLAnchorElement = (WorkerHTMLAnchorElement: any, env: WebWorkerEnvironment) => {
const HTMLAnchorDescriptorMap: PropertyDescriptorMap & ThisType<WorkerNode> = {};
Expand Down
2 changes: 1 addition & 1 deletion src/lib/web-worker/worker-css-style-declaration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApplyPath, CallType, InstanceId, WinId, WorkerConstructor } from '../types';
import { type ApplyPath, CallType, type InstanceId, type WinId, type WorkerConstructor } from '../types';
import { cachedDimensions, InstanceDataKey } from './worker-constants';
import { callMethod, getter, setter } from './worker-proxy';
import { defineConstructorName } from '../utils';
Expand Down
5 changes: 2 additions & 3 deletions src/lib/web-worker/worker-document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import {
CallType,
NodeName,
StateProp,
WebWorkerEnvironment,
WinDocId,
WorkerNode,
type WebWorkerEnvironment,
type WorkerNode,
} from '../types';
import {
cachedProps,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/web-worker/worker-environment.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createWindow } from './worker-window';
import { debug } from '../utils';
import { environments, webWorkerCtx } from './worker-constants';
import { InitializeEnvironmentData, WorkerMessageType } from '../types';
import { type InitializeEnvironmentData, WorkerMessageType } from '../types';
import { logWorker, normalizedWinId } from '../log';

export const createEnvironment = (
Expand Down
14 changes: 7 additions & 7 deletions src/lib/web-worker/worker-exec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { VERSION } from '../build-modules/version';
import { logWorker } from '../log';
import {
EventHandler,
InitializeScriptData,
InstanceId,
type EventHandler,
type InitializeScriptData,
type InstanceId,
NodeName,
ResolveUrlType,
type ResolveUrlType,
StateProp,
WebWorkerEnvironment,
WinId,
WorkerInstance,
type WebWorkerEnvironment,
type WinId,
type WorkerInstance,
WorkerMessageType,
} from '../types';
import { debug } from '../utils';
Expand Down
6 changes: 3 additions & 3 deletions src/lib/web-worker/worker-iframe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import { HTMLSrcElementDescriptorMap } from './worker-src-element';
import { setInstanceStateValue, getInstanceStateValue } from './worker-state';
import {
StateProp,
WebWorkerEnvironment,
WorkerInstance,
type WebWorkerEnvironment,
type WorkerInstance,
WorkerMessageType,
WorkerNode,
type WorkerNode,
} from '../types';

export const patchHTMLIFrameElement = (WorkerHTMLIFrameElement: any, env: WebWorkerEnvironment) => {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/web-worker/worker-location.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LocationUpdateData, LocationUpdateType, WebWorkerEnvironment } from '../types';
import { type LocationUpdateData, LocationUpdateType, type WebWorkerEnvironment } from '../types';

export function forwardLocationChange(
$winId$: number,
Expand Down
10 changes: 5 additions & 5 deletions src/lib/web-worker/worker-named-node-map.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
ApplyPath,
type ApplyPath,
CallType,
InstanceId,
WinId,
WorkerConstructor,
WorkerInstance,
type InstanceId,
type WinId,
type WorkerConstructor,
type WorkerInstance,
} from '../types';
import { defineConstructorName } from '../utils';
import { callMethod, getter, setter } from './worker-proxy';
Expand Down

0 comments on commit a9e5de0

Please sign in to comment.