Hyperlinkv0.8.0-beta.28

FileSystem

FileSystem.SizeInputtypeeffect/FileSystem.ts:429
SizeInput

Input type for size parameters that accepts multiple numeric types.

Details

This union type allows file system operations to accept size values in different formats for convenience, which are then normalized to the branded Size type internally.

Example (Using size inputs)

import { Effect, FileSystem } from "effect"

const program = Effect.gen(function*() {
  const fs = yield* FileSystem.FileSystem

  // All of these are valid SizeInput values
  yield* fs.truncate("file1.txt", 1024) // number
  yield* fs.truncate("file2.txt", BigInt(2048)) // bigint
  yield* fs.truncate("file3.txt", FileSystem.Size(4096)) // Size
})
sizes
export type SizeInput = bigint | number | Size
Referenced by 3 symbols