type ISOTime = `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z`; type GyazoType = "jpg" | "png" | "gif"; type ThumbURL = `https://thumb.gyazo.com/thumb/${number}${ "" | "_w" | "_crop" }/${string}.${GyazoType}`; type ThumbWebpURL = `https://thumb.gyazo.com/thumb/${number}${ "" | "_w" | "_crop" }/${string}.webp`; type IThumbURL = `https://i.gyazo.com/thumb/${number}${ "" | "_w" | "_crop" }/${string}.${GyazoType}`; type IThumbWebpURL = `https://i.gyazo.com/thumb/${number}${ "" | "_w" | "_crop" }/${string}.webp`; type PermalinkURL = `https://gyazo.com/${string}`; type IGyazoURL = `https://i.gyazo.com/${string}.${GyazoType}`; interface GridThumbs { large_url: ThumbURL | null; large_url_2x: ThumbURL | null; large_url_webp: ThumbWebpURL | null; large_url_webp_2x: ThumbWebpURL | null; medium_url: ThumbURL | null; medium_url_2x: ThumbURL | null; medium_url_webp: ThumbWebpURL | null; medium_url_webp_2x: ThumbWebpURL | null; small_url: ThumbURL | null; small_url_2x: ThumbURL | null; small_url_webp: ThumbWebpURL | null; small_url_webp_2x: ThumbWebpURL | null; mobile_2x_url: IThumbURL | null; mobile_2x_url_webp: IThumbWebpURL | null; } /** 座標を表す * - 左上が原点 * - 単位はpx */ interface Point { x: number; y: number; } /** 四角形の領域を表す */ interface BoundingPoly { vertices: [Point, Point, Point, Point]; } interface Exif { "Color Space": string; "Components Configuration": string; Compression: string; "Custom Rendered": string; "Date and Time": string; "Date and Time (Digitized)": string; "Exif Version": string; FlashPixVersion: string; Manufacturer: string; Model: string; Orientation: string; "Pixel X Dimension": string; "Pixel Y Dimension": string; "Resolution Unit": string; Software: string; "X-Resolution": `${number}`; "Y-Resolution": `${number}`; "YCbCr Positioning": string; ok: "ok"; } interface User { name: string; desc: string | null; icon_url: string; pro: boolean; } interface Image { alias_id: string; image_id: string; // 無料ユーザーで10枚以上取得しようとしたとき空文字になる thumb_url: ThumbURL; thumb_url_2x: ThumbURL; thumb_url_webp: ThumbWebpURL; thumb_url_webp_2x: ThumbWebpURL; file_only: boolean; has_files: boolean; file_types: string | null; file_names: string | null; cross_origin: "anonymous"; access_policy: "anyone"; accessible: boolean; created_at: ISOTime; updated_at: ISOTime | null; exif_captured_at: ISOTime | null; deletable: boolean; desc: string; grid_thumbs: GridThumbs; metadata?: { app: string; title: string; url: string; desc: string; ocr_started: boolean; exif: Exif; exif_status: { captured_at: "from_created_at"; ok: true; msg: "ok"; }, exif_normalized: { timezone: "unknown; } }, non_cropped_thumb: { scaled: { scale: 2; size: 400; url: ThumbURL; }; url: ThumbURL; }; owned: true; permalink_path: `/${string}` | null; // 無料ユーザーで10枚以上取得しようとしたときnullになる permalink_url: PermalinkURL | null; // 無料ユーザーで10枚以上取得しようとしたときnullになる user: User | null; // 無料ユーザーで10枚以上取得しようとしたときnullになる url: IGyazoURL | null; // 無料ユーザーで10枚以上取得しようとしたときnullになる };