add TypeScript fold methods