Class: IQConfig
config.IQConfig
IQConfig class for managing BBS configuration
Table of contents
Constructors
Accessors
Methods
- deleteCustom
- ensureDirectories
- fromJSON
- get
- getAll
- getCustom
- isLoaded
- load
- reset
- resetSection
- save
- set
- setAll
- setCustom
- toJSON
- validate
Constructors
constructor
• new IQConfig(configPath?)
Parameters
| Name | Type | Default value |
|---|---|---|
configPath |
string |
"./iniquity.json" |
Defined in
Accessors
display
• get display(): IDisplayConfig
Get display configuration
Returns
Defined in
• set display(config): void
Set display configuration
Parameters
| Name | Type |
|---|---|
config |
Partial<IDisplayConfig> |
Returns
void
Defined in
logging
• get logging(): ILoggingConfig
Get logging configuration
Returns
Defined in
• set logging(config): void
Set logging configuration
Parameters
| Name | Type |
|---|---|
config |
Partial<ILoggingConfig> |
Returns
void
Defined in
network
• get network(): INetworkConfig
Get network configuration
Returns
Defined in
• set network(config): void
Set network configuration
Parameters
| Name | Type |
|---|---|
config |
Partial<INetworkConfig> |
Returns
void
Defined in
paths
• get paths(): IPathsConfig
Get paths configuration
Returns
Defined in
• set paths(config): void
Set paths configuration
Parameters
| Name | Type |
|---|---|
config |
Partial<IPathsConfig> |
Returns
void
Defined in
security
• get security(): ISecurityConfig
Get security configuration
Returns
Defined in
• set security(config): void
Set security configuration
Parameters
| Name | Type |
|---|---|
config |
Partial<ISecurityConfig> |
Returns
void
Defined in
server
• get server(): IServerConfig
Get server configuration
Returns
Defined in
• set server(config): void
Set server configuration
Parameters
| Name | Type |
|---|---|
config |
Partial<IServerConfig> |
Returns
void
Defined in
Methods
deleteCustom
▸ deleteCustom(key): boolean
Delete custom configuration value
Parameters
| Name | Type |
|---|---|
key |
string |
Returns
boolean
Defined in
ensureDirectories
▸ ensureDirectories(): void
Ensure all required directories exist
Returns
void
Defined in
fromJSON
▸ fromJSON(json): boolean
Import configuration from JSON string
Parameters
| Name | Type |
|---|---|
json |
string |
Returns
boolean
Defined in
get
▸ get<T>(path): undefined | T
Get a specific config value by path (e.g., ‘server.name’)
Type parameters
| Name | Type |
|---|---|
T |
any |
Parameters
| Name | Type |
|---|---|
path |
string |
Returns
undefined | T
Defined in
getAll
▸ getAll(): IBBSConfig
Get full configuration
Returns
Defined in
getCustom
▸ getCustom<T>(key): undefined | T
Get custom configuration value
Type parameters
| Name | Type |
|---|---|
T |
any |
Parameters
| Name | Type |
|---|---|
key |
string |
Returns
undefined | T
Defined in
isLoaded
▸ isLoaded(): boolean
Check if config was loaded from file
Returns
boolean
Defined in
load
▸ load(): boolean
Load configuration from file
Returns
boolean
Defined in
reset
▸ reset(): void
Reset configuration to defaults
Returns
void
Defined in
resetSection
▸ resetSection(section): void
Reset a specific section to defaults
Parameters
| Name | Type |
|---|---|
section |
keyof IBBSConfig |
Returns
void
Defined in
save
▸ save(): boolean
Save configuration to file
Returns
boolean
Defined in
set
▸ set(path, value): boolean
Set a specific config value by path (e.g., ‘server.name’)
Parameters
| Name | Type |
|---|---|
path |
string |
value |
any |
Returns
boolean
Defined in
setAll
▸ setAll(config): void
Set full configuration
Parameters
| Name | Type |
|---|---|
config |
Partial<IBBSConfig> |
Returns
void
Defined in
setCustom
▸ setCustom(key, value): void
Set custom configuration value
Parameters
| Name | Type |
|---|---|
key |
string |
value |
any |
Returns
void
Defined in
toJSON
▸ toJSON(): string
Export configuration as JSON string
Returns
string
Defined in
validate
▸ validate(): Object
Validate configuration
Returns
Object
| Name | Type |
|---|---|
errors |
string[] |
valid |
boolean |