uniky 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,75 @@
1
+ // created by zhuxietong on 2026-01-30 17:08
2
+
3
+ declare namespace UniApp {
4
+ interface RequestOptions {
5
+ url: string
6
+ data?: any
7
+ header?: Record<string, string>
8
+ method?:
9
+ | 'GET'
10
+ | 'POST'
11
+ | 'PUT'
12
+ | 'DELETE'
13
+ | 'CONNECT'
14
+ | 'HEAD'
15
+ | 'OPTIONS'
16
+ | 'TRACE'
17
+ | 'PATCH'
18
+ timeout?: number
19
+ dataType?: string
20
+ responseType?: string
21
+ sslVerify?: boolean
22
+ withCredentials?: boolean
23
+ firstIpv4?: boolean
24
+ success?: (result: RequestSuccessCallbackResult) => void
25
+ fail?: (result: GeneralCallbackResult) => void
26
+ complete?: (result: GeneralCallbackResult) => void
27
+ }
28
+
29
+ interface RequestSuccessCallbackResult {
30
+ data: any
31
+ statusCode: number
32
+ header: Record<string, string>
33
+ cookies: string[]
34
+ profile?: RequestProfile
35
+ }
36
+
37
+ interface RequestProfile {
38
+ redirectStart: number
39
+ redirectEnd: number
40
+ fetchStart: number
41
+ domainLookupStart: number
42
+ domainLookupEnd: number
43
+ connectStart: number
44
+ connectEnd: number
45
+ SSLconnectionStart: number
46
+ SSLconnectionEnd: number
47
+ requestStart: number
48
+ requestEnd: number
49
+ responseStart: number
50
+ responseEnd: number
51
+ rtt: number
52
+ estimate_nettype: string
53
+ httpRttEstimate: number
54
+ transportRttEstimate: number
55
+ throughputKbpsEstimate: number
56
+ protocol: string
57
+ }
58
+
59
+ interface GeneralCallbackResult {
60
+ errMsg: string
61
+ errno?: number
62
+ [key: string]: any
63
+ }
64
+
65
+ interface RequestTask {
66
+ abort(): void
67
+ offHeadersReceived(callback: (result: any) => void): void
68
+ onHeadersReceived(callback: (result: any) => void): void
69
+ }
70
+ }
71
+
72
+ declare const uni: {
73
+ request(options: UniApp.RequestOptions): UniApp.RequestTask
74
+ [key: string]: any
75
+ }