Skip to content

Commit

Permalink
fix addListener signature
Browse files Browse the repository at this point in the history
  • Loading branch information
hugotomazi committed Jun 22, 2024
1 parent e108809 commit 0800c59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Gets the current color of the navigation bar in Hexadecimal.
### addListener(...)

```typescript
addListener(event: NavigationBarPluginEvents.SHOW, listenerFunc: () => void) => PluginListenerHandle
addListener(event: NavigationBarPluginEvents.SHOW, listenerFunc: () => void) => Promise<PluginListenerHandle>
```

Event fired after navigation bar is displayed
Expand All @@ -142,15 +142,15 @@ Event fired after navigation bar is displayed
| **`event`** | <code><a href="#navigationbarpluginevents">NavigationBarPluginEvents.SHOW</a></code> | The event |
| **`listenerFunc`** | <code>() =&gt; void</code> | Callback |

**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>

--------------------


### addListener(...)

```typescript
addListener(event: NavigationBarPluginEvents.HIDE, listenerFunc: () => void) => PluginListenerHandle
addListener(event: NavigationBarPluginEvents.HIDE, listenerFunc: () => void) => Promise<PluginListenerHandle>
```

Event fired after navigation bar is hidden
Expand All @@ -160,15 +160,15 @@ Event fired after navigation bar is hidden
| **`event`** | <code><a href="#navigationbarpluginevents">NavigationBarPluginEvents.HIDE</a></code> | The event |
| **`listenerFunc`** | <code>() =&gt; void</code> | Callback |

**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>

--------------------


### addListener(...)

```typescript
addListener(event: NavigationBarPluginEvents.COLOR_CHANGE, listenerFunc: (returnObject: { color: string; }) => void) => PluginListenerHandle
addListener(event: NavigationBarPluginEvents.COLOR_CHANGE, listenerFunc: (returnObject: { color: string; }) => void) => Promise<PluginListenerHandle>
```

Event fired after navigation bar color is changed
Expand All @@ -178,7 +178,7 @@ Event fired after navigation bar color is changed
| **`event`** | <code><a href="#navigationbarpluginevents">NavigationBarPluginEvents.COLOR_CHANGE</a></code> | The event |
| **`listenerFunc`** | <code>(returnObject: { color: string; }) =&gt; void</code> | Callback |

**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>

--------------------

Expand Down
6 changes: 3 additions & 3 deletions src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface NavigationBarPlugin {
addListener(
event: NavigationBarPluginEvents.SHOW,
listenerFunc: () => void
): PluginListenerHandle
): Promise<PluginListenerHandle>

/**
* Event fired after navigation bar is hidden
Expand All @@ -48,7 +48,7 @@ export interface NavigationBarPlugin {
addListener(
event: NavigationBarPluginEvents.HIDE,
listenerFunc: () => void
): PluginListenerHandle
): Promise<PluginListenerHandle>

/**
* Event fired after navigation bar color is changed
Expand All @@ -58,7 +58,7 @@ export interface NavigationBarPlugin {
addListener(
event: NavigationBarPluginEvents.COLOR_CHANGE,
listenerFunc: (returnObject: { color: string }) => void
): PluginListenerHandle
): Promise<PluginListenerHandle>
}

export interface ColorParameters {
Expand Down

0 comments on commit 0800c59

Please sign in to comment.