Type alias FormDataParameters<K>

FormDataParameters<K>: {
    [key in keyof MethodParameters<K>]: TgrmFileId extends MethodParameters<K>[key]
        ? Exclude<MethodParameters<K>[key], TgrmFileId> | File
        : MethodParameters<K>[key]
}

The parameters of a given method from Methods with the File type replaced by a Blob

Type Parameters

Example: <caption>Replace the file_id parameter with a File</caption>

const file = new File(["hello"], "hello.txt");
const params: FormDataParameters<"sendDocument"> = { chat_id: 123, document: file };