Skip to content

Commit a8c0b80

Browse files
committed
update readme
1 parent b11330f commit a8c0b80

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

README.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,18 @@ interface PluginInstance<T> {
521521
): Unsubscriber;
522522
};
523523
524+
style: {
525+
/**
526+
* Subscribe to workbook style updates
527+
*/
528+
subscribe(callback: (style: PluginStyle) => void): () => void;
529+
530+
/**
531+
* Request current style from workbook
532+
*/
533+
get(): Promise<PluginStyle>;
534+
};
535+
524536
/**
525537
* Destroys plugin instance and removes all subscribers
526538
*/
@@ -748,18 +760,6 @@ Returns a callback function to trigger one or more action effects for a given ac
748760
function useActionTrigger(configId: string): () => void;
749761
```
750762
751-
#### triggerActionCallback();
752-
753-
Arguments
754-
755-
- `configId : string` - The config ID corresponding to the action trigger
756-
757-
The function that can be called to asynchronously trigger the action
758-
759-
```ts
760-
function triggerActionCallback(configId: string): void;
761-
```
762-
763763
#### useActionEffect()
764764
765765
Registers and unregisters an action effect within the plugin
@@ -773,6 +773,16 @@ Arguments
773773
- `configId : string` - The config ID corresponding to the action effect
774774
- `effect : Function` - The function to be called when the effect is triggered
775775
776+
#### usePluginStyle()
777+
778+
Returns style properties from the workbook with live updates
779+
780+
```ts
781+
function usePluginStyle(): PluginStyle | undefined;
782+
```
783+
784+
> **Note:** Currently, the `PluginStyle` interface only supports the `backgroundColor` property. This property reflects the background color set in the workbook for the plugin element.
785+
776786
#### useConfig()
777787
778788
Returns the workbook element’s current configuration. If a key is provided, only

0 commit comments

Comments
 (0)