Interface: ISettingsService
molecule.ISettingsService
Implemented by
Methods
append
▸ append(settings
): void
Append new Settings object
eg: append({ project: { name: 'example' } })
Parameters
Name | Type | Description |
---|---|---|
settings | ISettings | object |
Returns
void
Defined in
src/services/settingsService.ts:33
applySettings
▸ applySettings(nextSettings
): void
Apply the nextSettings configuration
Parameters
Name | Type |
---|---|
nextSettings | ISettings |
Returns
void
Defined in
src/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
Name | Type | Description |
---|---|---|
obj | object | object |
Returns
object
Defined in
src/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
Name | Type | Description |
---|---|---|
obj | object | object |
Returns
string
Defined in
src/services/settingsService.ts:55
getDefaultSettingsTab
▸ getDefaultSettingsTab(): IEditorTab
<Object
>
Get the default Settings Tab object
Returns
IEditorTab
<Object
>
Defined in
src/services/settingsService.ts:86
getSettings
▸ getSettings(): ISettings
Get the settings object
Returns
Defined in
src/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
Name | Type |
---|---|
T | ISettings |
Parameters
Name | Type | Description |
---|---|---|
jsonStr | string | string |
Returns
T
T
Defined in
src/services/settingsService.ts:62
onChangeSettings
▸ onChangeSettings(callback
): void
Listen to the Settings change event.
Parameters
Name | Type |
---|---|
callback | (tab : IEditorTab <IEditorTab <Object >>) => void |
Returns
void
Defined in
src/services/settingsService.ts:80
openSettingsInEditor
▸ openSettingsInEditor(): void
Open the settings.json
in the Editor Panel
Returns
void
Defined in
src/services/settingsService.ts:70
toJSONString
▸ toJSONString(obj
, space?
): string
It converts an object to JSON string
Parameters
Name | Type |
---|---|
obj | object |
space? | number |
Returns
string
Defined in
src/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
Name | Type |
---|---|
settings | ISettings |
Returns
void