Skip to content

Instantly share code, notes, and snippets.

@josemarluedke
Created May 4, 2019 04:41
Show Gist options
  • Save josemarluedke/ee2612055aae28e4fa842d74f63caee9 to your computer and use it in GitHub Desktop.
Save josemarluedke/ee2612055aae28e4fa842d74f63caee9 to your computer and use it in GitHub Desktop.
Ember FastBoot service typescript type definitions
declare module 'ember-cli-fastboot/services/fastboot' {
import Service from '@ember/service';
interface Request {
method: string;
body: unknown;
cookies: unknown;
headers: unknown;
queryParams: unknown;
path: string;
protocol: string;
host: string;
}
interface Shoebox {
put(key: string, value: unknown): void;
retrieve(key: string): undefined | JSON;
}
export default class Fastboot extends Service {
public isFastBoot: boolean;
public request: Request;
public shoebox: Shoebox;
public response: unknown; // need types
public metadata: unknown; // need types
public deferRendering(promise: Promise<unknown>): unknown;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment