//#region src/saferTyping.d.ts /** * Use this only when you have 100% of certainty that this will not break the * types */ type __LEGIT_ANY__ = any; type __FIX_THIS_TYPING__ = any; type __LEGIT_ANY_FUNCTION__ = (...params: any) => __LEGIT_ANY__; /** An empty object type, equivalent to `{}` but with safer typing */ type EmptyObject = Record; /** * Cast a value to `any` type. Use this when you have legit usage of `any` * casting. * * @template V (optional) - When used enforces that the casted value is * assignable to the type V, use it for safer casts * @param value */ declare function __LEGIT_ANY_CAST__(value: V): __LEGIT_ANY__; /** * Cast a value to a specific type T. Use this when you have legit usage of type * assertion. * * @template T - The type to cast to * @template V (optional) - When used enforces that the casted value is * assignable to the type V, use it for safer casts * @param value */ declare function __LEGIT_CAST__(value: V): T; /** * Refine a value to a specific type T. Use this when you have legit usage of * type assertion. * * @template T - The type to cast to * @template V (optional) - When used enforces that the casted value is * assignable to the type V, use it for safer casts * @param value */ declare function __REFINE_CAST__(value: T): () => R; declare function __FIX_THIS_CASTING__(value: unknown): T; declare function __FIX_THIS_TYPING__(value: unknown): __LEGIT_ANY__; /** * Any type that is not a primitive (number, string, boolean, null, undefined, * symbol, bigint, ...) Equivalent to `object` type */ type AnyNonPrimitiveValue = object; /** * Cast any value to a string. Use this when you have legit usage of string * casting. */ declare function __UNSAFE_TO_STRING__(value: unknown): string; //#endregion export { AnyNonPrimitiveValue, EmptyObject, __FIX_THIS_CASTING__, __FIX_THIS_TYPING__, __LEGIT_ANY_CAST__, __LEGIT_ANY_FUNCTION__, __LEGIT_ANY__, __LEGIT_CAST__, __REFINE_CAST__, __UNSAFE_TO_STRING__ };