obsidian-dev-utils
Version:
This is the collection of useful functions that you can use for your Obsidian plugin development
30 lines (29 loc) • 1.21 kB
text/typescript
/**
* @packageDocumentation
*
* Contains utility functions for working with functions.
*/
/**
* A function that does nothing.
*/
export declare function noop(): void;
/**
* A function that does nothing.
*/
export declare function noopAsync(): Promise<void>;
/**
* Makes an async function that calls the original async function with the provided arguments and omits the return value.
*
* @typeParam Args - Arguments to be passed to the function.
* @param fn - Function to be called.
* @returns An async function that calls the original function with the provided arguments and omits the return value.
*/
export declare function omitAsyncReturnType<Args extends unknown[]>(fn: (...args: Args) => Promise<unknown>): (...args: Args) => Promise<void>;
/**
* Makes a function that calls the original function with the provided arguments and omits the return value.
*
* @typeParam Args - Arguments to be passed to the function.
* @param fn - Function to be called.
* @returns A function that calls the original function with the provided arguments and omits the return value.
*/
export declare function omitReturnType<Args extends unknown[]>(fn: (...args: Args) => unknown): (...args: Args) => void;