Documentation menu
API referenceMarkdown ↗

API reference

On this page
API reference0.1.0-alpha.36

Configuration

Modules

Symbols

Build configuration

  • MaligatorIntlFeature
    Service selections used when Intl is enabled; an empty list includes every service.

  • MaligatorFfiLibrary
    A C library the program imports as maligator:ffi/<name>.

  • MaligatorBuildConfig
    Trusted, strictly validated configuration evaluated for each CLI invocation.

  • defineBuild
    Preserve the inferred config type. Validation happens when the CLI loads the config.

    typescript
    import { defineBuild } from "@maligator/cli";
    export default defineBuild({ entry: "src/index.ts" });
Members and options

C library contracts

  • MaligatorFfiFind
    How the build finds a C library's headers and binaries. Relative paths resolve against the file that declares them. Name at least pkgConfig, libraries, or sources; the other fields add to what those provide.

  • MaligatorFfiHandle
    A C resource or caller-owned state struct. Its handles close on [Symbol.dispose]() or when passed to destroy; a closed handle throws instead of reaching C.

  • MaligatorFfiTypeFacts
    Facts about one C type, keyed by its typedef or tag.

  • MaligatorFfiFieldFacts
    A resource, callable or counted array field, or a range retained by caller-owned state.

  • MaligatorFfiEvidence
    A declaration whose documentation supports a fact, independent of its source location.

  • MaligatorFfiCount
    The C parameter or state field carrying a byte or element count.

  • MaligatorFfiShape
    Select active C union storage explicitly or through an integer discriminator.

  • MaligatorFfiValueFacts
    Facts about a parameter or a result.

  • MaligatorFfiCallable
    A C function whose code and referenced state remain valid for its lifetime.

  • MaligatorFfiCallback
    A callback the library calls before the function returns, such as an iteration or comparison function, until it releases the callback, until the next call replaces it, or to complete a handle's close. An exception it throws skips later calls and rethrows when the C function the library runs in returns.

  • MaligatorFfiCallbackResult
    A callback result's value shape, or the lifetime of a returned pointer.

  • MaligatorFfiFunctionFacts
    Facts about one C function, keyed by its name.

  • MaligatorFfiVariant
    One way to call a variadic function: the C types of the arguments after the fixed ones.

  • MaligatorFfiGlobalValueFacts
    Representation of a library-owned global, shared by its read and write accessors.

  • MaligatorFfiGlobalFacts
    Explicit access to a library-owned C object. Accessors run on the calling thread.

  • MaligatorLibraryContract
    Facts about a C library that hold wherever it is installed. The binding comes from the headers plus these facts.

  • defineLibrary
    Preserve the inferred contract type. Validation happens when the CLI loads the contract.

    typescript
    import { defineLibrary } from "@maligator/cli";
    export default defineLibrary({ headers: ["raylib.h"], find: [{ pkgConfig: "raylib" }] });
Members and options

CLI

maligator:application

  • ready
    Notify the development supervisor that this application is ready. Repeated calls are harmless. Returns true in a supervised application and false in a standalone application or ordinary worker. Call after resources such as a server listener are accepting work; this does not reserve ports or transfer traffic.

maligator:workers

  • createPool
    Create a bounded pool of persistent workers for a declared entry. Submission failures throw synchronously; admitted tasks settle asynchronously. Await ready before submitting startup-dependent work and close the pool when finished. Throws NotSupportedError without threads and RangeError for invalid bounds.
  • createWorkerUrl
    Declare an entry using a static string literal and explicit import.meta.url base. The immutable href projection can be passed to existing worker libraries.
  • transfer
    Wrap a result for transfer when the worker publishes it.
  • Worker
    Start a declared isolated module and expose its ordered port and complete lifecycle.
  • MessageChannel
    Create two transferable endpoints independently of worker startup.
  • MessagePort
    The port prototype for type and identity checks. Ports are created by channels and workers.
  • receiveMessageOnPort
    Synchronously dequeue one pending message without running unrelated callbacks.
  • capabilities
    Report the running host's worker facilities and capacity.
  • parentPort
    The worker's parent endpoint; null in the main isolate.
  • workerData
    The worker-owned clone of startup data.
  • WorkerUrl
    An immutable image-local worker entry declaration. The compiler resolves the declaration independently of how libraries pass the descriptor or its href onward. Erased module types express the caller's assertion; runtime entry identity is validated.
  • Transferable
    ArrayBuffer stores move at admission. MessagePort endpoints transfer ownership. SharedArrayBuffer is cloned by sharing its backing and cannot be transferred.
  • TaskContext
    Cancellation is cooperative while a pool task runs. The worker remains occupied until the task's returned promise settles.
  • TransferResult
    An opaque result envelope. Constructing it does not detach buffers; publication commits transfers.
  • TaskNames
    Names of context-first exported task functions.
  • TaskArgs
    The task's argument tuple, excluding its local cancellation context.
  • TaskValue
    The settled task result after unwrapping an explicit transfer envelope.
  • PoolOptions
    Fixed persistent worker count and admission bounds. Every worker has independent module state. A size-one pool dispatches admitted tasks serially.
  • RunOptions
    The transfer list commits synchronously when run returns normally. Validation, saturation, closed pools and already-aborted signals throw before admission.
  • MapOptions
    The window bounds pulled inputs and buffered results together. Results are yielded in input order; iterator return cancels this map's work and closes its input.
  • PoolStats
    A snapshot of this pool's scheduling and settled operations.
  • WorkerPool
    A bounded task scheduler over isolated persistent workers. Each worker executes one task through asynchronous settlement. No accepted task is replayed after worker failure.
  • WorkerExit
    A terminal record published only after the native worker is joined and its slot is released.
  • WorkerOptions
    Worker data is snapshotted before startup. The native host bounds live workers and message admission process-wide.
  • MessageChannelOptions
    Each endpoint bounds its pending message count and bytes. Rejection leaves the sender's transferables unchanged.
  • MessagePort
    An ordered bidirectional endpoint with transactional transfer and bounded queues. Message listeners and values are owned by the receiving isolate.
  • MessageChannel
    A standalone channel whose endpoints may be transferred to workers.
  • Worker
    A long-lived isolated module and its parent communication port. Startup completes after module evaluation; shutdown completes after native thread reaping.
Members and options

maligator:assets

  • embedFile
    Declare a file to embed and return its handle. Repeated declarations of the same file share one handle.
  • embedDirectory
    Declare a directory tree to embed and return its handle. Repeated declarations with the same options share one handle.
  • MaterializeOptions
    Where an embedded copy is written. Outside maligator build the source file is used in place and this option is ignored.
  • EmbeddedFile
    A file the build embeds. maligator build fixes its contents; other commands read the source file each time.
  • EmbeddedDirectory
    A directory tree the build embeds. maligator build fixes its member files; other commands list the source directory each time.
  • EmbedProducer
    A command that writes the declared files.
  • EmbedWatchProducer
    A long-running command that keeps the declared files current, such as a frontend dev server.
  • EmbedProducerUse
    Which producer each command runs. existing uses the files already on disk; a selected producer must be declared.
  • EmbedFileOptions
    How the declared files are produced. Only the project's own modules may name commands; they never reach a built executable.
  • EmbedDirectoryOptions
    Which files of the directory belong to the declaration, and how they are produced. Patterns are relative to the directory and use / separators.
Members and options

maligator:http

  • serve
    Listen and answer each request with fetch. Invalid options and bind failures throw.
  • serveAsset
    A handler that serves an embedded file or directory with its media type, ETag, cache headers, conditional and range requests, and precompressed copies in production builds. While a declaration's watcher runs, the handler forwards to the watcher's URL instead.
  • proxy
    A handler that forwards each request to the same path below target and returns the answer.
  • fetch
    The Fetch API's fetch, the same function as the global one. Importing it links the HTTP client without installing the global.
  • Handler
    Answers a buffered request. A thrown error or rejection reaches the server's error handler.
  • ErrorHandler
    Turns a handler failure into a response.
  • ServeOptions
    Where to listen and how to answer. Limits are integers from 0 through 2147483647.
  • Server
    A listening server. await using closes it at the end of a scope.
  • ServeAssetOptions
    How request paths map onto the asset. A path ending in / serves its index.html.
Members and options

maligator:fs

  • file
    A handle for the file at path. It does no I/O, so the file need not exist yet. Throws a TypeError for an empty path, a path with a null byte or a URL that is not a file: URL.
  • directory
    A handle for the directory at path. It does no I/O, so the directory need not exist yet. Throws a TypeError for an empty path, a path with a null byte or a URL that is not a file: URL.
  • realpath
    Return the absolute path of an existing entry after resolving symbolic links.
  • readlink
    Read the target stored in a symbolic link, keeping relative targets relative.
  • symlink
    Create a symbolic link to target. A relative target resolves from the link's parent. The target can be missing.
  • temporaryDirectory
    Create a directory accessible only by its owner and return its absolute handle. Call delete() when done.
  • watch
    Watch a file or directory using an async iterator. The first next() starts the watch. Breaking out of the loop, calling return(), or aborting the signal closes it.
  • FileSystemError
    The class of every rejection a failed filesystem operation causes.
  • FilePath
    A path, or a file: URL. A relative path resolves against the working directory when an operation runs.
  • FileData
    Contents to write. Strings are written as UTF-8; views write the bytes they cover.
  • WriteOptions
    How write stores the contents.
  • AppendOptions
    How append creates a missing file.
  • FileStreamOptions
    Byte range and read size for DiskFile.stream().
  • FileWriterOptions
    How DiskFile.writer() opens its file.
  • FileWriter
    A sink that opens the file on its first operation and queues operations in call order. Await a write before reusing its input buffer.
  • WatchOptions
    How watch() observes changes.
  • FileChange
    A filesystem notification. The OS can coalesce changes and may report a move as creation or deletion.
  • TransferOptions
    How copyTo and moveTo treat an existing destination.
  • StatOptions
    Which entry stat describes.
  • FileStat
    Metadata of a filesystem entry.
  • DiskFile
    A file on disk. Creating a handle does no I/O; each method reads or changes the file when called. Failed operations reject with a FileSystemError.
  • DirectoryListOptions
    Which entries to list. Patterns use *, ? and whole-segment ** on slash-separated paths relative to the directory. A pattern can match zero entries.
  • DirectoryEntry
    An entry returned by DiskDirectory.entries().
  • CreateDirectoryOptions
    How DiskDirectory.create() creates a directory.
  • DeleteOptions
    How a delete handles a missing entry.
  • DeleteDirectoryOptions
    How DiskDirectory.delete() removes a directory.
  • TemporaryDirectoryOptions
    Where to create a private temporary directory and how to name it.
  • DiskDirectory
    A directory on disk. Creating a handle does no I/O. Directory walks report symbolic links as entries and skip descending into them.
  • FileSystemError
    A failed filesystem operation. The message reads like Node's: the code, a description, the system call and the paths.
Members and options

maligator:test

  • test
    Register a test in the current suite.
  • describe
    Register a nested suite in the current suite.
  • expect
    Create fluent matchers for a received value.
  • beforeAll
    Run once before tests in the current suite.
  • afterAll
    Run once after tests in the current suite, including after test failures.
  • beforeEach
    Run before every selected descendant test. Ancestor hooks run before hooks declared by a nested suite.
  • afterEach
    Run after every selected descendant test. Nested-suite hooks run before ancestor hooks.
  • TestCallback
    A test or hook body. Maligator waits for a returned promise or thenable before advancing the lifecycle.
  • HookCallback
    A lifecycle hook body, with the same async completion contract as a test.
  • Constructor
    A constructable value accepted by expect.any.
  • AsymmetricMatcher
    Opaque partial-match value produced by helpers such as expect.objectContaining. It may be nested inside toEqual, toStrictEqual, and toMatchObject expectations.
  • Matchers
    Matchers for a synchronously received value.
  • AsyncMatchers
    Promise-returning matcher surface exposed by Matchers.resolves and Matchers.rejects. Await these calls so the test cannot finish before the assertion.
  • ExpectFunction
    Assertion entrypoint and Maligator-owned asymmetric matcher factories.
  • TestFunction
    Register tests in the current suite during module evaluation.
  • DescribeFunction
    Register nested suites synchronously during module evaluation.
Members and options

maligator:process

  • execution
    An immutable snapshot of the workflow, target, and resolved configuration, fixed before compilation. Known property reads can specialize application branches. Runtime arguments, environment, working directory, and PID are outside this snapshot. Profiling does not change production intent. Static and dynamic imports share its identity, and reflection sees the complete deeply frozen shape.
  • ExecutionProfile
    Profiling instrumentation: none by default; sampling for --profile; compiler for --profile=compiler. Both profiling modes select full optimization without selecting production application behavior.
  • ExecutionTarget
    The fixed platform contract of the application image.
  • ExecutionOptions
    Options shared by build, run, and dev. Output paths, verbosity, and compiler scheduling are tool settings and are not exposed.
  • TestExecutionOptions
    Normalized test settings, fixed for the application image. Changing these values invalidates specialized test artifacts.
  • ExecutionEngineConfig
    Resolved engine policies. These describe build inputs, never post-DCE native feature inclusion.
  • ExecutionConfig
    Resolved application engine and module policies. Excludes build-host paths, asset declarations, and output controls.
  • ExecutionCommon
    Fields shared by every execution workflow. All nested objects and arrays are deeply frozen at runtime.
  • Execution
    An immutable application-image description, discriminated by command. The command describes the workflow that prepared the image, not a transient process phase.
Members and options
Maligator 0.1.0-alpha.36 · Experimental · Source 6af07bd09681
Edit this page · Compatibility

Search guides and API reference.

Browse the API · Troubleshooting