@gramio/files
Advanced tools
Comparing version 0.0.4 to 0.0.5
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
/// <reference types="bun-types" /> | ||
/// <reference types="node" /> | ||
import type { Readable } from "node:stream"; | ||
@@ -12,19 +9,19 @@ /** Class-helper with static methods for file uploading. */ | ||
*/ | ||
static path(path: string, filename?: string): Promise<import("buffer").File>; | ||
static path(path: string, filename?: string): Promise<File>; | ||
/** | ||
* Method for uploading Media File by Readable stream. | ||
*/ | ||
static stream(stream: Readable, filename?: string): Promise<import("buffer").File>; | ||
static stream(stream: Readable, filename?: string): Promise<File>; | ||
/** | ||
* Method for uploading Media File by Buffer or ArrayBuffer. | ||
*/ | ||
static buffer(buffer: Buffer | ArrayBuffer, filename?: string): import("buffer").File; | ||
static buffer(buffer: Buffer | ArrayBuffer, filename?: string): File; | ||
/** | ||
* Method for uploading Media File by URL (also with fetch options). | ||
*/ | ||
static url(url: URL | string, filename?: string, options?: RequestInit): Promise<import("buffer").File>; | ||
static url(url: URL | string, filename?: string, options?: RequestInit): Promise<File>; | ||
/** | ||
*Method for uploading Media File by text content. | ||
*/ | ||
static text(text: string, filename?: string): import("buffer").File; | ||
static text(text: string, filename?: string): File; | ||
} |
@@ -6,3 +6,3 @@ /// <reference types="node" /> | ||
export declare function isMediaUpload<T extends keyof APIMethods>(method: T, params: NonNullable<APIMethodParams<T>>): boolean; | ||
export declare function convertJsonToFormData<T extends keyof APIMethods>(method: T, params: NonNullable<APIMethodParams<T>>): Promise<import("undici-types").FormData>; | ||
export declare function convertJsonToFormData<T extends keyof APIMethods>(method: T, params: NonNullable<APIMethodParams<T>>): Promise<FormData>; | ||
export declare function convertStreamToBuffer(stream: Readable): Promise<Buffer>; |
{ | ||
"name": "@gramio/files", | ||
"main": "./dist/index.js", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"type": "commonjs", | ||
@@ -21,11 +21,10 @@ "description": "Library for uploading files to Telegram and etc with files", | ||
"devDependencies": { | ||
"@biomejs/biome": "1.6.3", | ||
"@gramio/types": "^7.2.0", | ||
"@biomejs/biome": "1.6.4", | ||
"@types/bun": "^1.0.12", | ||
"@types/node": "^20.12.2", | ||
"@types/node": "^20.12.7", | ||
"prettier": "^3.2.5", | ||
"typescript": "^5.4.3" | ||
"typescript": "^5.4.5" | ||
}, | ||
"peerDependencies": { | ||
"@gramio/types": "^7.2.0" | ||
"dependencies": { | ||
"@gramio/types": "^7.2.1" | ||
}, | ||
@@ -32,0 +31,0 @@ "files": [ |
5
15313
378
+ Added@gramio/types@^7.2.1