( model: Domain.Namespace, indentation: number )
| 241 | } |
| 242 | |
| 243 | const printNamespace = ( |
| 244 | model: Domain.Namespace, |
| 245 | indentation: number |
| 246 | ): Effect.Effect<string, never, Configuration.Configuration | Parser.Source> => { |
| 247 | return Effect.gen(function*() { |
| 248 | const header = yield* printModel(model.name, model.doc, { |
| 249 | position: model.position, |
| 250 | indentation, |
| 251 | postfix: "(namespace)" |
| 252 | }) |
| 253 | const interfaces = yield* Effect.forEach(model.interfaces, (inter) => printInterface(inter, indentation + 1)) |
| 254 | const typeAliases = yield* Effect.forEach( |
| 255 | model.typeAliases, |
| 256 | (typeAlias) => printTypeAlias(typeAlias, indentation + 1) |
| 257 | ) |
| 258 | const namespaces = yield* Effect.forEach( |
| 259 | model.namespaces, |
| 260 | (namespace) => printNamespace(namespace, indentation + 1) |
| 261 | ) |
| 262 | return header + |
| 263 | interfaces.map((s) => "\n\n" + s).join("") + |
| 264 | typeAliases.map((s) => "\n\n" + s).join("") + |
| 265 | namespaces.map((s) => "\n\n" + s).join("") |
| 266 | }) |
| 267 | } |
| 268 | |
| 269 | /** @internal */ |
| 270 | export const print = (p: Printable) => { |
no test coverage detected