1/**
2 * Aggregate Deno platform services layer.
3 *
4 * This module defines the `DenoServices` union and a single `layer` that
5 * provides Deno-backed child process spawning, crypto, filesystem, path, stdio,
6 * and terminal services. Use the layer when a Deno program wants the standard
7 * platform services from one place.
8 *
9 * @since 4.0.0
10 */
11import type { Crypto } from "effect/Crypto"
12import type { FileSystem } from "effect/FileSystem"
13import * as Layer from "effect/Layer"
14import type { Path } from "effect/Path"
15import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"
16import type { Stdio } from "effect/Stdio"
17import type { Terminal } from "effect/Terminal"
18import * as DenoChildProcessSpawner from "./DenoChildProcessSpawner.ts"
19import * as DenoCrypto from "./DenoCrypto.ts"
20import * as DenoFileSystem from "./DenoFileSystem.ts"
21import * as DenoPath from "./DenoPath.ts"
22import * as DenoStdio from "./DenoStdio.ts"
23import * as DenoTerminal from "./DenoTerminal.ts"
24
25/**
26 * The union of core services provided by the Deno platform layer, including
27 * child process spawning, crypto, filesystem, path, stdio, and terminal services.
28 *
29 * @category models
30 * @since 4.0.0
31 */
32export type DenoServices = ChildProcessSpawner | Crypto | FileSystem | Path | Terminal | Stdio
33
34/**
35 * Provides the default Deno implementations for child process spawning,
36 * crypto, filesystem, path, stdio, and terminal services.
37 *
38 * @category layers
39 * @since 4.0.0
40 */
41export const layer: Layer.Layer<DenoServices> = DenoChildProcessSpawner.layer.pipe(
42 Layer.provideMerge(Layer.mergeAll(
43 DenoFileSystem.layer,
44 DenoCrypto.layer,
45 DenoPath.layer,
46 DenoStdio.layer,
47 DenoTerminal.layer
48 ))
49)