UNPKG

2.57 kBTypeScriptView Raw
1import type { Primitive } from './misc';
2export declare type Context = Record<string, unknown>;
3export interface Contexts extends Record<string, Context | undefined> {
4 app?: AppContext;
5 device?: DeviceContext;
6 os?: OsContext;
7 culture?: CultureContext;
8 response?: ResponseContext;
9}
10export interface AppContext extends Record<string, unknown> {
11 app_name?: string;
12 app_start_time?: string;
13 app_version?: string;
14 app_identifier?: string;
15 build_type?: string;
16 app_memory?: number;
17}
18export interface DeviceContext extends Record<string, unknown> {
19 name?: string;
20 family?: string;
21 model?: string;
22 model_id?: string;
23 arch?: string;
24 battery_level?: number;
25 orientation?: 'portrait' | 'landscape';
26 manufacturer?: string;
27 brand?: string;
28 screen_resolution?: string;
29 screen_height_pixels?: number;
30 screen_width_pixels?: number;
31 screen_density?: number;
32 screen_dpi?: number;
33 online?: boolean;
34 charging?: boolean;
35 low_memory?: boolean;
36 simulator?: boolean;
37 memory_size?: number;
38 free_memory?: number;
39 usable_memory?: number;
40 storage_size?: number;
41 free_storage?: number;
42 external_storage_size?: number;
43 external_free_storage?: number;
44 boot_time?: string;
45 processor_count?: number;
46 cpu_description?: string;
47 processor_frequency?: number;
48 device_type?: string;
49 battery_status?: string;
50 device_unique_identifier?: string;
51 supports_vibration?: boolean;
52 supports_accelerometer?: boolean;
53 supports_gyroscope?: boolean;
54 supports_audio?: boolean;
55 supports_location_service?: boolean;
56}
57export interface OsContext extends Record<string, unknown> {
58 name?: string;
59 version?: string;
60 build?: string;
61 kernel_version?: string;
62}
63export interface CultureContext extends Record<string, unknown> {
64 calendar?: string;
65 display_name?: string;
66 locale?: string;
67 is_24_hour_format?: boolean;
68 timezone?: string;
69}
70export interface ResponseContext extends Record<string, unknown> {
71 type?: string;
72 cookies?: string[][] | Record<string, string>;
73 headers?: Record<string, string>;
74 status_code?: number;
75 body_size?: number;
76}
77export interface TraceContext extends Record<string, unknown> {
78 data?: {
79 [key: string]: any;
80 };
81 description?: string;
82 op?: string;
83 parent_span_id?: string;
84 span_id: string;
85 status?: string;
86 tags?: {
87 [key: string]: Primitive;
88 };
89 trace_id: string;
90}
91//# sourceMappingURL=context.d.ts.map
\No newline at end of file