Skip to content

Commit

Permalink
Explicitly export members of fluidRouter to workaround Typescript iss…
Browse files Browse the repository at this point in the history
…ue (#5056)

When downstream customers augment the IRequestHeader, the [index: string]: any; signature is lost and they end up with "property does not exist" errors.

This change uses this workaround to resolve the issue:
microsoft/TypeScript#18877 (comment)
  • Loading branch information
ChumpChief committed Feb 5, 2021
1 parent 3a9d350 commit d50f6b0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/loader/core-interfaces/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@
export { IFluidObject } from "./fluidObject";

export * from "./fluidLoadable";
export * from "./fluidRouter";
// Typescript forgets the index signature when customers augment IRequestHeader if we export *.
// So we export the explicit members as a workaround:
// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038
export {
IRequest,
IRequestHeader,
IResponse,
IProvideFluidRouter,
IFluidRouter,
} from "./fluidRouter";
export * from "./handles";
export * from "./serializer";
export * from "./fluidPackage";

0 comments on commit d50f6b0

Please sign in to comment.