Skip to main content

Interface: ISettingsService

services.ISettingsService

Table of contents

Methods

Methods

append

append(settings): void

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

Parameters

NameTypeDescription
settingsISettingsobject

Returns

void

Defined in

src/services/settingsService.ts:16


applySettings

applySettings(nextSettings): void

Apply the nextSettings configuration

Parameters

NameType
nextSettingsISettings

Returns

void

Defined in

src/services/settingsService.ts:58


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

src/services/settingsService.ts:32


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

src/services/settingsService.ts:38


getDefaultSettingsTab

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

Get the default Settings Tab object

Returns

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

Defined in

src/services/settingsService.ts:69


getSettings

getSettings(): ISettings

Get the settings object

Returns

ISettings

Defined in

src/services/settingsService.ts:26


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

src/services/settingsService.ts:45


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

src/services/settingsService.ts:63


onSettingsSaved

onSettingsSaved(callback): void

Parameters

NameType
callback(settings: ISettings) => void

Returns

void

Defined in

src/services/settingsService.ts:73


openSettingsInEditor

openSettingsInEditor(): void

Open the settings.json in the Editor Panel

Returns

void

Defined in

src/services/settingsService.ts:53


saveSettings

saveSettings(): void

Returns

void

Defined in

src/services/settingsService.ts:71


toJSONString

toJSONString(obj, space?): string

It converts an object to JSON string

Parameters

NameType
objobject
space?number

Returns

string

Defined in

src/services/settingsService.ts:49


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

src/services/settingsService.ts:22