a library to speed up the development of Fivem scripts and frameworks
fivem-ts - Documentation v0.7.5 • Docs
fivem-ts - Documentation v0.7.5 / Shared / getConfig
getConfig(
target
,propertyKey
?):object
|undefined
Retrieves the configuration metadata associated with a class or method.
• target: object
The target object (class or prototype).
• propertyKey?: string
The name of the method being queried, if applicable.
object
| undefined
undefined
if no settings are found.@Config({ maxPlayers: 32, gameMode: 'deathmatch' })
class GameConfig {
}
class PlayerSettings {
@Config({ maxHealth: 100, canRespawn: true })
configurePlayer() {
}
}
// Retrieve configuration metadata
const classConfig = getConfig(GameConfig);
const methodConfig = getConfig(PlayerSettings.prototype, 'configurePlayer');
console.log('Class Config:', classConfig); // output: { maxPlayers: 32, gameMode: 'deathmatch' }
console.log('Method Config:', methodConfig); // output: { maxHealth: 100, canRespawn: true }