Skip to content

langium-zod / generateNamespaceOps

Function: generateNamespaceOps() ​

ts
function generateNamespaceOps(types, options?): string;

Defined in: emitters/namespace-ops.ts:322

No import-alias suffix is used. The generated domain.ts is a single barrel:

import * as ast from './ast.js'; export * from './ast.js'; // forwards every guard / reflection / non-namespaced type export type Data = ast.Data; // local type alias — shadows the star-exported interface export namespace Data { ... } // local value — shadows the star-exported reflection const

A local type + namespace pair under the same name merges (type space + value space) and, per TypeScript export precedence, shadows the corresponding names brought in by export * from './ast.js'. So function signatures reference bare Data / Attribute, which resolve to the local alias (namespaced types) or the star-exported interface (non-namespaced element types) — no $-suffixed aliases, no TS2395.

Parameters ​

ParameterType
typesZodTypeDescriptor[]
options?NamespaceOpsOptions

Returns ​

string

Released under the MIT License.