42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import { EntityDict } from '../oak-app-domain';
|
|
import { File } from 'formidable';
|
|
import { BRC } from '../types/RuntimeCxt';
|
|
export declare function getInfoByUrl(params: {
|
|
url: string;
|
|
}): Promise<{
|
|
title: string;
|
|
publishDate: number | undefined;
|
|
imageList: string[];
|
|
}>;
|
|
export declare function uploadExtraFile<ED extends EntityDict>(params: {
|
|
applicationId: string;
|
|
file: File;
|
|
extraFileId?: string;
|
|
}, // FormData表单提交
|
|
context: BRC<ED>): Promise<{
|
|
success: boolean;
|
|
}>;
|
|
/**
|
|
* 合并分片上传的文件
|
|
*/
|
|
export declare function mergeChunkedUpload<ED extends EntityDict>(params: {
|
|
extraFileId: string;
|
|
}, context: BRC<ED>): Promise<void>;
|
|
export declare function presignFile<ED extends EntityDict>(params: {
|
|
extraFileId: string;
|
|
method?: 'GET' | 'PUT' | 'POST' | 'DELETE';
|
|
}, context: BRC<ED>): Promise<{
|
|
url: string;
|
|
headers?: Record<string, string | string[]>;
|
|
formdata?: Record<string, any>;
|
|
}>;
|
|
export declare function presignMultiPartUpload<ED extends EntityDict>(params: {
|
|
extraFileId: string;
|
|
from: number;
|
|
to: number;
|
|
}, context: BRC<ED>): Promise<{
|
|
partNumber: number;
|
|
uploadUrl: string;
|
|
formData?: Record<string, any>;
|
|
}[]>;
|