effx
API reference@effx/compilerlift

native

API reference for @effx/compiler/lift/native

native.ts overview


Exports Grouped by Category


utils

NativeCallee

A native callee or value, concretely: the semantic kind, the target profile the claim was made under, the reference exactly as it appears in the lowered term, and the static member the term selects from it (HttpApiEndpoint + get, HttpApiSchema + NoContent; absent when the reference itself is the value).

Signature

declare const NativeCallee: Schema.Struct<{
  readonly kind: Schema.Literals<
    readonly [
      "HttpApiEndpoint",
      "HttpApiGroup",
      "HttpApi",
      "HttpApiSchema",
      "HttpApiBuilder",
      "OpenApi",
      "Schema",
      "SchemaAST"
    ]
  >
  readonly target: Schema.Literals<readonly ["effect-4.0"]>
  readonly ref: Schema.Struct<{
    readonly module: Schema.String
    readonly export: Schema.String
    readonly member: Schema.optionalKey<Schema.String>
  }>
  readonly member: Schema.optionalKey<Schema.String>
}>

NativeCallee (type alias)

Signature

type NativeCallee = typeof NativeCallee.Type

NativeFamily

Which module family of the target profile a kind belongs to (a key of generate/target.ts's table).

Signature

declare const NativeFamily: Schema.Literals<readonly ["core", "httpApi"]>

NativeFamily (type alias)

Signature

type NativeFamily = typeof NativeFamily.Type

NativeKind

The native Effect namespaces the lift reads. Each is a namespace export whose members the core names.

Signature

declare const NativeKind: Schema.Literals<
  readonly [
    "HttpApiEndpoint",
    "HttpApiGroup",
    "HttpApi",
    "HttpApiSchema",
    "HttpApiBuilder",
    "OpenApi",
    "Schema",
    "SchemaAST"
  ]
>

NativeKind (type alias)

Signature

type NativeKind = typeof NativeKind.Type

isNativeModule

Is a module inside the family that the target profile maps for this kind? Family roots come from the generator's stable profile table.

Signature

declare const isNativeModule: (target: TargetProfile, kind: NativeKind, module: string) => boolean

nativeCalleeOf

The native identity a term names, or undefined. A term names a native when it is Ref(r) or Member(Ref(r), m) and the frontend's inventory claims (r, m) under the model's own target and inside the family the profile table assigns to the claimed kind. Anything else is not native.

Signature

declare const nativeCalleeOf: (
  target: TargetProfile,
  natives: ReadonlyArray<NativeCallee>,
  term: Term
) => NativeCallee | undefined

nativeFamilies

Total by construction: adding a kind without a family does not compile.

Signature

declare const nativeFamilies: Readonly<
  Record<
    | "Schema"
    | "HttpApiEndpoint"
    | "HttpApiGroup"
    | "HttpApi"
    | "HttpApiSchema"
    | "HttpApiBuilder"
    | "OpenApi"
    | "SchemaAST",
    "core" | "httpApi"
  >
>

nativeName

The member a claim names: the static member of a namespace reference (HttpApiEndpoint + get), or the export itself when the frontend resolved the declaring module's export directly (get of HttpApiEndpoint.ts). Both spellings of one native value answer with the same name.

Signature

declare const nativeName: (callee: NativeCallee) => string

On this page