export type Fn = (...args: args) => returns; export declare const cached: (thunk: () => t) => (() => t); export declare const isThunk: (value: value) => value is Extract extends never ? value & Thunk : Extract; export type Thunk = () => ret; export type thunkable = t | Thunk; export declare const tryCatch: (fn: () => returns, onError?: (e: unknown) => onError) => returns | onError; export declare const DynamicFunction: DynamicFunction; export type DynamicFunction = new (...args: ConstructorParameters) => fn & { apply(thisArg: null, args: Parameters): ReturnType; call(thisArg: null, ...args: Parameters): ReturnType; }; export type CallableOptions = { attach?: attachments; bind?: object; }; /** @ts-ignore required to cast function type */ export interface Callable extends fn, attachments { } export declare class Callable { constructor(fn: fn, ...[opts]: {} extends attachments ? [opts?: CallableOptions] : [opts: CallableOptions]); } export type GuardablePredicate = ((In: input) => In is narrowed) | ((In: input) => boolean); export type TypeGuard = (In: input) => In is narrowed; /** * Checks if the environment has Content Security Policy (CSP) enabled, * preventing JIT-optimized code from being compiled via new Function(). * * @returns `true` if a function created using new Function() can be * successfully invoked in the environment, `false` otherwise. * * The result is cached for subsequent invocations. */ export declare const envHasCsp: () => boolean;