UNPKG

isaacscript-common

Version:

Helper functions and features for IsaacScript mods.

129 lines 7.08 kB
import type { CollectibleType, ItemPoolType } from "isaac-typescript-definitions"; import { DamageFlag, DisplayFlag, EntityFlag, ProjectileFlag, TearFlag, UseFlag } from "isaac-typescript-definitions"; import type { ReadonlyRecord } from "../types/ReadonlyRecord"; /** * Helper function to log all of the values in an array. * * @param array The array to log. * @param name Optional. The name of the array, which will be logged before the elements. */ export declare function logArray(this: void, array: readonly unknown[], name?: string): void; /** * Helper function to log the names of a collectible type array. * * @param collectibleTypes The collectible types to log. * @param name Optional. The name of the array, which will be logged before the elements. */ export declare function logCollectibleTypes(this: void, collectibleTypes: readonly CollectibleType[], name?: string): void; /** * Helper function to log a `Color` object. * * @param color The `Color` object to log. * @param name Optional. The name of the object, which will be logged before the properties. */ export declare function logColor(this: void, color: Color, name?: string): void; /** Helper function to log every damage flag that is turned on. Useful when debugging. */ export declare function logDamageFlags(this: void, damageFlags: DamageFlag | BitFlags<DamageFlag>): void; /** Helper function to log every display flag that is turned on. Useful when debugging. */ export declare function logDisplayFlags(this: void, displayFlags: DisplayFlag | BitFlags<DisplayFlag>): void; /** Helper function to log every entity flag that is turned on. Useful when debugging. */ export declare function logEntityFlags(this: void, entityFlags: EntityFlag | BitFlags<EntityFlag>): void; export declare function logEntityID(this: void, entity: Entity): void; /** Helper function for logging every flag that is turned on. Useful when debugging. */ export declare function logFlags<T extends BitFlag | BitFlag128>(this: void, flags: T | BitFlags<T>, flagEnum: ReadonlyRecord<string, T>, description?: string): void; /** Helper function for logging every game state flag that is turned on. Useful when debugging. */ export declare function logGameStateFlags(this: void): void; /** * Helper function to log the names of a item pool type array. * * @param itemPoolTypes The item pool types to log. * @param name Optional. The name of the array, which will be logged before the elements. */ export declare function logItemPoolTypes(this: void, itemPoolTypes: readonly ItemPoolType[], name?: string): void; /** * Helper function to log a `KColor` object. * * @param kColor The `KColor` object to log. * @param name Optional. The name of the object, which will be logged before the properties. */ export declare function logKColor(this: void, kColor: KColor, name?: string): void; /** Helper function for logging every level state flag that is turned on. Useful when debugging. */ export declare function logLevelStateFlags(this: void): void; /** * Helper function to log a TSTL `Map`. * * @param map The TSTL `Map` to log. * @param name Optional. The name of the map, which will be logged before the elements. */ export declare function logMap(this: void, map: ReadonlyMap<number | string, unknown>, name?: string): void; export declare function logMusic(this: void): void; export declare function logPlayerEffects(this: void, player: EntityPlayer): void; export declare function logPlayerHealth(this: void, player: EntityPlayer): void; /** Helper function for logging every projectile flag that is turned on. Useful when debugging. */ export declare function logProjectileFlags(this: void, projectileFlags: ProjectileFlag | BitFlags<ProjectileFlag>): void; /** Helper function for logging information about the current room. */ export declare function logRoom(this: void): void; /** * Helper function for logging every seed effect (i.e. Easter Egg) that is turned on for the * particular run. */ export declare function logSeedEffects(this: void): void; /** * Helper function to log a TSTL `Set`. * * @param set The TSTL `Set` to log. * @param name Optional. The name of the set, which will be logged before the elements. */ export declare function logSet(this: void, set: ReadonlySet<number | string>, name?: string): void; /** Helper function for logging every sound effect that is currently playing. */ export declare function logSounds(this: void): void; /** * Helper function for logging every key and value of a Lua table. This is a deep log; the function * will recursively call itself if it encounters a table within a table. * * This function will only work on tables that have string keys (because it logs the keys in order, * instead of randomly). It will throw a run-time error if it encounters a non-string key. * * In order to prevent infinite recursion, this function will not log a sub-table when there are 10 * or more parent tables. */ export declare function logTable(this: void, luaTable: unknown, parentTables?: number): void; /** * Helper function to log the differences between the entries of two tables. Note that this will * only do a shallow comparison. */ export declare function logTableDifferences<K extends AnyNotNil, V>(this: void, table1: LuaMap<K, V>, table2: LuaMap<K, V>): void; /** * Helper function to log the keys of a Lua table. This is not a deep log; only the keys of the * top-most table will be logged. * * This function is useful for tables that have recursive references. */ export declare function logTableKeys(this: void, luaTable: unknown): void; /** * Helper function to log every table key and value. This is a shallow log; the function will not * recursively traverse sub-tables. * * This function will only work on tables that have string keys (because it logs the keys in order, * instead of randomly). It will throw a run-time error if it encounters a non-string key. */ export declare function logTableShallow<K extends AnyNotNil, V>(this: void, luaTable: LuaMap<K, V>): void; /** Helper function for log every tear flag that is turned on. Useful when debugging. */ export declare function logTearFlags(this: void, tearFlags: TearFlag | BitFlags<TearFlag>): void; /** Helper function for printing out every use flag that is turned on. Useful when debugging. */ export declare function logUseFlags(this: void, useFlags: UseFlag | BitFlags<UseFlag>): void; /** * Helper function to enumerate all of the properties of a "userdata" object (i.e. an object from * the Isaac API). */ export declare function logUserdata(this: void, userdata: unknown): void; /** * Helper function to log a `Vector` object. * * @param vector The `Vector` object to log. * @param name Optional. The name of the object, which will be logged before the properties. * @param round Optional. If true, will round the vector values to the nearest integer. Default is * false. */ export declare function logVector(this: void, vector: Vector, name?: string, round?: boolean): void; //# sourceMappingURL=logMisc.d.ts.map