Class: ExtensionStore ‹T›#
Type parameters#
▪ T
Hierarchy#
- BaseStore‹T›
↳ ExtensionStore
Index#
Constructors#
Properties#
Accessors#
Methods#
- applyWithoutSync
- cwd
- disableSync
- enableSync
- fromStore
- init
- load
- loadExtension
- onModelChange
- onSync
- onSyncFromMain
- saveToFile
- toJSON
- unregisterIpcListener
- getInstance
- resetInstance
Constructors#
Protected
constructor#
+ new ExtensionStore(params
: BaseStoreParams): ExtensionStore
Inherited from ExtensionStore.constructor
Defined in src/common/base-store.ts:26
Parameters:
Name | Type |
---|---|
params |
BaseStoreParams |
Returns: ExtensionStore
Properties#
Protected
extension#
• extension: LensExtension
Defined in src/extensions/extension-store.ts:6
isLoaded#
• isLoaded: boolean = false
Inherited from ExtensionStore.isLoaded
Defined in src/common/base-store.ts:26
Protected
params#
• params: BaseStoreParams
Inherited from ExtensionStore.params
Defined in src/common/base-store.ts:28
Protected
Optional
storeConfig#
• storeConfig? : Config‹T›
Inherited from ExtensionStore.storeConfig
Defined in src/common/base-store.ts:22
Protected
syncDisposers#
• syncDisposers: Function[] = []
Inherited from ExtensionStore.syncDisposers
Defined in src/common/base-store.ts:23
whenLoaded#
• whenLoaded: Promise‹void› & object = when(() => this.isLoaded)
Inherited from ExtensionStore.whenLoaded
Defined in src/common/base-store.ts:25
Accessors#
name#
• get name(): string
Inherited from ExtensionStore.name
Defined in src/common/base-store.ts:38
Returns: string
path#
• get path(): string
Inherited from ExtensionStore.path
Defined in src/common/base-store.ts:50
Returns: string
Protected
syncMainChannel#
• get syncMainChannel(): string
Inherited from ExtensionStore.syncMainChannel
Defined in src/common/base-store.ts:46
Returns: string
Protected
syncRendererChannel#
• get syncRendererChannel(): string
Inherited from ExtensionStore.syncRendererChannel
Defined in src/common/base-store.ts:42
Returns: string
Methods#
Protected
applyWithoutSync#
▸ applyWithoutSync(callback
: function): void
Inherited from ExtensionStore.applyWithoutSync
Defined in src/common/base-store.ts:136
Parameters:
▪ callback: function
▸ (): void
Returns: void
Protected
cwd#
▸ cwd(): string
Overrides void
Defined in src/extensions/extension-store.ts:20
Returns: string
disableSync#
▸ disableSync(): void
Inherited from ExtensionStore.disableSync
Defined in src/common/base-store.ts:131
Returns: void
enableSync#
▸ enableSync(): void
Inherited from ExtensionStore.enableSync
Defined in src/common/base-store.ts:94
Returns: void
Protected
Abstract
fromStore#
▸ fromStore(data
: T): void
Inherited from ExtensionStore.fromStore
Defined in src/common/base-store.ts:166
fromStore is called internally when a child class syncs with the file system.
Parameters:
Name | Type | Description |
---|---|---|
data |
T | the parsed information read from the stored JSON file |
Returns: void
Protected
init#
▸ init(): Promise‹void›
Inherited from ExtensionStore.init
Defined in src/common/base-store.ts:54
Returns: Promise‹void›
load#
▸ load(): Promise‹void›
Overrides void
Defined in src/extensions/extension-store.ts:14
Returns: Promise‹void›
loadExtension#
▸ loadExtension(extension
: LensExtension): Promise‹void›
Defined in src/extensions/extension-store.ts:8
Parameters:
Name | Type |
---|---|
extension |
LensExtension |
Returns: Promise‹void›
Protected
onModelChange#
▸ onModelChange(model
: T): Promise‹void›
Inherited from ExtensionStore.onModelChange
Defined in src/common/base-store.ts:152
Parameters:
Name | Type |
---|---|
model |
T |
Returns: Promise‹void›
Protected
onSync#
▸ onSync(model
: T): void
Inherited from ExtensionStore.onSync
Defined in src/common/base-store.ts:145
Parameters:
Name | Type |
---|---|
model |
T |
Returns: void
Protected
onSyncFromMain#
▸ onSyncFromMain(model
: T): void
Inherited from ExtensionStore.onSyncFromMain
Defined in src/common/base-store.ts:120
Parameters:
Name | Type |
---|---|
model |
T |
Returns: void
Protected
saveToFile#
▸ saveToFile(model
: T): Promise‹void›
Inherited from ExtensionStore.saveToFile
Defined in src/common/base-store.ts:83
Parameters:
Name | Type |
---|---|
model |
T |
Returns: Promise‹void›
Abstract
toJSON#
▸ toJSON(): T
Inherited from ExtensionStore.toJSON
Defined in src/common/base-store.ts:175
toJSON is called when syncing the store to the filesystem. It should produce a JSON serializable object representaion of the current state.
It is recommended that a round trip is valid. Namely, calling
this.fromStore(this.toJSON())
shouldn't change the state.
Returns: T
unregisterIpcListener#
▸ unregisterIpcListener(): void
Inherited from ExtensionStore.unregisterIpcListener
Defined in src/common/base-store.ts:126
Returns: void
Static
getInstance#
▸ getInstance‹T›(...args
: ConstructorParameters‹Constructor‹T››): T
Inherited from ExtensionStore.getInstance
Defined in src/common/utils/singleton.ts:15
Type parameters:
▪ T
Parameters:
Name | Type |
---|---|
...args |
ConstructorParameters‹Constructor‹T›› |
Returns: T
Static
resetInstance#
▸ resetInstance(): void
Inherited from ExtensionStore.resetInstance
Defined in src/common/utils/singleton.ts:23
Returns: void