Skip to content

Instantly share code, notes, and snippets.

@heyimalex
heyimalex / typed-immutable.ts
Last active November 23, 2021 23:45
Pragmatic typed immutable.js records using typescript 2.1+
// Pragmatic typed immutable.js records using typescript 2.1+
// Comment with any suggestions/improvements!
import * as fs from 'fs'
import { Record, Map } from 'immutable'
type Stats = fs.Stats;
// Define the basic shape. All properties should be readonly. This model
// defines a folder because it seemed easy C: