Skip to content

Commit 712d5c2

Browse files
authored
fix: minor fixes to Pigeon typespecs (#297)
* fix: minor fixes to Pigeon typespecs Defines one `@spec` now for `Pigeon.push/3` with more accurate types. Also adjusted `@doc`s on some of the other functions. * fix: add typespec result for list of async notifs
1 parent d2c0263 commit 712d5c2

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

.tool-versions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
elixir 1.18.0-otp-27
2-
erlang 27.0.1
1+
elixir 1.18.3-otp-27
2+
erlang 27.3.1

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616

1717
- Return `:permission_denied` FCM error response if missing privileges. ([#290](https://github.com/codedge-llc/pigeon/pull/290))
1818
- Better handling of FCM errors with multiple details. ([#293](https://github.com/codedge-llc/pigeon/pull/293))
19-
- Minor documentation fixes. ([#294](https://github.com/codedge-llc/pigeon/pull/294))
19+
- Minor documentation and typespec fixes. ([#294](https://github.com/codedge-llc/pigeon/pull/294), [#297](https://github.com/codedge-llc/pigeon/pull/297))
2020

2121
## v2.0.1 - 2024-12-28
2222

lib/pigeon.ex

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,36 +66,36 @@ defmodule Pigeon do
6666
- `:timeout` - Push timeout. Defaults to 5000ms.
6767
"""
6868
@type push_opts :: [
69-
on_response: on_response | nil,
70-
timeout: non_neg_integer
69+
on_response: on_response() | nil,
70+
timeout: non_neg_integer()
7171
]
7272

7373
@doc """
7474
Returns the configured default pool size for Pigeon dispatchers.
75+
7576
To customize this value, include the following in your config/config.exs:
7677
7778
config :pigeon, :default_pool_size, 5
7879
"""
79-
@spec default_pool_size :: pos_integer
80+
@spec default_pool_size :: pos_integer()
8081
def default_pool_size() do
8182
Application.get_env(:pigeon, :default_pool_size, 5)
8283
end
8384

8485
@doc """
8586
Returns the configured JSON encoding library for Pigeon.
87+
8688
To customize the JSON library, include the following in your config/config.exs:
8789
8890
config :pigeon, :json_library, Jason
8991
"""
90-
@spec json_library :: module
92+
@spec json_library :: module()
9193
def json_library do
9294
Application.get_env(:pigeon, :json_library, Jason)
9395
end
9496

95-
@spec push(pid | atom, notification :: notification, push_opts) ::
96-
notification :: struct | no_return
97-
@spec push(pid | atom, notifications :: [notification, ...], push_opts) ::
98-
notifications :: [struct, ...] | no_return
97+
@spec push(pid() | atom(), notification() | [notification()], push_opts()) ::
98+
notification() | [notification()] | :ok | [:ok]
9999
@doc """
100100
Sends a push notification with given options.
101101
"""

0 commit comments

Comments
 (0)