export declare function guard(func: () => T, defaultValue?: T, onError?: (error: Error) => T | void): T;