effx
API reference@effx/compiler

surface-check

API reference for @effx/compiler/surface-check

surface-check.ts overview


Exports Grouped by Category


utils

CheckWiringInput (interface)

Signature

export interface CheckWiringInput {
  readonly surface: Surface
  readonly generated: ReadonlyArray<GeneratedSource>
  readonly facts: WiringFacts
  /** Entry as the user typed it, for messages. */
  readonly entry: string
}

GeneratedSource (interface)

Signature

export interface GeneratedSource {
  /** Absolute path, normalized the same way the frontend normalizes reference paths. */
  readonly path: string
  readonly contents: string
}

WiringFacts (interface)

Signature

export interface WiringFacts {
  /** Recognized `Cloudflare.Worker` calls in the reachable files. */
  readonly workers: ReadonlyArray<Location>
  readonly references: ReadonlyArray<WiringReference>
  /** Sites where wiring cannot be established statically (spec 0021 §4.2). */
  readonly undecidable: ReadonlyArray<{
    readonly location: Location
    readonly reason: Parameters<typeof CoreDiagnostics.EFFX2806.emit>[0]
  }>
}

WiringReference (interface)

A value reference, in a file reachable from the entry, to export name of generated module file.

Signature

export interface WiringReference {
  readonly file: string
  readonly name: string
  readonly location: Location
}

checkWiring

missing = expected ∖ referenced (EFFX2802); extra = referenced ∖ expected (EFFX2803).

Signature

declare const checkWiring: (input: CheckWiringInput) => ReadonlyArray<Diagnostic>

isWiringExport

The closed set of wiring-capable generated exports: AppRoutes of http.ts and the <Group>ApiHandlers factories of *-handlers.ts. Contract, rpc, cli, client, foldkit and guard files export no wiring.

Signature

declare const isWiringExport: (file: string, name: string) => boolean

On this page