@agconnect/network-types
Advanced tools
Comparing version 1.2.0 to 1.2.1-beta
154
index.d.ts
@@ -0,1 +1,3 @@ | ||
import {downloadTask} from "../network/src/quickppTransload/downloadTask"; | ||
export namespace AGCPlatformInfoService { | ||
@@ -5,2 +7,3 @@ export const enum Naming { | ||
} | ||
export interface PlatformInfo { | ||
@@ -30,2 +33,3 @@ getPlatform(): string; | ||
timeout?: number; | ||
transformResponse?:((data: any) => any)[]; | ||
responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'; | ||
@@ -50,12 +54,5 @@ onUploadProgress?: (progressEvent: any) => void; | ||
export interface Cancel { | ||
message: string; | ||
} | ||
export interface Canceler { | ||
(message?: string): void; | ||
} | ||
export interface CancelTokenStatic { | ||
new(executor: (cancel: Canceler) => void): CancelToken; | ||
source(): CancelTokenSource; | ||
@@ -67,5 +64,14 @@ } | ||
reason?: Cancel; | ||
throwIfRequested(): void; | ||
} | ||
export interface Cancel { | ||
message: string; | ||
} | ||
export interface Canceler { | ||
(message?: string): void; | ||
} | ||
export interface CancelTokenSource { | ||
@@ -93,2 +99,3 @@ token: CancelToken; | ||
} | ||
export interface AGCFile { | ||
@@ -104,3 +111,3 @@ uri: string; | ||
files: AGCFile[]; | ||
headers?: any; | ||
header?: any; | ||
method?: string; | ||
@@ -110,2 +117,3 @@ data?: any; | ||
} | ||
export interface AGCUploadResponse<T = any> { | ||
@@ -118,8 +126,125 @@ data: T; | ||
export interface AGCUploadTaskRequest { | ||
url: string; | ||
method?: string; | ||
files: AGCFile[]; | ||
data?: any; | ||
timeout?: number; | ||
validateStatus?: ((status: number) => boolean); | ||
} | ||
export interface AGCUploadTaskResponse<T = any> { | ||
data: T; | ||
status: number; | ||
headers: any; | ||
} | ||
export interface AGCDownloadRequest { | ||
url: string; | ||
header?: any; | ||
description?: string; | ||
filename?: string; | ||
validateStatus?: ((status: number) => boolean); | ||
} | ||
export interface AGCDownloadResponse<T = any> { | ||
status: number; | ||
token: string; | ||
} | ||
export interface AGCDownloadTaskRequest { | ||
url: string; | ||
header?: any; | ||
filename?: string; | ||
timeout?: number; | ||
validateStatus?: ((status: number) => boolean); | ||
} | ||
export interface AGCDownloadTaskResponse<T = any> { | ||
status: number; | ||
filePath: string; | ||
header: any; | ||
} | ||
export interface AGCDownloadCompleteRequest { | ||
token: string; | ||
validateStatus?: ((status: number) => boolean); | ||
} | ||
export interface AGCDownloadCompleteResponse<T = any> { | ||
status: number; | ||
uri: string; | ||
} | ||
export interface AGCRequestTaskRequest { | ||
url: string; | ||
data?: any; | ||
header?: any; | ||
method?: string; | ||
timeout?: number; | ||
responseType?: string; | ||
validateStatus?: ((status: number) => boolean); | ||
} | ||
export interface AGCRequestTaskResponse<T = any> { | ||
data: T; | ||
status: number; | ||
statusText: string; | ||
header: any; | ||
} | ||
export interface AGCFileTransload { | ||
upload(request: AGCUploadRequest): Promise<AGCUploadResponse>; | ||
uploadTask(request: AGCUploadRequest) : Promise<AGCUploadResponse>; | ||
onProgressUpdate(progress: (progressEvent: any) => void) : void; | ||
onHeadersReceived(received: (progressEvent: any) => void) : void; | ||
abort() : void; | ||
upload( | ||
req: AGCFileTransloadService.AGCUploadRequest | ||
): Promise<AGCFileTransloadService.AGCUploadResponse>; | ||
download( | ||
req: AGCFileTransloadService.AGCDownloadRequest | ||
): Promise<AGCFileTransloadService.AGCDownloadResponse>; | ||
onDownloadComplete( | ||
req: AGCFileTransloadService.AGCDownloadCompleteRequest | ||
): Promise<AGCFileTransloadService.AGCDownloadCompleteResponse>; | ||
downloadWithTask( | ||
req: AGCFileTransloadService.AGCDownloadTaskRequest | ||
): Promise<AGCFileTransloadService.AGCDownloadTaskResponse>; | ||
downloadtaskOnProgressUpdate(progress: (progressEvent: any) => void): void; | ||
downloadtaskOnHeadersReceived(received: (progressEvent: any) => void): void; | ||
downloadtaskOffProgressUpdate(): void; | ||
downloadtaskOffHeadersReceived(): void; | ||
downloadtaskAbort(): void; | ||
uploadWithTask( | ||
req: AGCFileTransloadService.AGCUploadTaskRequest | ||
): Promise<AGCFileTransloadService.AGCUploadTaskResponse>; | ||
uploadtaskOnProgressUpdate(progress: (progressEvent: any) => void): void; | ||
uploadtaskOnHeadersReceived(received: (progressEvent: any) => void): void; | ||
uploadtaskOffProgressUpdate(): void; | ||
uploadtaskOffHeadersReceived(): void; | ||
uploadtaskAbort(): void; | ||
request( | ||
req: AGCFileTransloadService.AGCRequestTaskRequest | ||
): Promise<AGCFileTransloadService.AGCRequestTaskResponse> ; | ||
requestOnProgressUpdate(progress: (progressEvent: any) => void): void; | ||
requestOnHeadersReceived(received: (progressEvent: any) => void): void; | ||
requestOffProgressUpdate(): void ; | ||
requestOffHeadersReceived(): void ; | ||
requestAbort(): void ; | ||
} | ||
@@ -132,2 +257,3 @@ } | ||
} | ||
export interface AGCWebSocket { | ||
@@ -134,0 +260,0 @@ connect(url: string, header: any, protocols?: [string]): void; |
{ | ||
"name": "@agconnect/network-types", | ||
"version": "1.2.0", | ||
"description": "", | ||
"version": "1.2.1-beta", | ||
"description": "@agconnect/network-types", | ||
"scripts": {}, | ||
@@ -12,4 +12,4 @@ "files": [ | ||
}, | ||
"author": "", | ||
"author": "https://developer.huawei.com/", | ||
"license": "ISC" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
7398
198
1
2