Skip to content

Commit 1bdafc0

Browse files
committed
add example response to docstrings
1 parent 24d6c17 commit 1bdafc0

File tree

1 file changed

+111
-1
lines changed

1 file changed

+111
-1
lines changed

src/lib/types.ts

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,28 @@ export interface DeviceInfoService {
625625
/**
626626
* Get list of running processes
627627
* @returns Array of process information
628+
* @example
629+
* ```typescript
630+
* const processes = await deviceInfo.proclist();
631+
* // Example response:
632+
* // [
633+
* // {
634+
* // name: 'audioaccessoryd',
635+
* // startDate: { 'NS.time': 786563887.8186979 },
636+
* // isApplication: false,
637+
* // pid: 77,
638+
* // realAppName: '/usr/libexec/audioaccessoryd'
639+
* // },
640+
* // {
641+
* // name: 'dmd',
642+
* // startDate: { 'NS.time': 786563890.2724509 },
643+
* // isApplication: false,
644+
* // pid: -102,
645+
* // realAppName: '/usr/libexec/dmd'
646+
* // },
647+
* // ...
648+
* // ]
649+
* ```
628650
*/
629651
proclist(): Promise<ProcessInfo[]>;
630652

@@ -638,36 +660,124 @@ export interface DeviceInfoService {
638660
/**
639661
* Get hardware information
640662
* @returns Hardware information object
663+
* @example
664+
* ```typescript
665+
* const hwInfo = await deviceInfo.hardwareInformation();
666+
* // Example response:
667+
* // {
668+
* // numberOfPhysicalCpus: 6,
669+
* // hwCPUsubtype: 2,
670+
* // numberOfCpus: 6,
671+
* // hwCPUtype: 16777228,
672+
* // hwCPU64BitCapable: 1,
673+
* // ProcessorTraceState: {
674+
* // HWTraceVersion: '{\n "lib_ver": "libhwtrace @ tag libhwtrace-118.1",\n "api_ver": 21,\n ...\n}',
675+
* // Streaming: false,
676+
* // ProdTraceSupported: false,
677+
* // AllocatedBufferSize: 0,
678+
* // HWSupported: false,
679+
* // HWConfigured: false,
680+
* // RequestedBufferSize: 0,
681+
* // DevTraceSupported: false
682+
* // }
683+
* // }
684+
* ```
641685
*/
642686
hardwareInformation(): Promise<any>;
643687

644688
/**
645689
* Get network information
646690
* @returns Network information object
691+
* @example
692+
* ```typescript
693+
* const networkInfo = await deviceInfo.networkInformation();
694+
* // Example response:
695+
* // {
696+
* // en2: 'Ethernet Adapter (en2)',
697+
* // en0: 'Wi-Fi',
698+
* // en1: 'Ethernet Adapter (en1)',
699+
* // lo0: 'Loopback'
700+
* // }
701+
* ```
647702
*/
648703
networkInformation(): Promise<any>;
649704

650705
/**
651706
* Get mach time information
652-
* @returns Mach time info object
707+
* @returns Mach time info array containing [machAbsoluteTime, numer, denom, machContinuousTime, systemTime, timezone]
708+
* @example
709+
* ```typescript
710+
* const machTime = await deviceInfo.machTimeInfo();
711+
* // Example response:
712+
* // [
713+
* // 1536005260807, // machAbsoluteTime
714+
* // 125, // numer
715+
* // 3, // denom
716+
* // 1713684132688, // machContinuousTime
717+
* // 1764942215.065243, // systemTime
718+
* // 'Asia/Kolkata' // timezone
719+
* // ]
720+
* ```
653721
*/
654722
machTimeInfo(): Promise<any>;
655723

656724
/**
657725
* Get mach kernel name
658726
* @returns Kernel name string
727+
* @example
728+
* ```typescript
729+
* const kernelName = await deviceInfo.machKernelName();
730+
* // Example response:
731+
* // '/mach.release.t8030'
732+
* ```
659733
*/
660734
machKernelName(): Promise<string>;
661735

662736
/**
663737
* Get kernel performance event database
664738
* @returns KPEP database object or null
739+
* @example
740+
* ```typescript
741+
* const kpep = await deviceInfo.kpepDatabase();
742+
* // Example response:
743+
* // {
744+
* // system: {
745+
* // cpu: {
746+
* // config_counters: 1020,
747+
* // marketing_name: 'Apple A13',
748+
* // fixed_counters: 3,
749+
* // aliases: { ... },
750+
* // events: { ... },
751+
* // architecture: 'arm64',
752+
* // power_counters: -32
753+
* // }
754+
* // },
755+
* // internal: false,
756+
* // id: 'cpu_100000c_2_462504d2',
757+
* // name: 'a13',
758+
* // version: [1, 0]
759+
* // }
760+
* ```
665761
*/
666762
kpepDatabase(): Promise<any | null>;
667763

668764
/**
669765
* Get trace code mappings
670766
* @returns Object mapping trace codes (as hex strings) to descriptions
767+
* @example
768+
* ```typescript
769+
* const codes = await deviceInfo.traceCodes();
770+
* // Example response:
771+
* // {
772+
* // '0x1020000': 'KTrap_DivideError',
773+
* // '0x1020004': 'KTrap_Debug',
774+
* // '0x1020008': 'KTrap_NMI',
775+
* // '0x102000c': 'KTrap_Int3',
776+
* // '0x1020010': 'KTrap_Overflow',
777+
* // '0x1020014': 'KTrap_BoundRange',
778+
* // ...
779+
* // }
780+
* ```
671781
*/
672782
traceCodes(): Promise<Record<string, string>>;
673783

0 commit comments

Comments
 (0)