Skip to main content
Version: Next

Interface: ISettingsService

molecule.ISettingsService

Implemented by

Methods

append

append(settings): void

Append new Settings object eg: append({ project: { name: 'example' } })

Parameters

NameTypeDescription
settingsISettingsobject

Returns

void

Defined in

services/settingsService.ts:33


applySettings

applySettings(nextSettings): void

Apply the nextSettings configuration

Parameters

NameType
nextSettingsISettings

Returns

void

Defined in

services/settingsService.ts:75


flatObject

flatObject(obj): object

It converts an object to a flatted object, eg: { a: { b: 'test' }}, result is : { 'a.b': 'test' }.

Parameters

NameTypeDescription
objobjectobject

Returns

object

Defined in

services/settingsService.ts:49


flatObject2JSONString

flatObject2JSONString(obj): string

It converts an object to a flatted json string, eg: { a: { b: 'test' }}, result is : { 'a.b': 'test' }.

Parameters

NameTypeDescription
objobjectobject

Returns

string

Defined in

services/settingsService.ts:55


getDefaultSettingsTab

getDefaultSettingsTab(): IEditorTab<{ language: string ; value: string }>

Get the default Settings Tab object

Returns

IEditorTab<{ language: string ; value: string }>

Defined in

services/settingsService.ts:86


getSettings

getSettings(): ISettings

Get the settings object

Returns

ISettings

Defined in

services/settingsService.ts:43


normalizeFlatObject

normalizeFlatObject<T>(jsonStr): T

It converts a flatted JSON string to a normal object, eg: { 'a.b': 'test' } result is : { a: { b: 'test' }}.

Type parameters

NameType
TISettings

Parameters

NameTypeDescription
jsonStrstringstring

Returns

T

T

Defined in

services/settingsService.ts:62


onChangeSettings

onChangeSettings(callback): void

Listen to the Settings change event.

Parameters

NameType
callback(tab: IEditorTab<IEditorTab<{ language: string ; value: string }>>) => void

Returns

void

Defined in

services/settingsService.ts:80


openSettingsInEditor

openSettingsInEditor(): void

Open the settings.json in the Editor Panel

Returns

void

Defined in

services/settingsService.ts:70


toJSONString

toJSONString(obj, space?): string

It converts an object to JSON string

Parameters

NameType
objobject
space?number

Returns

string

Defined in

services/settingsService.ts:66


update

update(settings): void

To update a settings object, it's going to overwrite a settings item if it existed.

Parameters

NameType
settingsISettings

Returns

void

Defined in

services/settingsService.ts:39