Last active
June 7, 2019 20:00
-
-
Save isthatcentered/edc685a3859bdaad0401d487fc75dd9c to your computer and use it in GitHub Desktop.
Typescript declaration merging / type augmentations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"//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 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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