/** * WARNING * * This file contains declaration of internal types that helps with * debugging and testing the library. The library must be compiled * with DEBUG build configuration to expose such functionality. */ /** * Information about underlying native object. */ export interface NativeObjectInfo { id: string; class: string; tag?: string; isValid: boolean; policies: string[]; createDate: number; lastUseDate?: number; usageCount?: number; } /** * Command type. */ export type NativeObjectCmd = 'create' | 'release' | 'releaseAll' | 'use' | 'find' | 'touch' | 'setPeriod'; /** * Native object types. */ export type NativeObjectType = 'data' | 'secure-data' | 'number' | 'password'; /** * Data accepted in debugCommand() function. */ export interface NativeObjectCmdData { objectId?: string; objectTag?: string; objectType?: NativeObjectType; releasePolicy?: string[]; cleanupPeriod?: number; } /** * Result returned from debugCommand() */ export type NativeObjectCmdResult = boolean | string | undefined; /** * Debug interface exposed by native object register. */ export interface NativeObjectRegisterIfc { /** * Dump content of internal native object register. The function is implemented in DEBUG build of the library. * @param instanceId If provided, then returns only objects associated to PowerAuth instance identifier. * @returns Array with `NativeObjectInfo` */ debugDump(instanceId: string | undefined): Promise>; /** * Manipulate with object register. The function is implemented in DEBUG build of the library. * @param command Command to execute. * @param data Command data. * @returns Command result. */ debugCommand(command: NativeObjectCmd, data: NativeObjectCmdData): Promise; }