Skip to content

Commit

Permalink
refactor(types): improve FormatType auto-generated API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
buzz committed May 28, 2024
1 parent 4405da4 commit a083e96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
8 changes: 2 additions & 6 deletions src/MediaInfo.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import { unknownToError } from './error.js'
import { FLOAT_FIELDS, INT_FIELDS, type MediaInfoType, type TrackType } from './MediaInfoType.js'
import type { MediaInfoFactoryOptions } from './mediaInfoFactory.js'
import type {
MediaInfoModule,
MediaInfoWasmInterface,
WasmConstructableFormatType,
} from './MediaInfoModule.js'
import type { MediaInfoModule, MediaInfoWasmInterface } from './MediaInfoModule.js'

const MAX_UINT32_PLUS_ONE = 2 ** 32

/** Format of the result type */
type FormatType = 'object' | WasmConstructableFormatType
type FormatType = 'object' | 'JSON' | 'XML' | 'HTML' | 'text'

type MediaInfoOptions<TFormat extends FormatType> = Required<
Omit<MediaInfoFactoryOptions<TFormat>, 'locateFile'>
Expand Down
7 changes: 1 addition & 6 deletions src/MediaInfoModule.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,5 @@ interface MediaInfoModule extends EmscriptenModule {

declare const mediaInfoModuleFactory: EmscriptenModuleFactory<MediaInfoModule>

export type {
MediaInfoModule,
MediaInfoWasmConstructable,
MediaInfoWasmInterface,
WasmConstructableFormatType,
}
export type { MediaInfoModule, MediaInfoWasmConstructable, MediaInfoWasmInterface }
export default mediaInfoModuleFactory
2 changes: 1 addition & 1 deletion src/mediaInfoFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function mediaInfoFactory<TFormat extends FormatType = typeof DEFAULT_OPTIONS.fo
): Promise<MediaInfo<TFormat>>

/**
* Factory function for {@link mediaInfoFactory}.
* Factory function for {@link MediaInfo}.
*
* @param options User options
* @param callback Function that is called once the module is created
Expand Down

0 comments on commit a083e96

Please sign in to comment.