O'Reilly logo
  • Hari Khalsa thinks this is interesting:

import { Server } from "phaethon"; const server = new Server(); server.listener = request => new phaethon.ServerResponse("Hello"); server.listenHttp(8800);


Cover of TypeScript Blueprints


This code sample is not entirely right. To match the code sample as provided the phaethon.ServerResponse should be changed to just `ServerResponse.

However, if the desire is to keep phaethon namespaced, than the import needs to be changed. One approach is to wildcard match on import statement. import * as phaethon from 'phaethon'; Then, subsequent references would use the phaeton namespace. new phaethon.Server(); and new phaethon.ServerResponse("Hello");