Docs@skmtc/core

Files and imports

CLASS

ReExportBase

@skmtc/core 0.63.4

The language-neutral contract for a registered re-export.

A @skmtc/lang-* package whose language supports re-exports provides a concrete subclass (TsReExport, …) that owns the language's re-export shape and rendering; a language without them simply never constructs one (its concise register vocabulary has no reExports field, so the absence is compile-time). The engine and CodeFileBase only ever see this neutral surface - the same split as ImportBase:

  • mergeKey() - identity for dedup AND the handle a File uses to arrange its re-export section (typically the source module path). Two re-exports with the same key collapse via merge.
  • merge(other) - combine a same-key re-export into this one (e.g. union their symbols). The subclass narrows other to its own type.
  • toString() - render the standalone re-export. A language File MAY re-arrange instead, so toString() is the per-entry render, not the whole section.

The merge of re-exports is language-neutral (it lives on CodeFileBase); the arrangement of the re-export section is language-specific (it lives in the concrete File.toString()).

Signature

import { ReExportBase } from '@skmtc/core'

abstract class ReExportBase

Methods

mergeKey

mergeKey(): string

Identity for dedup and arrangement - typically the source module path. Re-exports sharing a mergeKey() are merged via merge.

merge

merge(other: ReExportBase): ReExportBase

Combine another re-export that shares this mergeKey() into a single entry. The concrete subclass narrows other to its own type (and throws if handed a foreign re-export - which only happens if two languages wrote to one file, a misconfiguration).

toString

toString(): string

Render the standalone re-export. The File may re-arrange via mergeKey.