Skip to content

Commit

Permalink
feat: better declaration merging
Browse files Browse the repository at this point in the history
Signed-off-by: Anshuman Chhapolia <[email protected]>
  • Loading branch information
achhapolia10 committed Mar 23, 2024
1 parent 45037fd commit 85a8c7b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
11 changes: 0 additions & 11 deletions src/@types/global/index.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/address/Address.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
Controller,
ServiceController,
} from "@smoke-trees/postgres-backend";
import { RequestHandler } from "express";
import { Request, RequestHandler, Response } from "express";
import { Address } from "./Address.entity";
import { AddressService } from "./Address.service";

Expand Down
19 changes: 19 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { ContextType } from "@smoke-trees/smoke-context";

export type Optional<T, M extends keyof T> = Pick<Partial<T>, M> & Omit<T, M>;

declare global {
// eslint-disable-next-line
namespace SmokeContext {
export interface KeyValuePair {
userId: string;
}
}

// eslint-disable-next-line
namespace Express {
export interface Request {
context: ContextType;
}
}
}

0 comments on commit 85a8c7b

Please sign in to comment.