Summary
While preserving the implementations and outward-facing API shape (All consumers of the refactored APIs should not need any code changes to compile and test successfully), replace static classes like:
./FileSystem.ts
export class FileSystem {
public static someApi(...): TResult { ... }
}
with a reexported module namespace object that forwards individual exports for single files:
./FileSystem.ts
import * as FileSystem from './fileSystem/index';
./fileSystem/index.ts
export { someApi } from './someApi';
./fileSystem/someApi.ts
export function someApi(...): TResult { ... }
The Disposables and Objects APIs are existing examples of the new pattern. FileSystem and Text are examples of the old pattern to be replaced.
The reason for this conversion is that module namespace objects can be tree-shaken by modern bundlers, but static members on classes cannot.