You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to expose payload types for sparkplug-payload?
I can make the changes, just wondering if theres a reason why it isn't exposed already.
Currently, the way i work around this is by grabbing the return type of decodePayload, which is a bit silly but works
import { get } from "sparkplug-payload"
const { decodePayload, encodePayload } = get("spBv1.0")!
export type Payload = NonNullable<ReturnType<typeof decodePayload>>
export type Metric = NonNullable<Payload["metrics"]>[0]
export type MetricValue = Metric["value"]
export type DataType = Metric["type"]
The text was updated successfully, but these errors were encountered:
Would it be possible to expose payload types for sparkplug-payload?
I can make the changes, just wondering if theres a reason why it isn't exposed already.
Currently, the way i work around this is by grabbing the return type of
decodePayload
, which is a bit silly but worksThe text was updated successfully, but these errors were encountered: