-
Notifications
You must be signed in to change notification settings - Fork 141
Conversation
@eugenkiss Wanna help here? |
I believe @vigneshshanmugam should check if the shape of the One remark for @arhont375: In the example folder it'd be nice to have a README with information on how to run the example (for example using ts-node) since node cannot run TypeScript files directly of course. |
Codecov Report
@@ Coverage Diff @@
## master #226 +/- ##
=====================================
Coverage 99% 99%
=====================================
Files 15 15
Lines 603 603
Branches 112 112
=====================================
Hits 597 597
Misses 6 6 Continue to review full report at Codecov.
|
@eugenkiss |
examples/basic-typescript/README.md
Outdated
Install TypeScript compiler and execute following; | ||
|
||
```bash | ||
tsk ./index.ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tsc
?
index.d.ts
Outdated
amdLoaderUrl?: string | ||
, fetchContext?: (req: IncomingMessage) => Promise<object> | ||
, fetchTemplate?: (templatesPath: string, baseTemplateFn: (path: string) => string) => Promise<any> | ||
, filterRequestHeaders?: (attributes: object, req: IncomingMessage) => object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can type the fragmentAttributes since we expose only few of them by default.
- https://github.com/zalando/tailor/blob/master/lib/fragment.js#L24
- https://github.com/zalando/tailor/blob/master/lib/fragment.js#L58
- also add
[key: string]: any
since we override custom attributes - 207 custom attributes #209
index.d.ts
Outdated
, maxAssetLinks?: number | ||
, pipeAttributes?: (attributes: object) => object | ||
, pipeInstanceName?: string | ||
, requestFragment?: (filterHeaders: (attributes: object, req: IncomingMessage) => object, url: Url, attributes: object, req: IncomingMessage) => Promise<IncomingMessage> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
returns Promise<ServerResponse>
index.d.ts
Outdated
, fetchContext?: (req: IncomingMessage) => Promise<object> | ||
, fetchTemplate?: (templatesPath: string, baseTemplateFn: (path: string) => string) => Promise<any> | ||
, filterRequestHeaders?: (attributes: object, req: IncomingMessage) => object | ||
, filterResponseHeaders?: (attributes: object, req: ServerResponse) => object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: req
-> res
👍 |
2 similar comments
👍 |
👍 |
@arhont375 Thanks for the PR 🙂 |
HI,
Thank you for this great project.
This PR is adds TypeScript typings for this package, that will help other people to get information about possible options from IDE suggestions. A bit less possible to make mistake.
And also will allow using of this library in TypeSript projects without additional works.