Skip to content

Instantly share code, notes, and snippets.

@isthatcentered
Last active June 7, 2019 20:00
Show Gist options
  • Save isthatcentered/edc685a3859bdaad0401d487fc75dd9c to your computer and use it in GitHub Desktop.
Save isthatcentered/edc685a3859bdaad0401d487fc75dd9c to your computer and use it in GitHub Desktop.
Typescript declaration merging / type augmentations
{
"//1//":"This doesn't seem to be needed",
"compilerOptions": {
// ... your setup
"typeRoots": ["./custom.d.ts"] // Aka add these types on top of the other ones
}
}
import * as admin from "firebase-admin"
declare global
{
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Express
{
export interface Request
{
user: admin.auth.DecodedIdToken
}
interface Session
{
}
}
}
interface Array<T>
{
last(): T | undefined
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment