Skip to content

Commit

Permalink
fix circular dependency
Browse files Browse the repository at this point in the history
several import fixes
  • Loading branch information
bigmistqke committed Dec 2, 2024
1 parent cc3d9fd commit 7f620ec
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 13 deletions.
9 changes: 5 additions & 4 deletions entries/types.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import type { Box, SampleEntry } from '#/box';
import type { Box } from '#/box';
import type { trakBox } from '#/boxes/defaults';
import type { SubSample } from '#/boxes/subs';
import { UUID_BOXES } from '#/boxes/uuid';
import type { UUID_BOXES } from '#/boxes/uuid';
import type { DataStream } from '#/DataStream';
import * as DESCRIPTORS from '#/descriptor';
import type * as DESCRIPTORS from '#/descriptor';
import type { MP4BoxStream } from '#/stream';
import * as BOXES from './all-boxes';
import type { SampleEntry } from './all';
import type * as BOXES from './all-boxes';

type AllBoxes = Partial<typeof BOXES> & Partial<typeof UUID_BOXES>;
export namespace MP4Box {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"build:simple": "concurrently \"pnpm build:simple:esm\" \"pnpm build:simple:cjs\"",
"build:simple:esm": "tsup entries/simple.ts --format esm --sourcemap --dts",
"build:simple:cjs": "tsup entries/simple.ts --format cjs --sourcemap",
"circular": "dpdm -T ./src/all.ts",
"circular": "dpdm -T ./entries/all.ts",
"types": "tsc --noEmit --project tsconfig.json"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/DataStream.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MAX_SIZE } from '#/constants';
import type { StructDefinition, StructType, TypedArray } from '@types';
import { MP4BoxBuffer } from './buffer';
import { MP4BoxBuffer } from './mp4boxbuffer';

/*
TODO: fix endianness for 24/64-bit fields
Expand Down
1 change: 1 addition & 0 deletions src/boxes/sampleentries/base.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ContainerBox } from '#/box';
import type { MultiBufferStream } from '#/buffer';
import { Log } from '#/log';

export class SampleEntry extends ContainerBox {
data_reference_index?: number;
Expand Down
3 changes: 2 additions & 1 deletion src/boxes/stsd.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { FullBox, SampleEntry, parseOneBox } from '#/box';
import { FullBox, parseOneBox } from '#/box';
import type { MultiBufferStream } from '#/buffer';
import { OK } from '#/constants';
import { Log } from '#/log';
import { BoxRegistry } from '#/registry';
import { SampleEntry } from './sampleentries/base';

export class stsdBox extends FullBox {
entries: Array<SampleEntry>;
Expand Down
6 changes: 1 addition & 5 deletions src/buffer.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { DataStream } from '#/DataStream';
import { Log } from '#/log';

export class MP4BoxBuffer extends ArrayBuffer {
fileStart?: number;
usedBytes?: number;
}
import type { MP4BoxBuffer } from './mp4boxbuffer';

/**
* helper functions to concatenate two ArrayBuffer objects
Expand Down
3 changes: 2 additions & 1 deletion src/isofile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import { trexBox } from '#/boxes/trex';
import { trunBox } from '#/boxes/trun';
import { urlBox } from '#/boxes/url';
import { vmhdBox } from '#/boxes/vmhd';
import { MP4BoxBuffer, MultiBufferStream } from '#/buffer';
import { MultiBufferStream } from '#/buffer';
import {
ERR_NOT_ENOUGH_DATA,
TFHD_FLAG_BASE_DATA_OFFSET,
Expand Down Expand Up @@ -96,6 +96,7 @@ import type {
Track,
} from '@types';
import type { EntityToGroup } from './boxes/EntityToGroup/base';
import { MP4BoxBuffer } from './mp4boxbuffer';

export class SampleGroupInfo {
last_sample_in_run = -1;
Expand Down
4 changes: 4 additions & 0 deletions src/mp4boxbuffer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export class MP4BoxBuffer extends ArrayBuffer {
fileStart?: number;
usedBytes?: number;
}

0 comments on commit 7f620ec

Please sign in to comment.