LibWechat.Typespecs (lib_wechat v0.4.0)

View Source

LibWechat 类型规范模块

此模块定义了 LibWechat 库中使用的各种类型规范,用于提高代码的可读性和类型安全性。 类型规范有助于开发者理解函数的输入和输出类型,也有助于静态分析工具(如 Dialyzer)检查代码中的类型错误。

Summary

Types

access_token()

@type access_token() :: String.t()

api_response()

@type api_response() :: {:ok, dict()} | {:error, LibWechat.Error.t()}

appid()

@type appid() :: String.t()

binary_response()

@type binary_response() :: {:ok, binary()} | {:error, LibWechat.Error.t()}

body()

@type body() :: iodata() | nil

code()

@type code() :: String.t()

config()

@type config() :: keyword()

dict()

@type dict() :: %{required(String.t()) => any()}

finch_instance()

@type finch_instance() :: module()

headers()

@type headers() :: [{String.t(), String.t()}]

http_client()

@type http_client() :: module()

http_status()

@type http_status() :: non_neg_integer()

message_payload()

@type message_payload() :: dict()

method()

@type method() :: :get | :post | :head | :patch | :delete | :options | :put

name()

@type name() :: atom() | {:global, term()} | {:via, module(), term()}

on_start()

@type on_start() ::
  {:ok, pid()} | :ignore | {:error, {:already_started, pid()} | term()}

openid()

@type openid() :: String.t()

opts()

@type opts() :: keyword()

page()

@type page() :: String.t()

params()

@type params() :: %{required(String.t()) => binary()} | nil

path()

@type path() :: String.t()

query_params()

@type query_params() :: %{required(String.t()) => String.t()} | keyword()

scene()

@type scene() :: integer() | String.t()

secret()

@type secret() :: String.t()

security_payload()

@type security_payload() :: dict()

service_host()

@type service_host() :: String.t()

session_key()

@type session_key() :: String.t()

template_id()

@type template_id() :: String.t()

url()

@type url() :: String.t()

wxa_payload()

@type wxa_payload() :: dict()