Skip to content

Commit 66d6183

Browse files
authored
Explicitly export members of fluidRouter to workaround Typescript issue (#5056) (#5063)
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)
1 parent de226b2 commit 66d6183

File tree

1 file changed

+10
-1
lines changed
  • packages/loader/core-interfaces/src

1 file changed

+10
-1
lines changed

packages/loader/core-interfaces/src/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@
88
export { IFluidObject } from "./fluidObject";
99

1010
export * from "./fluidLoadable";
11-
export * from "./fluidRouter";
11+
// Typescript forgets the index signature when customers augment IRequestHeader if we export *.
12+
// So we export the explicit members as a workaround:
13+
// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038
14+
export {
15+
IRequest,
16+
IRequestHeader,
17+
IResponse,
18+
IProvideFluidRouter,
19+
IFluidRouter,
20+
} from "./fluidRouter";
1221
export * from "./handles";
1322
export * from "./serializer";
1423
export * from "./fluidPackage";

0 commit comments

Comments
 (0)