@agconnect/network-types
Advanced tools
Comparing version 1.2.0-beta1 to 1.2.0
@@ -32,2 +32,4 @@ export namespace AGCPlatformInfoService { | ||
onDownloadProgress?: (progressEvent: any) => void; | ||
validateStatus?: ((status: number) => boolean); | ||
cancelToken?: CancelToken; | ||
} | ||
@@ -42,2 +44,31 @@ | ||
export interface AGCError<T = any> extends Error { | ||
code?: string; | ||
response?: AGCResponse<T>; | ||
} | ||
export interface Cancel { | ||
message: string; | ||
} | ||
export interface Canceler { | ||
(message?: string): void; | ||
} | ||
export interface CancelTokenStatic { | ||
new(executor: (cancel: Canceler) => void): CancelToken; | ||
source(): CancelTokenSource; | ||
} | ||
export interface CancelToken { | ||
promise: Promise<Cancel>; | ||
reason?: Cancel; | ||
throwIfRequested(): void; | ||
} | ||
export interface CancelTokenSource { | ||
token: CancelToken; | ||
cancel: Canceler; | ||
} | ||
export interface AGCNetwork { | ||
@@ -51,5 +82,42 @@ post(url: string, param: any, headers?: any, config?: AGCRequestConfig): Promise<AGCResponse>; | ||
put(url: string, param?: any, headers?: any, config?: AGCRequestConfig): Promise<AGCResponse>; | ||
CancelToken: CancelTokenStatic; | ||
} | ||
} | ||
export namespace AGCFileTransloadService { | ||
export const enum Naming { | ||
value = "AGCFileTransloadService", | ||
} | ||
export interface AGCFile { | ||
uri: string; | ||
filename?: string; | ||
name?: string; | ||
type?: string; | ||
} | ||
export interface AGCUploadRequest { | ||
url: string; | ||
files: AGCFile[]; | ||
headers?: any; | ||
method?: string; | ||
data?: any; | ||
validateStatus?: ((status: number) => boolean); | ||
} | ||
export interface AGCUploadResponse<T = any> { | ||
data: T; | ||
status: number; | ||
statusText: string; | ||
headers: 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; | ||
} | ||
} | ||
export namespace AGCWebSocketService { | ||
@@ -56,0 +124,0 @@ export const enum Naming { |
{ | ||
"name": "@agconnect/network-types", | ||
"version": "1.2.0-beta1", | ||
"version": "1.2.0", | ||
"description": "", | ||
@@ -14,2 +14,2 @@ "scripts": {}, | ||
"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
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
4079
109
1