Skip to content
On this page

Types

Type definitions exported from mlly.

ChangeExtFn

Function that returns a new file extension for the given module specifier.

Returning an empty string ('') will remove the original file extension; returning null or undefined will skip extension replacement.

INFO

The new file extension need not begin with a dot character ('.').

ts
type ChangeExtFn<X extends Nilable<string> = Nilable<string>> = Fn<
  [specifier: string, url: URL],
  PromiseLike<X> | X
>

See Also

Declaration

Export declaration kinds.

ts
type Declaration =
  | 'class'
  | 'const enum'
  | 'const'
  | 'enum'
  | 'function'
  | 'function*'
  | 'interface'
  | 'let'
  | 'namespace'
  | 'type'
  | 'var'

MimeType

Supported MIME types.

ts
type MimeType =
  | 'application/json'
  | 'application/typescript'
  | 'application/wasm'
  | 'text/javascript'

See Also

ModuleId

ECMAScript (ES) module identifier.

ts
type ModuleId = URL | string

See Also

ModuleSpecifierType

Module specifier types.

ts
type ModuleSpecifierType = 'absolute' | 'bare' | 'relative'

See Also

Protocol

URL protocols.

ts
type Protocol = LiteralUnion<
  `${
    | 'blob'
    | 'content'
    | 'cvs'
    | 'data'
    | 'dns'
    | 'file'
    | 'fish'
    | 'ftp'
    | 'git'
    | 'http'
    | 'https'
    | 'mvn'
    | 'redis'
    | 'sftp'
    | 'ssh'
    | 'svn'
    | 'urn'
    | 'view-source'
    | 'ws'
    | 'wss'}:`,
  `${string}:`
>

See Also

SyntaxKindExport

export statement syntax kinds.

ts
type SyntaxKindExport =
  | StatementSyntaxKind.DECLARATION
  | StatementSyntaxKind.DEFAULT
  | StatementSyntaxKind.LIST
  | StatementSyntaxKind.NAMED
  | StatementSyntaxKind.NAMESPACE

See Also

SyntaxKindImport

import statement syntax kinds.

ts
type SyntaxKindImport =
  | StatementSyntaxKind.DEFAULT
  | StatementSyntaxKind.DEFAULT_WITH_NAMED
  | StatementSyntaxKind.DEFAULT_WITH_NAMESPACE
  | StatementSyntaxKind.DYNAMIC
  | StatementSyntaxKind.NAMED
  | StatementSyntaxKind.NAMESPACE
  | StatementSyntaxKind.SIDE_EFFECT

See Also

SyntaxKindRequire

require statement syntax kinds.

ts
type SyntaxKindRequire = StatementSyntaxKind.REQUIRE

See Also