Home Reference Source
import Settings from '@osjs/server/src/settings.js'
public class | source

Settings

OS.js Settings Manager

Constructor Summary

Public Constructor
public

constructor(core: Core, options: SettingsOptions)

Create new instance

Member Summary

Public Members
public

Method Summary

Public Methods
public

Destroy instance

public

async init(): Promise<boolean>

Initializes adapter

public

async load(req: Request, res: Response): Promise<undefined>

Sends load request to adapter

public

async save(req: Request, res: Response): Promise<undefined>

Sends save request to adapter

Public Constructors

public constructor(core: Core, options: SettingsOptions) source

Create new instance

Params:

NameTypeAttributeDescription
core Core

Core reference

options SettingsOptions
  • optional

Instance options

Public Members

public core: Core source

Public Methods

public destroy() source

Destroy instance

public async init(): Promise<boolean> source

Initializes adapter

Return:

Promise<boolean>

public async load(req: Request, res: Response): Promise<undefined> source

Sends load request to adapter

Params:

NameTypeAttributeDescription
req Request

Express request

res Response

Express response

Return:

Promise<undefined>

public async save(req: Request, res: Response): Promise<undefined> source

Sends save request to adapter

Params:

NameTypeAttributeDescription
req Request

Express request

res Response

Express response

Return:

Promise<undefined>