import { MakeOnlyOptionalKeys } from "./table_tools"; export declare namespace FunctionTools { function ExecuteIfClient(callback: (...args: T) => ReturnType, ...args: T): ReturnType | undefined; function ExecuteIfServer(callback: (...args: T) => ReturnType, ...args: T): ReturnType | undefined; /**executes client call back for the client and server callback for the server, returns the callback return arguments */ function ExecuteOnServerAndClient(server_callback: (...args: T) => ReturnType, client_callback: (...args: T) => ReturnType, ...args: T): ReturnType; function Execute(callback: (...args: T) => ReturnType, ...args: T): ReturnType; function ExecuteWith(item: T, callback: (item: T) => void): T; /** * creates the function that accepts optional arguments, but they are getting filled out by default parameters * @param default_parameters * @param callback * @returns */ function CreateFunctionWithOptionalArguments(default_parameters: MakeOnlyOptionalKeys, callback: (data: T) => Q): (data: T) => ReturnType; /** * * @param value value to switch * @param possible_variants possible variants of value * @param possible_answers possible answers with coresponding indexes to variants * @param default_value if variant wasnt found, will return a default value * @returns if value is a variant, will return the answer with the same index as a variant * * ```ts * * SwitchValueIfEquals( * value, * [1, 2, 3], * [3, 2, 1], * 0) * * //equivalent to * switch(value){ * case(1):{ * return 3; * } * case(2):{ * return 2; * } * case(3):{ * return 1} * } * default:{ * return: 0} * ``` */ function SwitchValueIfEquals(value: T, possible_variants: T[], possible_answers: Q[], default_value: Q): Q; }