webf icon indicating copy to clipboard operation
webf copied to clipboard

Implement FormData.

Open linsmod opened this issue 1 year ago • 13 comments

In this pull request, FormData Web API and it's qjs binding is implmented.

For prototype, see below:

type FormDataPart={}
export interface FormData {
    new():FormData;
    append(name: string, value: BlobPart, fileName?: string): void;
    // This method name is a placeholder of **delete** method to avoid using C++ keyword
    // and will be replaced to **delete** when installing in MemberInstaller::InstallFunctions.
    form_data_delete(name: string): void;
    get(name: string): BlobPart
    getAll(name: string): BlobPart[];
    has(name: string): boolean;
    set(name: string, value: BlobPart, fileName?: string): void;
    forEach(callbackfn: Function, thisArg?: any): void;
    keys():string[]
    values():BlobPart[]
    entries():FormDataPart[]
}

Todo: Making FetchModule support FormData body.

Todo: Should using fileName parameter in append/set implementation, we do NOT using it currently.

linsmod avatar Aug 13 '24 14:08 linsmod