Typescript: make arguments optional
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- api
調査の方向性
interface.d.tsを開き、onStart、onError、onSuccess、onProgress、beforeUploadのコールバック宣言を確認します。既存のTypeScript定義と想定される使用方法を確認したうえで、コールバックが未使用のパラメーターを省略しても型エラーにならないこと、および宣言が引き続き有効であることを検証します。
索引モデルが issue の本文から書いたものです。
説明
In interface.d.ts in these methods all the arguments are required:
onStart?: (file: RcFile) => void;
onError?: (error: Error, ret: object, file: RcFile) => void;
onSuccess?: (response: object, file: RcFile, xhr: object) => void;
onProgress?: (event: UploadProgressEvent, file: RcFile) => void;
beforeUpload?: (file: RcFile, FileList: RcFile[]) => BeforeUploadFileType | Promise<void | BeforeUploadFileType>;
But in my code I might be not interested in file argument, for example. While all args are required I must still define them and get TS errors for defined and not used variables.
Could you please make these args optional like this:
onSuccess?: (response?: object, file?: RcFile, xhr?: object) => void;
- 主要言語
- TypeScript
- スター
- 804
- フォーク
- 323
- 平均マージ
- 12分
- マージ済み PR(30日)
- 1
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
react-component/upload のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
react-component/upload#170 ·
-
HVAC website オープン
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
react-component/upload#697 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 15/100
react-component/upload#615 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
react-component/upload#522 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
react-component/upload#515 ·
react-component/upload の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
calcite-components needs triage refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Esri/calcite-design-system#15203 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
danielmiessler/LifeOS#2218 ·