Skip to content

fmodata: ContainerDbType not exported from public API #194

@chriscors

Description

@chriscors

Problem

ContainerDbType (the branded type returned by containerField()) is not exported from @proofkit/fmodata's main entry point. It is only exported from the internal barrel orm/index.d.ts, which is not accessible via the package's exports map.

This means any consumer that uses containerField() in a file with declaration emit enabled (declaration: true in tsconfig) will hit TS2742:

The inferred type of 'MyTable' cannot be named without a reference to
'../node_modules/@proofkit/fmodata/dist/esm/orm'. This is likely not portable.
A type annotation is necessary.

Expected behavior

ContainerDbType should be exported from @proofkit/fmodata alongside containerField:

export { containerField, type ContainerDbType } from "./orm";

Reproduction

import { fmTableOccurrence, containerField, textField } from "@proofkit/fmodata";

// This triggers TS2742 when declaration emit is enabled
export const MyTable = fmTableOccurrence("MyTable", {
  id: textField(),
  file: containerField(),
}, { entityId: "FMTID:123" });

Workaround

Disable declaration emit ("noEmit": true) if consuming the package source directly via transpilePackages.

Versions

  • @proofkit/fmodata: 0.1.0-beta.34 (also present in beta.35)
  • TypeScript: 5.8.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions