diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2020-01-12 16:40:58 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-12 16:40:58 +0900 |
| commit | 9703ba53405b2f355c6e0317f714d82ff3d4dee3 (patch) | |
| tree | 4cd80df78b5c78bb60d47179836d393ee8d805d4 /src/@types | |
| parent | Refactor (diff) | |
| download | sharkey-9703ba53405b2f355c6e0317f714d82ff3d4dee3.tar.gz sharkey-9703ba53405b2f355c6e0317f714d82ff3d4dee3.tar.bz2 sharkey-9703ba53405b2f355c6e0317f714d82ff3d4dee3.zip | |
ファイルと画像認識処理の改善 (#5690)
* dimensions制限とリファクタ
* comment
* 不要な変更削除
* use fromFile など
* Add probe-image-size.d.ts
* えーCRLFで作るなよ…
* Update src/@types/probe-image-size.d.ts
Co-Authored-By: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
* fix d.ts
* Update src/@types/probe-image-size.d.ts
Co-Authored-By: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
* Update src/@types/probe-image-size.d.ts
Co-Authored-By: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
* fix
Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Diffstat (limited to 'src/@types')
| -rw-r--r-- | src/@types/probe-image-size.d.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/@types/probe-image-size.d.ts b/src/@types/probe-image-size.d.ts new file mode 100644 index 0000000000..665edcf2e7 --- /dev/null +++ b/src/@types/probe-image-size.d.ts @@ -0,0 +1,27 @@ +declare module 'probe-image-size' { + import { ReadStream } from 'fs'; + + type ProbeOptions = { + retries: 1; + timeout: 30000; + }; + + type ProbeResult = { + width: number; + height: number; + length?: number; + type: string; + mime: string; + wUnits: 'in' | 'mm' | 'cm' | 'pt' | 'pc' | 'px' | 'em' | 'ex'; + hUnits: 'in' | 'mm' | 'cm' | 'pt' | 'pc' | 'px' | 'em' | 'ex'; + url?: string; + }; + + function probeImageSize(src: string | ReadStream, options?: ProbeOptions): Promise<ProbeResult>; + function probeImageSize(src: string | ReadStream, callback: (err: Error | null, result?: ProbeResult) => void): void; + function probeImageSize(src: string | ReadStream, options: ProbeOptions, callback: (err: Error | null, result?: ProbeResult) => void): void; + + namespace probeImageSize {} // Hack + + export = probeImageSize; +} |